@arbitrum/nitro-contracts 3.0.0-alpha.0 → 3.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
  3. package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
  4. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
  5. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
  6. package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +1 -1
  7. package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
  8. package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +1 -1
  9. package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
  10. package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
  11. package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +1 -1
  12. package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
  13. package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
  14. package/build/contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
  15. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
  16. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.dbg.json +1 -1
  17. package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
  18. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
  19. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  20. package/build/contracts/@openzeppelin/contracts/utils/Create2.sol/Create2.dbg.json +1 -1
  21. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
  22. package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
  23. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
  24. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +1 -1
  25. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  26. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  27. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
  28. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  29. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  30. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/Create2Upgradeable.sol/Create2Upgradeable.dbg.json +1 -1
  31. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
  32. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
  33. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
  34. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
  35. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol/EnumerableSetUpgradeable.dbg.json +1 -1
  36. package/build/contracts/src/assertionStakingPool/AbsBoldStakingPool.sol/AbsBoldStakingPool.dbg.json +1 -1
  37. package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.dbg.json +1 -1
  38. package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.json +2 -2
  39. package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.dbg.json +1 -1
  40. package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.json +2 -2
  41. package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.dbg.json +1 -1
  42. package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.json +2 -2
  43. package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.dbg.json +1 -1
  44. package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.json +2 -2
  45. package/build/contracts/src/assertionStakingPool/StakingPoolCreatorUtils.sol/StakingPoolCreatorUtils.dbg.json +1 -1
  46. package/build/contracts/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol/IAbsBoldStakingPool.dbg.json +1 -1
  47. package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol/IAssertionStakingPool.dbg.json +1 -1
  48. package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol/IAssertionStakingPoolCreator.dbg.json +1 -1
  49. package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol/IEdgeStakingPool.dbg.json +1 -1
  50. package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol/IEdgeStakingPoolCreator.dbg.json +1 -1
  51. package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
  52. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
  53. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.json +7 -7
  54. package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
  55. package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  56. package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -2
  57. package/build/contracts/src/bridge/DelayBuffer.sol/DelayBuffer.dbg.json +1 -1
  58. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
  59. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +2 -2
  60. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
  61. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +9 -9
  62. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
  63. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.json +2 -2
  64. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
  65. package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
  66. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
  67. package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
  68. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
  69. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.json +1 -1
  70. package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
  71. package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
  72. package/build/contracts/src/bridge/IInbox.sol/IInbox.json +1 -1
  73. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
  74. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.json +1 -1
  75. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
  76. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
  77. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
  78. package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
  79. package/build/contracts/src/bridge/Inbox.sol/Inbox.json +9 -9
  80. package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
  81. package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
  82. package/build/contracts/src/bridge/Outbox.sol/Outbox.json +2 -2
  83. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
  84. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +5 -5
  85. package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +1 -1
  86. package/build/contracts/src/chain/CacheManager.sol/CacheManager.json +2 -2
  87. package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.dbg.json +1 -1
  88. package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.json +2 -2
  89. package/build/contracts/src/challengeV2/IAssertionChain.sol/IAssertionChain.dbg.json +1 -1
  90. package/build/contracts/src/challengeV2/IEdgeChallengeManager.sol/IEdgeChallengeManager.dbg.json +4 -0
  91. package/build/contracts/src/challengeV2/{EdgeChallengeManager.sol → IEdgeChallengeManager.sol}/IEdgeChallengeManager.json +1 -1
  92. package/build/contracts/src/challengeV2/libraries/ArrayUtilsLib.sol/ArrayUtilsLib.dbg.json +1 -1
  93. package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.dbg.json +1 -1
  94. package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.json +2 -2
  95. package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.dbg.json +1 -1
  96. package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.json +2 -2
  97. package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.dbg.json +1 -1
  98. package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.json +2 -2
  99. package/build/contracts/src/challengeV2/libraries/UintUtilsLib.sol/UintUtilsLib.dbg.json +1 -1
  100. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
  101. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
  102. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
  103. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
  104. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.json +2 -2
  105. package/build/contracts/src/libraries/CallerChecker.sol/CallerChecker.dbg.json +4 -0
  106. package/build/contracts/src/libraries/CallerChecker.sol/CallerChecker.json +10 -0
  107. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
  108. package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.dbg.json +1 -1
  109. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
  110. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
  111. package/build/contracts/src/libraries/GasRefundEnabled.sol/GasRefundEnabled.dbg.json +1 -1
  112. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
  113. package/build/contracts/src/libraries/IReader4844.sol/IReader4844.dbg.json +1 -1
  114. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
  115. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.json +2 -2
  116. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
  117. package/build/contracts/src/mocks/Benchmarks.sol/Benchmarks.dbg.json +1 -1
  118. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
  119. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +2 -2
  120. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
  121. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -2
  122. package/build/contracts/src/mocks/CreateTest.sol/CreateTest.dbg.json +4 -0
  123. package/build/contracts/src/mocks/CreateTest.sol/CreateTest.json +15 -0
  124. package/build/contracts/src/mocks/HostioTest.sol/HostioTest.dbg.json +4 -0
  125. package/build/contracts/src/mocks/HostioTest.sol/HostioTest.json +513 -0
  126. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
  127. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +2 -2
  128. package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.dbg.json +1 -1
  129. package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.json +2 -2
  130. package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.dbg.json +1 -1
  131. package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.json +2 -2
  132. package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.dbg.json +1 -1
  133. package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.dbg.json +1 -1
  134. package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.json +2 -2
  135. package/build/contracts/src/mocks/Program.sol/ProgramTest.dbg.json +1 -1
  136. package/build/contracts/src/mocks/Program.sol/ProgramTest.json +2 -2
  137. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
  138. package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.dbg.json +1 -1
  139. package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.dbg.json +1 -1
  140. package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.json +5 -5
  141. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
  142. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +5 -5
  143. package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
  144. package/build/contracts/src/mocks/Simple.sol/Simple.json +2 -2
  145. package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +1 -1
  146. package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.dbg.json +1 -1
  147. package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.json +2 -2
  148. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
  149. package/build/contracts/src/mocks/TestWETH9.sol/IWETH9.dbg.json +1 -1
  150. package/build/contracts/src/mocks/TestWETH9.sol/TestWETH9.dbg.json +1 -1
  151. package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
  152. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
  153. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
  154. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
  155. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
  156. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
  157. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
  158. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
  159. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
  160. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
  161. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
  162. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
  163. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
  164. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
  165. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
  166. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
  167. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
  168. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
  169. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
  170. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
  171. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
  172. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
  173. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
  174. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
  175. package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.dbg.json +1 -1
  176. package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.json +4 -4
  177. package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.dbg.json +1 -1
  178. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
  179. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
  180. package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
  181. package/build/contracts/src/rollup/Assertion.sol/AssertionNodeLib.dbg.json +1 -1
  182. package/build/contracts/src/rollup/AssertionState.sol/AssertionStateLib.dbg.json +1 -1
  183. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.dbg.json +1 -1
  184. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.json +2 -2
  185. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.dbg.json +1 -1
  186. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.json +2 -2
  187. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.dbg.json +1 -1
  188. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollupAdmin.dbg.json +1 -1
  189. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ISeqInboxPostUpgradeInit.dbg.json +1 -1
  190. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.dbg.json +1 -1
  191. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.json +2 -2
  192. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.dbg.json +1 -1
  193. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.json +2 -2
  194. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
  195. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +2 -2
  196. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
  197. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +2 -2
  198. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
  199. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.json +2 -2
  200. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/FactoryDeployerHelper.dbg.json +1 -1
  201. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IDeployHelper.dbg.json +1 -1
  202. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20.dbg.json +1 -1
  203. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20Bridge.dbg.json +1 -1
  204. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IInboxBase.dbg.json +1 -1
  205. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
  206. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
  207. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
  208. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
  209. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
  210. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +2 -2
  211. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
  212. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
  213. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +2 -2
  214. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
  215. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +2 -2
  216. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
  217. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +2 -2
  218. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
  219. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +2 -2
  220. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
  221. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +2 -2
  222. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
  223. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +2 -2
  224. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
  225. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +2 -2
  226. package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
  227. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
  228. package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
  229. package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
  230. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
  231. package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
  232. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
  233. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
  234. package/build/contracts/src/state/MultiStack.sol/MultiStackLib.dbg.json +1 -1
  235. package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
  236. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
  237. package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
  238. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
  239. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
  240. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
  241. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +2 -2
  242. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
  243. package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
  244. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
  245. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
  246. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +2 -2
  247. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
  248. package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
  249. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
  250. package/out/yul/Reader4844.yul/Reader4844.json +1 -1
  251. package/package.json +1 -1
  252. package/src/bridge/AbsInbox.sol +10 -4
  253. package/src/bridge/IInboxBase.sol +6 -2
  254. package/src/bridge/Inbox.sol +3 -0
  255. package/src/bridge/SequencerInbox.sol +10 -11
  256. package/src/challengeV2/EdgeChallengeManager.sol +1 -225
  257. package/src/challengeV2/IAssertionChain.sol +1 -1
  258. package/src/challengeV2/IEdgeChallengeManager.sol +233 -0
  259. package/src/challengeV2/libraries/ChallengeEdgeLib.sol +1 -57
  260. package/src/challengeV2/libraries/EdgeChallengeManagerLib.sol +2 -113
  261. package/src/challengeV2/libraries/Structs.sol +176 -0
  262. package/src/libraries/CallerChecker.sol +18 -0
  263. package/src/libraries/Error.sol +3 -0
  264. package/src/libraries/GasRefundEnabled.sol +2 -2
  265. package/src/mocks/CreateTest.sol +44 -0
  266. package/src/mocks/HostioTest.sol +200 -0
  267. package/src/precompiles/ArbSys.sol +2 -1
  268. package/src/precompiles/ArbWasm.sol +1 -1
  269. package/src/rollup/IRollupCore.sol +1 -1
  270. package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/IEdgeChallengeManager.dbg.json +0 -4
