Skip to content
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

[MEV Boost] Allow Blinded block creation flow in BN - Part1 #5249

Merged
merged 5 commits into from
Mar 30, 2022

Conversation

tbenr
Copy link
Contributor

@tbenr tbenr commented Mar 28, 2022

PR Description

BlockFactory become mev_boost \ blinded block aware
BlockOperationSelectorFactory become mev_boost aware.

Instead of haveing a dedicated BlindedBeaconBlockBodyBuilder, the flow has been integrated in BeaconBlockBodyBuilderBellatrix. BeaconBlockBodyBuilder interface exposes isBlinded and will be used to expose to BlockOperationSelectorFactory to generate a builderConsumer that can reason about blinded\non-blinded blocks.

Fixed Issue(s)

#5261

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just small details and worth adding some tests.

.getPayload(payloadId, blockSlotState.getSlot())
.join()));

if (isMevBoostEnabled || blinded) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels weird to me that you could ask for a non-blinded block but be given one anyway because mev boost is enabled. Nots are it's wrong as such, just feels very unexpected. Maybe it's just that blinded should be forceBlinded?

Copy link
Contributor Author

@tbenr tbenr Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking again this is wrong.
At high-level these are the conditions I want to handle.

if (isMevBoostEnabled && blinded) {
// blinded mevboost flow
// set `bodyBuilder.executionPayloadHeader` via `executionEngineChannel.getPayloadHeader`
} else if (!isMevBoostEnabled && blinded) {
// blinded non-mevboost flow (To Be implemented - issue #5103)
// set `bodyBuilder.executionPayloadHeader` via `executionEngineChannel.getPayload` (extract header from full payload)
// cache the full payload to be used to "unblind" the signed block before publication
} else {
 // non-blind standard flow
 // set `bodyBuilder.executionPayload` via `executionEngineChannel.getPayload` 
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah that makes sense to me.

@@ -115,7 +119,8 @@ private ExecutionPayload getExecutionPayload(final BeaconBlock block) {
return BeaconBlockBodyBellatrix.required(block.getBody()).getExecutionPayload();
}

private BeaconBlock assertBlockCreated(final int blockSlot, final Spec spec)
private BeaconBlock assertBlockCreated(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should add a test for the cases where isMevBoostEnabled and blinded are true (and the various combinations). Looks like we're always passing false, false at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite not there yet. I'll do a Part-2 of the PR.

@tbenr tbenr changed the title [MEV Boost] Allow Blinded block creation flow in BN [MEV Boost] Allow Blinded block creation flow in BN - Part1 Mar 30, 2022
@tbenr tbenr force-pushed the blindedblock_flow branch from 093a039 to 6b53bc7 Compare March 30, 2022 14:16
@tbenr tbenr merged commit 91a13be into Consensys:master Mar 30, 2022
@tbenr tbenr deleted the blindedblock_flow branch March 30, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants