@arbitrum/nitro-contracts 1.2.0 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +2 -2
- package/build/contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.json +86 -0
- package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +10 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +15 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +15 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.json +13 -0
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.json +13 -0
- package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.json +15 -2
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +15 -2
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +15 -2
- package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.json +2 -2
- package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
- package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.json +2 -2
- package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
- package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
- package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
- package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.json +16 -16
- package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Inbox.sol/Inbox.json +15 -2
- package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
- package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Outbox.sol/Outbox.json +2 -2
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +23 -18
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +4 -0
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.json +490 -0
- package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +1 -1
- package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.json +2 -2
- package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json +50 -2
- package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.json +55 -0
- package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.dbg.json +1 -1
- package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.json +2 -2
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
- package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
- package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
- package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
- package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
- package/build/contracts/src/libraries/GasRefundEnabled.sol/GasRefundEnabled.dbg.json +1 -1
- package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
- package/build/contracts/src/libraries/IReader4844.sol/IReader4844.dbg.json +1 -1
- package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
- package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.json +2 -2
- package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
- package/build/contracts/src/mocks/Benchmarks.sol/Benchmarks.dbg.json +4 -0
- package/build/contracts/src/mocks/Benchmarks.sol/Benchmarks.json +46 -0
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +2 -2
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +15 -2
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +2 -2
- package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.dbg.json +1 -1
- package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.json +2 -2
- package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.dbg.json +4 -0
- package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.json +71 -0
- package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.dbg.json +4 -0
- package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.json +36 -0
- package/build/contracts/src/mocks/Program.sol/ProgramTest.dbg.json +4 -0
- package/build/contracts/src/mocks/Program.sol/ProgramTest.json +142 -0
- package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
- package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.json +2 -2
- package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.dbg.json +4 -0
- package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.json +25 -0
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +31 -26
- package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
- package/build/contracts/src/mocks/Simple.sol/Simple.json +2 -2
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +4 -0
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.json +37 -0
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.json +2 -2
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +1 -1
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +50 -2
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +1 -1
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +50 -2
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.json +15 -2
- package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
- package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
- package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.json +48 -0
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.json +2 -2
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.json +88 -0
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.json +50 -2
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.json +90 -2
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.json +90 -2
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.json +90 -2
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.json +90 -2
- package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.json +7 -0
- package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.json +161 -0
- package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.dbg.json +4 -0
- package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.json +453 -0
- package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.dbg.json +4 -0
- package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.json +113 -0
- package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
- package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +10 -10
- package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
- package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +2 -2
- package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.json +2 -2
- package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.json +8 -8
- package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +1 -1
- package/build/contracts/src/rollup/Node.sol/NodeLib.dbg.json +1 -1
- package/build/contracts/src/rollup/Node.sol/NodeLib.json +2 -2
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +23 -10
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.json +13 -0
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +10 -10
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +2 -2
- package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +2 -2
- package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +10 -10
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.json +13 -0
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +15 -2
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +15 -2
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +2 -2
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +15 -2
- package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +2 -2
- package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
- package/build/contracts/src/state/Deserialize.sol/Deserialize.json +2 -2
- package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
- package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
- package/build/contracts/src/state/Instructions.sol/Instructions.json +2 -2
- package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
- package/build/contracts/src/state/Machine.sol/MachineLib.json +2 -2
- package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
- package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.json +2 -2
- package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
- package/build/contracts/src/state/Module.sol/ModuleLib.json +2 -2
- package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
- package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.json +2 -2
- package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
- package/build/contracts/src/state/MultiStack.sol/MultiStackLib.dbg.json +4 -0
- package/build/contracts/src/state/MultiStack.sol/MultiStackLib.json +10 -0
- package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
- package/build/contracts/src/state/StackFrame.sol/StackFrameLib.json +2 -2
- package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
- package/build/contracts/src/state/Value.sol/ValueLib.json +2 -2
- package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.json +2 -2
- package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueStack.sol/ValueStackLib.json +2 -2
- package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +15 -2
- package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
- package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +2 -2
- package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
- package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
- package/build/contracts/src/test-helpers/TestToken.sol/TestToken.json +2 -2
- package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.json +2 -2
- package/package.json +14 -7
- package/src/bridge/ISequencerInbox.sol +4 -4
- package/src/bridge/SequencerInbox.sol +38 -30
- package/src/chain/CacheManager.sol +283 -0
- package/src/challenge/ChallengeLib.sol +0 -45
- package/src/challenge/ChallengeManager.sol +24 -9
- package/src/challenge/IChallengeManager.sol +13 -0
- package/src/libraries/Error.sol +3 -9
- package/src/mocks/Benchmarks.sol +52 -0
- package/src/mocks/MultiCallTest.sol +117 -0
- package/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol +29 -0
- package/src/mocks/Program.sol +126 -0
- package/src/mocks/SdkStorage.sol +176 -0
- package/src/mocks/SequencerInboxStub.sol +4 -4
- package/src/mocks/SimpleCacheManager.sol +22 -0
- package/src/osp/IOneStepProofEntry.sol +10 -0
- package/src/osp/OneStepProofEntry.sol +81 -7
- package/src/osp/OneStepProver0.sol +64 -20
- package/src/osp/OneStepProverHostIo.sol +201 -2
- package/src/osp/OneStepProverMemory.sol +4 -33
- package/src/precompiles/ArbDebug.sol +2 -0
- package/src/precompiles/ArbOwner.sol +51 -9
- package/src/precompiles/ArbWasm.sol +119 -0
- package/src/precompiles/ArbWasmCache.sol +33 -0
- package/src/state/Deserialize.sol +88 -47
- package/src/state/Instructions.sol +38 -3
- package/src/state/Machine.sol +92 -15
- package/src/state/MerkleProof.sol +22 -4
- package/src/state/Module.sol +3 -1
- package/src/state/ModuleMemory.sol +54 -0
- package/src/state/MultiStack.sol +58 -0
- package/src/state/StackFrame.sol +6 -1
- package/src/state/Value.sol +13 -1
- package/src/state/ValueStack.sol +6 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
// Copyright 2022-2024, Offchain Labs, Inc.
|
|
2
|
+
// For license information, see https://github.com/nitro/blob/master/LICENSE
|
|
3
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
4
|
+
|
|
5
|
+
pragma solidity ^0.8.0;
|
|
6
|
+
|
|
7
|
+
import "../precompiles/ArbOwnerPublic.sol";
|
|
8
|
+
import "../precompiles/ArbWasm.sol";
|
|
9
|
+
import "../precompiles/ArbWasmCache.sol";
|
|
10
|
+
import "solady/src/utils/MinHeapLib.sol";
|
|
11
|
+
|
|
12
|
+
contract CacheManager {
|
|
13
|
+
using MinHeapLib for MinHeapLib.Heap;
|
|
14
|
+
|
|
15
|
+
ArbOwnerPublic internal constant ARB_OWNER_PUBLIC = ArbOwnerPublic(address(0x6b));
|
|
16
|
+
ArbWasm internal constant ARB_WASM = ArbWasm(address(0x71));
|
|
17
|
+
ArbWasmCache internal constant ARB_WASM_CACHE = ArbWasmCache(address(0x72));
|
|
18
|
+
uint64 internal constant MAX_MAKE_SPACE = 5 * 1024 * 1024;
|
|
19
|
+
uint64 internal constant MIN_CODESIZE = 4096;
|
|
20
|
+
|
|
21
|
+
MinHeapLib.Heap internal bids;
|
|
22
|
+
Entry[] public entries;
|
|
23
|
+
|
|
24
|
+
uint64 public cacheSize;
|
|
25
|
+
uint64 public queueSize;
|
|
26
|
+
uint64 public decay;
|
|
27
|
+
bool public isPaused;
|
|
28
|
+
|
|
29
|
+
error NotChainOwner(address sender);
|
|
30
|
+
error AsmTooLarge(uint256 asm, uint256 queueSize, uint256 cacheSize);
|
|
31
|
+
error AlreadyCached(bytes32 codehash);
|
|
32
|
+
error BidTooLarge(uint256 bid);
|
|
33
|
+
error BidTooSmall(uint192 bid, uint192 min);
|
|
34
|
+
error BidsArePaused();
|
|
35
|
+
error MakeSpaceTooLarge(uint64 size, uint64 limit);
|
|
36
|
+
|
|
37
|
+
event InsertBid(bytes32 indexed codehash, uint192 bid, uint64 size);
|
|
38
|
+
event DeleteBid(bytes32 indexed codehash, uint192 bid, uint64 size);
|
|
39
|
+
event SetCacheSize(uint64 size);
|
|
40
|
+
event SetDecayRate(uint64 decay);
|
|
41
|
+
event Pause();
|
|
42
|
+
event Unpause();
|
|
43
|
+
|
|
44
|
+
struct Entry {
|
|
45
|
+
bytes32 code;
|
|
46
|
+
uint64 size;
|
|
47
|
+
uint192 bid;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
constructor(uint64 initCacheSize, uint64 initDecay) {
|
|
51
|
+
cacheSize = initCacheSize;
|
|
52
|
+
decay = initDecay;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
modifier onlyOwner() {
|
|
56
|
+
if (!ARB_OWNER_PUBLIC.isChainOwner(msg.sender)) {
|
|
57
|
+
revert NotChainOwner(msg.sender);
|
|
58
|
+
}
|
|
59
|
+
_;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// @notice Sets the intended cache size. Note that the queue may temporarily be larger.
|
|
63
|
+
function setCacheSize(uint64 newSize) external onlyOwner {
|
|
64
|
+
cacheSize = newSize;
|
|
65
|
+
emit SetCacheSize(newSize);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// @notice Sets the intended decay factor. Does not modify existing bids.
|
|
69
|
+
function setDecayRate(uint64 newDecay) external onlyOwner {
|
|
70
|
+
decay = newDecay;
|
|
71
|
+
emit SetDecayRate(newDecay);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/// @notice Disable new bids.
|
|
75
|
+
function paused() external onlyOwner {
|
|
76
|
+
isPaused = true;
|
|
77
|
+
emit Pause();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// @notice Enable new bids.
|
|
81
|
+
function unpause() external onlyOwner {
|
|
82
|
+
isPaused = false;
|
|
83
|
+
emit Unpause();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// @notice Evicts all programs in the cache.
|
|
87
|
+
function evictAll() external onlyOwner {
|
|
88
|
+
evictPrograms(type(uint256).max);
|
|
89
|
+
delete entries;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// @notice Evicts up to `count` programs from the cache.
|
|
93
|
+
function evictPrograms(uint256 count) public onlyOwner {
|
|
94
|
+
while (bids.length() != 0 && count > 0) {
|
|
95
|
+
(uint192 bid, uint64 index) = _getBid(bids.pop());
|
|
96
|
+
_deleteEntry(bid, index);
|
|
97
|
+
count -= 1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// @notice Returns all entries in the cache. Might revert if the cache is too large.
|
|
102
|
+
function getEntries() external view returns (Entry[] memory) {
|
|
103
|
+
return entries;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/// @notice Returns the `k` smallest entries in the cache sorted in ascending order.
|
|
107
|
+
/// If the cache have less than `k` entries, returns all entries.
|
|
108
|
+
function getSmallestEntries(uint256 k) public view returns (Entry[] memory result) {
|
|
109
|
+
if (bids.length() < k) {
|
|
110
|
+
k = bids.length();
|
|
111
|
+
}
|
|
112
|
+
uint256[] memory kbids = bids.smallest(k);
|
|
113
|
+
result = new Entry[](kbids.length);
|
|
114
|
+
for (uint256 i = 0; i < kbids.length; i++) {
|
|
115
|
+
(, uint64 index) = _getBid(kbids[i]);
|
|
116
|
+
result[i] = entries[index];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// @notice Returns the minimum bid required to cache a program of the given size.
|
|
121
|
+
/// Value returned here is the minimum bid that you can send with msg.value
|
|
122
|
+
function getMinBid(uint64 size) public view returns (uint192 min) {
|
|
123
|
+
if (size > cacheSize) {
|
|
124
|
+
revert AsmTooLarge(size, 0, cacheSize);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
size = size >= MIN_CODESIZE ? size : MIN_CODESIZE;
|
|
128
|
+
uint256 totalSize = queueSize + size;
|
|
129
|
+
if (totalSize <= cacheSize) {
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
uint256 needToFree = totalSize - cacheSize;
|
|
133
|
+
|
|
134
|
+
// size is at least MIN_CODESIZE, and vary no more than 10x right now, so we can safely assume
|
|
135
|
+
// for a given size, we need at most need to clear roundUp(size/MIN_CODESIZE) entries to make space
|
|
136
|
+
uint256 k = (needToFree + MIN_CODESIZE - 1) / MIN_CODESIZE;
|
|
137
|
+
Entry[] memory smallest = getSmallestEntries(k);
|
|
138
|
+
for (uint256 i = 0; i < smallest.length; i++) {
|
|
139
|
+
if (needToFree <= smallest[i].size) {
|
|
140
|
+
min = smallest[i].bid;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
needToFree -= smallest[i].size;
|
|
144
|
+
}
|
|
145
|
+
uint256 currentDecay = _calcDecay();
|
|
146
|
+
if (min < currentDecay) {
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
min = min - uint192(currentDecay);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/// @notice Returns the minimum bid required to cache the program with given codehash.
|
|
153
|
+
/// Value returned here is the minimum bid that you can send with msg.value
|
|
154
|
+
function getMinBid(bytes32 codehash) external view returns (uint192 min) {
|
|
155
|
+
return getMinBid(_asmSize(codehash));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/// @notice Sends all revenue to the network fee account.
|
|
159
|
+
function sweepFunds() external {
|
|
160
|
+
(bool success, bytes memory data) = ARB_OWNER_PUBLIC.getNetworkFeeAccount().call{
|
|
161
|
+
value: address(this).balance
|
|
162
|
+
}("");
|
|
163
|
+
if (!success) {
|
|
164
|
+
assembly {
|
|
165
|
+
revert(add(data, 32), mload(data))
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// @notice Places a bid, reverting if payment is insufficient.
|
|
171
|
+
function placeBid(bytes32 codehash) external payable {
|
|
172
|
+
if (isPaused) {
|
|
173
|
+
revert BidsArePaused();
|
|
174
|
+
}
|
|
175
|
+
if (_isCached(codehash)) {
|
|
176
|
+
revert AlreadyCached(codehash);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
uint64 asm = _asmSize(codehash);
|
|
180
|
+
(uint192 bid, uint64 index) = _makeSpace(asm);
|
|
181
|
+
return _addBid(bid, codehash, asm, index);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/// @notice Evicts entries until enough space exists in the cache, reverting if payment is insufficient.
|
|
185
|
+
/// Returns the new amount of space available on success.
|
|
186
|
+
/// @dev Will revert for requests larger than 5Mb. Call repeatedly for more.
|
|
187
|
+
function makeSpace(uint64 size) external payable returns (uint64 space) {
|
|
188
|
+
if (isPaused) {
|
|
189
|
+
revert BidsArePaused();
|
|
190
|
+
}
|
|
191
|
+
if (size > MAX_MAKE_SPACE) {
|
|
192
|
+
revert MakeSpaceTooLarge(size, MAX_MAKE_SPACE);
|
|
193
|
+
}
|
|
194
|
+
_makeSpace(size);
|
|
195
|
+
return cacheSize - queueSize;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function _calcDecay() internal view returns (uint256) {
|
|
199
|
+
return block.timestamp * decay;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/// @dev Converts a value to a bid by adding the time decay term.
|
|
203
|
+
function _toBid(uint256 value) internal view returns (uint192 bid) {
|
|
204
|
+
uint256 _bid = value + _calcDecay();
|
|
205
|
+
if (_bid > type(uint192).max) {
|
|
206
|
+
revert BidTooLarge(_bid);
|
|
207
|
+
}
|
|
208
|
+
return uint192(_bid);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/// @dev Evicts entries until enough space exists in the cache, reverting if payment is insufficient.
|
|
212
|
+
/// Returns the bid and the index to use for insertion.
|
|
213
|
+
function _makeSpace(uint64 size) internal returns (uint192 bid, uint64 index) {
|
|
214
|
+
// discount historical bids by the number of seconds
|
|
215
|
+
bid = _toBid(msg.value);
|
|
216
|
+
index = uint64(entries.length);
|
|
217
|
+
|
|
218
|
+
uint192 min;
|
|
219
|
+
uint64 limit = cacheSize;
|
|
220
|
+
while (queueSize + size > limit) {
|
|
221
|
+
(min, index) = _getBid(bids.pop());
|
|
222
|
+
_deleteEntry(min, index);
|
|
223
|
+
}
|
|
224
|
+
// if the new bid equals to the minimum bid, a random entry with minimum bid will be evicted
|
|
225
|
+
if (bid < min) {
|
|
226
|
+
revert BidTooSmall(bid, min);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/// @dev Adds a bid
|
|
231
|
+
function _addBid(
|
|
232
|
+
uint192 bid,
|
|
233
|
+
bytes32 code,
|
|
234
|
+
uint64 size,
|
|
235
|
+
uint64 index
|
|
236
|
+
) internal {
|
|
237
|
+
if (queueSize + size > cacheSize) {
|
|
238
|
+
revert AsmTooLarge(size, queueSize, cacheSize);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
Entry memory entry = Entry({size: size, code: code, bid: bid});
|
|
242
|
+
ARB_WASM_CACHE.cacheCodehash(code);
|
|
243
|
+
bids.push(_packBid(bid, index));
|
|
244
|
+
queueSize += size;
|
|
245
|
+
if (index == entries.length) {
|
|
246
|
+
entries.push(entry);
|
|
247
|
+
} else {
|
|
248
|
+
entries[index] = entry;
|
|
249
|
+
}
|
|
250
|
+
emit InsertBid(code, bid, size);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/// @dev Clears the entry at the given index
|
|
254
|
+
function _deleteEntry(uint192 bid, uint64 index) internal {
|
|
255
|
+
Entry memory entry = entries[index];
|
|
256
|
+
ARB_WASM_CACHE.evictCodehash(entry.code);
|
|
257
|
+
queueSize -= entry.size;
|
|
258
|
+
emit DeleteBid(entry.code, bid, entry.size);
|
|
259
|
+
delete entries[index];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// @dev Gets the bid and index from a packed bid item
|
|
263
|
+
function _getBid(uint256 info) internal pure returns (uint192 bid, uint64 index) {
|
|
264
|
+
bid = uint192(info >> 64);
|
|
265
|
+
index = uint64(info);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/// @dev Creates a packed bid item
|
|
269
|
+
function _packBid(uint192 bid, uint64 index) internal pure returns (uint256) {
|
|
270
|
+
return (uint256(bid) << 64) | uint256(index);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/// @dev Gets the size of the given program in bytes
|
|
274
|
+
function _asmSize(bytes32 codehash) internal view returns (uint64) {
|
|
275
|
+
uint32 size = ARB_WASM.codehashAsmSize(codehash);
|
|
276
|
+
return uint64(size >= MIN_CODESIZE ? size : MIN_CODESIZE); // pretend it's at least 4Kb
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/// @dev Determines whether a program is cached
|
|
280
|
+
function _isCached(bytes32 codehash) internal view returns (bool) {
|
|
281
|
+
return ARB_WASM_CACHE.codehashIsCached(codehash);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -48,51 +48,6 @@ library ChallengeLib {
|
|
|
48
48
|
return challenge.timeUsedSinceLastMove() > challenge.current.timeLeft;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function getStartMachineHash(bytes32 globalStateHash, bytes32 wasmModuleRoot)
|
|
52
|
-
internal
|
|
53
|
-
pure
|
|
54
|
-
returns (bytes32)
|
|
55
|
-
{
|
|
56
|
-
// Start the value stack with the function call ABI for the entrypoint
|
|
57
|
-
Value[] memory startingValues = new Value[](3);
|
|
58
|
-
startingValues[0] = ValueLib.newRefNull();
|
|
59
|
-
startingValues[1] = ValueLib.newI32(0);
|
|
60
|
-
startingValues[2] = ValueLib.newI32(0);
|
|
61
|
-
ValueArray memory valuesArray = ValueArray({inner: startingValues});
|
|
62
|
-
ValueStack memory values = ValueStack({proved: valuesArray, remainingHash: 0});
|
|
63
|
-
ValueStack memory internalStack;
|
|
64
|
-
StackFrameWindow memory frameStack;
|
|
65
|
-
|
|
66
|
-
Machine memory mach = Machine({
|
|
67
|
-
status: MachineStatus.RUNNING,
|
|
68
|
-
valueStack: values,
|
|
69
|
-
internalStack: internalStack,
|
|
70
|
-
frameStack: frameStack,
|
|
71
|
-
globalStateHash: globalStateHash,
|
|
72
|
-
moduleIdx: 0,
|
|
73
|
-
functionIdx: 0,
|
|
74
|
-
functionPc: 0,
|
|
75
|
-
modulesRoot: wasmModuleRoot
|
|
76
|
-
});
|
|
77
|
-
return mach.hash();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function getEndMachineHash(MachineStatus status, bytes32 globalStateHash)
|
|
81
|
-
internal
|
|
82
|
-
pure
|
|
83
|
-
returns (bytes32)
|
|
84
|
-
{
|
|
85
|
-
if (status == MachineStatus.FINISHED) {
|
|
86
|
-
return keccak256(abi.encodePacked("Machine finished:", globalStateHash));
|
|
87
|
-
} else if (status == MachineStatus.ERRORED) {
|
|
88
|
-
return keccak256(abi.encodePacked("Machine errored:"));
|
|
89
|
-
} else if (status == MachineStatus.TOO_FAR) {
|
|
90
|
-
return keccak256(abi.encodePacked("Machine too far:"));
|
|
91
|
-
} else {
|
|
92
|
-
revert("BAD_BLOCK_STATUS");
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
51
|
function extractChallengeSegment(SegmentSelection calldata selection)
|
|
97
52
|
internal
|
|
98
53
|
pure
|
|
@@ -35,6 +35,7 @@ contract ChallengeManager is DelegateCallAware, IChallengeManager {
|
|
|
35
35
|
ISequencerInbox public sequencerInbox;
|
|
36
36
|
IBridge public bridge;
|
|
37
37
|
IOneStepProofEntry public osp;
|
|
38
|
+
mapping(bytes32 => IOneStepProofEntry) public ospCond;
|
|
38
39
|
|
|
39
40
|
function challengeInfo(uint64 challengeIndex)
|
|
40
41
|
external
|
|
@@ -110,12 +111,28 @@ contract ChallengeManager is DelegateCallAware, IChallengeManager {
|
|
|
110
111
|
osp = osp_;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
/// @dev A osp breaking change is introduced as part of Stylus upgrade, where the new osp would not support
|
|
115
|
+
/// pre-Stylus legacy wasmModuleRoot. To ensure that the new osp is not used for legacy wasmModuleRoot,
|
|
116
|
+
/// we introduce a conditional OSP where condRoot should be set to the pre-Stylus root and condOsp should
|
|
117
|
+
/// be set to the pre-Stylus osp. The correct value should be handled by the upgrade action contract.
|
|
118
|
+
function postUpgradeInit(
|
|
119
|
+
IOneStepProofEntry osp_,
|
|
120
|
+
bytes32 condRoot,
|
|
121
|
+
IOneStepProofEntry condOsp
|
|
122
|
+
) external onlyDelegated onlyProxyOwner {
|
|
123
|
+
ospCond[condRoot] = condOsp;
|
|
116
124
|
osp = osp_;
|
|
117
125
|
}
|
|
118
126
|
|
|
127
|
+
function getOsp(bytes32 wasmModuleRoot) public view returns (IOneStepProofEntry) {
|
|
128
|
+
IOneStepProofEntry t = ospCond[wasmModuleRoot];
|
|
129
|
+
if (address(t) == address(0)) {
|
|
130
|
+
return osp;
|
|
131
|
+
} else {
|
|
132
|
+
return t;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
119
136
|
function createChallenge(
|
|
120
137
|
bytes32 wasmModuleRoot_,
|
|
121
138
|
MachineStatus[2] calldata startAndEndMachineStatuses_,
|
|
@@ -233,11 +250,9 @@ contract ChallengeManager is DelegateCallAware, IChallengeManager {
|
|
|
233
250
|
}
|
|
234
251
|
|
|
235
252
|
bytes32[] memory segments = new bytes32[](2);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
);
|
|
240
|
-
segments[1] = ChallengeLib.getEndMachineHash(machineStatuses[1], globalStateHashes[1]);
|
|
253
|
+
IOneStepProofEntry _osp = getOsp(challenge.wasmModuleRoot);
|
|
254
|
+
segments[0] = _osp.getStartMachineHash(globalStateHashes[0], challenge.wasmModuleRoot);
|
|
255
|
+
segments[1] = _osp.getEndMachineHash(machineStatuses[1], globalStateHashes[1]);
|
|
241
256
|
|
|
242
257
|
challenge.mode = ChallengeLib.ChallengeMode.EXECUTION;
|
|
243
258
|
|
|
@@ -259,7 +274,7 @@ contract ChallengeManager is DelegateCallAware, IChallengeManager {
|
|
|
259
274
|
require(challengeLength == 1, "TOO_LONG");
|
|
260
275
|
}
|
|
261
276
|
|
|
262
|
-
bytes32 afterHash =
|
|
277
|
+
bytes32 afterHash = getOsp(challenge.wasmModuleRoot).proveOneStep(
|
|
263
278
|
ExecutionContext({maxInboxMessagesRead: challenge.maxInboxMessages, bridge: bridge}),
|
|
264
279
|
challengeStart,
|
|
265
280
|
selection.oldSegments[selection.challengePosition],
|
|
@@ -47,6 +47,19 @@ interface IChallengeManager {
|
|
|
47
47
|
IOneStepProofEntry osp_
|
|
48
48
|
) external;
|
|
49
49
|
|
|
50
|
+
function postUpgradeInit(
|
|
51
|
+
IOneStepProofEntry osp_,
|
|
52
|
+
bytes32 condRoot,
|
|
53
|
+
IOneStepProofEntry condOsp
|
|
54
|
+
) external;
|
|
55
|
+
|
|
56
|
+
/// @notice Get the default osp, which is used for all wasm module roots that don't have a conditional OSP set
|
|
57
|
+
/// Use getOsp(wasmModuleRoot) to get the OSP for a specific wasm module root
|
|
58
|
+
function osp() external view returns (IOneStepProofEntry);
|
|
59
|
+
|
|
60
|
+
/// @notice Get the OSP for a given wasm module root
|
|
61
|
+
function getOsp(bytes32 wasmModuleRoot) external view returns (IOneStepProofEntry);
|
|
62
|
+
|
|
50
63
|
function createChallenge(
|
|
51
64
|
bytes32 wasmModuleRoot_,
|
|
52
65
|
MachineStatus[2] calldata startAndEndMachineStatuses_,
|
package/src/libraries/Error.sol
CHANGED
|
@@ -167,9 +167,6 @@ error BadSequencerNumber(uint256 stored, uint256 received);
|
|
|
167
167
|
/// @dev The sequence message number provided to this message was inconsistent with the previous one
|
|
168
168
|
error BadSequencerMessageNumber(uint256 stored, uint256 received);
|
|
169
169
|
|
|
170
|
-
/// @dev The batch data has the inbox authenticated bit set, but the batch data was not authenticated by the inbox
|
|
171
|
-
error DataNotAuthenticated();
|
|
172
|
-
|
|
173
170
|
/// @dev Tried to create an already valid Data Availability Service keyset
|
|
174
171
|
error AlreadyValidDASKeyset(bytes32);
|
|
175
172
|
|
|
@@ -188,15 +185,9 @@ error InitParamZero(string name);
|
|
|
188
185
|
/// @dev Thrown when data hashes where expected but not where present on the tx
|
|
189
186
|
error MissingDataHashes();
|
|
190
187
|
|
|
191
|
-
/// @dev Thrown when the data blob meta data is invalid
|
|
192
|
-
error InvalidBlobMetadata();
|
|
193
|
-
|
|
194
188
|
/// @dev Thrown when rollup is not updated with updateRollupAddress
|
|
195
189
|
error RollupNotChanged();
|
|
196
190
|
|
|
197
|
-
/// @dev Batch data was empty when non empty was expected
|
|
198
|
-
error EmptyBatchData();
|
|
199
|
-
|
|
200
191
|
/// @dev Unsupported header flag was provided
|
|
201
192
|
error InvalidHeaderFlag(bytes1);
|
|
202
193
|
|
|
@@ -205,3 +196,6 @@ error NativeTokenMismatch();
|
|
|
205
196
|
|
|
206
197
|
/// @dev Thrown when a deprecated function is called
|
|
207
198
|
error Deprecated();
|
|
199
|
+
|
|
200
|
+
/// @dev Thrown when any component of maxTimeVariation is over uint64
|
|
201
|
+
error BadMaxTimeVariation();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright 2022-2023, Offchain Labs, Inc.
|
|
2
|
+
// For license information, see https://github.com/nitro/blob/master/LICENSE
|
|
3
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
4
|
+
|
|
5
|
+
pragma solidity ^0.8.0;
|
|
6
|
+
|
|
7
|
+
contract Benchmarks {
|
|
8
|
+
function fillBlockRecover() external payable {
|
|
9
|
+
bytes32 bridgeToNova = 0xeddecf107b5740cef7f5a01e3ea7e287665c4e75a8eb6afae2fda2e3d4367786;
|
|
10
|
+
address cryptoIsCute = 0x361594F5429D23ECE0A88E4fBE529E1c49D524d8;
|
|
11
|
+
uint8 v = 27;
|
|
12
|
+
bytes32 r = 0xc6178c2de1078cd36c3bd302cde755340d7f17fcb3fcc0b9c333ba03b217029f;
|
|
13
|
+
bytes32 s = 0x5fdbcefe2675e96219cdae57a7894280bf80fd40d44ce146a35e169ea6a78fd3;
|
|
14
|
+
while (true) {
|
|
15
|
+
require(ecrecover(bridgeToNova, v, r, s) == cryptoIsCute, "WRONG_ARBINAUT");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fillBlockMulMod() external payable {
|
|
20
|
+
uint256 value = 0xeddecf107b5740cef7f5a01e3ea7e287665c4e75a8eb6afae2fda2e3d4367786;
|
|
21
|
+
while (true) {
|
|
22
|
+
value = mulmod(
|
|
23
|
+
value,
|
|
24
|
+
0xc6178c2de1078cd36c3bd302cde755340d7f17fcb3fcc0b9c333ba03b217029f,
|
|
25
|
+
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function fillBlockHash() external payable {
|
|
31
|
+
bytes32 hash = 0xeddecf107b5740cef7f5a01e3ea7e287665c4e75a8eb6afae2fda2e3d4367786;
|
|
32
|
+
while (true) {
|
|
33
|
+
hash = keccak256(abi.encodePacked(hash));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function fillBlockAdd() external payable {
|
|
38
|
+
uint256 value = 0;
|
|
39
|
+
while (true) {
|
|
40
|
+
unchecked {
|
|
41
|
+
value += 0xeddecf107b5740cef7f5a01e3ea7e287665c4e75a8eb6afae2fda2e3d4367786;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function fillBlockQuickStep() external payable {
|
|
47
|
+
uint256 value = 0;
|
|
48
|
+
while (true) {
|
|
49
|
+
value = msg.value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Copyright 2024, Offchain Labs, Inc.
|
|
2
|
+
// For license information, see https://github.com/nitro/blob/master/LICENSE
|
|
3
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
4
|
+
|
|
5
|
+
pragma solidity ^0.8.0;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* this contract is the solidity equivalent of stylus multicall test contract
|
|
9
|
+
* it should only be used for stylus tests, and it ignores good solidity good practices
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
contract MultiCallTest {
|
|
13
|
+
event Called(address addr, uint8 count, bool success, bytes returnData);
|
|
14
|
+
event Storage(bytes32 slot, bytes32 data, bool write);
|
|
15
|
+
|
|
16
|
+
function getBE(bytes calldata data, uint8 numBytes) internal pure returns (uint256) {
|
|
17
|
+
uint256 res = 0;
|
|
18
|
+
for (uint8 i = 0; i < numBytes; i++) {
|
|
19
|
+
res = res << 8;
|
|
20
|
+
res = res | uint8(data[i]);
|
|
21
|
+
}
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// solhint-disable no-complex-fallback
|
|
26
|
+
// solhint-disable reason-string
|
|
27
|
+
// solhint-disable avoid-low-level-calls
|
|
28
|
+
// solhint-disable-next-line prettier/prettier
|
|
29
|
+
fallback(bytes calldata input) external payable returns (bytes memory) {
|
|
30
|
+
require(input.length > 0);
|
|
31
|
+
uint8 count = uint8(input[0]);
|
|
32
|
+
input = input[1:];
|
|
33
|
+
|
|
34
|
+
// combined output of all calls
|
|
35
|
+
bytes memory output;
|
|
36
|
+
|
|
37
|
+
for (uint8 i = 0; i < count; i++) {
|
|
38
|
+
uint32 length = uint32(getBE(input, 4));
|
|
39
|
+
input = input[4:];
|
|
40
|
+
|
|
41
|
+
bytes calldata curr = input[:length];
|
|
42
|
+
input = input[length:];
|
|
43
|
+
|
|
44
|
+
uint8 kind = uint8(curr[0]);
|
|
45
|
+
curr = curr[1:];
|
|
46
|
+
|
|
47
|
+
if (kind & 0xf0 == 0x0) {
|
|
48
|
+
// call
|
|
49
|
+
uint256 value;
|
|
50
|
+
if (kind & 0x3 == 0) {
|
|
51
|
+
value = getBE(curr, 32);
|
|
52
|
+
curr = curr[32:];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
address addr = address(bytes20(curr[:20]));
|
|
56
|
+
bytes calldata data = curr[20:];
|
|
57
|
+
bytes memory out;
|
|
58
|
+
bool success;
|
|
59
|
+
|
|
60
|
+
if (kind & 0x3 == 0) {
|
|
61
|
+
(success, out) = addr.call{value: value}(data);
|
|
62
|
+
} else if (kind & 0x3 == 1) {
|
|
63
|
+
(success, out) = addr.delegatecall(data);
|
|
64
|
+
} else if (kind & 0x3 == 2) {
|
|
65
|
+
(success, out) = addr.staticcall(data);
|
|
66
|
+
} else {
|
|
67
|
+
revert("unknown call kind");
|
|
68
|
+
}
|
|
69
|
+
if (!success) {
|
|
70
|
+
if (kind & 0x4 == 0) {
|
|
71
|
+
uint256 len = out.length;
|
|
72
|
+
if (len > 0) {
|
|
73
|
+
assembly {
|
|
74
|
+
revert(add(out, 32), len)
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
revert();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
out = "";
|
|
81
|
+
}
|
|
82
|
+
if (kind & 0x8 != 0) {
|
|
83
|
+
emit Called(addr, count, success, out);
|
|
84
|
+
}
|
|
85
|
+
output = bytes.concat(output, out);
|
|
86
|
+
} else if (kind & 0xf0 == 0x10) {
|
|
87
|
+
// storage
|
|
88
|
+
bytes32 slot = bytes32(curr[:32]);
|
|
89
|
+
curr = curr[32:];
|
|
90
|
+
bytes32 data;
|
|
91
|
+
bool write;
|
|
92
|
+
if (kind & 0x3 == 0) {
|
|
93
|
+
data = bytes32(curr[:32]);
|
|
94
|
+
write = true;
|
|
95
|
+
assembly {
|
|
96
|
+
sstore(slot, data)
|
|
97
|
+
}
|
|
98
|
+
} else if (kind & 0x3 == 1) {
|
|
99
|
+
write = false;
|
|
100
|
+
assembly {
|
|
101
|
+
data := sload(slot)
|
|
102
|
+
}
|
|
103
|
+
output = bytes.concat(output, data);
|
|
104
|
+
} else {
|
|
105
|
+
revert("unknown storage kind");
|
|
106
|
+
}
|
|
107
|
+
if (kind & 0x8 != 0) {
|
|
108
|
+
emit Storage(slot, data, write);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
revert("unknown command");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return output;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright 2021-2022, Offchain Labs, Inc.
|
|
2
|
+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
|
|
3
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
4
|
+
|
|
5
|
+
pragma solidity ^0.8.0;
|
|
6
|
+
|
|
7
|
+
import "../precompiles/ArbSys.sol";
|
|
8
|
+
|
|
9
|
+
contract PendingBlkTimeAndNrAdvanceCheck {
|
|
10
|
+
uint256 immutable deployedAt;
|
|
11
|
+
uint256 immutable deployedAtBlock;
|
|
12
|
+
ArbSys constant ARB_SYS = ArbSys(address(100));
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
deployedAt = block.timestamp;
|
|
16
|
+
deployedAtBlock = ARB_SYS.arbBlockNumber();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function isAdvancing() external {
|
|
20
|
+
require(block.timestamp > deployedAt, "Time didn't advance");
|
|
21
|
+
require(ARB_SYS.arbBlockNumber() > deployedAtBlock, "Block didn't advance");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function checkArbBlockHashReturnsLatest(bytes32 expected) external {
|
|
25
|
+
bytes32 gotBlockHash = ARB_SYS.arbBlockHash(ARB_SYS.arbBlockNumber() - 1);
|
|
26
|
+
require(gotBlockHash != bytes32(0), "ZERO_BLOCK_HASH");
|
|
27
|
+
require(gotBlockHash == expected, "WRONG_BLOCK_HASH");
|
|
28
|
+
}
|
|
29
|
+
}
|