@@ -0,0 +1,233 @@
1
+ // Copyright 2023, Offchain Labs, Inc.
2
+ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE
3
+ // SPDX-License-Identifier: BUSL-1.1
4
+ //
5
+ pragma solidity ^0.8.0;
6
+
7
+ import "./IAssertionChain.sol";
8
+ import "./libraries/Structs.sol";
9
+ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
10
+
11
+ /// @title EdgeChallengeManager interface
12
+ interface IEdgeChallengeManager {
13
+ /// @notice Initialize the EdgeChallengeManager. EdgeChallengeManagers are upgradeable
14
+ /// so use the initializer paradigm
15
+ /// @param _assertionChain The assertion chain contract
16
+ /// @param _challengePeriodBlocks The amount of cumulative time an edge must spend unrivaled before it can be confirmed
17
+ /// This should be the censorship period + the cumulative amount of time needed to do any
18
+ /// offchain calculation. We currently estimate around 10 mins for each layer zero edge and 1
19
+ /// one minute for each other edge.
20
+ /// @param _oneStepProofEntry The one step proof logic
21
+ /// @param layerZeroBlockEdgeHeight The end height of layer zero edges of type Block
22
+ /// @param layerZeroBigStepEdgeHeight The end height of layer zero edges of type BigStep
23
+ /// @param layerZeroSmallStepEdgeHeight The end height of layer zero edges of type SmallStep
24
+ /// @param _stakeToken The token that stake will be provided in when creating zero layer block edges
25
+ /// @param _excessStakeReceiver The address that excess stake will be sent to when 2nd+ block edge is created
26
+ /// @param _numBigStepLevel The number of bigstep levels
27
+ /// @param _stakeAmounts The stake amount for each level. (first element is for block level)
28
+ function initialize(
29
+ IAssertionChain _assertionChain,
30
+ uint64 _challengePeriodBlocks,
31
+ IOneStepProofEntry _oneStepProofEntry,
32
+ uint256 layerZeroBlockEdgeHeight,
33
+ uint256 layerZeroBigStepEdgeHeight,
34
+ uint256 layerZeroSmallStepEdgeHeight,
35
+ IERC20 _stakeToken,
36
+ address _excessStakeReceiver,
37
+ uint8 _numBigStepLevel,
38
+ uint256[] calldata _stakeAmounts
39
+ ) external;
40
+
41
+ function challengePeriodBlocks() external view returns (uint64);
42
+
43
+ /// @notice The one step proof resolver used to decide between rival SmallStep edges of length 1
44
+ function oneStepProofEntry() external view returns (IOneStepProofEntry);
45
+
46
+ /// @notice Performs necessary checks and creates a new layer zero edge
47
+ /// @param args Edge creation args
48
+ function createLayerZeroEdge(
49
+ CreateEdgeArgs calldata args
50
+ ) external returns (bytes32);
51
+
52
+ /// @notice Bisect an edge. This creates two child edges:
53
+ /// lowerChild: has the same start root and height as this edge, but a different end root and height
54
+ /// upperChild: has the same end root and height as this edge, but a different start root and height
55
+ /// The lower child end root and height are equal to the upper child start root and height. This height
56
+ /// is the mandatoryBisectionHeight.
57
+ /// The lower child may already exist, however it's not possible for the upper child to exist as that would
58
+ /// mean that the edge has already been bisected
59
+ /// @param edgeId Edge to bisect
60
+ /// @param bisectionHistoryRoot The new history root to be used in the lower and upper children
61
+ /// @param prefixProof A proof to show that the bisectionHistoryRoot commits to a prefix of the current endHistoryRoot
62
+ /// @return lowerChildId The id of the newly created lower child edge
63
+ /// @return upperChildId The id of the newly created upper child edge
64
+ function bisectEdge(
65
+ bytes32 edgeId,
66
+ bytes32 bisectionHistoryRoot,
67
+ bytes calldata prefixProof
68
+ ) external returns (bytes32, bytes32);
69
+
70
+ /// @notice An edge can be confirmed if the total amount of time it and a single chain of its direct ancestors
71
+ /// has spent unrivaled is greater than the challenge period.
72
+ /// @dev Edges inherit time from their parents, so the sum of unrivaled timers is compared against the threshold.
73
+ /// Given that an edge cannot become unrivaled after becoming rivaled, once the threshold is passed
74
+ /// it will always remain passed. The direct ancestors of an edge are linked by parent-child links for edges
75
+ /// of the same level, and claimId-edgeId links for zero layer edges that claim an edge in the level below.
76
+ /// This method also includes the amount of time the assertion being claimed spent without a sibling
77
+ /// @param edgeId The id of the edge to confirm
78
+ function confirmEdgeByTime(
79
+ bytes32 edgeId,
80
+ AssertionStateData calldata claimStateData
81
+ ) external;
82
+
83
+ /// @notice Update multiple edges' timer cache by their children. Equivalent to calling updateTimerCacheByChildren for each edge.
84
+ /// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
85
+ /// Revert when the last edge's timer cache is already equal to or above maximumCachedTime.
86
+ /// @param edgeIds The ids of the edges to update
87
+ /// @param maximumCachedTime The maximum amount of cached time allowed on the last edge (β∗)
88
+ function multiUpdateTimeCacheByChildren(
89
+ bytes32[] calldata edgeIds,
90
+ uint256 maximumCachedTime
91
+ ) external;
92
+
93
+ /// @notice Update an edge's timer cache by its children.
94
+ /// Sets the edge's timer cache to its timeUnrivaled + (minimum timer cache of its children).
95
+ /// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
96
+ /// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
97
+ /// @param edgeId The id of the edge to update
98
+ /// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
99
+ function updateTimerCacheByChildren(bytes32 edgeId, uint256 maximumCachedTime) external;
100
+
101
+ /// @notice Given a one step fork edge and an edge with matching claim id,
102
+ /// set the one step fork edge's timer cache to its timeUnrivaled + claiming edge's timer cache.
103
+ /// May update timer cache above maximum if the last edge's timer cache was below maximumCachedTime.
104
+ /// Revert when the edge's timer cache is already equal to or above maximumCachedTime.
105
+ /// @param edgeId The id of the edge to update
106
+ /// @param claimingEdgeId The id of the edge which has a claimId equal to edgeId
107
+ /// @param maximumCachedTime The maximum amount of cached time allowed on the edge (β∗)
108
+ function updateTimerCacheByClaim(
109
+ bytes32 edgeId,
110
+ bytes32 claimingEdgeId,
111
+ uint256 maximumCachedTime
112
+ ) external;
113
+
114
+ /// @notice Confirm an edge by executing a one step proof
115
+ /// @dev One step proofs can only be executed against edges that have length one and of type SmallStep
116
+ /// @param edgeId The id of the edge to confirm
117
+ /// @param oneStepData Input data to the one step proof
118
+ /// @param prevConfig Data about the config set in prev
119
+ /// @param beforeHistoryInclusionProof Proof that the state which is the start of the edge is committed to by the startHistoryRoot
120
+ /// @param afterHistoryInclusionProof Proof that the state which is the end of the edge is committed to by the endHistoryRoot
121
+ function confirmEdgeByOneStepProof(
122
+ bytes32 edgeId,
123
+ OneStepData calldata oneStepData,
124
+ ConfigData calldata prevConfig,
125
+ bytes32[] calldata beforeHistoryInclusionProof,
126
+ bytes32[] calldata afterHistoryInclusionProof
127
+ ) external;
128
+
129
+ /// @notice When zero layer block edges are created a stake is also provided
130
+ /// The stake on this edge can be refunded if the edge is confirme
131
+ function refundStake(
132
+ bytes32 edgeId
133
+ ) external;
134
+
135
+ /// @notice Zero layer edges have to be a fixed height.
136
+ /// This function returns the end height for a given edge type
137
+ function getLayerZeroEndHeight(
138
+ EdgeType eType
139
+ ) external view returns (uint256);
140
+
141
+ /// @notice Calculate the unique id of an edge
142
+ /// @param level The level of the edge
143
+ /// @param originId The origin id of the edge
144
+ /// @param startHeight The start height of the edge
145
+ /// @param startHistoryRoot The start history root of the edge
146
+ /// @param endHeight The end height of the edge
147
+ /// @param endHistoryRoot The end history root of the edge
148
+ function calculateEdgeId(
149
+ uint8 level,
150
+ bytes32 originId,
151
+ uint256 startHeight,
152
+ bytes32 startHistoryRoot,
153
+ uint256 endHeight,
154
+ bytes32 endHistoryRoot
155
+ ) external pure returns (bytes32);
156
+
157
+ /// @notice Calculate the mutual id of the edge
158
+ /// Edges that are rivals share the same mutual id
159
+ /// @param level The level of the edge
160
+ /// @param originId The origin id of the edge
161
+ /// @param startHeight The start height of the edge
162
+ /// @param startHistoryRoot The start history root of the edge
163
+ /// @param endHeight The end height of the edge
164
+ function calculateMutualId(
165
+ uint8 level,
166
+ bytes32 originId,
167
+ uint256 startHeight,
168
+ bytes32 startHistoryRoot,
169
+ uint256 endHeight
170
+ ) external pure returns (bytes32);
171
+
172
+ /// @notice Has the edge already been stored in the manager
173
+ function edgeExists(
174
+ bytes32 edgeId
175
+ ) external view returns (bool);
176
+
177
+ /// @notice Get full edge data for an edge
178
+ function getEdge(
179
+ bytes32 edgeId
180
+ ) external view returns (ChallengeEdge memory);
181
+
182
+ /// @notice The length of the edge, from start height to end height
183
+ function edgeLength(
184
+ bytes32 edgeId
185
+ ) external view returns (uint256);
186
+
187
+ /// @notice Does this edge currently have one or more rivals
188
+ /// Rival edges share the same mutual id
189
+ function hasRival(
190
+ bytes32 edgeId
191
+ ) external view returns (bool);
192
+
193
+ /// @notice The confirmed rival of this mutual id
194
+ /// Returns 0 if one does not exist
195
+ function confirmedRival(
196
+ bytes32 mutualId
197
+ ) external view returns (bytes32);
198
+
199
+ /// @notice Does the edge have at least one rival, and it has length one
200
+ function hasLengthOneRival(
201
+ bytes32 edgeId
202
+ ) external view returns (bool);
203
+
204
+ /// @notice The amount of time this edge has spent without rivals
205
+ /// This value is increasing whilst an edge is unrivaled, once a rival is created
206
+ /// it is fixed. If an edge has rivals from the moment it is created then it will have
207
+ /// a zero time unrivaled
208
+ function timeUnrivaled(
209
+ bytes32 edgeId
210
+ ) external view returns (uint256);
211
+
212
+ /// @notice Get the id of the prev assertion that this edge is originates from
213
+ /// @dev Uses the parent chain to traverse upwards SmallStep->BigStep->Block->Assertion
214
+ /// until it gets to the origin assertion
215
+ function getPrevAssertionHash(
216
+ bytes32 edgeId
217
+ ) external view returns (bytes32);
218
+
219
+ /// @notice Fetch the raw first rival record for the given mutual id
220
+ /// @dev Returns 0 if there is no edge with the given mutual id
221
+ /// Returns a magic value if there is one edge but it is unrivaled
222
+ /// Returns the id of the second edge created with the mutual id, if > 1 exists
223
+ function firstRival(
224
+ bytes32 mutualId
225
+ ) external view returns (bytes32);
226
+
227
+ /// @notice True if an account has made a layer zero edge with the given mutual id.
228
+ /// This is only tracked when the validator whitelist is enabled
229
+ function hasMadeLayerZeroRival(
230
+ address account,
231
+ bytes32 mutualId
232
+ ) external view returns (bool);
233
+ }
@@ -6,63 +6,7 @@ pragma solidity ^0.8.17;
6
6
 
