use VC-provided graffiti for blinded block proposals (#4417)

This commit is contained in:
tersec 2022-12-12 13:02:06 +00:00 committed by GitHub
parent ad8e682f76
commit 45574021c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -653,7 +653,8 @@ proc getBlindedBeaconBlock[T](
proc getBlindedBlockParts( proc getBlindedBlockParts(
node: BeaconNode, head: BlockRef, pubkey: ValidatorPubKey, 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]] Future[Result[(bellatrix.ExecutionPayloadHeader, ForkedBeaconBlock), string]]
{.async.} = {.async.} =
let let
@ -692,7 +693,7 @@ proc getBlindedBlockParts(
getFieldNames(bellatrix.ExecutionPayloadHeader)) getFieldNames(bellatrix.ExecutionPayloadHeader))
let newBlock = await makeBeaconBlockForHeadAndSlot[bellatrix.ExecutionPayload]( 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, skip_randao_verification_bool = false,
execution_payload = Opt.some shimExecutionPayload, execution_payload = Opt.some shimExecutionPayload,
transactions_root = Opt.some executionPayloadHeader.get.transactions_root, transactions_root = Opt.some executionPayloadHeader.get.transactions_root,
@ -712,7 +713,8 @@ proc proposeBlockMEV(
randao: ValidatorSig, validator_index: ValidatorIndex): randao: ValidatorSig, validator_index: ValidatorIndex):
Future[Opt[BlockRef]] {.async.} = Future[Opt[BlockRef]] {.async.} =
let blindedBlockParts = await getBlindedBlockParts( 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: if blindedBlockParts.isErr:
# Not signed yet, fine to try to fall back on EL # Not signed yet, fine to try to fall back on EL
beacon_block_builder_missed_with_fallback.inc() beacon_block_builder_missed_with_fallback.inc()
@ -784,7 +786,7 @@ proc makeBlindedBeaconBlockForHeadAndSlot*(
forkyState.data.validators.item(validator_index).pubkey forkyState.data.validators.item(validator_index).pubkey
blindedBlockParts = await getBlindedBlockParts( blindedBlockParts = await getBlindedBlockParts(
node, head, pubkey, slot, randao_reveal, validator_index) node, head, pubkey, slot, randao_reveal, validator_index, graffiti)
if blindedBlockParts.isErr: if blindedBlockParts.isErr:
# Don't try EL fallback -- VC specifically requested a blinded block # Don't try EL fallback -- VC specifically requested a blinded block
return err("Unable to create blinded block") return err("Unable to create blinded block")