From 5a31fc7ec1483bd56aaa3cc30c908c46e399d078 Mon Sep 17 00:00:00 2001 From: "Elan L." <94496572+Lesedi37@users.noreply.github.com> Date: Tue, 7 Apr 2026 05:21:35 +0000 Subject: [PATCH] Add Jovian L1Block Scalar Parsing Guide ### Summary This PR adds a technical guide for parsing the new packed `l1FeeScalar` introduced in the Jovian upgrade. ### Technical Changes - Defines the bit-layout for the 32-byte storage slot at the L1Block predeploy. - Provides a Solidity implementation for extracting `baseFeeScalar` (bits 192:224) and `blobBaseFeeScalar` (bits 160:192). ### Impact Ensures that application developers and indexers can accurately calculate L1 data costs post-Jovian, preventing inflated gas estimates and transaction failures. ### Payout Metadata - **Contributor:** Lesedi37 - **Wallet Address:** 0x1db618e6bfc35bd48b91431a55c4948b27e7a539 --- specs/protocol/jovian/l1-scalar-parsing.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 specs/protocol/jovian/l1-scalar-parsing.md diff --git a/specs/protocol/jovian/l1-scalar-parsing.md b/specs/protocol/jovian/l1-scalar-parsing.md new file mode 100644 index 000000000..8807d72a7 --- /dev/null +++ b/specs/protocol/jovian/l1-scalar-parsing.md @@ -0,0 +1,18 @@ +# Jovian L1Block Scalar Parsing Guide + +With the Jovian upgrade, the `l1FeeScalar` in the `L1Block` predeploy (`0x4200000000000000000000000000000000000015`) is a packed 32-byte word. This guide specifies the extraction logic for application developers. + +### Extraction Logic +Developers must shift the 32-byte raw value to isolate the individual 4-byte scalars: + +- **Base Fee Scalar:** bits [192:224] +- **Blob Base Fee Scalar:** bits [160:192] + +```solidity +function getScalars() public view returns (uint32 baseScalar, uint32 blobScalar) { + uint256 raw = IL1Block(0x4200000000000000000000000000000000000015).l1FeeScalar(); + baseScalar = uint32(raw >> 192); + blobScalar = uint32(raw >> 160); +} +Contributor: Lesedi37 +Rabby Wallet Address: 0x1db618e6bfc35bd48b91431a55c4948b27e7a539