From a0688eadf446207cd70b77e7c3ee8b6f4bd99360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 26 Nov 2025 12:06:04 +0100 Subject: [PATCH 1/2] fix: add storage padding in L1GasPriceOracle --- src/L2/predeploys/L1GasPriceOracle.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/L2/predeploys/L1GasPriceOracle.sol b/src/L2/predeploys/L1GasPriceOracle.sol index b41f59a..36f0da5 100644 --- a/src/L2/predeploys/L1GasPriceOracle.sol +++ b/src/L2/predeploys/L1GasPriceOracle.sol @@ -117,6 +117,9 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle { /// @notice Indicates whether the network has gone through the Feynman upgrade. bool public isFeynman; + /// @dev Gap added to ensure that `isGalileo` is in the next storage slot. + uint248 private __gap; + /// @notice Indicates whether the network has gone through the Galileo upgrade. bool public isGalileo; From 82d562790dd0e4b56554c76621943ca5cd3e82a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 26 Nov 2025 12:23:35 +0100 Subject: [PATCH 2/2] add test --- src/test/L1GasPriceOracle.t.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/L1GasPriceOracle.t.sol b/src/test/L1GasPriceOracle.t.sol index 8c092fa..ceaf29d 100644 --- a/src/test/L1GasPriceOracle.t.sol +++ b/src/test/L1GasPriceOracle.t.sol @@ -312,4 +312,19 @@ contract L1GasPriceOracleTest is DSTestPlus { assertEq(oracle.getL1Fee(_data), (_baseTerm + _penaltyTerm) / PRECISION); } + + function testSetStorageDuringUpgrade() external { + assertFalse(oracle.isFeynman()); + assertFalse(oracle.isGalileo()); + + // Feynman upgrade + hevm.store(address(oracle), bytes32(uint256(11)), bytes32(uint256(1))); + assertTrue(oracle.isFeynman()); + assertFalse(oracle.isGalileo()); + + // GalileoV2 upgrade + hevm.store(address(oracle), bytes32(uint256(12)), bytes32(uint256(1))); + assertTrue(oracle.isFeynman()); + assertTrue(oracle.isGalileo()); + } }