@arbitrum/nitro-contracts 1.2.1 → 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/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/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/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +2 -2
- 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/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/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/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 +2 -2
- package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
- 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 +2 -2
- 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/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
- 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 +15 -2
- 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 +2 -2
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
- 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 +2 -2
- 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/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 +13 -7
- 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/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/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,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
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
import "../precompiles/ArbSys.sol";
|
|
7
|
+
import "@openzeppelin/contracts/utils/Strings.sol";
|
|
8
|
+
|
|
9
|
+
contract ProgramTest {
|
|
10
|
+
event Hash(bytes32 result);
|
|
11
|
+
|
|
12
|
+
function callKeccak(address program, bytes calldata data) external {
|
|
13
|
+
// in keccak.rs
|
|
14
|
+
// the input is the # of hashings followed by a preimage
|
|
15
|
+
// the output is the iterated hash of the preimage
|
|
16
|
+
(bool success, bytes memory result) = address(program).call(data);
|
|
17
|
+
require(success, "call failed");
|
|
18
|
+
bytes32 hash = bytes32(result);
|
|
19
|
+
emit Hash(hash);
|
|
20
|
+
require(hash == keccak256(data[1:]));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function staticcallProgram(address program, bytes calldata data)
|
|
24
|
+
external
|
|
25
|
+
view
|
|
26
|
+
returns (bytes memory)
|
|
27
|
+
{
|
|
28
|
+
(bool success, bytes memory result) = address(program).staticcall(data);
|
|
29
|
+
require(success, "call failed");
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function assert256(
|
|
34
|
+
bytes memory data,
|
|
35
|
+
string memory text,
|
|
36
|
+
uint256 expected
|
|
37
|
+
) internal pure returns (bytes memory) {
|
|
38
|
+
uint256 value = abi.decode(data, (uint256));
|
|
39
|
+
require(value == expected, text);
|
|
40
|
+
|
|
41
|
+
bytes memory rest = new bytes(data.length - 32);
|
|
42
|
+
for (uint256 i = 32; i < data.length; i++) {
|
|
43
|
+
rest[i - 32] = data[i];
|
|
44
|
+
}
|
|
45
|
+
return rest;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function staticcallEvmData(
|
|
49
|
+
address program,
|
|
50
|
+
address fundedAccount,
|
|
51
|
+
uint64 gas,
|
|
52
|
+
bytes calldata data
|
|
53
|
+
) external view returns (bytes memory) {
|
|
54
|
+
(bool success, bytes memory result) = address(program).staticcall{gas: gas}(data);
|
|
55
|
+
require(success, "call failed");
|
|
56
|
+
|
|
57
|
+
address arbPrecompile = address(0x69);
|
|
58
|
+
address ethPrecompile = address(0x01);
|
|
59
|
+
|
|
60
|
+
result = assert256(result, "block number ", block.number - 1);
|
|
61
|
+
result = assert256(result, "chain id ", block.chainid);
|
|
62
|
+
result = assert256(result, "base fee ", block.basefee);
|
|
63
|
+
result = assert256(result, "gas price ", tx.gasprice);
|
|
64
|
+
result = assert256(result, "gas limit ", block.gaslimit);
|
|
65
|
+
result = assert256(result, "value ", 0);
|
|
66
|
+
result = assert256(result, "timestamp ", block.timestamp);
|
|
67
|
+
result = assert256(result, "balance ", fundedAccount.balance);
|
|
68
|
+
result = assert256(result, "rust address ", uint256(uint160(program)));
|
|
69
|
+
result = assert256(result, "sender ", uint256(uint160(address(this))));
|
|
70
|
+
result = assert256(result, "origin ", uint256(uint160(tx.origin)));
|
|
71
|
+
result = assert256(result, "coinbase ", uint256(uint160(address(block.coinbase))));
|
|
72
|
+
result = assert256(result, "rust codehash", uint256(program.codehash));
|
|
73
|
+
result = assert256(result, "arb codehash ", uint256(arbPrecompile.codehash));
|
|
74
|
+
result = assert256(result, "eth codehash ", uint256(ethPrecompile.codehash));
|
|
75
|
+
|
|
76
|
+
bytes memory code = new bytes(program.code.length);
|
|
77
|
+
for (uint256 i = 0; i < program.code.length; i++) {
|
|
78
|
+
code[i] = result[i];
|
|
79
|
+
}
|
|
80
|
+
require(keccak256(code) == keccak256(program.code), "code");
|
|
81
|
+
bytes memory rest = new bytes(result.length - program.code.length);
|
|
82
|
+
for (uint256 i = program.code.length; i < result.length; i++) {
|
|
83
|
+
rest[i - program.code.length] = result[i];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
result = rest;
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function checkRevertData(
|
|
91
|
+
address program,
|
|
92
|
+
bytes calldata data,
|
|
93
|
+
bytes calldata expected
|
|
94
|
+
) external payable returns (bytes memory) {
|
|
95
|
+
(bool success, bytes memory result) = address(program).call{value: msg.value}(data);
|
|
96
|
+
require(!success, "unexpected success");
|
|
97
|
+
require(result.length == expected.length, "wrong revert data length");
|
|
98
|
+
for (uint256 i = 0; i < result.length; i++) {
|
|
99
|
+
require(result[i] == expected[i], "revert data mismatch");
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function mathTest(address program) external {
|
|
105
|
+
uint256 value = 0xeddecf107b5740cef7f5a01e3ea7e287665c4e75a8eb6afae2fda2e3d4367786;
|
|
106
|
+
value = mulmod(
|
|
107
|
+
value,
|
|
108
|
+
0xc6178c2de1078cd36c3bd302cde755340d7f17fcb3fcc0b9c333ba03b217029f,
|
|
109
|
+
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
|
|
110
|
+
);
|
|
111
|
+
value = addmod(
|
|
112
|
+
value,
|
|
113
|
+
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f,
|
|
114
|
+
0xc6178c2de1078cd36c3bd302cde755340d7f17fcb3fcc0b9c333ba03b217029f
|
|
115
|
+
);
|
|
116
|
+
unchecked {
|
|
117
|
+
value /= 0xeddecf107b5740ce;
|
|
118
|
+
value = value**0xfffffffefffffc2f;
|
|
119
|
+
value = value % 0xc6178c2de1078cd3;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(bool success, bytes memory result) = address(program).call("");
|
|
123
|
+
require(success, "call failed");
|
|
124
|
+
require(keccak256(result) == keccak256(abi.encodePacked(value)));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
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 SdkStorage {
|
|
8
|
+
bool flag;
|
|
9
|
+
address owner;
|
|
10
|
+
address other;
|
|
11
|
+
Struct sub;
|
|
12
|
+
Struct[] structs;
|
|
13
|
+
uint64[] vector;
|
|
14
|
+
uint40[][] nested;
|
|
15
|
+
bytes bytesFull;
|
|
16
|
+
bytes bytesLong;
|
|
17
|
+
string chars;
|
|
18
|
+
Maps maps;
|
|
19
|
+
Arrays arrays;
|
|
20
|
+
|
|
21
|
+
struct Struct {
|
|
22
|
+
uint16 num;
|
|
23
|
+
int32 other;
|
|
24
|
+
bytes32 word;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
struct Maps {
|
|
28
|
+
mapping(uint256 => address) basic;
|
|
29
|
+
mapping(address => bool[]) vects;
|
|
30
|
+
mapping(int32 => address)[] array;
|
|
31
|
+
mapping(bytes1 => mapping(bool => uint256)) nested;
|
|
32
|
+
mapping(string => Struct) structs;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
struct Arrays {
|
|
36
|
+
string[4] strings;
|
|
37
|
+
uint8 spacer;
|
|
38
|
+
uint24[5] packed;
|
|
39
|
+
uint8 trail;
|
|
40
|
+
address[2] spill;
|
|
41
|
+
uint8[2][4] matrix;
|
|
42
|
+
int96[4][] vector;
|
|
43
|
+
int96[][4] vectors;
|
|
44
|
+
Struct[3] structs;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function populate() external {
|
|
48
|
+
flag = true;
|
|
49
|
+
owner = address(0x70);
|
|
50
|
+
other = address(0x30);
|
|
51
|
+
|
|
52
|
+
sub.num = 32;
|
|
53
|
+
sub.other = type(int32).max;
|
|
54
|
+
sub.word = bytes32(uint256(64));
|
|
55
|
+
|
|
56
|
+
for (uint64 i = 0; i < 32; i++) {
|
|
57
|
+
vector.push(i);
|
|
58
|
+
}
|
|
59
|
+
vector[7] = 77;
|
|
60
|
+
|
|
61
|
+
for (uint256 w = 0; w < 10; w++) {
|
|
62
|
+
nested.push(new uint40[](w));
|
|
63
|
+
for (uint256 i = 0; i < w; i++) {
|
|
64
|
+
nested[w][i] = uint40(i);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (uint256 w = 0; w < 10; w++) {
|
|
68
|
+
for (uint256 i = 0; i < w; i++) {
|
|
69
|
+
nested[w][i] *= 2;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
for (uint8 i = 0; i < 31; i++) {
|
|
74
|
+
bytesFull = abi.encodePacked(bytesFull, i);
|
|
75
|
+
}
|
|
76
|
+
for (uint8 i = 0; i < 80; i++) {
|
|
77
|
+
bytesLong = abi.encodePacked(bytesLong, i);
|
|
78
|
+
}
|
|
79
|
+
chars = "arbitrum stylus";
|
|
80
|
+
|
|
81
|
+
for (uint256 i = 0; i < 16; i++) {
|
|
82
|
+
maps.basic[i] = address(uint160(i));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
for (uint160 a = 0; a < 4; a++) {
|
|
86
|
+
maps.vects[address(a)] = new bool[](0);
|
|
87
|
+
for (uint256 i = 0; i <= a; i++) {
|
|
88
|
+
maps.vects[address(a)].push(true);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (int32 i = 0; i < 4; i++) {
|
|
93
|
+
maps.array.push();
|
|
94
|
+
maps.array[uint256(uint32(i))][i] = address(uint160(uint32(i)));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
for (uint8 i = 0; i < 4; i++) {
|
|
98
|
+
maps.nested[bytes1(i)][i % 2 == 0] = i + 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
maps.structs["stylus"] = sub;
|
|
102
|
+
|
|
103
|
+
for (uint256 i = 0; i < 4; i++) {
|
|
104
|
+
structs.push(sub);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
arrays.strings[2] = "L2 is for you!";
|
|
108
|
+
|
|
109
|
+
for (uint256 i = 0; i < 5; i++) {
|
|
110
|
+
arrays.packed[i] = uint24(i);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
for (uint256 i = 0; i < 2; i++) {
|
|
114
|
+
arrays.spill[i] = address(uint160(i));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (uint256 i = 0; i < 4; i++) {
|
|
118
|
+
arrays.matrix[i][0] = uint8(i);
|
|
119
|
+
arrays.matrix[i][1] = arrays.matrix[i][0] + 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
for (uint256 w = 0; w < 3; w++) {
|
|
123
|
+
int96[4] memory array;
|
|
124
|
+
for (int256 i = 0; i < 4; i++) {
|
|
125
|
+
array[uint256(i)] = int96(i);
|
|
126
|
+
}
|
|
127
|
+
arrays.vector.push(array);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
for (uint256 w = 0; w < 4; w++) {
|
|
131
|
+
for (int96 i = 0; i < 4; i++) {
|
|
132
|
+
arrays.vectors[w].push(i);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
for (uint256 i = 0; i < 3; i++) {
|
|
137
|
+
arrays.structs[i] = sub;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function remove() external {
|
|
142
|
+
while (bytesFull.length != 0) {
|
|
143
|
+
bytesFull.pop();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
while (bytesLong.length > 16) {
|
|
147
|
+
bytesLong.pop();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
chars = "wasm is cute <3";
|
|
151
|
+
|
|
152
|
+
while (vector.length != 0) {
|
|
153
|
+
vector.pop();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
while (nested.length > 1) {
|
|
157
|
+
nested.pop();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
for (uint256 i = 0; i < 8; i++) {
|
|
161
|
+
delete maps.basic[i];
|
|
162
|
+
}
|
|
163
|
+
maps.basic[8] = address(32);
|
|
164
|
+
|
|
165
|
+
for (uint160 i = 0; i < 4; i++) {
|
|
166
|
+
delete maps.vects[address(i)];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
structs.pop();
|
|
170
|
+
|
|
171
|
+
delete arrays.matrix;
|
|
172
|
+
delete arrays.vector;
|
|
173
|
+
delete arrays.vectors;
|
|
174
|
+
delete arrays.structs;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import "../precompiles/ArbWasmCache.sol";
|
|
7
|
+
|
|
8
|
+
contract SimpleCacheManager {
|
|
9
|
+
function cacheProgram(address program) external {
|
|
10
|
+
ArbWasmCache(address(0x72)).cacheCodehash(codehash(program));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function evictProgram(address program) external {
|
|
14
|
+
ArbWasmCache(address(0x72)).evictCodehash(codehash(program));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function codehash(address program) internal view returns (bytes32 hash) {
|
|
18
|
+
assembly {
|
|
19
|
+
hash := extcodehash(program)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -11,6 +11,16 @@ library OneStepProofEntryLib {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
interface IOneStepProofEntry {
|
|
14
|
+
function getStartMachineHash(bytes32 globalStateHash, bytes32 wasmModuleRoot)
|
|
15
|
+
external
|
|
16
|
+
pure
|
|
17
|
+
returns (bytes32);
|
|
18
|
+
|
|
19
|
+
function getEndMachineHash(MachineStatus status, bytes32 globalStateHash)
|
|
20
|
+
external
|
|
21
|
+
pure
|
|
22
|
+
returns (bytes32);
|
|
23
|
+
|
|
14
24
|
function proveOneStep(
|
|
15
25
|
ExecutionContext calldata execCtx,
|
|
16
26
|
uint256 machineStep,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2021-
|
|
1
|
+
// Copyright 2021-2023, Offchain Labs, Inc.
|
|
2
2
|
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
|
|
3
3
|
// SPDX-License-Identifier: BUSL-1.1
|
|
4
4
|
|
|
@@ -7,12 +7,17 @@ pragma solidity ^0.8.0;
|
|
|
7
7
|
import "../state/Deserialize.sol";
|
|
8
8
|
import "../state/Machine.sol";
|
|
9
9
|
import "../state/MerkleProof.sol";
|
|
10
|
+
import "../state/MultiStack.sol";
|
|
10
11
|
import "./IOneStepProver.sol";
|
|
11
12
|
import "./IOneStepProofEntry.sol";
|
|
12
13
|
|
|
13
14
|
contract OneStepProofEntry is IOneStepProofEntry {
|
|
14
15
|
using MerkleProofLib for MerkleProof;
|
|
15
16
|
using MachineLib for Machine;
|
|
17
|
+
using MultiStackLib for MultiStack;
|
|
18
|
+
|
|
19
|
+
using ValueStackLib for ValueStack;
|
|
20
|
+
using StackFrameLib for StackFrameWindow;
|
|
16
21
|
|
|
17
22
|
IOneStepProver public prover0;
|
|
18
23
|
IOneStepProver public proverMem;
|
|
@@ -31,6 +36,58 @@ contract OneStepProofEntry is IOneStepProofEntry {
|
|
|
31
36
|
proverHostIo = proverHostIo_;
|
|
32
37
|
}
|
|
33
38
|
|
|
39
|
+
// Copied from ChallengeLib.sol
|
|
40
|
+
function getStartMachineHash(bytes32 globalStateHash, bytes32 wasmModuleRoot)
|
|
41
|
+
external
|
|
42
|
+
pure
|
|
43
|
+
returns (bytes32)
|
|
44
|
+
{
|
|
45
|
+
// Start the value stack with the function call ABI for the entrypoint
|
|
46
|
+
Value[] memory startingValues = new Value[](3);
|
|
47
|
+
startingValues[0] = ValueLib.newRefNull();
|
|
48
|
+
startingValues[1] = ValueLib.newI32(0);
|
|
49
|
+
startingValues[2] = ValueLib.newI32(0);
|
|
50
|
+
ValueArray memory valuesArray = ValueArray({inner: startingValues});
|
|
51
|
+
ValueStack memory values = ValueStack({proved: valuesArray, remainingHash: 0});
|
|
52
|
+
ValueStack memory internalStack;
|
|
53
|
+
StackFrameWindow memory frameStack;
|
|
54
|
+
MultiStack memory emptyMultiStack;
|
|
55
|
+
emptyMultiStack.setEmpty();
|
|
56
|
+
|
|
57
|
+
Machine memory mach = Machine({
|
|
58
|
+
status: MachineStatus.RUNNING,
|
|
59
|
+
valueStack: values,
|
|
60
|
+
valueMultiStack: emptyMultiStack,
|
|
61
|
+
internalStack: internalStack,
|
|
62
|
+
frameStack: frameStack,
|
|
63
|
+
frameMultiStack: emptyMultiStack,
|
|
64
|
+
globalStateHash: globalStateHash,
|
|
65
|
+
moduleIdx: 0,
|
|
66
|
+
functionIdx: 0,
|
|
67
|
+
functionPc: 0,
|
|
68
|
+
recoveryPc: MachineLib.NO_RECOVERY_PC,
|
|
69
|
+
modulesRoot: wasmModuleRoot
|
|
70
|
+
});
|
|
71
|
+
return mach.hash();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Copied from ChallengeLib.sol
|
|
75
|
+
function getEndMachineHash(MachineStatus status, bytes32 globalStateHash)
|
|
76
|
+
external
|
|
77
|
+
pure
|
|
78
|
+
returns (bytes32)
|
|
79
|
+
{
|
|
80
|
+
if (status == MachineStatus.FINISHED) {
|
|
81
|
+
return keccak256(abi.encodePacked("Machine finished:", globalStateHash));
|
|
82
|
+
} else if (status == MachineStatus.ERRORED) {
|
|
83
|
+
return keccak256(abi.encodePacked("Machine errored:"));
|
|
84
|
+
} else if (status == MachineStatus.TOO_FAR) {
|
|
85
|
+
return keccak256(abi.encodePacked("Machine too far:"));
|
|
86
|
+
} else {
|
|
87
|
+
revert("BAD_BLOCK_STATUS");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
34
91
|
function proveOneStep(
|
|
35
92
|
ExecutionContext calldata execCtx,
|
|
36
93
|
uint256 machineStep,
|
|
@@ -65,17 +122,22 @@ contract OneStepProofEntry is IOneStepProofEntry {
|
|
|
65
122
|
);
|
|
66
123
|
|
|
67
124
|
{
|
|
68
|
-
|
|
125
|
+
Instruction[] memory codeChunk;
|
|
126
|
+
MerkleProof memory codeProof;
|
|
69
127
|
MerkleProof memory funcProof;
|
|
70
|
-
(
|
|
71
|
-
(
|
|
128
|
+
(codeChunk, offset) = Deserialize.instructions(proof, offset);
|
|
129
|
+
(codeProof, offset) = Deserialize.merkleProof(proof, offset);
|
|
72
130
|
(funcProof, offset) = Deserialize.merkleProof(proof, offset);
|
|
73
|
-
bytes32 codeHash =
|
|
131
|
+
bytes32 codeHash = codeProof.computeRootFromInstructions(
|
|
132
|
+
mach.functionPc / 64,
|
|
133
|
+
codeChunk
|
|
134
|
+
);
|
|
74
135
|
bytes32 recomputedRoot = funcProof.computeRootFromFunction(
|
|
75
136
|
mach.functionIdx,
|
|
76
137
|
codeHash
|
|
77
138
|
);
|
|
78
139
|
require(recomputedRoot == mod.functionsMerkleRoot, "BAD_FUNCTIONS_ROOT");
|
|
140
|
+
inst = codeChunk[mach.functionPc % 64];
|
|
79
141
|
}
|
|
80
142
|
proof = proof[offset:];
|
|
81
143
|
}
|
|
@@ -113,7 +175,8 @@ contract OneStepProofEntry is IOneStepProofEntry {
|
|
|
113
175
|
} else if (
|
|
114
176
|
(opcode >= Instructions.GET_GLOBAL_STATE_BYTES32 &&
|
|
115
177
|
opcode <= Instructions.SET_GLOBAL_STATE_U64) ||
|
|
116
|
-
(opcode >= Instructions.READ_PRE_IMAGE && opcode <= Instructions.
|
|
178
|
+
(opcode >= Instructions.READ_PRE_IMAGE && opcode <= Instructions.UNLINK_MODULE) ||
|
|
179
|
+
(opcode >= Instructions.NEW_COTHREAD && opcode <= Instructions.SWITCH_COTHREAD)
|
|
117
180
|
) {
|
|
118
181
|
prover = proverHostIo;
|
|
119
182
|
} else {
|
|
@@ -122,7 +185,18 @@ contract OneStepProofEntry is IOneStepProofEntry {
|
|
|
122
185
|
|
|
123
186
|
(mach, mod) = prover.executeOneStep(execCtx, mach, mod, inst, proof);
|
|
124
187
|
|
|
125
|
-
|
|
188
|
+
bool updateRoot = !(opcode == Instructions.LINK_MODULE ||
|
|
189
|
+
opcode == Instructions.UNLINK_MODULE);
|
|
190
|
+
if (updateRoot) {
|
|
191
|
+
mach.modulesRoot = modProof.computeRootFromModule(oldModIdx, mod);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (mach.status == MachineStatus.ERRORED && mach.recoveryPc != MachineLib.NO_RECOVERY_PC) {
|
|
195
|
+
// capture error, recover into main thread.
|
|
196
|
+
mach.switchCoThreadStacks();
|
|
197
|
+
mach.setPcFromRecovery();
|
|
198
|
+
mach.status = MachineStatus.RUNNING;
|
|
199
|
+
}
|
|
126
200
|
|
|
127
201
|
return mach.hash();
|
|
128
202
|
}
|