Skip to content

Commit

Permalink
Add participation data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Aug 7, 2024
1 parent 308fa49 commit e2bebac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions services/blockauctioneer/mock/service.go
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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
}
20 changes: 16 additions & 4 deletions services/blockauctioneer/service.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit e2bebac

Please sign in to comment.