-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add circuit breaker for relayer/builder #11215
Conversation
beacon-chain/node/config.go
Outdated
@@ -65,6 +65,24 @@ func configureSafeSlotsToImportOptimistically(cliCtx *cli.Context) error { | |||
return nil | |||
} | |||
|
|||
func configureMevBoostCircuitBreakerValues(cliCtx *cli.Context) 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.
maybe we should name it form configureMevBoostCircuitBreakerValues
toconfigureBuilderCircuitBreaker
beacon-chain/node/config.go
Outdated
func configureMevBoostCircuitBreakerValues(cliCtx *cli.Context) error { | ||
if cliCtx.IsSet(flags.BuilderFallbackSkips.Name) { | ||
c := params.BeaconConfig().Copy() | ||
c.BuilderFallbackSkipsSlot = types.Slot(cliCtx.Int(flags.BuilderFallbackSkips.Name)) |
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.
maybe rename to MaxBuilderConsecutiveMissedSlots
telling the system that there should be a max of x slots missed before falling back to something
beacon-chain/node/config.go
Outdated
} | ||
if cliCtx.IsSet(flags.BuilderFallbackSkipsPerEpoch.Name) { | ||
c := params.BeaconConfig().Copy() | ||
c.BuilderFallbackSkipsSlotsLastEpoch = types.Slot(cliCtx.Int(flags.BuilderFallbackSkipsPerEpoch.Name)) |
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.
and corresponding MaxBuilderMissedSlotsInEpoch
|
||
circuitBreak, err := vs.circuitBreakBuilder(b.Slot) | ||
if err != nil { | ||
return false, nil, errors.Wrap(err, "could not determine if builder circuit breaker condition") |
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.
maybe remove the if statement
@@ -16,6 +16,16 @@ var ( | |||
Usage: "A MEV builder relay string http endpoint, this wil be used to interact MEV builder network using API defined in: https://ethereum.github.io/builder-specs/#/Builder", | |||
Value: "", | |||
} | |||
BuilderFallbackSkips = &cli.IntFlag{ | |||
Name: "builder-fallback-skips", | |||
Usage: "Number of consecutive skip slot to fallback from using relay/builder to local execution engine for block construction", |
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.
related to flag name changes
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.
Approving but might want a second pair of eyes maybe?
Really nice PR, thanks for putting it together in a concise manner |
This PR implements a circuit breaker for the builder/relayer infra to determine whether or not we should propose blocks through the builder API. This code doesn't live on the normal block proposal path, it lives in the builder block proposal path, and the risk factor is low. With that said, please careful review
The following flags are added:
--builder-fallback-skips
(default value 4)the number of slots before the proposal slot that has been skipped
--builder-fallback-skips-per-epoch
(default value 6)the number of slots in the last 32 slots that have been skipped
Would appreciate feedback on the defaults!