@@ -57,9 +57,15 @@ contract L1Block is ISemver, IGasToken {
5757 /// @notice The latest L1 blob base fee.
5858 uint256 public blobBaseFee;
5959
60- /// @custom:semver 1.5.1-beta.2
60+ /// @notice The eip-1550 base fee change denominator value.
61+ uint64 public eip1559Denominator;
62+
63+ /// @notice The eip-1550 base fee change elasticity value.
64+ uint64 public eip1559Elasticity;
65+
66+ /// @custom:semver 1.5.1-beta.3
6167 function version () public pure virtual returns (string memory ) {
62- return "1.5.1-beta.2 " ;
68+ return "1.5.1-beta.3 " ;
6369 }
6470
6571 /// @notice Returns the gas paying token, its decimals, name and symbol.
@@ -168,6 +174,59 @@ contract L1Block is ISemver, IGasToken {
168174 }
169175 }
170176
177+ /// @notice Updates the L1 block values for a Holocene upgraded chain.
178+ /// Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size.
179+ /// Params are expected to be in the following order:
180+ /// 1. _baseFeeScalar L1 base fee scalar
181+ /// 2. _blobBaseFeeScalar L1 blob base fee scalar
182+ /// 3. _sequenceNumber Number of L2 blocks since epoch start.
183+ /// 4. _timestamp L1 timestamp.
184+ /// 5. _number L1 blocknumber.
185+ /// 6. _basefee L1 base fee.
186+ /// 7. _blobBaseFee L1 blob base fee.
187+ /// 8. _hash L1 blockhash.
188+ /// 9. _batcherHash Versioned hash to authenticate batcher by.
189+ /// 10. _eip1559Elasticity EIP-1559 elasticity multiplier value.
190+ /// 11. _eip1559Denominator EIP-1559 base fee change denominator value.
191+ function setL1BlockValuesHolocene () public {
192+ _setL1BlockValuesHolocene ();
193+ }
194+
195+ /// @notice Updates the L1 block values for a Holocene upgraded chain.
196+ /// Params are packed and passed in as raw msg.data instead of ABI to reduce calldata size.
197+ /// Params are expected to be in the following order:
198+ /// 1. _baseFeeScalar L1 base fee scalar
199+ /// 2. _blobBaseFeeScalar L1 blob base fee scalar
200+ /// 3. _sequenceNumber Number of L2 blocks since epoch start.
201+ /// 4. _timestamp L1 timestamp.
202+ /// 5. _number L1 blocknumber.
203+ /// 6. _basefee L1 base fee.
204+ /// 7. _blobBaseFee L1 blob base fee.
205+ /// 8. _hash L1 blockhash.
206+ /// 9. _batcherHash Versioned hash to authenticate batcher by.
207+ /// 10. _eip1559Elasticity EIP-1559 elasticity multiplier value.
208+ /// 11. _eip1559Denominator EIP-1559 base fee change denominator value.
209+ function _setL1BlockValuesHolocene () internal {
210+ address depositor = DEPOSITOR_ACCOUNT ();
211+ assembly {
212+ // Revert if the caller is not the depositor account.
213+ if xor (caller (), depositor) {
214+ mstore (0x00 , 0x3cc50b45 ) // 0x3cc50b45 is the 4-byte selector of "NotDepositor()"
215+ revert (0x1C , 0x04 ) // returns the stored 4-byte selector from above
216+ }
217+ // sequencenum (uint64), blobBaseFeeScalar (uint32), baseFeeScalar (uint32)
218+ sstore (sequenceNumber.slot, shr (128 , calldataload (4 )))
219+ // number (uint64) and timestamp (uint64)
220+ sstore (number.slot, shr (128 , calldataload (20 )))
221+ sstore (basefee.slot, calldataload (36 )) // uint256
222+ sstore (blobBaseFee.slot, calldataload (68 )) // uint256
223+ sstore (hash.slot, calldataload (100 )) // bytes32
224+ sstore (batcherHash.slot, calldataload (132 )) // bytes32
225+ // eip1559Denominator (uint64) and eip1559Elasticity (uint64)
226+ sstore (eip1559Denominator.slot, shr (128 , calldataload (164 ))) // uint64
227+ }
228+ }
229+
171230 /// @notice Sets the gas paying token for the L2 system. Can only be called by the special
172231 /// depositor account. This function is not called on every L2 block but instead
173232 /// only called by specially crafted L1 deposit transactions.
0 commit comments