-
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
Changes from 9 commits
5509187
a510a79
66b1351
55aa6bb
130d9fd
299ab1e
c4e4606
ef0218e
b01ade2
35f2aff
7bbe222
b542ca8
36609ea
2cfe4bb
43f1b24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ var emptyTransactionsRoot = [32]byte{127, 254, 36, 30, 166, 1, 135, 253, 176, 24 | |
const blockBuilderTimeout = 1 * time.Second | ||
|
||
// Sets the execution data for the block. Execution data can come from local EL client or remote builder depends on validator registration and circuit breaker conditions. | ||
func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, localPayload, builderPayload interfaces.ExecutionData, builderKzgCommitments [][]byte) error { | ||
func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, localPayload, builderPayload interfaces.ExecutionData, builderKzgCommitments [][]byte, builderBoostFactor uint64) error { | ||
_, span := trace.StartSpan(ctx, "ProposerServer.setExecutionData") | ||
defer span.End() | ||
|
||
|
@@ -80,9 +80,17 @@ 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 commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm I don't like this. The point of There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
boost := params.BeaconConfig().LocalBlockValueBoost | ||
higherValueBuilder := builderValueGwei*100 > localValueGwei*(100+boost) | ||
higherValueBuilder := builderValueGwei*builderBoostFactor > localValueGwei*(100+boost) | ||
if boost > 0 && builderBoostFactor > (100+boost) { | ||
log.WithFields(logrus.Fields{ | ||
"localGweiValue": localValueGwei, | ||
"localBoostPercentage": boost, | ||
"builderGweiValue": builderValueGwei, | ||
"builderBoostFactor": builderBoostFactor, | ||
}).Warn("Proposer: using builder payload even though local block value boost is more than 0") | ||
} | ||
|
||
// If we can't get the builder value, just use local block. | ||
if higherValueBuilder && withdrawalsMatched { // Builder value is higher and withdrawals match. | ||
|
@@ -98,13 +106,15 @@ func setExecutionData(ctx context.Context, blk interfaces.SignedBeaconBlock, loc | |
"localGweiValue": localValueGwei, | ||
"localBoostPercentage": boost, | ||
"builderGweiValue": builderValueGwei, | ||
"builderBoostFactor": builderBoostFactor, | ||
}).Warn("Proposer: using local execution payload because higher value") | ||
} | ||
span.AddAttributes( | ||
trace.BoolAttribute("higherValueBuilder", higherValueBuilder), | ||
trace.Int64Attribute("localGweiValue", int64(localValueGwei)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("localBoostPercentage", int64(boost)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("builderGweiValue", int64(builderValueGwei)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("localGweiValue", int64(localValueGwei)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("localBoostPercentage", int64(boost)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("builderGweiValue", int64(builderValueGwei)), // lint:ignore uintcast -- This is OK for tracing. | ||
trace.Int64Attribute("builderBoostFactor", int64(builderBoostFactor)), // lint:ignore uintcast -- This is OK for tracing. | ||
) | ||
return setLocalExecution(blk, localPayload) | ||
default: // Bellatrix case. | ||
|
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 callshared.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