From 03f9503de0f229610b7d8dcc2a3b846548320dd8 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Tue, 22 Mar 2022 08:03:55 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Alex Stokes --- specs/capella/beacon-chain.md | 8 ++++---- specs/capella/fork-choice.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/capella/beacon-chain.md b/specs/capella/beacon-chain.md index c7b4fe897..7bae80d57 100644 --- a/specs/capella/beacon-chain.md +++ b/specs/capella/beacon-chain.md @@ -195,7 +195,7 @@ def is_fully_withdrawable_validator(validator: Validator, epoch: Epoch) -> bool: """ Check if ``validator`` is fully withdrawable. """ - is_eth1_withdrawal_prefix = validator.withdrawal_credentials[0:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX + is_eth1_withdrawal_prefix = validator.withdrawal_credentials[:1] == ETH1_ADDRESS_WITHDRAWAL_PREFIX return is_eth1_withdrawal_prefix and validator.withdrawable_epoch <= epoch < validator.fully_withdrawn_epoch ``` @@ -256,10 +256,10 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None: dequeued_withdrawals = state.withdrawals_queue[:num_withdrawals] assert len(dequeued_withdrawals) == len(payload.withdrawals) - for dequeued_receipt, withdrawal in zip(dequeued_withdrawals, payload.withdrawals): - assert dequeued_receipt == withdrawal + for dequeued_withdrawal, withdrawal in zip(dequeued_withdrawals, payload.withdrawals): + assert dequeued_withdrawal == withdrawal - # Remove dequeued receipts from state + # Remove dequeued withdrawals from state state.withdrawals_queue = state.withdrawals_queue[num_withdrawals:] ``` diff --git a/specs/capella/fork-choice.md b/specs/capella/fork-choice.md index 10f034e1d..5a2ef00b6 100644 --- a/specs/capella/fork-choice.md +++ b/specs/capella/fork-choice.md @@ -33,7 +33,7 @@ Otherwise, `notify_forkchoice_updated` inherits all prior functionality. def notify_forkchoice_updated(self: ExecutionEngine, head_block_hash: Hash32, finalized_block_hash: Hash32, - payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]: + payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]: # new in Capella ... ``` @@ -49,5 +49,5 @@ class PayloadAttributes(object): timestamp: uint64 prev_randao: Bytes32 suggested_fee_recipient: ExecutionAddress - withdrawals: Sequence[Withdrawal] + withdrawals: Sequence[Withdrawal] # new in Capella ```