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

use VC-provided graffiti for blinded block proposals #4417

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions beacon_chain/validators/validator_duties.nim
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ proc getBlindedBeaconBlock[T](

proc getBlindedBlockParts(
node: BeaconNode, head: BlockRef, pubkey: ValidatorPubKey,
slot: Slot, randao: ValidatorSig, validator_index: ValidatorIndex):
slot: Slot, randao: ValidatorSig, validator_index: ValidatorIndex,
graffiti: GraffitiBytes):
Future[Result[(bellatrix.ExecutionPayloadHeader, ForkedBeaconBlock), string]]
{.async.} =
let
Expand Down Expand Up @@ -692,7 +693,7 @@ proc getBlindedBlockParts(
getFieldNames(bellatrix.ExecutionPayloadHeader))

let newBlock = await makeBeaconBlockForHeadAndSlot[bellatrix.ExecutionPayload](
node, randao, validator_index, node.graffitiBytes, head, slot,
node, randao, validator_index, graffiti, head, slot,
skip_randao_verification_bool = false,
execution_payload = Opt.some shimExecutionPayload,
transactions_root = Opt.some executionPayloadHeader.get.transactions_root,
Expand All @@ -712,7 +713,8 @@ proc proposeBlockMEV(
randao: ValidatorSig, validator_index: ValidatorIndex):
Future[Opt[BlockRef]] {.async.} =
let blindedBlockParts = await getBlindedBlockParts(
node, head, validator.pubkey, slot, randao, validator_index)
node, head, validator.pubkey, slot, randao, validator_index,
node.graffitiBytes)
if blindedBlockParts.isErr:
# Not signed yet, fine to try to fall back on EL
beacon_block_builder_missed_with_fallback.inc()
Expand Down Expand Up @@ -784,7 +786,7 @@ proc makeBlindedBeaconBlockForHeadAndSlot*(
forkyState.data.validators.item(validator_index).pubkey

blindedBlockParts = await getBlindedBlockParts(
node, head, pubkey, slot, randao_reveal, validator_index)
node, head, pubkey, slot, randao_reveal, validator_index, graffiti)
if blindedBlockParts.isErr:
# Don't try EL fallback -- VC specifically requested a blinded block
return err("Unable to create blinded block")
Expand Down