From e2bebac49e7f9df2faae60015c30e78bb6d68bcc Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Wed, 7 Aug 2024 07:11:20 +0100 Subject: [PATCH] Add participation data. --- services/blockauctioneer/mock/service.go | 8 ++++---- services/blockauctioneer/service.go | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/services/blockauctioneer/mock/service.go b/services/blockauctioneer/mock/service.go index acd62bd..b3398e5 100644 --- a/services/blockauctioneer/mock/service.go +++ b/services/blockauctioneer/mock/service.go @@ -1,4 +1,4 @@ -// Copyright © 2022, 2023 Attestant Limited. +// Copyright © 2022 - 2024 Attestant Limited. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -15,7 +15,6 @@ package mock import ( "context" - "math/big" "github.com/attestantio/go-block-relay/services/blockauctioneer" builderclient "github.com/attestantio/go-builder-client" @@ -40,7 +39,8 @@ func (s *Service) AuctionBlock(_ context.Context, error, ) { return &blockauctioneer.Results{ - Values: make(map[string]*big.Int), - Providers: make([]builderclient.BuilderBidProvider, 0), + Participation: make(map[string]*blockauctioneer.Participation), + AllProviders: make([]builderclient.BuilderBidProvider, 0), + Providers: make([]builderclient.BuilderBidProvider, 0), }, nil } diff --git a/services/blockauctioneer/service.go b/services/blockauctioneer/service.go index b8820e7..7f7f4b7 100644 --- a/services/blockauctioneer/service.go +++ b/services/blockauctioneer/service.go @@ -1,4 +1,4 @@ -// Copyright © 2022 Attestant Limited. +// Copyright © 2022, 2024 Attestant Limited. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -27,13 +27,25 @@ type Service interface{} // Results provides the results of the auction process. type Results struct { - // Values is a map of provider=>value. - Values map[string]*big.Int + // Participation contains details of each provider's participation. + // There is only a single result per provider, being that with the highest score. + Participation map[string]*Participation // AllProviders is the list of providers that were queried for bids. AllProviders []builderclient.BuilderBidProvider + // WinningParticipation is the current winning bid amongst all participants. + WinningParticipation *Participation // Providers is the list of providers that returned the winning bid. Providers []builderclient.BuilderBidProvider - // Bid is the winning signed builder bid. +} + +// Participation provide detailed information about a relay's participation in the auction process. +type Participation struct { + // Category is the category of the bid. + // This is free-form text, and could for example be "Priority", "Excluded" etc. + Category string + // Score is the eligibility score. + Score *big.Int + // Bid is the signed builder bid. Bid *spec.VersionedSignedBuilderBid }