7
7
  import "./Enums.sol";
8
8
  import "./ChallengeErrors.sol";
9
-
10
- /// @notice An edge committing to a range of states. These edges will be bisected, slowly
11
- /// reducing them in length until they reach length one. At that point new edges of a different
12
- /// level will be added that claim the result of this edge, or a one step proof will be calculated
13
- /// if the edge level is already of type SmallStep.
14
- struct ChallengeEdge {
15
- /// @notice The origin id is a link from the edge to an edge or assertion at a lower level.
16
- /// Intuitively all edges with the same origin id agree on the information committed to in the origin id
17
- /// For a SmallStep edge the origin id is the 'mutual' id of the length one BigStep edge being claimed by the zero layer ancestors of this edge
18
- /// For a BigStep edge the origin id is the 'mutual' id of the length one Block edge being claimed by the zero layer ancestors of this edge
19
- /// For a Block edge the origin id is the assertion hash of the assertion that is the root of the challenge - all edges in this challenge agree
20
- /// that that assertion hash is valid.
21
- /// The purpose of the origin id is to ensure that only edges that agree on a common start position
22
- /// are being compared against one another.
23
- bytes32 originId;
24
- /// @notice A root of all the states in the history up to the startHeight
25
- bytes32 startHistoryRoot;
26
- /// @notice The height of the start history root
27
- uint256 startHeight;
28
- /// @notice A root of all the states in the history up to the endHeight. Since endHeight > startHeight, the startHistoryRoot must
29
- /// commit to a prefix of the states committed to by the endHistoryRoot
30
- bytes32 endHistoryRoot;
31
- /// @notice The height of the end history root
32
- uint256 endHeight;
33
- /// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
34
- /// lower child is populated here, until that time this value is 0. The lower child has startHistoryRoot and startHeight
35
- /// equal to this edge, but endHistoryRoot and endHeight equal to some prefix of the endHistoryRoot of this edge
36
- bytes32 lowerChildId;
37
- /// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
38
- /// upper child is populated here, until that time this value is 0. The upper child has startHistoryRoot and startHeight
39
- /// equal to some prefix of the endHistoryRoot of this edge, and endHistoryRoot and endHeight equal to this edge
40
- bytes32 upperChildId;
41
- /// @notice The edge or assertion in the upper level that this edge claims to be true.
42
- /// Only populated on zero layer edges
43
- bytes32 claimId;
44
- /// @notice The entity that supplied a mini-stake accompanying this edge
45
- /// Only populated on zero layer edges
46
- address staker;
47
- /// @notice The block number when this edge was created
48
- uint64 createdAtBlock;
49
- /// @notice The block number at which this edge was confirmed
50
- /// Zero if not confirmed
51
- uint64 confirmedAtBlock;
52
- /// @notice Current status of this edge. All edges are created Pending, and may be updated to Confirmed
53
- /// Once Confirmed they cannot transition back to Pending
54
- EdgeStatus status;
55
- /// @notice The level of this edge.
56
- /// Level 0 is type Block
57
- /// Last level (defined by NUM_BIGSTEP_LEVEL + 1) is type SmallStep
58
- /// All levels in between are of type BigStep
59
- uint8 level;
60
- /// @notice Set to true when the staker has been refunded. Can only be set to true if the status is Confirmed
61
- /// and the staker is non zero.
62
- bool refunded;
63
- /// @notice TODO
64
- uint64 totalTimeUnrivaledCache;
65
- }
9
+ import "./Structs.sol";
66
10
 
