From a1cdd69eda2deaf508d4c3d0e66f3145dae90da1 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 14:58:39 -0600 Subject: [PATCH 01/18] make fast confirmation generic using a set of confirmers --- src/rollup/RollupAdminLogic.sol | 10 ++++++---- src/rollup/RollupCore.sol | 16 +++++++++++++++- src/rollup/RollupUserLogic.sol | 17 ++++++----------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index bb875aa2..4698ba24 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -66,7 +66,8 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl loserStakeEscrow = config.loserStakeEscrow; stakeToken = config.stakeToken; - anyTrustFastConfirmer = config.anyTrustFastConfirmer; + // todo: add config.zeroLevelBoldFastConfirmer + _fastConfirmers.add(config.anyTrustFastConfirmer); bytes32 parentAssertionHash = bytes32(0); bytes32 inboxAcc = bytes32(0); @@ -451,9 +452,10 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl function setAnyTrustFastConfirmer( address _anyTrustFastConfirmer ) external { - anyTrustFastConfirmer = _anyTrustFastConfirmer; - emit AnyTrustFastConfirmerSet(_anyTrustFastConfirmer); - // previously: emit OwnerFunctionCalled(31); + // TODO: new function for adding removing generic fastConfirmers. this function should be removed + // anyTrustFastConfirmer = _anyTrustFastConfirmer; + // emit AnyTrustFastConfirmerSet(_anyTrustFastConfirmer); + // // previously: emit OwnerFunctionCalled(31); } /** diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 035c9a0e..0cc1b078 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -110,7 +110,14 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { uint256 public rollupDeploymentBlock; bool public validatorWhitelistDisabled; - address public anyTrustFastConfirmer; + EnumerableSetUpgradeable.AddressSet internal _fastConfirmers; + + /// @notice Whether fastConfirmNewAssertion has been called with the given prevAssertion + /// @dev Used to prevent stake accounting issues when fastConfirmNewAssertion is called multiple times on the same prev. + /// If fastConfirmNewAssertion is called multiple times on the same prev, + /// it would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. + /// This is because the protocol assume there is only 1 unique confirmable child assertion. + mapping(bytes32 => bool) public fastConfirmNewAssertionPrevUsed; // If the chain this RollupCore is deployed on is an Arbitrum chain. bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum(); @@ -121,6 +128,13 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { return ISequencerInbox(bridge.sequencerInbox()); } + /// @notice Fast confirmers are allowed to create and confirm assertions instantly, without any checks or stake + /// In an AnyTrust chain, there may be a fastConfirmer which is a contract that can call this function when it receives sufficient signatures from DAC members. + /// In a 0-level bold enabled chain, there may be a fastConfirmer which accepts guardian signatures and a SNARK proving the assertion. + function fastConfirmers() external view returns (address[] memory) { + return _fastConfirmers.values(); + } + /** * @notice Get a storage reference to the Assertion for the given assertion hash * @dev The assertion may not exists diff --git a/src/rollup/RollupUserLogic.sol b/src/rollup/RollupUserLogic.sol index fdfca221..83ff4d18 100644 --- a/src/rollup/RollupUserLogic.sol +++ b/src/rollup/RollupUserLogic.sol @@ -286,9 +286,7 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { } /** - * @notice This allow the anyTrustFastConfirmer to force confirm any pending assertion - * the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to - * a contract that can call this function when received sufficient signatures + * @notice This allows fastConfirmers to force confirm any pending assertion */ function fastConfirmAssertion( bytes32 assertionHash, @@ -296,20 +294,15 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { AssertionState calldata confirmState, bytes32 inboxAcc ) public whenNotPaused { - require(msg.sender == anyTrustFastConfirmer, "NOT_FAST_CONFIRMER"); + require(_fastConfirmers.contains(msg.sender), "NOT_FAST_CONFIRMER"); // this skip deadline, prev, challenge validations confirmAssertionInternal(assertionHash, parentAssertionHash, confirmState, inboxAcc); } /** - * @notice This allow the anyTrustFastConfirmer to immediately create and confirm an assertion - * the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to - * a contract that can call this function when received sufficient signatures - * The logic in this function is similar to stakeOnNewAssertion, but without staker checks + * @notice This allows fastConfirmers to immediately create and confirm an assertion * - * We trust the anyTrustFastConfirmer to not call this function multiple times on the same prev, - * as doing so would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. - * This is because the protocol assume there is only 1 unique confirmable child assertion. + * The logic in this function is similar to stakeOnNewAssertion, but without staker checks */ function fastConfirmNewAssertion( AssertionInputs calldata assertion, @@ -325,6 +318,8 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { assertion.beforeStateData.sequencerBatchAcc ); getAssertionStorage(prevAssertion).requireExists(); + require(!fastConfirmNewAssertionPrevUsed[prevAssertion], "PREV_ALREADY_USED"); + fastConfirmNewAssertionPrevUsed[prevAssertion] = true; if (status == AssertionStatus.NoAssertion) { // If not exists, we create the new assertion From d4ab699875aa6e24ac4970949688c6240b86cf28 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:01:34 -0600 Subject: [PATCH 02/18] fix comment --- src/rollup/RollupCore.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 0cc1b078..8932ed02 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -113,7 +113,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { EnumerableSetUpgradeable.AddressSet internal _fastConfirmers; /// @notice Whether fastConfirmNewAssertion has been called with the given prevAssertion - /// @dev Used to prevent stake accounting issues when fastConfirmNewAssertion is called multiple times on the same prev. + /// @dev Used to prevent stake accounting issues so fastConfirmNewAssertion cannot be called multiple times on the same prev. /// If fastConfirmNewAssertion is called multiple times on the same prev, /// it would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. /// This is because the protocol assume there is only 1 unique confirmable child assertion. From da8e3b754b88f9dd3810071436ca380476cb767d Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:13:26 -0600 Subject: [PATCH 03/18] scaffold new fast confirmer --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/rollup/ZeroLevelBoldFastConfirmer.sol diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol new file mode 100644 index 00000000..9f02fe89 --- /dev/null +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -0,0 +1,52 @@ +// Copyright 2021-2022, Offchain Labs, Inc. +// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.0; + +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; + +// dummy interface for the SNARK verifier. +interface ISnarkVerifier { + function verifyProof(bytes calldata inputS) external view returns (bool); +} + +contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable { + /// @notice Gnosis Safe multisig address of the guardian council + address public guardianCouncil; + + /// @notice SNARK verifier contract address + ISnarkVerifier public snarkVerifier; + + event GuardianCouncilSet(address indexed newGuardianCouncil); + + function initialize(address _guardianCouncil, address _initialOwner, address _snarkVerifier) public initializer { + __Ownable_init(); + guardianCouncil = _guardianCouncil; + _transferOwnership(_initialOwner); + snarkVerifier = ISnarkVerifier(_snarkVerifier); + } + + /// @notice Fast confirms an assertion + /// @dev MUST revert if we cannot validate the guardian council signatures or the SNARK + function fastConfirmAssertion( + bytes32 assertionHash, + bytes32 parentAssertionHash, + AssertionState calldata confirmState, + bytes32 inboxAcc + ) public { + // todo: check 1271 of guardian council + // todo: check snark + // todo: confirm the assertion + } + + function setGuardianCouncil(address _guardianCouncil) external onlyOwner { + guardianCouncil = _guardianCouncil; + emit GuardianCouncilSet(_guardianCouncil); + } + + function setSnarkVerifier(address _snarkVerifier) external onlyOwner { + snarkVerifier = ISnarkVerifier(_snarkVerifier); + } +} \ No newline at end of file From ca83737f49011b0feea8f74867f8cd301dc44bc9 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:20:26 -0600 Subject: [PATCH 04/18] check guardian signature --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 58 +++++++++++++++++++---- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 9f02fe89..4039e32e 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -4,25 +4,43 @@ pragma solidity ^0.8.0; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {AssertionState} from "./AssertionState.sol"; +import { + OwnableUpgradeable +} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import { + EIP712Upgradeable +} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; // dummy interface for the SNARK verifier. interface ISnarkVerifier { - function verifyProof(bytes calldata inputS) external view returns (bool); + function verifyProof( + bytes calldata inputS + ) external view returns (bool); } -contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable { +contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { + bytes32 public constant FAST_CONFIRM_TYPEHASH = + keccak256("FastConfirmAssertion(bytes32 assertionHash)"); + /// @notice Gnosis Safe multisig address of the guardian council address public guardianCouncil; /// @notice SNARK verifier contract address ISnarkVerifier public snarkVerifier; + error InvalidGuardianSignature(); + event GuardianCouncilSet(address indexed newGuardianCouncil); - function initialize(address _guardianCouncil, address _initialOwner, address _snarkVerifier) public initializer { + function initialize( + address _guardianCouncil, + address _initialOwner, + address _snarkVerifier + ) public initializer { __Ownable_init(); + __EIP712_init("ZeroLevelBoldFastConfirmer", "1"); guardianCouncil = _guardianCouncil; _transferOwnership(_initialOwner); snarkVerifier = ISnarkVerifier(_snarkVerifier); @@ -34,19 +52,41 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable { bytes32 assertionHash, bytes32 parentAssertionHash, AssertionState calldata confirmState, - bytes32 inboxAcc + bytes32 inboxAcc, + bytes calldata guardianSignature ) public { - // todo: check 1271 of guardian council + bytes32 digest = + _hashTypedDataV4(keccak256(abi.encode(FAST_CONFIRM_TYPEHASH, assertionHash))); + + if ( + IERC1271(guardianCouncil) + .isValidSignature( + getFastConfirmAssertionMessageDigest(assertionHash), guardianSignature + ) != 0x1626ba7e + ) { + revert InvalidGuardianSignature(); + } + // todo: check snark // todo: confirm the assertion } - function setGuardianCouncil(address _guardianCouncil) external onlyOwner { + function getFastConfirmAssertionMessageDigest( + bytes32 assertionHash + ) public view returns (bytes32) { + return _hashTypedDataV4(keccak256(abi.encode(FAST_CONFIRM_TYPEHASH, assertionHash))); + } + + function setGuardianCouncil( + address _guardianCouncil + ) external onlyOwner { guardianCouncil = _guardianCouncil; emit GuardianCouncilSet(_guardianCouncil); } - function setSnarkVerifier(address _snarkVerifier) external onlyOwner { + function setSnarkVerifier( + address _snarkVerifier + ) external onlyOwner { snarkVerifier = ISnarkVerifier(_snarkVerifier); } -} \ No newline at end of file +} From bf5a7763aea6893cd91249b73652fe057b6f8873 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:22:15 -0600 Subject: [PATCH 05/18] check snark proof --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 4039e32e..bd62720e 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -31,6 +31,7 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { ISnarkVerifier public snarkVerifier; error InvalidGuardianSignature(); + error InvalidSnarkProof(); event GuardianCouncilSet(address indexed newGuardianCouncil); @@ -53,7 +54,8 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes32 parentAssertionHash, AssertionState calldata confirmState, bytes32 inboxAcc, - bytes calldata guardianSignature + bytes calldata guardianSignature, + bytes calldata snarkProof ) public { bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(FAST_CONFIRM_TYPEHASH, assertionHash))); @@ -67,7 +69,10 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { revert InvalidGuardianSignature(); } - // todo: check snark + if (!snarkVerifier.verifyProof(snarkProof)) { + revert InvalidSnarkProof(); + } + // todo: confirm the assertion } From 1f0a1a9108372a9b2a2707587b5c621f0f710a4a Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:26:54 -0600 Subject: [PATCH 06/18] confirm the assertion --- src/rollup/IRollupLogic.sol | 7 +++++++ src/rollup/ZeroLevelBoldFastConfirmer.sol | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/rollup/IRollupLogic.sol b/src/rollup/IRollupLogic.sol index b3f825fd..5ab1adeb 100644 --- a/src/rollup/IRollupLogic.sol +++ b/src/rollup/IRollupLogic.sol @@ -66,4 +66,11 @@ interface IRollupUser is IRollupCore, IOwnable { address expectedWithdrawalAddress, uint256 tokenAmount ) external; + + function fastConfirmAssertion( + bytes32 assertionHash, + bytes32 parentAssertionHash, + AssertionState calldata confirmState, + bytes32 inboxAcc + ) external; } diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index bd62720e..e0296595 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -12,6 +12,7 @@ import { EIP712Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {IRollupUser} from "./IRollupLogic.sol"; // dummy interface for the SNARK verifier. interface ISnarkVerifier { @@ -24,6 +25,9 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes32 public constant FAST_CONFIRM_TYPEHASH = keccak256("FastConfirmAssertion(bytes32 assertionHash)"); + /// @notice The rollup contract to fast confirm on + IRollupUser public rollup; + /// @notice Gnosis Safe multisig address of the guardian council address public guardianCouncil; @@ -36,12 +40,14 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { event GuardianCouncilSet(address indexed newGuardianCouncil); function initialize( + address _rollup, address _guardianCouncil, address _initialOwner, address _snarkVerifier ) public initializer { __Ownable_init(); __EIP712_init("ZeroLevelBoldFastConfirmer", "1"); + rollup = IRollupUser(_rollup); guardianCouncil = _guardianCouncil; _transferOwnership(_initialOwner); snarkVerifier = ISnarkVerifier(_snarkVerifier); @@ -57,9 +63,6 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes calldata guardianSignature, bytes calldata snarkProof ) public { - bytes32 digest = - _hashTypedDataV4(keccak256(abi.encode(FAST_CONFIRM_TYPEHASH, assertionHash))); - if ( IERC1271(guardianCouncil) .isValidSignature( @@ -73,7 +76,7 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { revert InvalidSnarkProof(); } - // todo: confirm the assertion + rollup.fastConfirmAssertion(assertionHash, parentAssertionHash, confirmState, inboxAcc); } function getFastConfirmAssertionMessageDigest( From 5078857b0bf0b20ec402b5cf910a9795ef633741 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:27:33 -0600 Subject: [PATCH 07/18] cleaner --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index e0296595..4cc72c71 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -63,11 +63,10 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes calldata guardianSignature, bytes calldata snarkProof ) public { + bytes32 messageDigest = getFastConfirmAssertionMessageDigest(assertionHash); if ( - IERC1271(guardianCouncil) - .isValidSignature( - getFastConfirmAssertionMessageDigest(assertionHash), guardianSignature - ) != 0x1626ba7e + IERC1271(guardianCouncil).isValidSignature(messageDigest, guardianSignature) + != 0x1626ba7e ) { revert InvalidGuardianSignature(); } From 6eb050bc1bbeb314e7c80079c8f7e2df17918883 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:40:45 -0600 Subject: [PATCH 08/18] fastConfirmNewAssertion --- src/rollup/IRollupLogic.sol | 5 +++ src/rollup/ZeroLevelBoldFastConfirmer.sol | 48 ++++++++++++++++------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/rollup/IRollupLogic.sol b/src/rollup/IRollupLogic.sol index 5ab1adeb..f61b1a1b 100644 --- a/src/rollup/IRollupLogic.sol +++ b/src/rollup/IRollupLogic.sol @@ -73,4 +73,9 @@ interface IRollupUser is IRollupCore, IOwnable { AssertionState calldata confirmState, bytes32 inboxAcc ) external; + + function fastConfirmNewAssertion( + AssertionInputs calldata assertion, + bytes32 expectedAssertionHash + ) external; } diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 4cc72c71..88593840 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -4,7 +4,8 @@ pragma solidity ^0.8.0; -import {AssertionState} from "./AssertionState.sol"; +import {AssertionInputs} from "./Assertion.sol"; +import {AssertionState, AssertionStateLib} from "./AssertionState.sol"; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; @@ -22,6 +23,8 @@ interface ISnarkVerifier { } contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { + using AssertionStateLib for AssertionState; + bytes32 public constant FAST_CONFIRM_TYPEHASH = keccak256("FastConfirmAssertion(bytes32 assertionHash)"); @@ -53,8 +56,6 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { snarkVerifier = ISnarkVerifier(_snarkVerifier); } - /// @notice Fast confirms an assertion - /// @dev MUST revert if we cannot validate the guardian council signatures or the SNARK function fastConfirmAssertion( bytes32 assertionHash, bytes32 parentAssertionHash, @@ -63,21 +64,20 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes calldata guardianSignature, bytes calldata snarkProof ) public { - bytes32 messageDigest = getFastConfirmAssertionMessageDigest(assertionHash); - if ( - IERC1271(guardianCouncil).isValidSignature(messageDigest, guardianSignature) - != 0x1626ba7e - ) { - revert InvalidGuardianSignature(); - } - - if (!snarkVerifier.verifyProof(snarkProof)) { - revert InvalidSnarkProof(); - } - + _verifyProofs(assertionHash, guardianSignature, snarkProof); rollup.fastConfirmAssertion(assertionHash, parentAssertionHash, confirmState, inboxAcc); } + function fastConfirmNewAssertion( + AssertionInputs calldata assertion, + bytes32 assertionHash, + bytes calldata guardianSignature, + bytes calldata snarkProof + ) external { + _verifyProofs(assertionHash, guardianSignature, snarkProof); + rollup.fastConfirmNewAssertion(assertion, assertionHash); + } + function getFastConfirmAssertionMessageDigest( bytes32 assertionHash ) public view returns (bytes32) { @@ -96,4 +96,22 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { ) external onlyOwner { snarkVerifier = ISnarkVerifier(_snarkVerifier); } + + function _verifyProofs( + bytes32 assertionHash, + bytes calldata guardianSignature, + bytes calldata snarkProof + ) internal view { + bytes32 messageDigest = getFastConfirmAssertionMessageDigest(assertionHash); + if ( + IERC1271(guardianCouncil).isValidSignature(messageDigest, guardianSignature) + != 0x1626ba7e + ) { + revert InvalidGuardianSignature(); + } + + if (!snarkVerifier.verifyProof(snarkProof)) { + revert InvalidSnarkProof(); + } + } } From dd257fbdb9162a67e38d668824a39b2a37cab18a Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:44:28 -0600 Subject: [PATCH 09/18] pass assertion to snark verifier --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 88593840..24617556 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -18,7 +18,8 @@ import {IRollupUser} from "./IRollupLogic.sol"; // dummy interface for the SNARK verifier. interface ISnarkVerifier { function verifyProof( - bytes calldata inputS + bytes32 assertionHash, + bytes calldata input ) external view returns (bool); } @@ -110,7 +111,7 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { revert InvalidGuardianSignature(); } - if (!snarkVerifier.verifyProof(snarkProof)) { + if (!snarkVerifier.verifyProof(assertionHash, snarkProof)) { revert InvalidSnarkProof(); } } From 0644331b38773df610fba85a50aad4e33571f3c1 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:26:55 -0600 Subject: [PATCH 10/18] fix storage --- src/rollup/RollupCore.sol | 12 +-- test/storage/RollupAdminLogic | 134 +++++++++++++++++----------------- test/storage/RollupCore | 134 +++++++++++++++++----------------- test/storage/RollupUserLogic | 134 +++++++++++++++++----------------- 4 files changed, 214 insertions(+), 200 deletions(-) diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 8932ed02..14e4ddbc 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -110,6 +110,13 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { uint256 public rollupDeploymentBlock; bool public validatorWhitelistDisabled; + address private __unused__anyTrustFastConfirmer; + + // If the chain this RollupCore is deployed on is an Arbitrum chain. + bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum(); + // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation. + mapping(bytes32 => uint256) internal _assertionCreatedAtArbSysBlock; + EnumerableSetUpgradeable.AddressSet internal _fastConfirmers; /// @notice Whether fastConfirmNewAssertion has been called with the given prevAssertion @@ -119,11 +126,6 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { /// This is because the protocol assume there is only 1 unique confirmable child assertion. mapping(bytes32 => bool) public fastConfirmNewAssertionPrevUsed; - // If the chain this RollupCore is deployed on is an Arbitrum chain. - bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum(); - // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation. - mapping(bytes32 => uint256) internal _assertionCreatedAtArbSysBlock; - function sequencerInbox() public view virtual returns (ISequencerInbox) { return ISequencerInbox(bridge.sequencerInbox()); } diff --git a/test/storage/RollupAdminLogic b/test/storage/RollupAdminLogic index 8f53588e..627eac04 100644 --- a/test/storage/RollupAdminLogic +++ b/test/storage/RollupAdminLogic @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ +╭---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ diff --git a/test/storage/RollupCore b/test/storage/RollupCore index e493175c..f970a170 100644 --- a/test/storage/RollupCore +++ b/test/storage/RollupCore @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+===============================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | -|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ +╭---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | +|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ diff --git a/test/storage/RollupUserLogic b/test/storage/RollupUserLogic index b2edbafb..126e6543 100644 --- a/test/storage/RollupUserLogic +++ b/test/storage/RollupUserLogic @@ -1,67 +1,71 @@ -╭--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+=========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -╰--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ +╭---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++==========================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +╰---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ From 832806a84b9142c3ec2e629270e1d897e8665e7e Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 31 Mar 2026 08:53:33 -0600 Subject: [PATCH 11/18] remove unnecessary mapping --- src/rollup/RollupCore.sol | 10 ++-------- src/rollup/RollupUserLogic.sol | 7 +++++-- test/storage/RollupAdminLogic | 2 -- test/storage/RollupCore | 2 -- test/storage/RollupUserLogic | 2 -- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 14e4ddbc..f5f5b3aa 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -119,18 +119,12 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { EnumerableSetUpgradeable.AddressSet internal _fastConfirmers; - /// @notice Whether fastConfirmNewAssertion has been called with the given prevAssertion - /// @dev Used to prevent stake accounting issues so fastConfirmNewAssertion cannot be called multiple times on the same prev. - /// If fastConfirmNewAssertion is called multiple times on the same prev, - /// it would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. - /// This is because the protocol assume there is only 1 unique confirmable child assertion. - mapping(bytes32 => bool) public fastConfirmNewAssertionPrevUsed; - function sequencerInbox() public view virtual returns (ISequencerInbox) { return ISequencerInbox(bridge.sequencerInbox()); } - /// @notice Fast confirmers are allowed to create and confirm assertions instantly, without any checks or stake + /// @notice Fast confirmers are allowed to create and confirm assertions instantly, without any checks or stake. + /// Fast confirmers are assumed to only create / confirm honest assertions. /// In an AnyTrust chain, there may be a fastConfirmer which is a contract that can call this function when it receives sufficient signatures from DAC members. /// In a 0-level bold enabled chain, there may be a fastConfirmer which accepts guardian signatures and a SNARK proving the assertion. function fastConfirmers() external view returns (address[] memory) { diff --git a/src/rollup/RollupUserLogic.sol b/src/rollup/RollupUserLogic.sol index 83ff4d18..b064dc32 100644 --- a/src/rollup/RollupUserLogic.sol +++ b/src/rollup/RollupUserLogic.sol @@ -303,6 +303,11 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { * @notice This allows fastConfirmers to immediately create and confirm an assertion * * The logic in this function is similar to stakeOnNewAssertion, but without staker checks + * + * We trust the fastConfirmers to not call this function multiple times on the same prev, + * as doing so would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. + * This is because the protocol assume there is only 1 unique confirmable child assertion. + * Since fastConfirmers are assumed to only create / confirm honest assertions, this should not be an issue in practice. */ function fastConfirmNewAssertion( AssertionInputs calldata assertion, @@ -318,8 +323,6 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { assertion.beforeStateData.sequencerBatchAcc ); getAssertionStorage(prevAssertion).requireExists(); - require(!fastConfirmNewAssertionPrevUsed[prevAssertion], "PREV_ALREADY_USED"); - fastConfirmNewAssertionPrevUsed[prevAssertion] = true; if (status == AssertionStatus.NoAssertion) { // If not exists, we create the new assertion diff --git a/test/storage/RollupAdminLogic b/test/storage/RollupAdminLogic index 627eac04..3599b329 100644 --- a/test/storage/RollupAdminLogic +++ b/test/storage/RollupAdminLogic @@ -65,7 +65,5 @@ | _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | |---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| | _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | ╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ diff --git a/test/storage/RollupCore b/test/storage/RollupCore index f970a170..6d4a7bea 100644 --- a/test/storage/RollupCore +++ b/test/storage/RollupCore @@ -65,7 +65,5 @@ | _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | |---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| | _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | ╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ diff --git a/test/storage/RollupUserLogic b/test/storage/RollupUserLogic index 126e6543..6c6fe865 100644 --- a/test/storage/RollupUserLogic +++ b/test/storage/RollupUserLogic @@ -65,7 +65,5 @@ | _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | |---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| | _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| fastConfirmNewAssertionPrevUsed | mapping(bytes32 => bool) | 127 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | ╰---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ From b11be5cc1ccdc1f90878cd730d099934f38234c6 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:11:58 -0600 Subject: [PATCH 12/18] add zero level bold fast confirmer to config struct --- src/rollup/BOLDUpgradeAction.sol | 1 + src/rollup/Config.sol | 1 + src/rollup/RollupAdminLogic.sol | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index e744c27a..71ab03d2 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -389,6 +389,7 @@ contract BOLDUpgradeAction { genesisAssertionState: genesisAssertionState, genesisInboxCount: inboxMaxCount, anyTrustFastConfirmer: address(0), // fast confirmer would be migrated from the old rollup if existed + zeroLevelBoldFastConfirmer: address(0), // this feature is not enabled for the original bold upgrade. included to satisfy compiler numBigStepLevel: NUM_BIGSTEP_LEVEL, challengeGracePeriodBlocks: CHALLENGE_GRACE_PERIOD_BLOCKS, bufferConfig: bufferConfig, diff --git a/src/rollup/Config.sol b/src/rollup/Config.sol index 5aafe852..c461a800 100644 --- a/src/rollup/Config.sol +++ b/src/rollup/Config.sol @@ -35,6 +35,7 @@ struct Config { /// @notice The inbox size at the time the genesis execution state was created uint256 genesisInboxCount; address anyTrustFastConfirmer; + address zeroLevelBoldFastConfirmer; uint8 numBigStepLevel; uint64 challengeGracePeriodBlocks; BufferConfig bufferConfig; diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index 4698ba24..158f44d8 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -66,8 +66,12 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl loserStakeEscrow = config.loserStakeEscrow; stakeToken = config.stakeToken; - // todo: add config.zeroLevelBoldFastConfirmer - _fastConfirmers.add(config.anyTrustFastConfirmer); + if (config.anyTrustFastConfirmer != address(0)) { + _fastConfirmers.add(config.anyTrustFastConfirmer); + } + if (config.zeroLevelBoldFastConfirmer != address(0)) { + _fastConfirmers.add(config.zeroLevelBoldFastConfirmer); + } bytes32 parentAssertionHash = bytes32(0); bytes32 inboxAcc = bytes32(0); From a934b1b9f9415ee396e9c220cce582e8abbfbe05 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:14:24 -0600 Subject: [PATCH 13/18] postUpgradeInit --- src/rollup/RollupAdminLogic.sol | 10 ++++++++++ src/rollup/RollupCore.sol | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index 158f44d8..9d1e747c 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -118,6 +118,16 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl emit RollupInitialized(config.wasmModuleRoot, config.chainId); } + function postUpgradeInit(address zeroLevelBoldFastConfirmer) external onlyProxy reinitializer(2) { + if (zeroLevelBoldFastConfirmer != address(0)) { + _fastConfirmers.add(zeroLevelBoldFastConfirmer); + } + if (__unused__anyTrustFastConfirmer != address(0)) { + _fastConfirmers.add(__unused__anyTrustFastConfirmer); + __unused__anyTrustFastConfirmer = address(0); + } + } + /** * Functions are only to reach this logic contract if the caller is the owner * so there is no need for a redundant onlyOwner check diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index f5f5b3aa..3075e31d 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -110,7 +110,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { uint256 public rollupDeploymentBlock; bool public validatorWhitelistDisabled; - address private __unused__anyTrustFastConfirmer; + address internal __unused__anyTrustFastConfirmer; // If the chain this RollupCore is deployed on is an Arbitrum chain. bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum(); From 23ada88886dcff0b733daeca91234de9df41dc70 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:27:32 -0600 Subject: [PATCH 14/18] setFastConfirmer --- src/rollup/BOLDUpgradeAction.sol | 2 +- src/rollup/IRollupAdmin.sol | 12 ++++++------ src/rollup/RollupAdminLogic.sol | 14 ++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index 71ab03d2..82c58c0c 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -568,7 +568,7 @@ contract BOLDUpgradeAction { // anyTrustFastConfirmer only exists since v2.0.0, but the old rollup can be on an older version try OLD_ROLLUP.anyTrustFastConfirmer() returns (address anyTrustFastConfirmer) { if (anyTrustFastConfirmer != address(0)) { - IRollupAdmin(address(rollup)).setAnyTrustFastConfirmer(anyTrustFastConfirmer); + IRollupAdmin(address(rollup)).setFastConfirmer(anyTrustFastConfirmer, true); // todo: consider removing this action entirely } } catch { // do nothing if anyTrustFastConfirmer doesnt exist diff --git a/src/rollup/IRollupAdmin.sol b/src/rollup/IRollupAdmin.sol index 9bb48c5f..39800aa3 100644 --- a/src/rollup/IRollupAdmin.sol +++ b/src/rollup/IRollupAdmin.sol @@ -59,8 +59,8 @@ interface IRollupAdmin { /// @dev Validator whitelist was disabled or enabled event ValidatorWhitelistDisabledSet(bool _validatorWhitelistDisabled); - /// @dev AnyTrust fast confirmer was set - event AnyTrustFastConfirmerSet(address anyTrustFastConfirmer); + /// @dev Fast confirmer was set or unset + event FastConfirmerSet(address anyTrustFastConfirmer, bool enabled); /// @dev Challenge manager was set event ChallengeManagerSet(address challengeManager); @@ -215,11 +215,11 @@ interface IRollupAdmin { ) external; /** - * @notice set the anyTrustFastConfirmer address - * @param _anyTrustFastConfirmer new value of anyTrustFastConfirmer + * @notice set or unset a fastConfirmer address */ - function setAnyTrustFastConfirmer( - address _anyTrustFastConfirmer + function setFastConfirmer( + address fastConfirmer, + bool enabled ) external; /** diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index 9d1e747c..629b93b5 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -460,16 +460,14 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl } /** - * @notice set the anyTrustFastConfirmer address - * @param _anyTrustFastConfirmer new value of anyTrustFastConfirmer + * @notice set or unset a fastConfirmer address */ - function setAnyTrustFastConfirmer( - address _anyTrustFastConfirmer + function setFastConfirmer( + address fastConfirmer, + bool enabled ) external { - // TODO: new function for adding removing generic fastConfirmers. this function should be removed - // anyTrustFastConfirmer = _anyTrustFastConfirmer; - // emit AnyTrustFastConfirmerSet(_anyTrustFastConfirmer); - // // previously: emit OwnerFunctionCalled(31); + enabled ? _fastConfirmers.add(fastConfirmer) : _fastConfirmers.remove(fastConfirmer); + emit FastConfirmerSet(fastConfirmer, enabled); } /** From d9a2f3353ff13c706b7807b097e7ba591d970d85 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:48:42 -0600 Subject: [PATCH 15/18] verify latest confirmed --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 24617556..11f93498 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -6,6 +6,7 @@ pragma solidity ^0.8.0; import {AssertionInputs} from "./Assertion.sol"; import {AssertionState, AssertionStateLib} from "./AssertionState.sol"; +import {RollupLib} from "./RollupLib.sol"; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; @@ -40,6 +41,7 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { error InvalidGuardianSignature(); error InvalidSnarkProof(); + error LatestConfirmedAssertionMismatch(bytes32 expected, bytes32 actual); event GuardianCouncilSet(address indexed newGuardianCouncil); @@ -66,6 +68,7 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes calldata snarkProof ) public { _verifyProofs(assertionHash, guardianSignature, snarkProof); + _verifyLatestConfirmed(parentAssertionHash); rollup.fastConfirmAssertion(assertionHash, parentAssertionHash, confirmState, inboxAcc); } @@ -76,6 +79,11 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { bytes calldata snarkProof ) external { _verifyProofs(assertionHash, guardianSignature, snarkProof); + _verifyLatestConfirmed(RollupLib.assertionHash( + assertion.beforeStateData.prevPrevAssertionHash, + assertion.beforeState, + assertion.beforeStateData.sequencerBatchAcc + )); rollup.fastConfirmNewAssertion(assertion, assertionHash); } @@ -98,6 +106,13 @@ contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { snarkVerifier = ISnarkVerifier(_snarkVerifier); } + function _verifyLatestConfirmed(bytes32 parentAssertionHash) internal view { + bytes32 latestConfirmed = rollup.latestConfirmed(); + if (parentAssertionHash != latestConfirmed) { + revert LatestConfirmedAssertionMismatch(parentAssertionHash, latestConfirmed); + } + } + function _verifyProofs( bytes32 assertionHash, bytes calldata guardianSignature, From 0826bfdb8625312be419e0b3e9ccf8e64ed3af03 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 21 Apr 2026 08:58:22 -0600 Subject: [PATCH 16/18] single fast confirmer --- src/rollup/BOLDUpgradeAction.sol | 3 +-- src/rollup/Config.sol | 1 - src/rollup/IRollupAdmin.sol | 12 ++++++------ src/rollup/RollupAdminLogic.sol | 30 ++++++++---------------------- src/rollup/RollupCore.sol | 12 +----------- src/rollup/RollupUserLogic.sol | 14 ++++++++------ 6 files changed, 24 insertions(+), 48 deletions(-) diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index 82c58c0c..e744c27a 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -389,7 +389,6 @@ contract BOLDUpgradeAction { genesisAssertionState: genesisAssertionState, genesisInboxCount: inboxMaxCount, anyTrustFastConfirmer: address(0), // fast confirmer would be migrated from the old rollup if existed - zeroLevelBoldFastConfirmer: address(0), // this feature is not enabled for the original bold upgrade. included to satisfy compiler numBigStepLevel: NUM_BIGSTEP_LEVEL, challengeGracePeriodBlocks: CHALLENGE_GRACE_PERIOD_BLOCKS, bufferConfig: bufferConfig, @@ -568,7 +567,7 @@ contract BOLDUpgradeAction { // anyTrustFastConfirmer only exists since v2.0.0, but the old rollup can be on an older version try OLD_ROLLUP.anyTrustFastConfirmer() returns (address anyTrustFastConfirmer) { if (anyTrustFastConfirmer != address(0)) { - IRollupAdmin(address(rollup)).setFastConfirmer(anyTrustFastConfirmer, true); // todo: consider removing this action entirely + IRollupAdmin(address(rollup)).setAnyTrustFastConfirmer(anyTrustFastConfirmer); } } catch { // do nothing if anyTrustFastConfirmer doesnt exist diff --git a/src/rollup/Config.sol b/src/rollup/Config.sol index c461a800..5aafe852 100644 --- a/src/rollup/Config.sol +++ b/src/rollup/Config.sol @@ -35,7 +35,6 @@ struct Config { /// @notice The inbox size at the time the genesis execution state was created uint256 genesisInboxCount; address anyTrustFastConfirmer; - address zeroLevelBoldFastConfirmer; uint8 numBigStepLevel; uint64 challengeGracePeriodBlocks; BufferConfig bufferConfig; diff --git a/src/rollup/IRollupAdmin.sol b/src/rollup/IRollupAdmin.sol index 39800aa3..9bb48c5f 100644 --- a/src/rollup/IRollupAdmin.sol +++ b/src/rollup/IRollupAdmin.sol @@ -59,8 +59,8 @@ interface IRollupAdmin { /// @dev Validator whitelist was disabled or enabled event ValidatorWhitelistDisabledSet(bool _validatorWhitelistDisabled); - /// @dev Fast confirmer was set or unset - event FastConfirmerSet(address anyTrustFastConfirmer, bool enabled); + /// @dev AnyTrust fast confirmer was set + event AnyTrustFastConfirmerSet(address anyTrustFastConfirmer); /// @dev Challenge manager was set event ChallengeManagerSet(address challengeManager); @@ -215,11 +215,11 @@ interface IRollupAdmin { ) external; /** - * @notice set or unset a fastConfirmer address + * @notice set the anyTrustFastConfirmer address + * @param _anyTrustFastConfirmer new value of anyTrustFastConfirmer */ - function setFastConfirmer( - address fastConfirmer, - bool enabled + function setAnyTrustFastConfirmer( + address _anyTrustFastConfirmer ) external; /** diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index 629b93b5..bb875aa2 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -66,12 +66,7 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl loserStakeEscrow = config.loserStakeEscrow; stakeToken = config.stakeToken; - if (config.anyTrustFastConfirmer != address(0)) { - _fastConfirmers.add(config.anyTrustFastConfirmer); - } - if (config.zeroLevelBoldFastConfirmer != address(0)) { - _fastConfirmers.add(config.zeroLevelBoldFastConfirmer); - } + anyTrustFastConfirmer = config.anyTrustFastConfirmer; bytes32 parentAssertionHash = bytes32(0); bytes32 inboxAcc = bytes32(0); @@ -118,16 +113,6 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl emit RollupInitialized(config.wasmModuleRoot, config.chainId); } - function postUpgradeInit(address zeroLevelBoldFastConfirmer) external onlyProxy reinitializer(2) { - if (zeroLevelBoldFastConfirmer != address(0)) { - _fastConfirmers.add(zeroLevelBoldFastConfirmer); - } - if (__unused__anyTrustFastConfirmer != address(0)) { - _fastConfirmers.add(__unused__anyTrustFastConfirmer); - __unused__anyTrustFastConfirmer = address(0); - } - } - /** * Functions are only to reach this logic contract if the caller is the owner * so there is no need for a redundant onlyOwner check @@ -460,14 +445,15 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl } /** - * @notice set or unset a fastConfirmer address + * @notice set the anyTrustFastConfirmer address + * @param _anyTrustFastConfirmer new value of anyTrustFastConfirmer */ - function setFastConfirmer( - address fastConfirmer, - bool enabled + function setAnyTrustFastConfirmer( + address _anyTrustFastConfirmer ) external { - enabled ? _fastConfirmers.add(fastConfirmer) : _fastConfirmers.remove(fastConfirmer); - emit FastConfirmerSet(fastConfirmer, enabled); + anyTrustFastConfirmer = _anyTrustFastConfirmer; + emit AnyTrustFastConfirmerSet(_anyTrustFastConfirmer); + // previously: emit OwnerFunctionCalled(31); } /** diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 3075e31d..035c9a0e 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -110,27 +110,17 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { uint256 public rollupDeploymentBlock; bool public validatorWhitelistDisabled; - address internal __unused__anyTrustFastConfirmer; + address public anyTrustFastConfirmer; // If the chain this RollupCore is deployed on is an Arbitrum chain. bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum(); // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation. mapping(bytes32 => uint256) internal _assertionCreatedAtArbSysBlock; - EnumerableSetUpgradeable.AddressSet internal _fastConfirmers; - function sequencerInbox() public view virtual returns (ISequencerInbox) { return ISequencerInbox(bridge.sequencerInbox()); } - /// @notice Fast confirmers are allowed to create and confirm assertions instantly, without any checks or stake. - /// Fast confirmers are assumed to only create / confirm honest assertions. - /// In an AnyTrust chain, there may be a fastConfirmer which is a contract that can call this function when it receives sufficient signatures from DAC members. - /// In a 0-level bold enabled chain, there may be a fastConfirmer which accepts guardian signatures and a SNARK proving the assertion. - function fastConfirmers() external view returns (address[] memory) { - return _fastConfirmers.values(); - } - /** * @notice Get a storage reference to the Assertion for the given assertion hash * @dev The assertion may not exists diff --git a/src/rollup/RollupUserLogic.sol b/src/rollup/RollupUserLogic.sol index b064dc32..fdfca221 100644 --- a/src/rollup/RollupUserLogic.sol +++ b/src/rollup/RollupUserLogic.sol @@ -286,7 +286,9 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { } /** - * @notice This allows fastConfirmers to force confirm any pending assertion + * @notice This allow the anyTrustFastConfirmer to force confirm any pending assertion + * the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to + * a contract that can call this function when received sufficient signatures */ function fastConfirmAssertion( bytes32 assertionHash, @@ -294,20 +296,20 @@ contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser { AssertionState calldata confirmState, bytes32 inboxAcc ) public whenNotPaused { - require(_fastConfirmers.contains(msg.sender), "NOT_FAST_CONFIRMER"); + require(msg.sender == anyTrustFastConfirmer, "NOT_FAST_CONFIRMER"); // this skip deadline, prev, challenge validations confirmAssertionInternal(assertionHash, parentAssertionHash, confirmState, inboxAcc); } /** - * @notice This allows fastConfirmers to immediately create and confirm an assertion - * + * @notice This allow the anyTrustFastConfirmer to immediately create and confirm an assertion + * the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to + * a contract that can call this function when received sufficient signatures * The logic in this function is similar to stakeOnNewAssertion, but without staker checks * - * We trust the fastConfirmers to not call this function multiple times on the same prev, + * We trust the anyTrustFastConfirmer to not call this function multiple times on the same prev, * as doing so would result in incorrect accounting of withdrawable funds in the loserStakeEscrow. * This is because the protocol assume there is only 1 unique confirmable child assertion. - * Since fastConfirmers are assumed to only create / confirm honest assertions, this should not be an issue in practice. */ function fastConfirmNewAssertion( AssertionInputs calldata assertion, From 827070b76299508dc1e4d0eb3cc946970a5f4555 Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 21 Apr 2026 08:59:49 -0600 Subject: [PATCH 17/18] test storage --- test/storage/RollupAdminLogic | 132 +++++++++++++++++----------------- test/storage/RollupCore | 132 +++++++++++++++++----------------- test/storage/RollupUserLogic | 132 +++++++++++++++++----------------- 3 files changed, 195 insertions(+), 201 deletions(-) diff --git a/test/storage/RollupAdminLogic b/test/storage/RollupAdminLogic index 3599b329..8f53588e 100644 --- a/test/storage/RollupAdminLogic +++ b/test/storage/RollupAdminLogic @@ -1,69 +1,67 @@ -╭---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| -| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | -╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ +╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++===========================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupAdminLogic.sol:RollupAdminLogic | +╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------------------╯ diff --git a/test/storage/RollupCore b/test/storage/RollupCore index 6d4a7bea..e493175c 100644 --- a/test/storage/RollupCore +++ b/test/storage/RollupCore @@ -1,69 +1,67 @@ -╭---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | -|---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| -| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | -╰---------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ +╭--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++===============================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupCore.sol:RollupCore | +|--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupCore.sol:RollupCore | +╰--------------------------------+-----------------------------------------------+------+--------+-------+--------------------------------------╯ diff --git a/test/storage/RollupUserLogic b/test/storage/RollupUserLogic index 6c6fe865..b2edbafb 100644 --- a/test/storage/RollupUserLogic +++ b/test/storage/RollupUserLogic @@ -1,69 +1,67 @@ -╭---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | Contract | -+==========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| __unused__anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -|---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| -| _fastConfirmers | struct EnumerableSetUpgradeable.AddressSet | 125 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | -╰---------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ +╭--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | Contract | ++=========================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _initializing | bool | 0 | 1 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[50] | 1 | 0 | 1600 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _paused | bool | 51 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| __gap | uint256[49] | 52 | 0 | 1568 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| chainId | uint256 | 101 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| confirmPeriodBlocks | uint64 | 102 | 0 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorAfkBlocks | uint64 | 102 | 8 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| baseStake | uint256 | 103 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| wasmModuleRoot | bytes32 | 104 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeManager | contract IEdgeChallengeManager | 105 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| challengeGracePeriodBlocks | uint64 | 105 | 20 | 8 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| inbox | contract IInboxBase | 106 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| bridge | contract IBridge | 107 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| outbox | contract IOutbox | 108 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupEventInbox | contract IRollupEventInbox | 109 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWalletCreator | address | 110 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| loserStakeEscrow | address | 111 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| stakeToken | address | 112 | 0 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| minimumAssertionPeriod | uint256 | 113 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validators | struct EnumerableSetUpgradeable.AddressSet | 114 | 0 | 64 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _latestConfirmed | bytes32 | 116 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertions | mapping(bytes32 => struct AssertionNode) | 117 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerList | address[] | 118 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _stakerMap | mapping(address => struct IRollupCore.Staker) | 119 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _withdrawableFunds | mapping(address => uint256) | 120 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| totalWithdrawableFunds | uint256 | 121 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| rollupDeploymentBlock | uint256 | 122 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| validatorWhitelistDisabled | bool | 123 | 0 | 1 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| anyTrustFastConfirmer | address | 123 | 1 | 20 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +|--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------| +| _assertionCreatedAtArbSysBlock | mapping(bytes32 => uint256) | 124 | 0 | 32 | src/rollup/RollupUserLogic.sol:RollupUserLogic | +╰--------------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------╯ From c752210959b25f9963c5d5d5f96564cd322bb78b Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Tue, 21 Apr 2026 09:00:35 -0600 Subject: [PATCH 18/18] note anytrust --- src/rollup/ZeroLevelBoldFastConfirmer.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rollup/ZeroLevelBoldFastConfirmer.sol b/src/rollup/ZeroLevelBoldFastConfirmer.sol index 11f93498..6c3496f4 100644 --- a/src/rollup/ZeroLevelBoldFastConfirmer.sol +++ b/src/rollup/ZeroLevelBoldFastConfirmer.sol @@ -24,6 +24,7 @@ interface ISnarkVerifier { ) external view returns (bool); } +// todo: add AnyTrust fast confirmer path to perserve that functionality contract ZeroLevelBoldFastConfirmer is OwnableUpgradeable, EIP712Upgradeable { using AssertionStateLib for AssertionState;