Skip to content

Commit 62800ff

Browse files
authored
handle self-builds during envelope broadcasting (#7979)
1 parent e290728 commit 62800ff

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ proc validateBeaconBlock*(
10361036

10371037
ok()
10381038

1039-
# https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/p2p-interface.md#execution_payload
1039+
# https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.2/specs/gloas/p2p-interface.md#execution_payload
10401040
proc validateExecutionPayload*(
10411041
dag: ChainDAGRef, quarantine: ref Quarantine,
10421042
envelopeQuarantine: ref EnvelopeQuarantine,
@@ -1109,12 +1109,20 @@ proc validateExecutionPayload*(
11091109
# [REJECT] signed_execution_payload_envelope.signature is valid with respect
11101110
# to the builder's public key.
11111111
if dag.headState.kind >= ConsensusFork.Gloas:
1112+
let builderKey =
1113+
if bid.builder_index == BUILDER_INDEX_SELF_BUILD:
1114+
dag.validatorKey(blck.proposer_index).valueOr:
1115+
return dag.checkedReject("ExecutionPayload: unknown proposer")
1116+
else:
1117+
dag.validatorKey(bid.builder_index).valueOr:
1118+
return dag.checkedReject("ExecutionPayload: unknown builder index")
1119+
11121120
if not verify_execution_payload_envelope_signature(
11131121
dag.forkAtEpoch(envelope.slot.epoch),
11141122
dag.genesis_validators_root,
11151123
envelope.slot.epoch,
11161124
signed_execution_payload_envelope.message,
1117-
dag.validatorKey(envelope.builder_index).get(),
1125+
builderKey,
11181126
signed_execution_payload_envelope.signature):
11191127
return dag.checkedReject("ExecutionPayload: invalid builder signature")
11201128
else:

0 commit comments

Comments
 (0)