-
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
Beacon api: produce block should skip mev-boost #11488
Conversation
if !req.SkipMevBoost { | ||
registered, err := vs.validatorRegistered(ctx, altairBlk.ProposerIndex) | ||
if registered && err == nil { | ||
builderReady, b, err := vs.GetAndBuildBlindBlock(ctx, altairBlk) | ||
if err != nil { | ||
// In the event of an error, the node should fall back to default execution engine for building block. | ||
log.WithError(err).Error("Failed to build a block from external builder, falling " + | ||
"back to local execution client") | ||
builderGetPayloadMissCount.Inc() | ||
} else if builderReady { | ||
return b, nil | ||
} | ||
} else if err != nil { | ||
log.WithFields(logrus.Fields{ | ||
"slot": req.Slot, | ||
"validatorIndex": altairBlk.ProposerIndex, | ||
}).Errorf("Could not determine validator has registered. Default to local execution client: %v", err) | ||
} | ||
} else if err != nil { | ||
log.WithFields(logrus.Fields{ | ||
"slot": req.Slot, | ||
"validatorIndex": altairBlk.ProposerIndex, | ||
}).Errorf("Could not determine validator has registered. Default to local execution client: %v", err) |
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 add tests for these 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.
req.SkipMevBoost
is true is tested through TestProduceBlockV2SSZ
and TestProduceBlockV2
.
req.SkipMevBoost
is false is tested through TestServer_GetBellatrixBeaconBlock_BuilderCase
. Local test 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.
Also added another local test TestServer_GetBellatrixBeaconBlock_LocalProgressingWithBuilderSkipped
// By definition `/eth/v2/validator/blocks/{slot}/ssz`, does not produce block using mev-boost and relayer network: | ||
// https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlockV2 |
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 add a suggestion to which API endpoint is supposed to be used for MEV boost / relay. I.e. blinded blocks endpoint.
The link you provided doesn't define anything about whether or not mev-boost should be used.
beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
What type of PR is this?
What does this PR do? Why is it needed?
When calling beacon API
/eth/v2/validator/blocks/{slot}
and/eth/v2/validator/blocks/{slot}/ssz
, these end points should not call mev-boost/relayer to outsource block construction. This PR fixes it by adding fieldSkipMevBoost
toBlockRequest
such that ifSkipMevBoost
is true, the prysm API server will not attempt to reach mev-boost. This is the cleanest solution IMO, the other options are to refactor prysm API's get beacon block into two methods where one calls mev-boost and one doesn'tWhich issues(s) does this PR fix?
Fixes #11481
Other notes for review
Given that this is a protobuf change, we'll need to be careful there's no backward compatibility issue between beacon node and validator.