67
11
  library ChallengeEdgeLib {
68
12
  /// @notice Common checks to do when adding an edge
@@ -8,124 +8,13 @@ import "./UintUtilsLib.sol";
8
8
  import "./MerkleTreeAccumulatorLib.sol";
9
9
  import "./ChallengeEdgeLib.sol";
10
10
  import "../../osp/IOneStepProofEntry.sol";
11
- import "../../rollup/AssertionState.sol";
12
11
  import "../../libraries/Constants.sol";
13
12
  import "./ChallengeErrors.sol";
14
-
15
- /// @notice An execution state and proof to show that it's valid
16
- struct AssertionStateData {
17
- /// @notice An execution state
18
- AssertionState assertionState;
19
- /// @notice assertion Hash of the prev assertion
20
- bytes32 prevAssertionHash;
21
- /// @notice Inbox accumulator of the assertion
22
- bytes32 inboxAcc;
23
- }
24
-
25
- /// @notice Data for creating a layer zero edge
26
- struct CreateEdgeArgs {
27
- /// @notice The level of edge to be created. Challenges are decomposed into multiple levels.
28
- /// The first (level 0) being of type Block, followed by n (set by NUM_BIGSTEP_LEVEL) levels of type BigStep, and finally
29
- /// followed by a single level of type SmallStep. Each level is bisected until an edge
30
- /// of length one is reached before proceeding to the next level. The first edge in each level (the layer zero edge)
31
- /// makes a claim about an assertion or assertion in the lower level.
32
- /// Finally in the last level, a SmallStep edge is added that claims a lower level length one BigStep edge, and these
33
- /// SmallStep edges are bisected until they reach length one. A length one small step edge
34
- /// can then be directly executed using a one-step proof.
35
- uint8 level;
36
- /// @notice The end history root of the edge to be created
37
- bytes32 endHistoryRoot;
38
- /// @notice The end height of the edge to be created.
39
- /// @dev End height is deterministic for different levels but supplying it here gives the
40
- /// caller a bit of extra security that they are supplying data for the correct level of edge
41
- uint256 endHeight;
42
- /// @notice The edge, or assertion, that is being claimed correct by the newly created edge.
43
- bytes32 claimId;
44
- /// @notice Proof that the start history root commits to a prefix of the states that
45
- /// end history root commits to
46
- bytes prefixProof;
47
- /// @notice Edge type specific data
48
- /// For Block type edges this is the abi encoding of:
49
- /// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
50
- /// AssertionStateData: the before state of the edge
51
- /// AssertionStateData: the after state of the edge
52
- /// bytes32 predecessorId: id of the prev assertion
53
- /// bytes32 inboxAcc: the inbox accumulator of the assertion
54
- /// For BigStep and SmallStep edges this is the abi encoding of:
55
- /// bytes32: Start state - first state the edge commits to
56
- /// bytes32: End state - last state the edge commits to
57
- /// bytes32[]: Claim start inclusion proof - proof to show the start state is the first state in the claim edge
58
- /// bytes32[]: Claim end inclusion proof - proof to show the end state is the last state in the claim edge
59
- /// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
60
- bytes proof;
61
- }
62
-
63
- /// @notice Data parsed raw proof data
64
- struct ProofData {
65
- /// @notice The first state being committed to by an edge
66
- bytes32 startState;
67
- /// @notice The last state being committed to by an edge
68
- bytes32 endState;
69
- /// @notice A proof that the end state is included in the edge
70
- bytes32[] inclusionProof;
71
- }
72
-
73
- /// @notice Stores all edges and their rival status
74
- struct EdgeStore {
75
- /// @notice A mapping of edge id to edges. Edges are never deleted, only created, and potentially confirmed.
76
- mapping(bytes32 => ChallengeEdge) edges;
77
- /// @notice A mapping of mutualId to edge id. Rivals share the same mutual id, and here we
78
- /// store the edge id of the second edge that was created with the same mutual id - the first rival
79
- /// When only one edge exists for a specific mutual id then a special magic string hash is stored instead
80
- /// of the first rival id, to signify that a single edge does exist with this mutual id
81
- mapping(bytes32 => bytes32) firstRivals;
82
- /// @notice A mapping of mutualId to the edge id of the confirmed rival with that mutualId
83
- /// @dev Each group of rivals (edges sharing mutual id) can only have at most one confirmed edge
84
- mapping(bytes32 => bytes32) confirmedRivals;
85
- /// @notice A mapping of account -> mutualId -> bool indicating if the account has created a layer zero edge with a mutual id
86
- mapping(address => mapping(bytes32 => bool)) hasMadeLayerZeroRival;
87
- }
88
-
89
- /// @notice Input data to a one step proof
90
- struct OneStepData {
91
- /// @notice The hash of the state that's being executed from
92
- bytes32 beforeHash;
93
- /// @notice Proof data to accompany the execution context
94
- bytes proof;
95
- }
96
-
97
- /// @notice Data about a recently added edge
98
- struct EdgeAddedData {
99
- bytes32 edgeId;
100
- bytes32 mutualId;
101
- bytes32 originId;
102
- bytes32 claimId;
103
- uint256 length;
104
- uint8 level;
105
- bool hasRival;
106
- bool isLayerZero;
107
- }
108
-
109
- /// @notice Data about an assertion that is being claimed by an edge
110
- /// @dev This extra information that is needed in order to verify that a block edge can be created
111
- struct AssertionReferenceData {
112
- /// @notice The id of the assertion - will be used in a sanity check
113
- bytes32 assertionHash;
114
- /// @notice The predecessor of the assertion
115
- bytes32 predecessorId;
116
- /// @notice Is the assertion pending
117
- bool isPending;
118
- /// @notice Does the assertion have a sibling
119
- bool hasSibling;
120
- /// @notice The execution state of the predecessor assertion
121
- AssertionState startState;
122
- /// @notice The execution state of the assertion being claimed
123
- AssertionState endState;
124
- }
125
-
13
+ import "./Structs.sol";
126
14
  /// @title Core functionality for the Edge Challenge Manager
127
15
  /// @notice The edge manager library allows edges to be added and bisected, and keeps track of the amount
128
16
  /// of time an edge remained unrivaled.
17
+
129
18
  library EdgeChallengeManagerLib {
130
19
  using ChallengeEdgeLib for ChallengeEdge;
131
20
  using GlobalStateLib for GlobalState;
@@ -0,0 +1,176 @@
1
+ // Copyright 2023, Offchain Labs, Inc.
2
+ // For license information, see https://github.com/offchainlabs/bold/blob/main/LICENSE
3
+ // SPDX-License-Identifier: BUSL-1.1
4
+ //
5
+ pragma solidity ^0.8.0;
6
+
7
+ import "./Enums.sol";
8
+ import "../../rollup/AssertionState.sol";
9
+
10
+ /// @notice An execution state and proof to show that it's valid
11
+ struct AssertionStateData {
12
+ /// @notice An execution state
13
+ AssertionState assertionState;
14
+ /// @notice assertion Hash of the prev assertion
15
+ bytes32 prevAssertionHash;
16
+ /// @notice Inbox accumulator of the assertion
17
+ bytes32 inboxAcc;
18
+ }
19
+
20
+ /// @notice Data for creating a layer zero edge
21
+ struct CreateEdgeArgs {
22
+ /// @notice The level of edge to be created. Challenges are decomposed into multiple levels.
23
+ /// The first (level 0) being of type Block, followed by n (set by NUM_BIGSTEP_LEVEL) levels of type BigStep, and finally
24
+ /// followed by a single level of type SmallStep. Each level is bisected until an edge
25
+ /// of length one is reached before proceeding to the next level. The first edge in each level (the layer zero edge)
26
+ /// makes a claim about an assertion or assertion in the lower level.
27
+ /// Finally in the last level, a SmallStep edge is added that claims a lower level length one BigStep edge, and these
28
+ /// SmallStep edges are bisected until they reach length one. A length one small step edge
29
+ /// can then be directly executed using a one-step proof.
30
+ uint8 level;
31
+ /// @notice The end history root of the edge to be created
32
+ bytes32 endHistoryRoot;
33
+ /// @notice The end height of the edge to be created.
34
+ /// @dev End height is deterministic for different levels but supplying it here gives the
35
+ /// caller a bit of extra security that they are supplying data for the correct level of edge
36
+ uint256 endHeight;
37
+ /// @notice The edge, or assertion, that is being claimed correct by the newly created edge.
38
+ bytes32 claimId;
39
+ /// @notice Proof that the start history root commits to a prefix of the states that
40
+ /// end history root commits to
41
+ bytes prefixProof;
42
+ /// @notice Edge type specific data
43
+ /// For Block type edges this is the abi encoding of:
44
+ /// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
45
+ /// AssertionStateData: the before state of the edge
46
+ /// AssertionStateData: the after state of the edge
47
+ /// bytes32 predecessorId: id of the prev assertion
48
+ /// bytes32 inboxAcc: the inbox accumulator of the assertion
49
+ /// For BigStep and SmallStep edges this is the abi encoding of:
50
+ /// bytes32: Start state - first state the edge commits to
51
+ /// bytes32: End state - last state the edge commits to
52
+ /// bytes32[]: Claim start inclusion proof - proof to show the start state is the first state in the claim edge
53
+ /// bytes32[]: Claim end inclusion proof - proof to show the end state is the last state in the claim edge
54
+ /// bytes32[]: Inclusion proof - proof to show that the end state is the last state in the end history root
55
+ bytes proof;
56
+ }
57
+
58
+ /// @notice Data parsed raw proof data
59
+ struct ProofData {
60
+ /// @notice The first state being committed to by an edge
61
+ bytes32 startState;
62
+ /// @notice The last state being committed to by an edge
63
+ bytes32 endState;
64
+ /// @notice A proof that the end state is included in the edge
65
+ bytes32[] inclusionProof;
66
+ }
67
+
68
+ /// @notice Stores all edges and their rival status
69
+ struct EdgeStore {
70
+ /// @notice A mapping of edge id to edges. Edges are never deleted, only created, and potentially confirmed.
71
+ mapping(bytes32 => ChallengeEdge) edges;
72
+ /// @notice A mapping of mutualId to edge id. Rivals share the same mutual id, and here we
73
+ /// store the edge id of the second edge that was created with the same mutual id - the first rival
74
+ /// When only one edge exists for a specific mutual id then a special magic string hash is stored instead
75
+ /// of the first rival id, to signify that a single edge does exist with this mutual id
76
+ mapping(bytes32 => bytes32) firstRivals;
77
+ /// @notice A mapping of mutualId to the edge id of the confirmed rival with that mutualId
78
+ /// @dev Each group of rivals (edges sharing mutual id) can only have at most one confirmed edge
79
+ mapping(bytes32 => bytes32) confirmedRivals;
80
+ /// @notice A mapping of account -> mutualId -> bool indicating if the account has created a layer zero edge with a mutual id
81
+ mapping(address => mapping(bytes32 => bool)) hasMadeLayerZeroRival;
82
+ }
83
+
84
+ /// @notice Input data to a one step proof
85
+ struct OneStepData {
86
+ /// @notice The hash of the state that's being executed from
87
+ bytes32 beforeHash;
88
+ /// @notice Proof data to accompany the execution context
89
+ bytes proof;
90
+ }
91
+
92
+ /// @notice Data about a recently added edge
93
+ struct EdgeAddedData {
94
+ bytes32 edgeId;
95
+ bytes32 mutualId;
96
+ bytes32 originId;
97
+ bytes32 claimId;
98
+ uint256 length;
99
+ uint8 level;
100
+ bool hasRival;
101
+ bool isLayerZero;
102
+ }
103
+
104
+ /// @notice Data about an assertion that is being claimed by an edge
105
+ /// @dev This extra information that is needed in order to verify that a block edge can be created
106
+ struct AssertionReferenceData {
107
+ /// @notice The id of the assertion - will be used in a sanity check
108
+ bytes32 assertionHash;
109
+ /// @notice The predecessor of the assertion
110
+ bytes32 predecessorId;
111
+ /// @notice Is the assertion pending
112
+ bool isPending;
113
+ /// @notice Does the assertion have a sibling
114
+ bool hasSibling;
115
+ /// @notice The execution state of the predecessor assertion
116
+ AssertionState startState;
117
+ /// @notice The execution state of the assertion being claimed
118
+ AssertionState endState;
119
+ }
120
+
121
+ /// @notice An edge committing to a range of states. These edges will be bisected, slowly
122
+ /// reducing them in length until they reach length one. At that point new edges of a different
123
+ /// level will be added that claim the result of this edge, or a one step proof will be calculated
124
+ /// if the edge level is already of type SmallStep.
125
+ struct ChallengeEdge {
126
+ /// @notice The origin id is a link from the edge to an edge or assertion at a lower level.
127
+ /// Intuitively all edges with the same origin id agree on the information committed to in the origin id
128
+ /// For a SmallStep edge the origin id is the 'mutual' id of the length one BigStep edge being claimed by the zero layer ancestors of this edge
129
+ /// For a BigStep edge the origin id is the 'mutual' id of the length one Block edge being claimed by the zero layer ancestors of this edge
130
+ /// For a Block edge the origin id is the assertion hash of the assertion that is the root of the challenge - all edges in this challenge agree
131
+ /// that that assertion hash is valid.
132
+ /// The purpose of the origin id is to ensure that only edges that agree on a common start position
133
+ /// are being compared against one another.
134
+ bytes32 originId;
135
+ /// @notice A root of all the states in the history up to the startHeight
136
+ bytes32 startHistoryRoot;
137
+ /// @notice The height of the start history root
138
+ uint256 startHeight;
139
+ /// @notice A root of all the states in the history up to the endHeight. Since endHeight > startHeight, the startHistoryRoot must
140
+ /// commit to a prefix of the states committed to by the endHistoryRoot
141
+ bytes32 endHistoryRoot;
142
+ /// @notice The height of the end history root
143
+ uint256 endHeight;
144
+ /// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
145
+ /// lower child is populated here, until that time this value is 0. The lower child has startHistoryRoot and startHeight
146
+ /// equal to this edge, but endHistoryRoot and endHeight equal to some prefix of the endHistoryRoot of this edge
147
+ bytes32 lowerChildId;
148
+ /// @notice Edges can be bisected into two children. If this edge has been bisected the id of the
149
+ /// upper child is populated here, until that time this value is 0. The upper child has startHistoryRoot and startHeight
150
+ /// equal to some prefix of the endHistoryRoot of this edge, and endHistoryRoot and endHeight equal to this edge
151
+ bytes32 upperChildId;
152
+ /// @notice The edge or assertion in the upper level that this edge claims to be true.
153
+ /// Only populated on zero layer edges
154
+ bytes32 claimId;
155
+ /// @notice The entity that supplied a mini-stake accompanying this edge
156
+ /// Only populated on zero layer edges
157
+ address staker;
158
+ /// @notice The block number when this edge was created
159
+ uint64 createdAtBlock;
160
+ /// @notice The block number at which this edge was confirmed
161
+ /// Zero if not confirmed
162
+ uint64 confirmedAtBlock;
163
+ /// @notice Current status of this edge. All edges are created Pending, and may be updated to Confirmed
164
+ /// Once Confirmed they cannot transition back to Pending
165
+ EdgeStatus status;
166
+ /// @notice The level of this edge.
167
+ /// Level 0 is type Block
168
+ /// Last level (defined by NUM_BIGSTEP_LEVEL + 1) is type SmallStep
169
+ /// All levels in between are of type BigStep
170
+ uint8 level;
171
+ /// @notice Set to true when the staker has been refunded. Can only be set to true if the status is Confirmed
172
+ /// and the staker is non zero.
173
+ bool refunded;
174
+ /// @notice TODO
175
+ uint64 totalTimeUnrivaledCache;
176
+ }
@@ -0,0 +1,18 @@
1
+ // Copyright 2021-2024, 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
+ library CallerChecker {
8
+ /**
9
+ * @notice A EIP-7702 safe check to ensure the caller is the origin and is codeless
10
+ * @return bool true if the caller is the origin and is codeless, false otherwise
11
+ * @dev If the caller is the origin and is codeless, then msg.data is guaranteed to be same as tx.data
12
+ * It also mean the caller would not be able to call a contract multiple times with the same transaction
13
+ */
14
+ function isCallerCodelessOrigin() internal view returns (bool) {
15
+ // solhint-disable-next-line avoid-tx-origin
16
+ return msg.sender == tx.origin && msg.sender.code.length == 0;
17
+ }
18
+ }
@@ -13,6 +13,9 @@ error HadZeroInit();
13
13
  /// @dev Thrown when post upgrade init validation fails
14
14
  error BadPostUpgradeInit();
15
15
 
16
+ /// @dev Thrown when the caller is not a codeless origin
17
+ error NotCodelessOrigin();
18
+
16
19
  /// @dev Thrown when non owner tries to access an only-owner function
17
20
  /// @param sender The msg.sender who is not the owner
18
21
  /// @param owner The owner address
@@ -7,6 +7,7 @@ pragma solidity ^0.8.0;
7
7
 
8
8
  import "./IReader4844.sol";
9
9
  import "./IGasRefunder.sol";
10
+ import "../libraries/CallerChecker.sol";
10
11
 
11
12
  abstract contract GasRefundEnabled {
12
13
  uint256 internal immutable gasPerBlob = 2 ** 17;
@@ -24,8 +25,7 @@ abstract contract GasRefundEnabled {
24
25
  startGasLeft += calldataWords * 6 + (calldataWords ** 2) / 512;
25
26
  // if triggered in a contract call, the spender may be overrefunded by appending dummy data to the call
26
27
  // so we check if it is a top level call, which would mean the sender paid calldata as part of tx.input
27
- // solhint-disable-next-line avoid-tx-origin
28
- if (msg.sender != tx.origin) {
28
+ if (!CallerChecker.isCallerCodelessOrigin()) {
29
29
  // We can't be sure if this calldata came from the top level tx,
30
30
  // so to be safe we tell the gas refunder there was no calldata.
31
31
  calldataSize = 0;