-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Holocene: eip-1559 parameters in extraData #428
base: main
Are you sure you want to change the base?
Holocene: eip-1559 parameters in extraData #428
Conversation
9b2a23d
to
4793842
Compare
4793842
to
78552cd
Compare
As discussed in discord, updated spec to use extraData instead of nonce. |
8fd9747
to
edd510b
Compare
…Data instead of nonce.
edd510b
to
9aaaed6
Compare
- if `parent_header.extraData` is empty, the [canyon base fee parameter constants](../exec-engine.md#1559-parameters) | ||
are used for the block's base fee parameters. | ||
- if `parent_header.extraData` is non-empty with the version byte (first byte) value 0, the remaining 64 | ||
bytes are used for the block's eip-1559 parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if `parent_header.extraData` is empty, the [canyon base fee parameter constants](../exec-engine.md#1559-parameters) | |
are used for the block's base fee parameters. | |
- if `parent_header.extraData` is non-empty with the version byte (first byte) value 0, the remaining 64 | |
bytes are used for the block's eip-1559 parameters. | |
- if Holocene is not active in `parent_header.timestamp`, then `parent_header.extraData` may be set to anything valid in pre-Holocene context. The [canyon base fee parameter constants](../exec-engine.md#1559-parameters), or prior EIP-1559 constants are used for the block's base fee parameters. | |
- While not set in regular pre-Holocene blocks, the `extraData` was set in the genesis block of some pre-Holocene chains, and other blocks with pre-Bedrock legacy content. It is thus important to check the hardfork before parsing the `extraData`. | |
- if Holocene is active in `parent_header.timestamp`, then `parent_header.extraData` is non-empty, with the following encoding: | |
- the first byte is set to `0`, used as version byte for the content. | |
- the next 8 bytes are used to encode the 1559 params following the [`eip1559Params` | |
encoding](#eip1559params-encoding). | |
- the `extraData` ends there, at 9 bytes length. The `extraData` has a maximum capacity of 32 bytes (to fit in the L1 beacon-chain `extraData` data-type), and may be modified/extended in future versions. |
A hardfork should also not retro-actively apply constraints on prior blocks, like the parent-block.
The spec needs to call out that the transition block does not read the 1559 params from the more arbitrary pre-holocene block.
The previous spec rule would create weird behavior for the block right after genesis, if Holocene wasn't active then yet.
| `GAS_LIMIT` | `uint8(2)` | `abi.encode(uint64 _gasLimit)` | Modifies the L2 gas limit | | ||
| `UNSAFE_BLOCK_SIGNER` | `uint8(3)` | `abi.encode(address)` | Modifies the account that is authorized to progress the unsafe chain | | ||
| `EIP_1559_PARAMS` | `uint8(4)` | `(uint256(_denominator) << 32) \| _elasticity` | Modifies the EIP-1559 denominator and elasticity | | ||
| `EIP_1559_PARAMS` | `uint8(4)` | `abi.encode((uint256(_denominator) << 32) \| _elasticity)` | Modifies the EIP-1559 denominator and elasticity | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth clarifying that this is the format emitted by the SystemConfig
. Not the same as the format in the block-header extraData
.
Description
EIP-1559 parameters need to be in the ExecutionPayload, not just the PayloadAttributes, to allow geth to properly include the encoded parameters in the block header. So instead of using nonce, we use the extraData field which is already in the ExecutionPayload. This will also reserve nonce to be used for sub-second block times.