Check gas limit consistency with the target#5236
Conversation
| 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 |
There was a problem hiding this comment.
Don't we have to worry about overflow here? What if parent_gas_limit is really small (or 0, as we encountered at default Gloas genesis).
There was a problem hiding this comment.
Actually nvm, it's fine because of how max_gas_limit_difference is calculated (parent_gas_limit <= 1024 implies max_gas_limit_difference == 0).
**Motivation** - alpha.8 spec **Description** - implement ethereum/consensus-specs#5236 **AI Assistance Disclosure** - codex --------- Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Supersedes #593 with ethereum/consensus-specs#5196, ethereum/consensus-specs#5236 added Adds the proposer preferences API for Gloas, deprecates the legacy fee-recipient/gas-limit endpoints, and tightens `beacon_committee_subscriptions` for CGC bookkeeping. ## Added - `POST /eth/v1/validator/proposer_preferences` — VC submission of signed preferences and publishes them on the `proposer_preferences` gossipsub topic. - `proposer_preferences` SSE event for messages passing gossip validation. - `Gloas.ProposerPreferences` / `Gloas.SignedProposerPreferences` types, including `dependent_root` (used for gossip dedup and validation). ## Deprecated - `POST /eth/v1/validator/prepare_beacon_proposer` — superseded by signed proposer preferences. Pre-Gloas support is REQUIRED; post-Gloas the endpoint MAY be a no-op or removed. - `POST /eth/v1/validator/register_validator` — fee recipient and gas limit move to signed proposer preferences. Same pre/post-Gloas support rules apply. ## Updated - `POST /eth/v1/validator/beacon_committee_subscriptions` — from Gloas onwards, BNs use the subscription set to identify which validators are using the node and to size the node's custody group count (CGC). VCs SHOULD submit one entry per attached active validator per attestation duty, including when multiple validators share the same `(slot, committee_index)`, so the BN tracks every attached validator rather than only one per subnet. Fixes #570 --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com>
| - _[IGNORE]_ `bid.parent_block_hash` is the block hash of a known execution | ||
| payload in fork choice. | ||
| payload in fork choice and | ||
| `is_gas_limit_target_compatible(parent_gas_limit, bid.gas_limit, proposer_preferences.target_gas_limit)` |
There was a problem hiding this comment.
just realized this but shouldn't this be a REJECT if is_gas_limit_target_compatible = False? we do the same if fee recipient is incorrect, wondering if we used IGNORE just because it's combined with "known execution payload in fork choice" condition
There was a problem hiding this comment.
Yes, I think it should. Can you open a PR for this?
There was a problem hiding this comment.
This is one approach to check that the builder's bid is compatible with the user's preference. In this approach this consistency check is not part of consensus as discussed during ACDT 79. In this approach the bid is required to have the actual gas limit in the payload and the CL just imposes compatibility with proposer preferences at the gossip layer rather than the consensus layer.
This relies on getting the parent gas limit from cached information in the node.
Another approach to make it part of consensus as discussed in ACDT would be to store the latest gas limit in the beacon state and make this part of
verify_execution_payload_envelope. This avoids this computation on gossip validation but requires an extra cache in the beacon state.A third approach is to send the preferences to the engine on
notify_newPayloadand require the EL to make this check.