@@ -226,6 +226,7 @@ class Builder(Container):
226226class BuilderPendingPayment (Container ):
227227 weight: Gwei
228228 withdrawal: BuilderPendingWithdrawal
229+ proposer_index: ValidatorIndex
229230```
230231
231232#### ` BuilderPendingWithdrawal `
@@ -1480,6 +1481,7 @@ def process_execution_payload_bid(state: BeaconState, block: BeaconBlock) -> Non
14801481 amount = amount,
14811482 builder_index = builder_index,
14821483 ),
1484+ proposer_index = block.proposer_index,
14831485 )
14841486 state.builder_pending_payments[SLOTS_PER_EPOCH + bid.slot % SLOTS_PER_EPOCH ] = (
14851487 pending_payment
@@ -1811,16 +1813,22 @@ def process_proposer_slashing(state: BeaconState, proposer_slashing: ProposerSla
18111813 assert bls.Verify(proposer.pubkey, signing_root, signed_header.signature)
18121814
18131815 # [New in Gloas:EIP7732]
1814- # Remove the BuilderPendingPayment corresponding to
1815- # this proposal if it is still in the 2-epoch window.
1816+ # Remove the BuilderPendingPayment corresponding to this proposal if it is
1817+ # still in the 2-epoch window. Only clear it when the slashed validator is
1818+ # the proposer that armed the payment; otherwise an unrelated same-slot
1819+ # equivocation could grief an honest proposer's payment.
18161820 slot = header_1.slot
18171821 proposal_epoch = compute_epoch_at_slot(slot)
18181822 if proposal_epoch == get_current_epoch(state):
18191823 payment_index = SLOTS_PER_EPOCH + slot % SLOTS_PER_EPOCH
1820- state.builder_pending_payments[payment_index] = BuilderPendingPayment()
1824+ payment = state.builder_pending_payments[payment_index]
1825+ if payment.proposer_index == header_1.proposer_index:
1826+ state.builder_pending_payments[payment_index] = BuilderPendingPayment()
18211827 elif proposal_epoch == get_previous_epoch(state):
18221828 payment_index = slot % SLOTS_PER_EPOCH
1823- state.builder_pending_payments[payment_index] = BuilderPendingPayment()
1829+ payment = state.builder_pending_payments[payment_index]
1830+ if payment.proposer_index == header_1.proposer_index:
1831+ state.builder_pending_payments[payment_index] = BuilderPendingPayment()
18241832
18251833 slash_validator(state, header_1.proposer_index)
18261834```
0 commit comments