-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding builder boost factor to get block v3 #13409
Conversation
switch trimmed { | ||
case "": // default to 100 if it's not provided | ||
return 100, nil | ||
case "2**64-1": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol I thought that the user would have to specify explicitly 18446744073709551615
@@ -80,9 +80,9 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc | |||
} | |||
|
|||
// Use builder payload if the following in true: | |||
// builder_bid_value * 100 > local_block_value * (local-block-value-boost + 100) | |||
// builder_bid_value * builderBoostFactor(default 100) > local_block_value * (local-block-value-boost + 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I don't like this. The point of builderBoostFactor
is that it replaces our current parameter local-block-value-boost
not to use both... I'm not sure what the right approach is here but at the very least we should log if there's a request and the local boost is set to non-zero and the boost factor to non default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a log for now we'll see if others have an opinion
@@ -566,6 +567,9 @@ message BlockRequest { | |||
|
|||
// Signal server to skip outsourcing block request from mev-boost/relayer so that returned block will always be a local block. | |||
bool skip_mev_boost = 4; | |||
|
|||
// Percentage multiplier to apply to the builder's payload value when choosing between a builder payload header and payload from the paired execution node | |||
google.protobuf.UInt64Value builder_boost_factor = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, why isn't this simply uint64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep it nullable since 0 is a valid value and we don't have defaults in protobuf3. this way i can check if it was set or not and add a default
}, any) | ||
} | ||
|
||
func processBuilderBoostFactor(raw string) (*wrapperspb.UInt64Value, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec defines the boost factor as Uint64
. There is no need for this function, you can just call shared.UintFromQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need it as nullable, i'll doublecheck sharedUintFromQuery though
@@ -96,7 +97,7 @@ func TestServer_setExecutionData(t *testing.T) { | |||
builderPayload, builderKzgCommitments, err := vs.getBuilderPayloadAndBlobs(ctx, b.Slot(), b.ProposerIndex()) | |||
require.NoError(t, err) | |||
require.DeepEqual(t, [][]uint8(nil), builderKzgCommitments) | |||
require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments)) | |||
require.NoError(t, setExecutionData(context.Background(), blk, localPayload, builderPayload, builderKzgCommitments, 100)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the constant default value here and everywhere else
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Implements the query parameter
builder_boost_factor
used for[/eth/v3/validator/blocks/{slot}](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/produceBlockV3)
description from beacon apis
Which issues(s) does this PR fix?
ethereum/beacon-APIs#386, ethereum/beacon-APIs#398
Other notes for review