From a02419a28d45d62e544f1db980e5a7a70561c4f0 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Wed, 10 May 2023 20:58:33 -0600 Subject: [PATCH 1/2] Store rollup node ArbSys block numbers if on an Arbitrum host chain --- src/rollup/IRollupCore.sol | 9 +++++++ src/rollup/RollupCore.sol | 44 +++++++++++++++++++++++++++++++ test/storage/RollupAdminLogic.dot | 2 +- test/storage/RollupCore.dot | 2 +- test/storage/RollupUserLogic.dot | 2 +- 5 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/rollup/IRollupCore.sol b/src/rollup/IRollupCore.sol index 05532c6691..f66958a838 100644 --- a/src/rollup/IRollupCore.sol +++ b/src/rollup/IRollupCore.sol @@ -84,6 +84,15 @@ interface IRollupCore { */ function getNode(uint64 nodeNum) external view returns (Node memory); + /** + * @notice Returns the block in which the given node was created for looking up its creation event. + * Unlike the Node's createdAtBlock field, this will be the ArbSys blockNumber if the host chain is an Arbitrum chain. + * That means that the block number returned for this is usable for event queries. + * This function will revert if the given node number does not exist. + * @dev This function is meant for internal use only and has no stability guarantees. + */ + function getNodeCreationBlockForLogLookup(uint64 nodeNum) external view returns (uint256); + /** * @notice Check if the specified node has been staked on by the provided staker. * Only accurate at the latest confirmed node and afterwards. diff --git a/src/rollup/RollupCore.sol b/src/rollup/RollupCore.sol index 31e0625f85..6b4e64de5c 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -18,6 +18,8 @@ import "../bridge/ISequencerInbox.sol"; import "../bridge/IBridge.sol"; import "../bridge/IOutbox.sol"; +import "../precompiles/ArbSys.sol"; + import {NO_CHAL_INDEX} from "../libraries/Constants.sol"; abstract contract RollupCore is IRollupCore, PausableUpgradeable { @@ -76,6 +78,18 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { bool public validatorWhitelistDisabled; + // If the chain this RollupCore is deployed on is an Arbitrum chain. + bool internal immutable _hostChainIsArbitrum; + // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation. + mapping(uint64 => uint256) internal _nodeCreatedAtArbSysBlock; + + constructor() { + (bool ok, bytes memory data) = address(100).staticcall( + bytes.concat(ArbSys.arbOSVersion.selector) + ); + _hostChainIsArbitrum = ok && data.length == 32; + } + /** * @notice Get a storage reference to the Node for the given node index * @param nodeNum Index of the node @@ -92,6 +106,30 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { return getNodeStorage(nodeNum); } + /** + * @notice Returns the block in which the given node was created for looking up its creation event. + * Unlike the Node's createdAtBlock field, this will be the ArbSys blockNumber if the host chain is an Arbitrum chain. + * That means that the block number returned for this is usable for event queries. + * This function will revert if the given node number does not exist. + * @dev This function is meant for internal use only and has no stability guarantees. + */ + function getNodeCreationBlockForLogLookup(uint64 nodeNum) + external + view + override + returns (uint256) + { + if (_hostChainIsArbitrum) { + uint256 blockNum = _nodeCreatedAtArbSysBlock[nodeNum]; + require(blockNum > 0, "NO_NODE"); + return blockNum; + } else { + Node storage node = getNodeStorage(nodeNum); + require(node.deadlineBlock != 0, "NO_NODE"); + return node.createdAtBlock; + } + } + /** * @notice Check if the specified node has been staked on by the provided staker. * Only accurate at the latest confirmed node and afterwards. @@ -250,6 +288,9 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { __Pausable_init(); _nodes[GENESIS_NODE] = initialNode; _firstUnresolvedNode = GENESIS_NODE + 1; + if (_hostChainIsArbitrum) { + _nodeCreatedAtArbSysBlock[GENESIS_NODE] = ArbSys(address(100)).arbBlockNumber(); + } } /** @@ -259,6 +300,9 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { function nodeCreated(Node memory node) internal { _latestNodeCreated++; _nodes[_latestNodeCreated] = node; + if (_hostChainIsArbitrum) { + _nodeCreatedAtArbSysBlock[_latestNodeCreated] = ArbSys(address(100)).arbBlockNumber(); + } } /// @notice Reject the next unresolved node diff --git a/test/storage/RollupAdminLogic.dot b/test/storage/RollupAdminLogic.dot index 7bb33b6661..f998ff5131 100644 --- a/test/storage/RollupAdminLogic.dot +++ b/test/storage/RollupAdminLogic.dot @@ -4,7 +4,7 @@ rankdir=LR color=black arrowhead=open node [shape=record, style=filled, fillcolor=gray95 fontname="Courier New"] -8 [label="RollupAdminLogic \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: RollupCore.extraChallengeTimeBlocks (8) | uint64: RollupCore.confirmPeriodBlocks (8) } | { uint256: RollupCore.chainId (32) } | { uint256: RollupCore.baseStake (32) } | { bytes32: RollupCore.wasmModuleRoot (32) } | { unallocated (12) | IInbox: RollupCore.inbox (20) } | { unallocated (12) | IBridge: RollupCore.bridge (20) } | { unallocated (12) | IOutbox: RollupCore.outbox (20) } | { unallocated (12) | ISequencerInbox: RollupCore.sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: RollupCore.rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: RollupCore.challengeManager (20) } | { unallocated (12) | address: RollupCore.validatorUtils (20) } | { unallocated (12) | address: RollupCore.validatorWalletCreator (20) } | { unallocated (12) | address: RollupCore.loserStakeEscrow (20) } | { unallocated (12) | address: RollupCore.stakeToken (20) } | { uint256: RollupCore.minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): RollupCore.isValidator (32) } | { uint64: RollupCore._lastStakeBlock (8) | uint64: RollupCore._latestNodeCreated (8) | uint64: RollupCore._firstUnresolvedNode (8) | uint64: RollupCore._latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): RollupCore._nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): RollupCore._nodeStakers (32) } | { <141> address[]: RollupCore._stakerList (32) } | { <147> mapping\(address=\>Staker\): RollupCore._stakerMap (32) } | { <151> Zombie[]: RollupCore._zombies (32) } | { mapping\(address=\>uint256\): RollupCore._withdrawableFunds (32) } | { uint256: RollupCore.totalWithdrawableFunds (32) } | { uint256: RollupCore.rollupDeploymentBlock (32) } | { unallocated (31) | bool: RollupCore.validatorWhitelistDisabled (1) }}}"] +8 [label="RollupAdminLogic \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: RollupCore.extraChallengeTimeBlocks (8) | uint64: RollupCore.confirmPeriodBlocks (8) } | { uint256: RollupCore.chainId (32) } | { uint256: RollupCore.baseStake (32) } | { bytes32: RollupCore.wasmModuleRoot (32) } | { unallocated (12) | IInbox: RollupCore.inbox (20) } | { unallocated (12) | IBridge: RollupCore.bridge (20) } | { unallocated (12) | IOutbox: RollupCore.outbox (20) } | { unallocated (12) | ISequencerInbox: RollupCore.sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: RollupCore.rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: RollupCore.challengeManager (20) } | { unallocated (12) | address: RollupCore.validatorUtils (20) } | { unallocated (12) | address: RollupCore.validatorWalletCreator (20) } | { unallocated (12) | address: RollupCore.loserStakeEscrow (20) } | { unallocated (12) | address: RollupCore.stakeToken (20) } | { uint256: RollupCore.minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): RollupCore.isValidator (32) } | { uint64: RollupCore._lastStakeBlock (8) | uint64: RollupCore._latestNodeCreated (8) | uint64: RollupCore._firstUnresolvedNode (8) | uint64: RollupCore._latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): RollupCore._nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): RollupCore._nodeStakers (32) } | { <141> address[]: RollupCore._stakerList (32) } | { <147> mapping\(address=\>Staker\): RollupCore._stakerMap (32) } | { <151> Zombie[]: RollupCore._zombies (32) } | { mapping\(address=\>uint256\): RollupCore._withdrawableFunds (32) } | { uint256: RollupCore.totalWithdrawableFunds (32) } | { uint256: RollupCore.rollupDeploymentBlock (32) } | { unallocated (31) | bool: RollupCore.validatorWhitelistDisabled (1) } | { mapping\(uint64=\>uint256\): RollupCore._nodeCreatedAtArbSysBlock (32) }}}"] 1 [label="uint256[50]: __gap \<\\>\n | {{ slot| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 } | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) }}}"] diff --git a/test/storage/RollupCore.dot b/test/storage/RollupCore.dot index 4ac2a5ef20..f97adc588e 100644 --- a/test/storage/RollupCore.dot +++ b/test/storage/RollupCore.dot @@ -4,7 +4,7 @@ rankdir=LR color=black arrowhead=open node [shape=record, style=filled, fillcolor=gray95 fontname="Courier New"] -8 [label="RollupCore \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: extraChallengeTimeBlocks (8) | uint64: confirmPeriodBlocks (8) } | { uint256: chainId (32) } | { uint256: baseStake (32) } | { bytes32: wasmModuleRoot (32) } | { unallocated (12) | IInbox: inbox (20) } | { unallocated (12) | IBridge: bridge (20) } | { unallocated (12) | IOutbox: outbox (20) } | { unallocated (12) | ISequencerInbox: sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: challengeManager (20) } | { unallocated (12) | address: validatorUtils (20) } | { unallocated (12) | address: validatorWalletCreator (20) } | { unallocated (12) | address: loserStakeEscrow (20) } | { unallocated (12) | address: stakeToken (20) } | { uint256: minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): isValidator (32) } | { uint64: _lastStakeBlock (8) | uint64: _latestNodeCreated (8) | uint64: _firstUnresolvedNode (8) | uint64: _latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): _nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): _nodeStakers (32) } | { <141> address[]: _stakerList (32) } | { <147> mapping\(address=\>Staker\): _stakerMap (32) } | { <151> Zombie[]: _zombies (32) } | { mapping\(address=\>uint256\): _withdrawableFunds (32) } | { uint256: totalWithdrawableFunds (32) } | { uint256: rollupDeploymentBlock (32) } | { unallocated (31) | bool: validatorWhitelistDisabled (1) }}}"] +8 [label="RollupCore \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: extraChallengeTimeBlocks (8) | uint64: confirmPeriodBlocks (8) } | { uint256: chainId (32) } | { uint256: baseStake (32) } | { bytes32: wasmModuleRoot (32) } | { unallocated (12) | IInbox: inbox (20) } | { unallocated (12) | IBridge: bridge (20) } | { unallocated (12) | IOutbox: outbox (20) } | { unallocated (12) | ISequencerInbox: sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: challengeManager (20) } | { unallocated (12) | address: validatorUtils (20) } | { unallocated (12) | address: validatorWalletCreator (20) } | { unallocated (12) | address: loserStakeEscrow (20) } | { unallocated (12) | address: stakeToken (20) } | { uint256: minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): isValidator (32) } | { uint64: _lastStakeBlock (8) | uint64: _latestNodeCreated (8) | uint64: _firstUnresolvedNode (8) | uint64: _latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): _nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): _nodeStakers (32) } | { <141> address[]: _stakerList (32) } | { <147> mapping\(address=\>Staker\): _stakerMap (32) } | { <151> Zombie[]: _zombies (32) } | { mapping\(address=\>uint256\): _withdrawableFunds (32) } | { uint256: totalWithdrawableFunds (32) } | { uint256: rollupDeploymentBlock (32) } | { unallocated (31) | bool: validatorWhitelistDisabled (1) } | { mapping\(uint64=\>uint256\): _nodeCreatedAtArbSysBlock (32) }}}"] 1 [label="uint256[50]: __gap \<\\>\n | {{ slot| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 } | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) }}}"] diff --git a/test/storage/RollupUserLogic.dot b/test/storage/RollupUserLogic.dot index 2c02db6443..bed63789be 100644 --- a/test/storage/RollupUserLogic.dot +++ b/test/storage/RollupUserLogic.dot @@ -4,7 +4,7 @@ rankdir=LR color=black arrowhead=open node [shape=record, style=filled, fillcolor=gray95 fontname="Courier New"] -8 [label="RollupUserLogic \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: RollupCore.extraChallengeTimeBlocks (8) | uint64: RollupCore.confirmPeriodBlocks (8) } | { uint256: RollupCore.chainId (32) } | { uint256: RollupCore.baseStake (32) } | { bytes32: RollupCore.wasmModuleRoot (32) } | { unallocated (12) | IInbox: RollupCore.inbox (20) } | { unallocated (12) | IBridge: RollupCore.bridge (20) } | { unallocated (12) | IOutbox: RollupCore.outbox (20) } | { unallocated (12) | ISequencerInbox: RollupCore.sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: RollupCore.rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: RollupCore.challengeManager (20) } | { unallocated (12) | address: RollupCore.validatorUtils (20) } | { unallocated (12) | address: RollupCore.validatorWalletCreator (20) } | { unallocated (12) | address: RollupCore.loserStakeEscrow (20) } | { unallocated (12) | address: RollupCore.stakeToken (20) } | { uint256: RollupCore.minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): RollupCore.isValidator (32) } | { uint64: RollupCore._lastStakeBlock (8) | uint64: RollupCore._latestNodeCreated (8) | uint64: RollupCore._firstUnresolvedNode (8) | uint64: RollupCore._latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): RollupCore._nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): RollupCore._nodeStakers (32) } | { <141> address[]: RollupCore._stakerList (32) } | { <147> mapping\(address=\>Staker\): RollupCore._stakerMap (32) } | { <151> Zombie[]: RollupCore._zombies (32) } | { mapping\(address=\>uint256\): RollupCore._withdrawableFunds (32) } | { uint256: RollupCore.totalWithdrawableFunds (32) } | { uint256: RollupCore.rollupDeploymentBlock (32) } | { unallocated (31) | bool: RollupCore.validatorWhitelistDisabled (1) }}}"] +8 [label="RollupUserLogic \<\\>\n | {{ slot| 0 | 1-50 | 51 | 52-100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 } | { type: \.variable (bytes) | { unallocated (30) | bool: Initializable._initializing (1) | bool: Initializable._initialized (1) } | { <53> uint256[50]: ContextUpgradeable.__gap (1600) } | { unallocated (31) | bool: PausableUpgradeable._paused (1) } | { <104> uint256[49]: PausableUpgradeable.__gap (1568) } | { unallocated (16) | uint64: RollupCore.extraChallengeTimeBlocks (8) | uint64: RollupCore.confirmPeriodBlocks (8) } | { uint256: RollupCore.chainId (32) } | { uint256: RollupCore.baseStake (32) } | { bytes32: RollupCore.wasmModuleRoot (32) } | { unallocated (12) | IInbox: RollupCore.inbox (20) } | { unallocated (12) | IBridge: RollupCore.bridge (20) } | { unallocated (12) | IOutbox: RollupCore.outbox (20) } | { unallocated (12) | ISequencerInbox: RollupCore.sequencerInbox (20) } | { unallocated (12) | IRollupEventInbox: RollupCore.rollupEventInbox (20) } | { unallocated (12) | IChallengeManager: RollupCore.challengeManager (20) } | { unallocated (12) | address: RollupCore.validatorUtils (20) } | { unallocated (12) | address: RollupCore.validatorWalletCreator (20) } | { unallocated (12) | address: RollupCore.loserStakeEscrow (20) } | { unallocated (12) | address: RollupCore.stakeToken (20) } | { uint256: RollupCore.minimumAssertionPeriod (32) } | { mapping\(address=\>bool\): RollupCore.isValidator (32) } | { uint64: RollupCore._lastStakeBlock (8) | uint64: RollupCore._latestNodeCreated (8) | uint64: RollupCore._firstUnresolvedNode (8) | uint64: RollupCore._latestConfirmed (8) } | { <138> mapping\(uint64=\>Node\): RollupCore._nodes (32) } | { mapping\(uint64=\>mapping\(address=\>bool\)\): RollupCore._nodeStakers (32) } | { <141> address[]: RollupCore._stakerList (32) } | { <147> mapping\(address=\>Staker\): RollupCore._stakerMap (32) } | { <151> Zombie[]: RollupCore._zombies (32) } | { mapping\(address=\>uint256\): RollupCore._withdrawableFunds (32) } | { uint256: RollupCore.totalWithdrawableFunds (32) } | { uint256: RollupCore.rollupDeploymentBlock (32) } | { unallocated (31) | bool: RollupCore.validatorWhitelistDisabled (1) } | { mapping\(uint64=\>uint256\): RollupCore._nodeCreatedAtArbSysBlock (32) }}}"] 1 [label="uint256[50]: __gap \<\\>\n | {{ slot| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 } | { type: variable (bytes) | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) } | { uint256 (32) }}}"] From 67127e2c2fd0943d9d87a05915d77b1f220906aa Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Wed, 10 May 2023 20:59:43 -0600 Subject: [PATCH 2/2] Use abi.encodeWithSelector instead of bytes.concat --- 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 6b4e64de5c..f96f609bd0 100644 --- a/src/rollup/RollupCore.sol +++ b/src/rollup/RollupCore.sol @@ -85,7 +85,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable { constructor() { (bool ok, bytes memory data) = address(100).staticcall( - bytes.concat(ArbSys.arbOSVersion.selector) + abi.encodeWithSelector(ArbSys.arbOSVersion.selector) ); _hostChainIsArbitrum = ok && data.length == 32; }