Skip to content

Commit

Permalink
Ecotone spec updates for system_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Bayardo authored and roberto-bayardo committed Dec 21, 2023
1 parent b495204 commit 229faa6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions specs/system_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- [System config contents (version 0)](#system-config-contents-version-0)
- [`batcherHash` (`bytes32`)](#batcherhash-bytes32)
- [`overhead` and `scalar` (`uint256,uint256`)](#overhead-and-scalar-uint256uint256)
- [`overhead`,`scalar` (`uint256,uint256`) and `l1BasefeeScalar`,`l1BlobBasefeeScalar` (`uint32,uint32`)](#overheadscalar-uint256uint256-and-l1basefeescalarl1blobbasefeescalar-uint32uint32)
- [`gasLimit` (`uint64`)](#gaslimit-uint64)
- [`unsafeBlockSigner` (`address`)](#unsafeblocksigner-address)
- [Writing the system config](#writing-the-system-config)
Expand All @@ -31,10 +31,12 @@ Version `0` embeds the current batch submitter ethereum address (`bytes20`) in t
In the future this versioned hash may become a commitment to a more extensive configuration,
to enable more extensive redundancy and/or rotation configurations.

### `overhead` and `scalar` (`uint256,uint256`)
### `overhead`,`scalar` (`uint256,uint256`) and `l1BasefeeScalar`,`l1BlobBasefeeScalar` (`uint32,uint32`)

The L1 fee parameters, also known as Gas Price Oracle (GPO) parameters,
are updated in conjunction and apply new L1 costs to the L2 transactions.
These parameters are the L1 fee parameters, also known as Gas Price Oracle (GPO) parameters, used
to compute the L1 data fee applied to an L2 transaction. Prior to the Ecotone upgrade, `overhead`
and `scalar` are consulted and passed to the L2 via L1 block info for this purpose. After the
upgrade, `l1BasefeeScalar` and `l1BlobBasefeeScalar` are used instead.

### `gasLimit` (`uint64`)

Expand Down Expand Up @@ -70,7 +72,9 @@ A rollup node initializes its derivation process by finding a starting point bas
- When started from L2 genesis, the initial system configuration is retrieved from the rollup chain configuration.
- When started from an existing L2 chain, a previously included L1 block is determined as derivation starting point,
and the system config can thus be retrieved from the last L2 block that referenced the L1 block as L1 origin:
- `batcherHash`, `overhead` and `scalar` are retrieved from the L1 block info transaction.
- If the chain state precedes the Ecotone upgrade, `batcherHash`, `overhead` and `scalar` are
retrieved from the L1 block info transaction. Otherwise, `batcherHash`, `l1BasefeeScalar`, and
`l1BlobBasefeeScalar` are retrieved instead.
- `gasLimit` is retrieved from the L2 block header.
- other future variables may also be retrieved from other contents of the L2 block, such as the header.

Expand All @@ -89,6 +93,10 @@ The contained log events are filtered and processed as follows:
- type `1`: `overhead` and `scalar` overwrite, as two packed `uint256` entries.
- type `2`: `gasLimit` overwrite, as `uint64` payload.
- type `3`: `unsafeBlockSigner` overwrite, as `address` payload.
- type `4`: `l1BasefeeScalar` and `l1BlobBasefeeScalar` overwrite, as two packed `uint32`
entries in [`abi.encodePacked()`][encodePacked] format.

[encodePacked]: https://docs.soliditylang.org/en/latest/abi-spec.html#non-standard-packed-mode

Note that individual derivation stages may be processing different L1 blocks,
and should thus maintain individual system configuration copies,
Expand Down

0 comments on commit 229faa6

Please sign in to comment.