diff --git a/specs/gloas/builder.md b/specs/gloas/builder.md index 2f3edd8b45..a41c63c5dc 100644 --- a/specs/gloas/builder.md +++ b/specs/gloas/builder.md @@ -131,8 +131,8 @@ to include. They produce a `SignedExecutionPayloadBid` as follows. The proposer's preferred fee recipient is obtained from the `SignedProposerPreferences` whose `message.proposal_slot` matches `bid.slot` and whose `message.dependent_root` matches - `get_proposer_dependent_root(parent_state, compute_epoch_at_slot(bid.slot))`, - where `parent_state` is the post-state of `bid.parent_block_root`. + `get_shuffling_dependent_root(store, bid.parent_block_root, compute_epoch_at_slot(bid.slot))`, + where `store` is the fork choice store. 07. Set `bid.gas_limit` to be the gas limit of the constructed payload, which **MUST** satisfy `is_gas_limit_target_compatible(parent_gas_limit, bid.gas_limit, target_gas_limit)`, diff --git a/specs/gloas/fork-choice.md b/specs/gloas/fork-choice.md index 347648c93d..1a871b3fed 100644 --- a/specs/gloas/fork-choice.md +++ b/specs/gloas/fork-choice.md @@ -54,7 +54,7 @@ - [Modified `update_latest_messages`](#modified-update_latest_messages) - [`on_block` helpers](#on_block-helpers) - [Modified `record_block_timeliness`](#modified-record_block_timeliness) - - [Modified `get_dependent_root`](#modified-get_dependent_root) + - [Modified `get_shuffling_dependent_root`](#modified-get_shuffling_dependent_root) - [Modified `update_proposer_boost_root`](#modified-update_proposer_boost_root) - [Handlers](#handlers) - [Modified `on_block`](#modified-on_block) @@ -933,11 +933,10 @@ def record_block_timeliness(store: Store, root: Root) -> None: ] ``` -#### Modified `get_dependent_root` +#### Modified `get_shuffling_dependent_root` ```python -def get_dependent_root(store: Store, root: Root) -> Root: - epoch = get_current_store_epoch(store) +def get_shuffling_dependent_root(store: Store, root: Root, epoch: Epoch) -> Root: if epoch <= MIN_SEED_LOOKAHEAD: # Genesis block parent return Root() @@ -958,7 +957,10 @@ def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None: is_first_block = store.proposer_boost_root == Root() # [Modified in Gloas:EIP7732] is_timely = store.block_timeliness[root][ATTESTATION_TIMELINESS_INDEX] - is_same_dependent_root = get_dependent_root(store, root) == get_dependent_root(store, head) + epoch = get_current_store_epoch(store) + head_dependent_root = get_shuffling_dependent_root(store, head, epoch) + block_dependent_root = get_shuffling_dependent_root(store, root, epoch) + is_same_dependent_root = head_dependent_root == block_dependent_root # Add proposer score boost if the block is timely, not conflicting with an # existing block, with the same dependent root as the canonical chain head. diff --git a/specs/gloas/p2p-interface.md b/specs/gloas/p2p-interface.md index be9f280395..eb9f8e375a 100644 --- a/specs/gloas/p2p-interface.md +++ b/specs/gloas/p2p-interface.md @@ -361,8 +361,8 @@ The following validations MUST pass before forwarding the `bid = signed_execution_payload_bid.message`, the alias `signed_proposer_preferences` for the validated `SignedProposerPreferences` whose `message.proposal_slot` is `bid.slot` and `message.dependent_root` is -`get_proposer_dependent_root(parent_state, compute_epoch_at_slot(bid.slot))`, -where `parent_state` is the post-state of `bid.parent_block_root`, and the alias +`get_shuffling_dependent_root(store, bid.parent_block_root, compute_epoch_at_slot(bid.slot))`, +where `store` is the fork choice store, and the alias `proposer_preferences = signed_proposer_preferences.message`: - _[IGNORE]_ `bid.slot` is the current slot or the next slot. @@ -470,16 +470,6 @@ def is_valid_proposal_slot(state: BeaconState, preferences: ProposerPreferences) return state.proposer_lookahead[index] == preferences.validator_index ``` -```python -def get_proposer_dependent_root(state: BeaconState, epoch: Epoch) -> Root: - """ - Return the dependent root for the proposer lookahead at ``epoch``. - """ - return get_block_root_at_slot( - state, Slot(compute_start_slot_at_epoch(Epoch(epoch - MIN_SEED_LOOKAHEAD)) - 1) - ) -``` - *Note*: Nodes SHOULD subscribe to this topic at least one epoch before the fork activation. Proposers SHOULD broadcast their preferences in the epoch before the fork. diff --git a/specs/gloas/validator.md b/specs/gloas/validator.md index 9ec9159fe1..0cde4919fd 100644 --- a/specs/gloas/validator.md +++ b/specs/gloas/validator.md @@ -156,9 +156,9 @@ To construct each `SignedProposerPreferences`: 1. Instantiate a new `ProposerPreferences` object as `preferences`. 2. Set `preferences.dependent_root` to - `get_proposer_dependent_root(state, compute_epoch_at_slot(preferences.proposal_slot))`, - where `state` is the proposer's current head state. Use the genesis block - root in case of underflow. + `get_shuffling_dependent_root(store, head_root, compute_epoch_at_slot(preferences.proposal_slot))`, + where `store` is the fork choice store and `head_root` is the proposer's + current head root. 3. Set `preferences.proposal_slot` to `upcoming_proposal_slots[i]`. 4. Set `preferences.validator_index` to the validator's index. 5. Set `preferences.fee_recipient` to the execution address where the validator diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index 0e30fc881e..41b51c3ce6 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -59,7 +59,7 @@ - [`update_latest_messages`](#update_latest_messages) - [`on_block` helpers](#on_block-helpers) - [`record_block_timeliness`](#record_block_timeliness) - - [`get_dependent_root`](#get_dependent_root) + - [`get_shuffling_dependent_root`](#get_shuffling_dependent_root) - [`update_proposer_boost_root`](#update_proposer_boost_root) - [Handlers](#handlers) - [`on_tick`](#on_tick) @@ -856,11 +856,10 @@ def record_block_timeliness(store: Store, root: Root) -> None: store.block_timeliness[root] = is_timely ``` -##### `get_dependent_root` +##### `get_shuffling_dependent_root` ```python -def get_dependent_root(store: Store, root: Root) -> Root: - epoch = get_current_store_epoch(store) +def get_shuffling_dependent_root(store: Store, root: Root, epoch: Epoch) -> Root: if epoch <= MIN_SEED_LOOKAHEAD: # Genesis block parent return Root() @@ -876,7 +875,10 @@ def get_dependent_root(store: Store, root: Root) -> Root: def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None: is_first_block = store.proposer_boost_root == Root() is_timely = store.block_timeliness[root] - is_same_dependent_root = get_dependent_root(store, root) == get_dependent_root(store, head) + epoch = get_current_store_epoch(store) + head_dependent_root = get_shuffling_dependent_root(store, head, epoch) + block_dependent_root = get_shuffling_dependent_root(store, root, epoch) + is_same_dependent_root = head_dependent_root == block_dependent_root # Add proposer score boost if the block is timely, not conflicting with an # existing block, with the same dependent root as the canonical chain head.