Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions specs/gloas/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)`,
Expand Down
12 changes: 7 additions & 5 deletions specs/gloas/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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.
Expand Down
14 changes: 2 additions & 12 deletions specs/gloas/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
jtraglia marked this conversation as resolved.
`proposer_preferences = signed_proposer_preferences.message`:

- _[IGNORE]_ `bid.slot` is the current slot or the next slot.
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions specs/gloas/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions specs/phase0/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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.
Expand Down