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
2 changes: 1 addition & 1 deletion specs/gloas/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ to include. They produce a `SignedExecutionPayloadBid` as follows.
where `parent_state` is the post-state of `bid.parent_block_root`.
07. Set `bid.gas_limit` to be the gas limit of the constructed payload, which
**MUST** satisfy `is_gas_limit_target_compatible` with respect to the
`gas_limit` in the `SignedProposerPreferences` referenced in step 6.
`target_gas_limit` in the `SignedProposerPreferences` referenced in step 6.
08. Set `bid.builder_index` to be the index of the builder performing these
actions.
09. Set `bid.slot` to be the slot for which this bid is aimed. This slot
Expand Down
17 changes: 9 additions & 8 deletions specs/gloas/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ProposerPreferences(Container):
proposal_slot: Slot
validator_index: ValidatorIndex
fee_recipient: ExecutionAddress
gas_limit: uint64
target_gas_limit: uint64
```

#### New `SignedProposerPreferences`
Expand Down Expand Up @@ -361,7 +361,7 @@ the alias `proposer_preferences = signed_proposer_preferences.message`.
payload in fork choice. Let `parent_gas_limit` be the `gas_limit` of that
execution payload.
- _[IGNORE]_
`is_gas_limit_target_compatible(parent_gas_limit, bid.gas_limit, proposer_preferences.gas_limit) == True`.
`is_gas_limit_target_compatible(parent_gas_limit, bid.gas_limit, proposer_preferences.target_gas_limit) == True`.
- _[IGNORE]_ `bid.parent_block_root` is the hash tree root of a known beacon
block in fork choice.
- _[REJECT]_ `signed_execution_payload_bid.signature` is valid with respect to
Expand All @@ -371,18 +371,19 @@ The following helper is used to validate the bid's gas limit

```python
def is_gas_limit_target_compatible(
parent_gas_limit: uint64, gas_limit: uint64, proposer_gas_limit: uint64
parent_gas_limit: uint64, gas_limit: uint64, target_gas_limit: uint64
) -> bool:
"""
Check if the bid's gas limit is compatible with the proposer's preferences.
Check if ``gas_limit`` is compatible with ``target_gas_limit`` under the
EIP-1559 transition rule from ``parent_gas_limit``.
"""
max_gas_limit_difference = max(parent_gas_limit // 1024, 1) - 1
min_gas_limit = parent_gas_limit - max_gas_limit_difference
max_gas_limit = parent_gas_limit + max_gas_limit_difference

if proposer_gas_limit >= min_gas_limit and proposer_gas_limit <= max_gas_limit:
return gas_limit == proposer_gas_limit
if proposer_gas_limit > max_gas_limit:
if target_gas_limit >= min_gas_limit and target_gas_limit <= max_gas_limit:
return gas_limit == target_gas_limit
if target_gas_limit > max_gas_limit:
return gas_limit == max_gas_limit
return gas_limit == min_gas_limit
```
Expand All @@ -399,7 +400,7 @@ bid at regular time intervals.

This topic is used to propagate signed proposer preferences as
`SignedProposerPreferences`. These messages allow validators to communicate
their preferred `fee_recipient` and `gas_limit` to builders.
their preferred `fee_recipient` and `target_gas_limit` to builders.

The following validations MUST pass before forwarding the
`signed_proposer_preferences` on the network, assuming the alias
Expand Down
10 changes: 5 additions & 5 deletions specs/gloas/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ A validator MAY broadcast `SignedProposerPreferences` messages to the
`get_upcoming_proposal_slots(state, validator_index)`. These include any future
proposal slots within the proposer lookahead, i.e. the current epoch up to
`MIN_SEED_LOOKAHEAD` epochs ahead. This allows builders to construct execution
payloads with the validator's preferred `fee_recipient` and `gas_limit`. If a
validator does not broadcast a `SignedProposerPreferences` message, this implies
that the validator will not accept any trustless bids for that slot.
payloads with the validator's preferred `fee_recipient` and `target_gas_limit`.
If a validator does not broadcast a `SignedProposerPreferences` message, this
implies that the validator will not accept any trustless bids for that slot.

```python
def get_upcoming_proposal_slots(
Expand Down Expand Up @@ -161,8 +161,8 @@ To construct each `SignedProposerPreferences`:
4. Set `preferences.validator_index` to the validator's index.
5. Set `preferences.fee_recipient` to the execution address where the validator
wishes to receive the builder payment.
6. Set `preferences.gas_limit` to the validator's preferred gas limit for this
execution payload.
6. Set `preferences.target_gas_limit` to the validator's preferred gas limit for
this execution payload.
7. Instantiate a new `SignedProposerPreferences` object as `signed_preferences`.
8. Set `signed_preferences.message` to `preferences`.
9. Set `signed_preferences.signature` to the result of
Expand Down