@aztec-foundation/l1-artifacts 6.0.0-rc.4 → 6.0.0-rc.6

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.
Files changed (357) hide show
  1. package/dest/AttesterExitExtLibAbi.d.ts +12 -0
  2. package/dest/AttesterExitExtLibAbi.d.ts.map +1 -1
  3. package/dest/AttesterExitExtLibAbi.js +16 -0
  4. package/dest/AttesterExitExtLibAbi.js.map +1 -1
  5. package/dest/AttesterExitExtLibBytecode.d.ts +1 -1
  6. package/dest/AttesterExitExtLibBytecode.js +1 -1
  7. package/dest/CoinIssuerAbi.d.ts +12 -0
  8. package/dest/CoinIssuerAbi.d.ts.map +1 -1
  9. package/dest/CoinIssuerAbi.js +16 -0
  10. package/dest/CoinIssuerAbi.js.map +1 -1
  11. package/dest/DateGatedRelayerAbi.d.ts +12 -0
  12. package/dest/DateGatedRelayerAbi.d.ts.map +1 -1
  13. package/dest/DateGatedRelayerAbi.js +16 -0
  14. package/dest/DateGatedRelayerAbi.js.map +1 -1
  15. package/dest/EmpireBaseAbi.d.ts +12 -0
  16. package/dest/EmpireBaseAbi.d.ts.map +1 -1
  17. package/dest/EmpireBaseAbi.js +16 -0
  18. package/dest/EmpireBaseAbi.js.map +1 -1
  19. package/dest/EpochProofExtLibAbi.d.ts +12 -0
  20. package/dest/EpochProofExtLibAbi.d.ts.map +1 -1
  21. package/dest/EpochProofExtLibAbi.js +16 -0
  22. package/dest/EpochProofExtLibAbi.js.map +1 -1
  23. package/dest/EpochProofExtLibBytecode.d.ts +1 -1
  24. package/dest/EpochProofExtLibBytecode.js +1 -1
  25. package/dest/ErrorsAbi.d.ts +12 -0
  26. package/dest/ErrorsAbi.d.ts.map +1 -1
  27. package/dest/ErrorsAbi.js +16 -0
  28. package/dest/ErrorsAbi.js.map +1 -1
  29. package/dest/EscapeHatchAbi.d.ts +22 -0
  30. package/dest/EscapeHatchAbi.d.ts.map +1 -1
  31. package/dest/EscapeHatchAbi.js +29 -0
  32. package/dest/EscapeHatchAbi.js.map +1 -1
  33. package/dest/EscapeHatchBytecode.d.ts +1 -1
  34. package/dest/EscapeHatchBytecode.d.ts.map +1 -1
  35. package/dest/EscapeHatchBytecode.js +1 -1
  36. package/dest/EscapeHatchBytecode.js.map +1 -1
  37. package/dest/EscapeHatchStorage.d.ts +8 -8
  38. package/dest/EscapeHatchStorage.js +8 -8
  39. package/dest/FeeAssetHandlerAbi.d.ts +12 -0
  40. package/dest/FeeAssetHandlerAbi.d.ts.map +1 -1
  41. package/dest/FeeAssetHandlerAbi.js +16 -0
  42. package/dest/FeeAssetHandlerAbi.js.map +1 -1
  43. package/dest/FeeJuicePortalAbi.d.ts +12 -0
  44. package/dest/FeeJuicePortalAbi.d.ts.map +1 -1
  45. package/dest/FeeJuicePortalAbi.js +16 -0
  46. package/dest/FeeJuicePortalAbi.js.map +1 -1
  47. package/dest/FeeJuicePortalBytecode.d.ts +1 -1
  48. package/dest/FeeJuicePortalBytecode.js +1 -1
  49. package/dest/GSEAbi.d.ts +12 -0
  50. package/dest/GSEAbi.d.ts.map +1 -1
  51. package/dest/GSEAbi.js +16 -0
  52. package/dest/GSEAbi.js.map +1 -1
  53. package/dest/GovernanceAbi.d.ts +12 -0
  54. package/dest/GovernanceAbi.d.ts.map +1 -1
  55. package/dest/GovernanceAbi.js +16 -0
  56. package/dest/GovernanceAbi.js.map +1 -1
  57. package/dest/GovernanceProposerAbi.d.ts +12 -0
  58. package/dest/GovernanceProposerAbi.d.ts.map +1 -1
  59. package/dest/GovernanceProposerAbi.js +16 -0
  60. package/dest/GovernanceProposerAbi.js.map +1 -1
  61. package/dest/HonkVerifierAbi.d.ts +12 -0
  62. package/dest/HonkVerifierAbi.d.ts.map +1 -1
  63. package/dest/HonkVerifierAbi.js +16 -0
  64. package/dest/HonkVerifierAbi.js.map +1 -1
  65. package/dest/IERC20Abi.d.ts +12 -0
  66. package/dest/IERC20Abi.d.ts.map +1 -1
  67. package/dest/IERC20Abi.js +16 -0
  68. package/dest/IERC20Abi.js.map +1 -1
  69. package/dest/ISequencerRewardCalculatorAbi.d.ts +12 -0
  70. package/dest/ISequencerRewardCalculatorAbi.d.ts.map +1 -1
  71. package/dest/ISequencerRewardCalculatorAbi.js +16 -0
  72. package/dest/ISequencerRewardCalculatorAbi.js.map +1 -1
  73. package/dest/IVerifierAbi.d.ts +12 -0
  74. package/dest/IVerifierAbi.d.ts.map +1 -1
  75. package/dest/IVerifierAbi.js +16 -0
  76. package/dest/IVerifierAbi.js.map +1 -1
  77. package/dest/InboxAbi.d.ts +12 -0
  78. package/dest/InboxAbi.d.ts.map +1 -1
  79. package/dest/InboxAbi.js +16 -0
  80. package/dest/InboxAbi.js.map +1 -1
  81. package/dest/InboxBytecode.d.ts +1 -1
  82. package/dest/InboxBytecode.js +1 -1
  83. package/dest/MockVerifierAbi.d.ts +12 -0
  84. package/dest/MockVerifierAbi.d.ts.map +1 -1
  85. package/dest/MockVerifierAbi.js +16 -0
  86. package/dest/MockVerifierAbi.js.map +1 -1
  87. package/dest/MockZKPassportVerifierAbi.d.ts +12 -0
  88. package/dest/MockZKPassportVerifierAbi.d.ts.map +1 -1
  89. package/dest/MockZKPassportVerifierAbi.js +16 -0
  90. package/dest/MockZKPassportVerifierAbi.js.map +1 -1
  91. package/dest/MultiAdderAbi.d.ts +12 -0
  92. package/dest/MultiAdderAbi.d.ts.map +1 -1
  93. package/dest/MultiAdderAbi.js +16 -0
  94. package/dest/MultiAdderAbi.js.map +1 -1
  95. package/dest/MultiAdderBytecode.d.ts +1 -1
  96. package/dest/MultiAdderBytecode.js +1 -1
  97. package/dest/NewGovernanceProposerPayloadAbi.d.ts +12 -0
  98. package/dest/NewGovernanceProposerPayloadAbi.d.ts.map +1 -1
  99. package/dest/NewGovernanceProposerPayloadAbi.js +16 -0
  100. package/dest/NewGovernanceProposerPayloadAbi.js.map +1 -1
  101. package/dest/OutboxAbi.d.ts +12 -0
  102. package/dest/OutboxAbi.d.ts.map +1 -1
  103. package/dest/OutboxAbi.js +16 -0
  104. package/dest/OutboxAbi.js.map +1 -1
  105. package/dest/OutboxBytecode.d.ts +1 -1
  106. package/dest/OutboxBytecode.js +1 -1
  107. package/dest/RegisterNewRollupVersionPayloadAbi.d.ts +40 -0
  108. package/dest/RegisterNewRollupVersionPayloadAbi.d.ts.map +1 -1
  109. package/dest/RegisterNewRollupVersionPayloadAbi.js +52 -0
  110. package/dest/RegisterNewRollupVersionPayloadAbi.js.map +1 -1
  111. package/dest/RegisterNewRollupVersionPayloadBytecode.d.ts +1 -1
  112. package/dest/RegisterNewRollupVersionPayloadBytecode.d.ts.map +1 -1
  113. package/dest/RegisterNewRollupVersionPayloadBytecode.js +1 -1
  114. package/dest/RegisterNewRollupVersionPayloadBytecode.js.map +1 -1
  115. package/dest/RegistryAbi.d.ts +12 -0
  116. package/dest/RegistryAbi.d.ts.map +1 -1
  117. package/dest/RegistryAbi.js +16 -0
  118. package/dest/RegistryAbi.js.map +1 -1
  119. package/dest/RewardDistributorAbi.d.ts +12 -0
  120. package/dest/RewardDistributorAbi.d.ts.map +1 -1
  121. package/dest/RewardDistributorAbi.js +16 -0
  122. package/dest/RewardDistributorAbi.js.map +1 -1
  123. package/dest/RewardExtLibAbi.d.ts +12 -0
  124. package/dest/RewardExtLibAbi.d.ts.map +1 -1
  125. package/dest/RewardExtLibAbi.js +16 -0
  126. package/dest/RewardExtLibAbi.js.map +1 -1
  127. package/dest/RewardExtLibBytecode.d.ts +1 -1
  128. package/dest/RewardExtLibBytecode.js +1 -1
  129. package/dest/RollupAbi.d.ts +12 -0
  130. package/dest/RollupAbi.d.ts.map +1 -1
  131. package/dest/RollupAbi.js +16 -0
  132. package/dest/RollupAbi.js.map +1 -1
  133. package/dest/RollupBytecode.d.ts +1 -1
  134. package/dest/RollupBytecode.js +1 -1
  135. package/dest/RollupOperationsExtLibAbi.d.ts +12 -0
  136. package/dest/RollupOperationsExtLibAbi.d.ts.map +1 -1
  137. package/dest/RollupOperationsExtLibAbi.js +16 -0
  138. package/dest/RollupOperationsExtLibAbi.js.map +1 -1
  139. package/dest/RollupOperationsExtLibBytecode.d.ts +1 -1
  140. package/dest/RollupOperationsExtLibBytecode.js +1 -1
  141. package/dest/SlasherAbi.d.ts +12 -0
  142. package/dest/SlasherAbi.d.ts.map +1 -1
  143. package/dest/SlasherAbi.js +16 -0
  144. package/dest/SlasherAbi.js.map +1 -1
  145. package/dest/SlasherDeploymentExtLibAbi.d.ts +12 -0
  146. package/dest/SlasherDeploymentExtLibAbi.d.ts.map +1 -1
  147. package/dest/SlasherDeploymentExtLibAbi.js +16 -0
  148. package/dest/SlasherDeploymentExtLibAbi.js.map +1 -1
  149. package/dest/SlasherDeploymentExtLibBytecode.d.ts +1 -1
  150. package/dest/SlasherDeploymentExtLibBytecode.js +1 -1
  151. package/dest/SlashingProposerAbi.d.ts +12 -0
  152. package/dest/SlashingProposerAbi.d.ts.map +1 -1
  153. package/dest/SlashingProposerAbi.js +16 -0
  154. package/dest/SlashingProposerAbi.js.map +1 -1
  155. package/dest/SlashingProposerBytecode.d.ts +1 -1
  156. package/dest/SlashingProposerBytecode.js +1 -1
  157. package/dest/StakingAssetHandlerAbi.d.ts +12 -0
  158. package/dest/StakingAssetHandlerAbi.d.ts.map +1 -1
  159. package/dest/StakingAssetHandlerAbi.js +16 -0
  160. package/dest/StakingAssetHandlerAbi.js.map +1 -1
  161. package/dest/TestERC20Abi.d.ts +12 -0
  162. package/dest/TestERC20Abi.d.ts.map +1 -1
  163. package/dest/TestERC20Abi.js +16 -0
  164. package/dest/TestERC20Abi.js.map +1 -1
  165. package/dest/TokenPortalAbi.d.ts +12 -0
  166. package/dest/TokenPortalAbi.d.ts.map +1 -1
  167. package/dest/TokenPortalAbi.js +16 -0
  168. package/dest/TokenPortalAbi.js.map +1 -1
  169. package/dest/TokenPortalBytecode.d.ts +1 -1
  170. package/dest/TokenPortalBytecode.js +1 -1
  171. package/dest/UniswapPortalAbi.d.ts +12 -0
  172. package/dest/UniswapPortalAbi.d.ts.map +1 -1
  173. package/dest/UniswapPortalAbi.js +16 -0
  174. package/dest/UniswapPortalAbi.js.map +1 -1
  175. package/dest/UniswapPortalBytecode.d.ts +1 -1
  176. package/dest/UniswapPortalBytecode.js +1 -1
  177. package/dest/ValidatorOperationsExtLibAbi.d.ts +12 -0
  178. package/dest/ValidatorOperationsExtLibAbi.d.ts.map +1 -1
  179. package/dest/ValidatorOperationsExtLibAbi.js +16 -0
  180. package/dest/ValidatorOperationsExtLibAbi.js.map +1 -1
  181. package/dest/ValidatorOperationsExtLibBytecode.d.ts +1 -1
  182. package/dest/ValidatorOperationsExtLibBytecode.d.ts.map +1 -1
  183. package/dest/ValidatorOperationsExtLibBytecode.js +1 -1
  184. package/dest/ValidatorOperationsExtLibBytecode.js.map +1 -1
  185. package/dest/ValidatorSelectionLibAbi.d.ts +12 -0
  186. package/dest/ValidatorSelectionLibAbi.d.ts.map +1 -1
  187. package/dest/ValidatorSelectionLibAbi.js +16 -0
  188. package/dest/ValidatorSelectionLibAbi.js.map +1 -1
  189. package/dest/ValidatorSelectionLibBytecode.d.ts +1 -1
  190. package/dest/ValidatorSelectionLibBytecode.js +1 -1
  191. package/dest/checksum.d.ts +1 -1
  192. package/dest/checksum.js +1 -1
  193. package/l1-contracts/cache/solidity-files-cache.json +1 -1
  194. package/l1-contracts/foundry.toml +1 -0
  195. package/l1-contracts/out/AddressSnapshotLib.sol/AddressSnapshotLib.json +1 -1
  196. package/l1-contracts/out/AttestationLib.sol/AttestationLib.json +1 -1
  197. package/l1-contracts/out/AttesterExitExtLib.sol/AttesterExitExtLib.json +1 -1
  198. package/l1-contracts/out/BN254Lib.sol/BN254Lib.json +1 -1
  199. package/l1-contracts/out/Ballot.sol/BallotLib.json +1 -1
  200. package/l1-contracts/out/BlobLib.sol/BlobLib.json +1 -1
  201. package/l1-contracts/out/Bn254LibWrapper.sol/Bn254LibWrapper.json +1 -1
  202. package/l1-contracts/out/CheckpointLog.sol/CompressedTempCheckpointLogLib.json +1 -1
  203. package/l1-contracts/out/CheckpointedUintLib.sol/CheckpointedUintLib.json +1 -1
  204. package/l1-contracts/out/CoinIssuer.sol/CoinIssuer.json +1 -1
  205. package/l1-contracts/out/CompressedTimeMath.sol/CompressedTimeMath.json +1 -1
  206. package/l1-contracts/out/Configuration.sol/CompressedConfigurationLib.json +1 -1
  207. package/l1-contracts/out/ConfigurationLib.sol/ConfigurationLib.json +1 -1
  208. package/l1-contracts/out/ConstantsGen.sol/Constants.json +1 -1
  209. package/l1-contracts/out/CoordinationSignatureLib.sol/CoordinationSignatureLib.json +1 -1
  210. package/l1-contracts/out/DataStructures.sol/DataStructures.json +1 -1
  211. package/l1-contracts/out/DateGatedRelayer.sol/DateGatedRelayer.json +1 -1
  212. package/l1-contracts/out/DeployAztecL1Contracts.s.sol/DeployAztecL1Contracts.json +1 -1
  213. package/l1-contracts/out/DeployRollupForUpgrade.s.sol/DeployRollupForUpgrade.json +1 -1
  214. package/l1-contracts/out/DeployRollupLib.sol/DeployRollupLib.json +1 -1
  215. package/l1-contracts/out/DeploymentConfiguration.sol/DeploymentConfiguration.json +1 -1
  216. package/l1-contracts/out/DeploymentConfiguration.sol/IDeploymentConfiguration.json +1 -1
  217. package/l1-contracts/out/DepositDelegationLib.sol/DepositDelegationLib.json +1 -1
  218. package/l1-contracts/out/EmpireBase.sol/EmpireBase.json +1 -1
  219. package/l1-contracts/out/EpochProofExtLib.sol/EpochProofExtLib.json +1 -1
  220. package/l1-contracts/out/EpochProofLib.sol/EpochProofLib.json +1 -1
  221. package/l1-contracts/out/Errors.sol/Errors.json +1 -1
  222. package/l1-contracts/out/EscapeHatch.sol/EscapeHatch.json +1 -1
  223. package/l1-contracts/out/FeeAssetHandler.sol/FeeAssetHandler.json +1 -1
  224. package/l1-contracts/out/FeeAssetHandler.sol/IFeeAssetHandler.json +1 -1
  225. package/l1-contracts/out/FeeConfig.sol/FeeConfigLib.json +1 -1
  226. package/l1-contracts/out/FeeConfig.sol/PriceLib.json +1 -1
  227. package/l1-contracts/out/FeeJuicePortal.sol/FeeJuicePortal.json +1 -1
  228. package/l1-contracts/out/FeeLib.sol/FeeLib.json +1 -1
  229. package/l1-contracts/out/FeeStructs.sol/FeeHeaderLib.json +1 -1
  230. package/l1-contracts/out/FeeStructs.sol/FeeStructsLib.json +1 -1
  231. package/l1-contracts/out/FieldLib.sol/FieldLib.json +1 -1
  232. package/l1-contracts/out/FlushEntryQueue.s.sol/FlushEntryQueue.json +1 -0
  233. package/l1-contracts/out/FlushRewarder.sol/FlushRewarder.json +1 -1
  234. package/l1-contracts/out/GSE.sol/GSE.json +1 -1
  235. package/l1-contracts/out/GSE.sol/GSECore.json +1 -1
  236. package/l1-contracts/out/GSE.sol/IGSE.json +1 -1
  237. package/l1-contracts/out/GSE.sol/IGSECore.json +1 -1
  238. package/l1-contracts/out/GSEPayload.sol/GSEPayload.json +1 -1
  239. package/l1-contracts/out/Governance.sol/Governance.json +1 -1
  240. package/l1-contracts/out/GovernanceProposer.sol/GovernanceProposer.json +1 -1
  241. package/l1-contracts/out/Hash.sol/Hash.json +1 -1
  242. package/l1-contracts/out/HonkVerifier.sol/HonkVerifier.json +1 -1
  243. package/l1-contracts/out/IBn254LibWrapper.sol/IBn254LibWrapper.json +1 -1
  244. package/l1-contracts/out/ICoinIssuer.sol/ICoinIssuer.json +1 -1
  245. package/l1-contracts/out/IDateGatedRelayer.sol/IDateGatedRelayer.json +1 -1
  246. package/l1-contracts/out/IEmpire.sol/IEmperor.json +1 -1
  247. package/l1-contracts/out/IEmpire.sol/IEmpire.json +1 -1
  248. package/l1-contracts/out/IEscapeHatch.sol/IEscapeHatch.json +1 -1
  249. package/l1-contracts/out/IEscapeHatch.sol/IEscapeHatchCore.json +1 -1
  250. package/l1-contracts/out/IFeeJuicePortal.sol/IFeeJuicePortal.json +1 -1
  251. package/l1-contracts/out/IFlushRewarder.sol/IFlushRewarder.json +1 -1
  252. package/l1-contracts/out/IGovernance.sol/IGovernance.json +1 -1
  253. package/l1-contracts/out/IGovernanceProposer.sol/IGovernanceProposer.json +1 -1
  254. package/l1-contracts/out/IInbox.sol/IInbox.json +1 -1
  255. package/l1-contracts/out/IInstance.sol/IInstance.json +1 -1
  256. package/l1-contracts/out/IMintableERC20.sol/IMintableERC20.json +1 -1
  257. package/l1-contracts/out/IOutbox.sol/IOutbox.json +1 -1
  258. package/l1-contracts/out/IPayload.sol/IPayload.json +1 -1
  259. package/l1-contracts/out/IProposerPayload.sol/IProposerPayload.json +1 -1
  260. package/l1-contracts/out/IRegistry.sol/IHaveVersion.json +1 -1
  261. package/l1-contracts/out/IRegistry.sol/IRegistry.json +1 -1
  262. package/l1-contracts/out/IRewardDistributor.sol/IRewardDistributor.json +1 -1
  263. package/l1-contracts/out/IRollup.sol/IRollup.json +1 -1
  264. package/l1-contracts/out/IRollup.sol/IRollupCore.json +1 -1
  265. package/l1-contracts/out/IRootRegistry.sol/IRootRegistry.json +1 -1
  266. package/l1-contracts/out/ISequencerRewardCalculator.sol/ISequencerRewardCalculator.json +1 -1
  267. package/l1-contracts/out/ISlasher.sol/ISlasher.json +1 -1
  268. package/l1-contracts/out/IStaking.sol/IStaking.json +1 -1
  269. package/l1-contracts/out/IStaking.sol/IStakingCore.json +1 -1
  270. package/l1-contracts/out/IValidatorSelection.sol/IValidatorSelection.json +1 -1
  271. package/l1-contracts/out/IValidatorSelection.sol/IValidatorSelectionCore.json +1 -1
  272. package/l1-contracts/out/IVerifier.sol/IVerifier.json +1 -1
  273. package/l1-contracts/out/Inbox.sol/Inbox.json +1 -1
  274. package/l1-contracts/out/InputsExtractor.sol/InputsExtractor.json +1 -1
  275. package/l1-contracts/out/InvalidateLib.sol/InvalidateLib.json +1 -1
  276. package/l1-contracts/out/MerkleLib.sol/MerkleLib.json +1 -1
  277. package/l1-contracts/out/MockERC20.sol/MockERC20.json +1 -1
  278. package/l1-contracts/out/MockERC721.sol/MockERC721.json +1 -1
  279. package/l1-contracts/out/MockFeeJuicePortal.sol/MockFeeJuicePortal.json +1 -1
  280. package/l1-contracts/out/MockVerifier.sol/MockVerifier.json +1 -1
  281. package/l1-contracts/out/MockZKPassportVerifier.sol/IZKPassportVerifier.json +1 -1
  282. package/l1-contracts/out/MockZKPassportVerifier.sol/MockZKPassportVerifier.json +1 -1
  283. package/l1-contracts/out/MultiAdder.sol/IMultiAdder.json +1 -1
  284. package/l1-contracts/out/MultiAdder.sol/MultiAdder.json +1 -1
  285. package/l1-contracts/out/Outbox.sol/Outbox.json +1 -1
  286. package/l1-contracts/out/OuterCount8.sol/HonkVerifier.json +1 -1
  287. package/l1-contracts/out/Proposal.sol/CompressedProposalLib.json +1 -1
  288. package/l1-contracts/out/ProposalLib.sol/ProposalLib.json +1 -1
  289. package/l1-contracts/out/ProposeLib.sol/ProposeLib.json +1 -1
  290. package/l1-contracts/out/ProposedHeaderLib.sol/ProposedHeaderLib.json +1 -1
  291. package/l1-contracts/out/RegisterNewRollupVersionPayload.sol/RegisterNewRollupVersionPayload.json +1 -1
  292. package/l1-contracts/out/Registry.sol/Registry.json +1 -1
  293. package/l1-contracts/out/RewardBooster.sol/IBooster.json +1 -1
  294. package/l1-contracts/out/RewardBooster.sol/IBoosterCore.json +1 -1
  295. package/l1-contracts/out/RewardBooster.sol/RewardBooster.json +1 -1
  296. package/l1-contracts/out/RewardDistributor.sol/RewardDistributor.json +1 -1
  297. package/l1-contracts/out/RewardExtLib.sol/RewardExtLib.json +1 -1
  298. package/l1-contracts/out/RewardLib.sol/BpsLib.json +1 -1
  299. package/l1-contracts/out/RewardLib.sol/RewardLib.json +1 -1
  300. package/l1-contracts/out/Rollup.sol/Rollup.json +1 -1
  301. package/l1-contracts/out/RollupConfiguration.sol/IRollupConfiguration.json +1 -1
  302. package/l1-contracts/out/RollupConfiguration.sol/RollupConfiguration.json +1 -1
  303. package/l1-contracts/out/RollupCore.sol/RollupCore.json +1 -1
  304. package/l1-contracts/out/RollupOperationsExtLib.sol/RollupOperationsExtLib.json +1 -1
  305. package/l1-contracts/out/STFLib.sol/STFLib.json +1 -1
  306. package/l1-contracts/out/SampleLib.sol/SampleLib.json +1 -1
  307. package/l1-contracts/out/SequencerRewardCalculatorLib.sol/SequencerRewardCalculatorLib.json +1 -1
  308. package/l1-contracts/out/SignatureLib.sol/SignatureLib.json +1 -1
  309. package/l1-contracts/out/SlashPayload.sol/SlashPayload.json +1 -1
  310. package/l1-contracts/out/SlashPayloadCloneable.sol/SlashPayloadCloneable.json +1 -1
  311. package/l1-contracts/out/SlashPayloadLib.sol/SlashPayloadLib.json +1 -1
  312. package/l1-contracts/out/SlashRoundLib.sol/CompressedSlashRoundMath.json +1 -1
  313. package/l1-contracts/out/Slasher.sol/Slasher.json +1 -1
  314. package/l1-contracts/out/SlasherDeploymentExtLib.sol/SlasherDeploymentExtLib.json +1 -1
  315. package/l1-contracts/out/SlashingProposer.sol/SlashingProposer.json +1 -1
  316. package/l1-contracts/out/StakingAssetHandler.sol/IStakingAssetHandler.json +1 -1
  317. package/l1-contracts/out/StakingAssetHandler.sol/StakingAssetHandler.json +1 -1
  318. package/l1-contracts/out/StakingLib.sol/StakingLib.json +1 -1
  319. package/l1-contracts/out/StakingQueue.sol/StakingQueueLib.json +1 -1
  320. package/l1-contracts/out/StakingQueueConfig.sol/StakingQueueConfigLib.json +1 -1
  321. package/l1-contracts/out/StdError.sol/stdError.json +1 -1
  322. package/l1-contracts/out/TestERC20.sol/TestERC20.json +1 -1
  323. package/l1-contracts/out/TestPayloads.sol/CallAssetPayload.json +1 -1
  324. package/l1-contracts/out/TestPayloads.sol/CallRevertingPayload.json +1 -1
  325. package/l1-contracts/out/TestPayloads.sol/EmptyPayload.json +1 -1
  326. package/l1-contracts/out/TestPayloads.sol/FakeRollup.json +1 -1
  327. package/l1-contracts/out/TestPayloads.sol/RevertingCall.json +1 -1
  328. package/l1-contracts/out/TestPayloads.sol/UpgradePayload.json +1 -1
  329. package/l1-contracts/out/TimeLib.sol/TimeLib.json +1 -1
  330. package/l1-contracts/out/Tips.sol/ChainTipsLib.json +1 -1
  331. package/l1-contracts/out/ValidatorOperationsExtLib.sol/ValidatorOperationsExtLib.json +1 -1
  332. package/l1-contracts/out/ValidatorSelectionLib.sol/ValidatorSelectionLib.json +1 -1
  333. package/l1-contracts/out/ZKPassportHelper.sol/ZKPassportHelper.json +1 -1
  334. package/l1-contracts/out/ZKPassportRootVerifier.sol/ZKPassportRootVerifier.json +1 -1
  335. package/l1-contracts/out/ZKPassportSubVerifier.sol/ZKPassportSubVerifier.json +1 -1
  336. package/l1-contracts/out/build-info/018c24616ac5aeef.json +1 -0
  337. package/l1-contracts/out/generated/HonkVerifier.sol/HonkVerifier.json +1 -1
  338. package/l1-contracts/out/libraries/Errors.sol/Errors.json +1 -1
  339. package/l1-contracts/out/rollup/BlobLib.sol/BlobLib.json +1 -1
  340. package/l1-contracts/out/src/ZKPassportHelper.sol/ZKPassportHelper.json +1 -1
  341. package/l1-contracts/out/src/ZKPassportRootVerifier.sol/ZKPassportRootVerifier.json +1 -1
  342. package/l1-contracts/out/src/ZKPassportSubVerifier.sol/ZKPassportSubVerifier.json +1 -1
  343. package/l1-contracts/script/deploy/DeployRollupLib.sol +5 -12
  344. package/l1-contracts/script/deploy/FlushEntryQueue.s.sol +32 -0
  345. package/l1-contracts/scripts/forge_broadcast.js +104 -34
  346. package/l1-contracts/scripts/network-defaults.json +1 -1
  347. package/l1-contracts/src/core/EscapeHatch.sol +56 -12
  348. package/l1-contracts/src/core/interfaces/IEscapeHatch.sol +1 -0
  349. package/l1-contracts/src/core/interfaces/IStaking.sol +11 -0
  350. package/l1-contracts/src/core/libraries/ConstantsGen.sol +1 -1
  351. package/l1-contracts/src/core/libraries/Errors.sol +1 -0
  352. package/l1-contracts/src/core/libraries/rollup/FeeLib.sol +7 -12
  353. package/l1-contracts/src/core/libraries/rollup/StakingLib.sol +117 -12
  354. package/l1-contracts/src/core/libraries/rollup/ValidatorSelectionLib.sol +8 -6
  355. package/l1-contracts/src/periphery/RegisterNewRollupVersionPayload.sol +30 -10
  356. package/package.json +1 -1
  357. package/l1-contracts/out/build-info/4cb7b5442b848dcc.json +0 -1
@@ -49,6 +49,9 @@ contract EscapeHatch is IEscapeHatch {
49
49
  // The rollup contract that the escape hatch belongs to
50
50
  IInstance internal immutable ROLLUP;
51
51
 
52
+ // The rollup samples the RANDAO for an epoch this many epochs before that epoch starts
53
+ uint256 internal immutable ROLLUP_LAG_IN_EPOCHS_FOR_RANDAO;
54
+
52
55
  // The lag defines how far in advance we pick the
53
56
  uint256 internal immutable LAG_IN_HATCHES;
54
57
 
@@ -123,6 +126,7 @@ contract EscapeHatch is IEscapeHatch {
123
126
  require(_proposingExitDelay <= 30 days, Errors.EscapeHatch__InvalidConfiguration());
124
127
 
125
128
  ROLLUP = IInstance(_rollup);
129
+ ROLLUP_LAG_IN_EPOCHS_FOR_RANDAO = IInstance(_rollup).getLagInEpochsForRandao();
126
130
  BOND_TOKEN = IERC20(_bondToken);
127
131
  BOND_SIZE = _bondSize;
128
132
  WITHDRAWAL_TAX = _withdrawalTax;
@@ -500,6 +504,15 @@ contract EscapeHatch is IEscapeHatch {
500
504
  return address(ROLLUP);
501
505
  }
502
506
 
507
+ /**
508
+ * @notice Get the rollup's RANDAO lag that seed queries compensate for
509
+ *
510
+ * @return The rollup's `lagInEpochsForRandao`, as read from the rollup at construction
511
+ */
512
+ function getRollupLagInEpochsForRandao() external view override(IEscapeHatch) returns (uint256) {
513
+ return ROLLUP_LAG_IN_EPOCHS_FOR_RANDAO;
514
+ }
515
+
503
516
  /**
504
517
  * @notice Get the bond token address
505
518
  *
@@ -618,20 +631,35 @@ contract EscapeHatch is IEscapeHatch {
618
631
  return;
619
632
  }
620
633
 
621
- // Get the seed timestamp and sample RANDAO
622
- uint32 seedTs = getSeedTimestamp(targetHatch);
623
- uint256 seed = ROLLUP.getSampleSeedAt(Timestamp.wrap(seedTs));
634
+ // The rollup derives an epoch's seed from the RANDAO checkpointed ROLLUP_LAG_IN_EPOCHS_FOR_RANDAO epochs
635
+ // earlier, so query the epoch whose RANDAO sample lands on the seed epoch, which is after the freeze.
636
+ // The rollup only records a checkpoint when a transaction (a checkpoint proposal or `checkpointRandao`)
637
+ // reaches it during the seed epoch, and it records the prevrandao of whichever block carries the first such
638
+ // transaction, so the first caller chooses among that epoch's blocks. If no transaction reaches it, the
639
+ // lookup falls back to the previous checkpoint, which is for the freeze epoch or an earlier one and so may
640
+ // have been known before the freeze, letting candidates tune the set against it. `checkpointRandao` is
641
+ // permissionless, so anyone can prevent this by calling it during the seed epoch, unless L1 censors the call.
642
+ Epoch queriedEpoch = _getSeedEpoch(targetHatch) + Epoch.wrap(ROLLUP_LAG_IN_EPOCHS_FOR_RANDAO);
643
+ uint256 seed = ROLLUP.getSampleSeedAt(ROLLUP.getTimestampForEpoch(queriedEpoch));
624
644
  uint256 index = uint256(keccak256(abi.encode(targetHatch, seed))) % setSize;
625
645
  address proposer = $activeCandidates.getAddressFromIndexAtTimestamp(index, freezeTs);
626
646
 
627
- $designatedProposer[targetHatch] = proposer;
628
-
629
647
  CandidateInfo storage data = $candidateDatas[proposer];
648
+ Status status = data.status;
649
+
650
+ // The candidate was ACTIVE at the freeze, but may have called `initiateExit` since (EXITING), or
651
+ // also completed `leaveCandidateSet` (NONE): the latter is reachable when the exit happened while
652
+ // this contract was not the active escape hatch, as selection is skipped in that state and the
653
+ // snapshot still lists the candidate. A NONE candidate has had its bond refunded and cannot be
654
+ // designated proposer, so the hatch is left without a proposer, as if the snapshot were empty.
655
+ if (status == Status.NONE) {
656
+ return;
657
+ }
658
+
659
+ $designatedProposer[targetHatch] = proposer;
630
660
 
631
- // At snapshot time, the candidate must have been ACTIVE, but could have been changed to EXITING,
632
- // if the candidate called `initiateExit` after the freeze. In that case, skip removal as already
633
- // done. Any other status indicates a broken invariant and remove() will revert.
634
- if (data.status != Status.EXITING) {
661
+ // An EXITING candidate has already been removed from the active set.
662
+ if (status != Status.EXITING) {
635
663
  $activeCandidates.remove(proposer);
636
664
  }
637
665
 
@@ -680,22 +708,38 @@ contract EscapeHatch is IEscapeHatch {
680
708
  * @dev This is after the freeze timestamp to prevent manipulation of the
681
709
  * candidate set based on known RANDAO values.
682
710
  *
711
+ * Do not pass this timestamp to `ROLLUP.getSampleSeedAt`: the rollup subtracts its own
712
+ * `lagInEpochsForRandao` from the epoch it is asked about, so that call returns a seed built from
713
+ * a RANDAO checkpointed in the freeze epoch or earlier. `selectCandidates` queries the epoch that
714
+ * many epochs later instead.
715
+ *
683
716
  * @param _hatch The target hatch (the one being prepared/proposed for)
684
717
  *
685
718
  * @return The timestamp at which the RANDAO seed is sampled for this hatch
686
719
  */
687
720
  function getSeedTimestamp(Hatch _hatch) public view override(IEscapeHatch) returns (uint32) {
721
+ return Timestamp.unwrap(ROLLUP.getTimestampForEpoch(_getSeedEpoch(_hatch))).toUint32();
722
+ }
723
+
724
+ // ============ Internal Functions ============
725
+
726
+ /**
727
+ * @notice Get the epoch whose RANDAO checkpoint seeds a target hatch
728
+ *
729
+ * @param _hatch The target hatch (the one being prepared/proposed for)
730
+ *
731
+ * @return The epoch during which the RANDAO that seeds this hatch's selection is checkpointed
732
+ */
733
+ function _getSeedEpoch(Hatch _hatch) internal view returns (Epoch) {
688
734
  require(Hatch.unwrap(_hatch) >= LAG_IN_HATCHES, Errors.EscapeHatch__HatchTooEarly(_hatch));
689
735
 
690
736
  Hatch samplingHatch = _hatch - Hatch.wrap(LAG_IN_HATCHES);
691
737
  Epoch firstEpoch = _getFirstEpoch(samplingHatch);
692
738
  require(Epoch.unwrap(firstEpoch) >= LAG_IN_EPOCHS_FOR_RANDAO, Errors.EscapeHatch__HatchTooEarly(_hatch));
693
739
 
694
- Epoch seedEpoch = firstEpoch - Epoch.wrap(LAG_IN_EPOCHS_FOR_RANDAO);
695
- return Timestamp.unwrap(ROLLUP.getTimestampForEpoch(seedEpoch)).toUint32();
740
+ return firstEpoch - Epoch.wrap(LAG_IN_EPOCHS_FOR_RANDAO);
696
741
  }
697
742
 
698
- // ============ Internal Functions ============
699
743
  function _getHatch(Epoch _epoch) internal view returns (Hatch) {
700
744
  return Hatch.wrap(Epoch.unwrap(_epoch) / FREQUENCY);
701
745
  }
@@ -68,6 +68,7 @@ interface IEscapeHatch is IEscapeHatchCore {
68
68
  function getSetTimestamp(Hatch _hatch) external view returns (uint32);
69
69
  function getSeedTimestamp(Hatch _hatch) external view returns (uint32);
70
70
  function getRollup() external view returns (address);
71
+ function getRollupLagInEpochsForRandao() external view returns (uint256);
71
72
  function getBondToken() external view returns (address);
72
73
  function getBondSize() external view returns (uint96);
73
74
  function getWithdrawalTax() external view returns (uint96);
@@ -56,7 +56,18 @@ interface IStakingCore {
56
56
  G1Point memory _proofOfPossession,
57
57
  bool _moveWithLatestRollup
58
58
  ) external;
59
+ /**
60
+ * @notice Activates queued validators, up to the epoch's flush budget (and `_toAdd` when given)
61
+ * @dev Before every deposit the flush requires `StakingLib.getFlushDepositGasFloor` gas to be left (about 1.1M at
62
+ * the default proof-of-possession cap) and reverts with `Staking__InsufficientFlushGas` otherwise. Size the
63
+ * transaction with `eth_estimateGas`, which accounts for this, or leave that much headroom beyond the gas the
64
+ * flush consumes. A limit derived from simulated gas used is not enough for a flush of a few entries.
65
+ */
59
66
  function flushEntryQueue() external;
67
+ /**
68
+ * @notice Same as `flushEntryQueue()`, processing at most `_toAdd` queued validators
69
+ * @param _toAdd The maximum number of entries to process
70
+ */
60
71
  function flushEntryQueue(uint256 _toAdd) external;
61
72
  function initiateWithdraw(address _attester, address _recipient) external returns (bool);
62
73
  function finalizeWithdraw(address _attester) external;
@@ -22,7 +22,7 @@ library Constants {
22
22
  uint256 internal constant INITIAL_CHECKPOINT_NUMBER = 1;
23
23
  uint256 internal constant MAX_CHECKPOINTS_PER_EPOCH = 32;
24
24
  uint256 internal constant GENESIS_ARCHIVE_ROOT =
25
- 21_246_368_624_984_810_056_997_782_223_963_634_317_886_840_379_204_818_011_598_235_099_924_970_848_182;
25
+ 18_960_341_753_124_503_935_458_443_175_457_612_933_904_560_152_578_324_286_385_834_188_202_890_618_308;
26
26
  uint256 internal constant EMPTY_EPOCH_OUT_HASH =
27
27
  355_785_372_471_781_095_838_790_036_702_437_931_769_306_153_278_986_832_745_847_530_947_941_691_539;
28
28
  uint256 internal constant FEE_JUICE_ADDRESS = 3;
@@ -155,6 +155,7 @@ library Errors {
155
155
  error Staking__AlreadyQueued(address _attester);
156
156
  error Staking__QueueEmpty();
157
157
  error Staking__DepositOutOfGas();
158
+ error Staking__InsufficientFlushGas(uint256 required, uint256 available);
158
159
  error Staking__AlreadyActive(address attester); // 0x5e206fa4
159
160
  error Staking__QueueAlreadyFlushed(Epoch epoch); // 0x21148c78
160
161
  error Staking__AlreadyRegistered(address instance, address attester);
@@ -60,19 +60,14 @@ uint256 constant MAX_FEE_ASSET_PRICE_MODIFIER_BPS = 100;
60
60
  /*
61
61
  * L1 gas the fee model charges for proposing a checkpoint and for verifying an epoch proof.
62
62
  *
63
- * Placeholders. Both are sized against the Glamsterdam gas schedule (EIP-8037 state gas,
64
- * EIP-8038 state access repricing), measured by running the `BenchmarkRollupTest` gas report
65
- * under `forge --evm-version amsterdam`: `propose` costs ~500k and `submitEpochRootProof` ~3.5M,
66
- * against ~327k and ~1.5M on the pre-fork schedule.
67
- *
68
- * Neither number is a production measurement. The benchmark installs `MockVerifier` and submits
69
- * an empty proof, so the epoch figure omits both proof verification and the proof calldata, and
70
- * the harness measures a bare `propose` while the sequencer publishes through Multicall3's
71
- * `aggregate3` with `setupEpoch` folded in. Replace both with values measured on testnet once the
72
- * fork is live.
63
+ * Measured on Sepolia under the Glamsterdam gas schedule (EIP-8037 state gas, EIP-8038 state
64
+ * access repricing), with the sequencer publishing through Multicall3's `aggregate3`. A propose
65
+ * costs ~487k at the median and ~514k averaged per checkpoint once the `setupEpoch` folded into
66
+ * the first checkpoint of each epoch is included; 520k is the most expensive regular propose
67
+ * observed. The first proof submitted for an epoch costs ~2.36M at the median and ~2.51M at most.
73
68
  */
74
- uint256 constant L1_GAS_PER_CHECKPOINT_PROPOSED = 500_000;
75
- uint256 constant L1_GAS_PER_EPOCH_VERIFIED = 4_000_000;
69
+ uint256 constant L1_GAS_PER_CHECKPOINT_PROPOSED = 520_000;
70
+ uint256 constant L1_GAS_PER_EPOCH_VERIFIED = 2_500_000;
76
71
 
77
72
  // The uncongested baseline of the congestion multiplier is (1 + mu) * 1e9, where mu is the
78
73
  // protocol fee margin: congestionMultiplier scales this minimum by (10_000 + marginBps) / 10_000.
@@ -29,6 +29,58 @@ import {Math} from "@oz/utils/math/Math.sol";
29
29
  import {SafeCast} from "@oz/utils/math/SafeCast.sol";
30
30
  import {Checkpoints} from "@oz/utils/structs/Checkpoints.sol";
31
31
 
32
+ /*
33
+ * Gas floor for each `GSE.deposit` call made by `StakingLib.flushEntryQueue`.
34
+ *
35
+ * `GSE.deposit` verifies the proof of possession through an external call capped at the GSE's
36
+ * `proofOfPossessionGasLimit`. If that call receives less than the cap, the verifier can fail with non-empty revert
37
+ * data, which `flushEntryQueue` cannot tell apart from a genuinely invalid deposit, so it would refund and drop a
38
+ * valid entry. The flush therefore requires, before each call, enough gas that the verifier is guaranteed its full
39
+ * cap through both EIP-150 63/64 boundaries (Rollup -> GSE and GSE -> verifier). See
40
+ * `StakingLib.getFlushDepositGasFloor` for the derivation.
41
+ *
42
+ * The floor covers the verifier call only. A flush that clears it can still run out of gas later in the deposit
43
+ * (the attester's storage writes, the stake transfer, `Governance.deposit`). Those failures must reach
44
+ * `flushEntryQueue` as EMPTY revert data, so that it reverts the whole flush with `Staking__DepositOutOfGas` instead
45
+ * of refunding the entry. That holds because `GSE.deposit` makes its external calls either directly, which bubbles
46
+ * the callee's revert data unchanged, or through `SafeERC20`, which re-raises the callee's raw revert data; nothing
47
+ * on that path wraps a failed sub-call in a custom error. Changes to the GSE, the staking asset or the Governance
48
+ * deposit path must preserve this.
49
+ *
50
+ * The values are fixed and sized for the Glamsterdam gas schedule (EIP-8037 state gas, EIP-8038 repricing), measured
51
+ * against the `amsterdam` EVM (see `test/staking/flush-gas-floor/`). Under EIP-8037 the new storage slots that
52
+ * `GSE.deposit` writes before the verifier call dominate `FLUSH_GSE_PRE_CHECK_GAS`, and the new balance slot of a
53
+ * fresh withdrawer dominates `FLUSH_REFUND_GAS_RESERVE`. On earlier schedules (Prague, Osaka) the same path costs far
54
+ * less, so the floor is larger than needed there: honest flushes still activate, they only need a higher gas limit.
55
+ * The values MUST be re-derived at every later fork that reprices storage writes, account access or calls, and
56
+ * whenever the storage the GSE writes before the verifier changes. A floor that is too low lets a flush caller
57
+ * starve the verifier again. A floor that is too high only raises the gas limit an honest flusher must set, since
58
+ * unused gas is not charged, until it exceeds what one transaction can carry.
59
+ */
60
+
61
+ /// @dev Gas `GSE.deposit` spends from its entry until the verifier call: the registration checks, the attester
62
+ /// checkpoint writes and the `ownedPKs` write. Sized for Glamsterdam: measured at 682_620 under `amsterdam`
63
+ /// (154_300 under `osaka`), the rest is margin. Follows EIP-8037 state gas for new storage slots and the deployed
64
+ /// GSE's storage layout.
65
+ uint256 constant FLUSH_GSE_PRE_CHECK_GAS = 700_000;
66
+
67
+ /// @dev Gas the GSE spends between its last pre-check instruction and the verifier's first instruction, excluding the
68
+ /// forwarded cap: one cold account access to the verifier and the argument encoding. Measured at about 2_700
69
+ /// under `amsterdam`. Any shortfall is covered by the margin in `FLUSH_GSE_PRE_CHECK_GAS`, which sits behind the
70
+ /// same 63/64 boundary.
71
+ uint256 constant FLUSH_POP_CALL_GAS_RESERVE = 3000;
72
+
73
+ /// @dev Gas the Rollup spends between its `gasleft()` check and the GSE's first instruction, excluding the forwarded
74
+ /// gas: the comparison and a call to the GSE, which is warm because the flush has already called it. Measured at
75
+ /// about 700.
76
+ uint256 constant FLUSH_GSE_CALL_GAS_RESERVE = 2000;
77
+
78
+ /// @dev Gas for the refund branch after a deposit fails with revert data: the stake transfer to a withdrawer that may
79
+ /// not hold the staking asset yet (a new balance slot under EIP-8037) and the `FailedDeposit` event. Measured at
80
+ /// about 131_000 under `amsterdam`. A GSE that fails during or before verification has spent at most the rest of
81
+ /// the floor, so this part of the forwarded gas comes back to the Rollup.
82
+ uint256 constant FLUSH_REFUND_GAS_RESERVE = 150_000;
83
+
32
84
  // None -> Does not exist in our setup
33
85
  // Validating -> Participating as validator
34
86
  // Zombie -> Not participating as validator, but have funds in setup,
@@ -419,6 +471,10 @@ library StakingLib {
419
471
  * - On failure: refunds their stake and emits FailedDeposit event
420
472
  *
421
473
  * The function will revert if:
474
+ * - Less than `getFlushDepositGasFloor` gas is left right before any GSE deposit call, so that the caller's
475
+ * gas limit cannot starve the proof-of-possession check of a valid entry into a refund. Callers must
476
+ * therefore size the transaction with `eth_estimateGas`, which accounts for the floor, or leave that much
477
+ * gas beyond what the flush consumes; a limit derived from simulated gas used fails for small flushes.
422
478
  * - A deposit fails due to out of gas (to prevent queue draining attacks)
423
479
  *
424
480
  * The function approves the GSE contract to spend the total stake amount needed for all deposits,
@@ -446,21 +502,25 @@ library StakingLib {
446
502
  // Approve the GSE to spend the total stake amount needed for all deposits.
447
503
  uint256 amount = store.gse.ACTIVATION_THRESHOLD();
448
504
  store.stakingAsset.approve(address(store.gse), amount * numToDequeue);
505
+ // Read once per flush: only the GSE owner can change the cap, and nothing the flush calls can reach the owner.
506
+ uint256 requiredGas = getFlushDepositGasFloor(store.gse.proofOfPossessionGasLimit());
507
+ address gse = address(store.gse);
449
508
  uint256 depositCount = 0;
450
509
  for (uint256 i = 0; i < numToDequeue; i++) {
451
510
  DepositArgs memory args = store.entryQueue.dequeue();
452
- (bool success, bytes memory data) = address(store.gse)
453
- .call(
454
- abi.encodeWithSelector(
455
- IGSECore.deposit.selector,
456
- args.attester,
457
- args.withdrawer,
458
- args.publicKeyInG1,
459
- args.publicKeyInG2,
460
- args.proofOfPossession,
461
- args.moveWithLatestRollup
462
- )
463
- );
511
+ bytes memory depositCall = abi.encodeWithSelector(
512
+ IGSECore.deposit.selector,
513
+ args.attester,
514
+ args.withdrawer,
515
+ args.publicKeyInG1,
516
+ args.publicKeyInG2,
517
+ args.proofOfPossession,
518
+ args.moveWithLatestRollup
519
+ );
520
+ // Kept immediately before the call: `FLUSH_GSE_CALL_GAS_RESERVE` only covers the instructions in between.
521
+ uint256 availableGas = gasleft();
522
+ require(availableGas >= requiredGas, Errors.Staking__InsufficientFlushGas(requiredGas, availableGas));
523
+ (bool success, bytes memory data) = gse.call(depositCall);
464
524
  if (success) {
465
525
  depositCount++;
466
526
  emit IStakingCore.Deposit(
@@ -815,6 +875,51 @@ library StakingLib {
815
875
  return getStorage().availableValidatorFlushes;
816
876
  }
817
877
 
878
+ /**
879
+ * @notice The least gas `flushEntryQueue` must hold right before each `GSE.deposit` call, so that the
880
+ * proof-of-possession verifier inside it is guaranteed its full gas cap.
881
+ * @dev Derivation. Under EIP-150 a frame forwards at most all but one 64th of the gas it holds at a CALL, counted
882
+ * after the CALL's own upfront charges (account access, memory): a callee asking for `X` receives
883
+ * `min(X, G - G / 64)`. A frame that must hand `X` to its callee therefore has to hold `G >= X * 64 / 63` at
884
+ * the CALL, which `X * 64 / 63 + 1` rounds up in integer arithmetic. Two such boundaries sit between the flush
885
+ * and the verifier, and the floor walks back through them:
886
+ *
887
+ * 1. GSE -> verifier. The GSE calls the verifier with `{gas: cap}`, so at that CALL it must hold
888
+ * `cap * 64 / 63 + 1`, plus `FLUSH_POP_CALL_GAS_RESERVE` for what it spends between holding that amount
889
+ * and the CALL being charged (argument encoding, cold access to the verifier).
890
+ * 2. Inside the GSE. Before it reaches the verifier, `GSE.deposit` spends `FLUSH_GSE_PRE_CHECK_GAS` on its
891
+ * checks and storage writes, so at its entry it must hold that much more.
892
+ * 3. Rollup -> GSE. `flushEntryQueue` calls the GSE without a gas argument, so the GSE receives all but one
893
+ * 64th of what the Rollup holds at the CALL: the Rollup must hold the GSE entry amount `* 64 / 63 + 1`,
894
+ * plus `FLUSH_GSE_CALL_GAS_RESERVE` for what it spends between the `gasleft()` read and the CALL being
895
+ * charged.
896
+ * 4. Refund. `FLUSH_REFUND_GAS_RESERVE` is added last and unscaled. It is forwarded to the GSE with
897
+ * everything else and comes back because the GSE does not consume it on the failure paths that end in a
898
+ * refund: a deposit rejected before the verifier spends far less than `FLUSH_GSE_PRE_CHECK_GAS`, and a
899
+ * deposit rejected by the verifier with its full cap consumes at most the GSE entry amount, so at least
900
+ * 63/64 of the reserve returns, on top of the 1/64 the Rollup kept at the CALL. A deposit that runs out
901
+ * of gas after the verifier reverts with empty data and the whole flush reverts, so no refund is
902
+ * attempted. The reserve is needed because the retained 1/64 alone (about 15k at the default cap) does
903
+ * not cover the refund branch.
904
+ *
905
+ * At the default 250k cap: 253_969 + 3_000 = 256_969 at the verifier CALL, 956_969 at the GSE entry, and
906
+ * 972_159 + 2_000 + 150_000 = 1_124_159 at the Rollup. A floor of `cap * 64 / 63` plus a reserve, without
907
+ * `FLUSH_GSE_PRE_CHECK_GAS`, would be about 285k and would let the Rollup pass its check while the verifier is
908
+ * still starved: the GSE spends the pre-check gas inside its own frame, behind the Rollup -> GSE boundary.
909
+ *
910
+ * The constants are sized for the Glamsterdam gas schedule (see their definitions). All arithmetic is uint256
911
+ * and checked, and a `uint64` cap cannot overflow it, so an absurdly large cap yields a floor no transaction
912
+ * can meet and every flush that reaches a deposit reverts with `Staking__InsufficientFlushGas` until the cap
913
+ * is lowered.
914
+ * @param _proofOfPossessionGasLimit The GSE's current `proofOfPossessionGasLimit`
915
+ * @return The gas floor checked before each deposit call
916
+ */
917
+ function getFlushDepositGasFloor(uint256 _proofOfPossessionGasLimit) internal pure returns (uint256) {
918
+ uint256 gseGasAtVerifierCall = (_proofOfPossessionGasLimit * 64) / 63 + 1 + FLUSH_POP_CALL_GAS_RESERVE;
919
+ uint256 gseGasAtEntry = FLUSH_GSE_PRE_CHECK_GAS + gseGasAtVerifierCall;
920
+ return (gseGasAtEntry * 64) / 63 + 1 + FLUSH_GSE_CALL_GAS_RESERVE + FLUSH_REFUND_GAS_RESERVE;
921
+ }
922
+
818
923
  /// @notice Enforces invariants on a {StakingQueueConfig}.
819
924
  /// - `normalFlushSizeMin > 0`: a zero floor can close the queue on a running rollup.
820
925
  /// - `normalFlushSizeQuotient > 0`: {getEntryQueueFlushSize} divides by this field.
@@ -60,9 +60,12 @@ import {TransientSlot} from "@oz/utils/TransientSlot.sol";
60
60
  * 4. Seed Management:
61
61
  * - Sample seeds determine committee and proposer selection for each epoch
62
62
  * - Seeds use prevrandao from L1 blocks combined with epoch number for unpredictability
63
- * - Prevrandao are set 2 epochs in advance to prevent last-minute manipulation and provide L1-reorg resistance
64
- * - First two epochs use randao values (type(uint224).max) for bootstrap (this results in the committee
65
- * being predictable in the first 2 epochs which is considered acceptable when bootstrapping the network)
63
+ * - Prevrandao is checkpointed once per epoch and read `lagInEpochsForRandao` epochs later to prevent
64
+ * last-minute manipulation and provide L1-reorg resistance
65
+ * - The first `lagInEpochsForRandao` epochs sample before the genesis checkpoint and so use a zero randao,
66
+ * and the epochs after them use the deployment block's prevrandao until a later checkpoint is recorded
67
+ * (this results in the committee being predictable in those epochs, which is considered acceptable when
68
+ * bootstrapping the network)
66
69
  *
67
70
  * 5. Caching and Optimization:
68
71
  * - Transient storage caches proposer computations within the same transaction
@@ -81,7 +84,7 @@ import {TransientSlot} from "@oz/utils/TransientSlot.sol";
81
84
  * - Committee selection happens before epoch start, preventing manipulation
82
85
  * - Signature verification ensures only legitimate committee members can attest
83
86
  * - Committee commitments prevent committee substitution attacks
84
- * - Two-epoch delay in seed setting prevents last-minute influence and provides L1-reorg resistance
87
+ * - The `lagInEpochsForRandao` seed delay prevents last-minute influence and provides L1-reorg resistance
85
88
  *
86
89
  * Time-based Architecture:
87
90
  * - Epochs define committee boundaries (committee stable within epoch)
@@ -128,8 +131,7 @@ library ValidatorSelectionLib {
128
131
  * @notice Initializes the validator selection system with target committee size
129
132
  * @dev It is HIGHLY recommended to use lagInEpochsForValidatorSet > lagInEpochsForRandao, to avoid sequencer bias
130
133
  * but we allow them being equal because it makes test networks faster to kick off.
131
- * @dev Sets up the initial configuration and bootstrap seeds for the first two epochs.
132
- * The first two epochs use maximum seed values for startup.
134
+ * @dev Sets up the initial configuration and records the genesis RANDAO checkpoint from the deployment block.
133
135
  * @param _targetCommitteeSize The desired number of validators in each epoch's committee
134
136
  */
135
137
  function initialize(uint256 _targetCommitteeSize, uint256 _lagInEpochsForValidatorSet, uint256 _lagInEpochsForRandao)
@@ -5,47 +5,67 @@ pragma solidity >=0.8.27;
5
5
  import {IInstance} from "@aztec/core/interfaces/IInstance.sol";
6
6
  import {IGSECore} from "@aztec/governance/GSE.sol";
7
7
  import {IPayload} from "@aztec/governance/interfaces/IPayload.sol";
8
- import {IRegistry} from "@aztec/governance/interfaces/IRegistry.sol";
8
+ import {IHaveVersion, IRegistry} from "@aztec/governance/interfaces/IRegistry.sol";
9
9
 
10
10
  /**
11
11
  * @title RegisterNewRollupVersionPayload
12
12
  * @author Aztec Labs
13
13
  * @notice A payload that registers a new rollup version in the Registry and GSE.
14
+ * @dev Only executes while PREDECESSOR is still the canonical rollup, so a stale registration cannot demote a
15
+ * newer one.
14
16
  */
15
17
  contract RegisterNewRollupVersionPayload is IPayload {
16
- /// @notice The registry contract where the rollup will be registered
18
+ /// @notice The registry the rollup is registered in.
17
19
  IRegistry public immutable REGISTRY;
18
20
 
19
- /// @notice The rollup instance to register
21
+ /// @notice The rollup to register.
20
22
  IInstance public immutable ROLLUP;
21
23
 
24
+ /// @notice The rollup that was canonical when this payload was deployed. ROLLUP replaces it.
25
+ IHaveVersion public immutable PREDECESSOR;
26
+
27
+ /// @notice Thrown when PREDECESSOR is no longer the canonical rollup.
28
+ error PredecessorNotCanonical(address predecessor, address canonical);
29
+
22
30
  /**
23
- * @notice Constructs a new RegisterNewRollupVersionPayload
24
- * @param _registry The registry contract
25
- * @param _rollup The rollup instance to register
31
+ * @param _registry The registry to register the rollup in
32
+ * @param _rollup The rollup to register
26
33
  */
27
34
  constructor(IRegistry _registry, IInstance _rollup) {
28
35
  REGISTRY = _registry;
29
36
  ROLLUP = _rollup;
37
+ PREDECESSOR = _registry.getCanonicalRollup();
30
38
  }
31
39
 
32
40
  /**
33
- * @notice Returns the actions to execute for registering the new rollup version
41
+ * @notice Returns the actions that register ROLLUP.
42
+ * @dev The first action checks that PREDECESSOR is still canonical, so a stale registration reverts before
43
+ * anything is written.
34
44
  * @return The array of actions to execute
35
45
  */
36
46
  function getActions() external view override(IPayload) returns (IPayload.Action[] memory) {
37
- IPayload.Action[] memory res = new IPayload.Action[](2);
47
+ IPayload.Action[] memory res = new IPayload.Action[](3);
48
+
49
+ res[0] = Action({target: address(this), data: abi.encodeWithSelector(this.assertPredecessorIsCanonical.selector)});
38
50
 
39
- res[0] =
51
+ res[1] =
40
52
  Action({target: address(REGISTRY), data: abi.encodeWithSelector(IRegistry.addRollup.selector, address(ROLLUP))});
41
53
 
42
- res[1] = Action({
54
+ res[2] = Action({
43
55
  target: address(ROLLUP.getGSE()), data: abi.encodeWithSelector(IGSECore.addRollup.selector, address(ROLLUP))
44
56
  });
45
57
 
46
58
  return res;
47
59
  }
48
60
 
61
+ /// @notice Reverts unless PREDECESSOR is the canonical rollup in REGISTRY.
62
+ /// @dev Called by Governance as the first action of this payload.
63
+ // solhint-disable-next-line comprehensive-interface
64
+ function assertPredecessorIsCanonical() external view {
65
+ address canonical = address(REGISTRY.getCanonicalRollup());
66
+ require(canonical == address(PREDECESSOR), PredecessorNotCanonical(address(PREDECESSOR), canonical));
67
+ }
68
+
49
69
  /**
50
70
  * @notice Returns the URI describing this payload
51
71
  * @return The payload URI string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec-foundation/l1-artifacts",
3
- "version": "6.0.0-rc.4",
3
+ "version": "6.0.0-rc.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./network-defaults.json": "./l1-contracts/scripts/network-defaults.json",
@@ -1 +0,0 @@
1
- {"id":"4cb7b5442b848dcc","source_id_to_path":{"0":"generated/HonkVerifier.sol","1":"lib/circuits/src/solidity/src/Constants.sol","2":"lib/circuits/src/solidity/src/DateUtils.sol","3":"lib/circuits/src/solidity/src/IProofVerifier.sol","4":"lib/circuits/src/solidity/src/IRootRegistry.sol","5":"lib/circuits/src/solidity/src/InputsExtractor.sol","6":"lib/circuits/src/solidity/src/StringUtils.sol","7":"lib/circuits/src/solidity/src/Types.sol","8":"lib/circuits/src/solidity/src/ZKPassportHelper.sol","9":"lib/circuits/src/solidity/src/ZKPassportRootVerifier.sol","10":"lib/circuits/src/solidity/src/ZKPassportSubVerifier.sol","11":"lib/forge-std/src/Base.sol","12":"lib/forge-std/src/Script.sol","13":"lib/forge-std/src/StdAssertions.sol","14":"lib/forge-std/src/StdChains.sol","15":"lib/forge-std/src/StdCheats.sol","16":"lib/forge-std/src/StdError.sol","17":"lib/forge-std/src/StdInvariant.sol","18":"lib/forge-std/src/StdJson.sol","19":"lib/forge-std/src/StdMath.sol","20":"lib/forge-std/src/StdStorage.sol","21":"lib/forge-std/src/StdStyle.sol","22":"lib/forge-std/src/StdToml.sol","23":"lib/forge-std/src/StdUtils.sol","24":"lib/forge-std/src/Test.sol","25":"lib/forge-std/src/Vm.sol","26":"lib/forge-std/src/console.sol","27":"lib/forge-std/src/console2.sol","28":"lib/forge-std/src/interfaces/IERC165.sol","29":"lib/forge-std/src/interfaces/IERC20.sol","30":"lib/forge-std/src/interfaces/IERC721.sol","31":"lib/forge-std/src/interfaces/IMulticall3.sol","32":"lib/forge-std/src/mocks/MockERC20.sol","33":"lib/forge-std/src/mocks/MockERC721.sol","34":"lib/forge-std/src/safeconsole.sol","35":"lib/openzeppelin-contracts/contracts/access/Ownable.sol","36":"lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol","37":"lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol","38":"lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol","39":"lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol","40":"lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol","41":"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol","42":"lib/openzeppelin-contracts/contracts/proxy/Clones.sol","43":"lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol","44":"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","45":"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","46":"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol","47":"lib/openzeppelin-contracts/contracts/utils/Address.sol","48":"lib/openzeppelin-contracts/contracts/utils/Context.sol","49":"lib/openzeppelin-contracts/contracts/utils/Create2.sol","50":"lib/openzeppelin-contracts/contracts/utils/Errors.sol","51":"lib/openzeppelin-contracts/contracts/utils/Panic.sol","52":"lib/openzeppelin-contracts/contracts/utils/ShortStrings.sol","53":"lib/openzeppelin-contracts/contracts/utils/SlotDerivation.sol","54":"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol","55":"lib/openzeppelin-contracts/contracts/utils/Strings.sol","56":"lib/openzeppelin-contracts/contracts/utils/TransientSlot.sol","57":"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol","58":"lib/openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol","59":"lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol","60":"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol","61":"lib/openzeppelin-contracts/contracts/utils/math/Math.sol","62":"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol","63":"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol","64":"lib/openzeppelin-contracts/contracts/utils/structs/BitMaps.sol","65":"lib/openzeppelin-contracts/contracts/utils/structs/Checkpoints.sol","66":"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol","67":"script/deploy/DeployAztecL1Contracts.s.sol","68":"script/deploy/DeployRollupForUpgrade.s.sol","69":"script/deploy/DeployRollupLib.sol","70":"script/deploy/DeploymentConfiguration.sol","71":"script/deploy/RollupConfiguration.sol","72":"src/core/EscapeHatch.sol","73":"src/core/Rollup.sol","74":"src/core/RollupCore.sol","75":"src/core/interfaces/IEscapeHatch.sol","76":"src/core/interfaces/IFeeJuicePortal.sol","77":"src/core/interfaces/IInstance.sol","78":"src/core/interfaces/IRollup.sol","79":"src/core/interfaces/ISequencerRewardCalculator.sol","80":"src/core/interfaces/ISlasher.sol","81":"src/core/interfaces/IStaking.sol","82":"src/core/interfaces/IValidatorSelection.sol","83":"src/core/interfaces/IVerifier.sol","84":"src/core/interfaces/messagebridge/IInbox.sol","85":"src/core/interfaces/messagebridge/IOutbox.sol","86":"src/core/libraries/ConstantsGen.sol","87":"src/core/libraries/DataStructures.sol","88":"src/core/libraries/Errors.sol","89":"src/core/libraries/HatchMath.sol","90":"src/core/libraries/SlashPayloadLib.sol","91":"src/core/libraries/SlashRoundLib.sol","92":"src/core/libraries/StakingQueue.sol","93":"src/core/libraries/TimeLib.sol","94":"src/core/libraries/compressed-data/CheckpointLog.sol","95":"src/core/libraries/compressed-data/StakingQueueConfig.sol","96":"src/core/libraries/compressed-data/Tips.sol","97":"src/core/libraries/compressed-data/fees/FeeConfig.sol","98":"src/core/libraries/compressed-data/fees/FeeStructs.sol","99":"src/core/libraries/crypto/Hash.sol","100":"src/core/libraries/crypto/MerkleLib.sol","101":"src/core/libraries/crypto/SampleLib.sol","102":"src/core/libraries/rollup/AttestationLib.sol","103":"src/core/libraries/rollup/AttesterExitExtLib.sol","104":"src/core/libraries/rollup/BlobLib.sol","105":"src/core/libraries/rollup/CoordinationSignatureLib.sol","106":"src/core/libraries/rollup/EpochProofExtLib.sol","107":"src/core/libraries/rollup/EpochProofLib.sol","108":"src/core/libraries/rollup/FeeLib.sol","109":"src/core/libraries/rollup/FieldLib.sol","110":"src/core/libraries/rollup/InvalidateLib.sol","111":"src/core/libraries/rollup/ProposeLib.sol","112":"src/core/libraries/rollup/ProposedHeaderLib.sol","113":"src/core/libraries/rollup/RewardExtLib.sol","114":"src/core/libraries/rollup/RewardLib.sol","115":"src/core/libraries/rollup/RollupOperationsExtLib.sol","116":"src/core/libraries/rollup/STFLib.sol","117":"src/core/libraries/rollup/SequencerRewardCalculatorLib.sol","118":"src/core/libraries/rollup/SlasherDeploymentExtLib.sol","119":"src/core/libraries/rollup/StakingLib.sol","120":"src/core/libraries/rollup/ValidatorOperationsExtLib.sol","121":"src/core/libraries/rollup/ValidatorSelectionLib.sol","122":"src/core/messagebridge/FeeJuicePortal.sol","123":"src/core/messagebridge/Inbox.sol","124":"src/core/messagebridge/Outbox.sol","125":"src/core/reward-boost/RewardBooster.sol","126":"src/core/slashing/Slasher.sol","127":"src/core/slashing/SlashingProposer.sol","128":"src/governance/Bn254LibWrapper.sol","129":"src/governance/CoinIssuer.sol","130":"src/governance/GSE.sol","131":"src/governance/GSEPayload.sol","132":"src/governance/Governance.sol","133":"src/governance/Registry.sol","134":"src/governance/RewardDistributor.sol","135":"src/governance/interfaces/IBn254LibWrapper.sol","136":"src/governance/interfaces/ICoinIssuer.sol","137":"src/governance/interfaces/IEmpire.sol","138":"src/governance/interfaces/IGovernance.sol","139":"src/governance/interfaces/IGovernanceProposer.sol","140":"src/governance/interfaces/IPayload.sol","141":"src/governance/interfaces/IProposerPayload.sol","142":"src/governance/interfaces/IRegistry.sol","143":"src/governance/interfaces/IRewardDistributor.sol","144":"src/governance/libraries/AddressSnapshotLib.sol","145":"src/governance/libraries/CheckpointedUintLib.sol","146":"src/governance/libraries/ConfigurationLib.sol","147":"src/governance/libraries/DepositDelegationLib.sol","148":"src/governance/libraries/Errors.sol","149":"src/governance/libraries/ProposalLib.sol","150":"src/governance/libraries/compressed-data/Ballot.sol","151":"src/governance/libraries/compressed-data/Configuration.sol","152":"src/governance/libraries/compressed-data/Proposal.sol","153":"src/governance/proposer/EmpireBase.sol","154":"src/governance/proposer/GovernanceProposer.sol","155":"src/mock/FeeAssetHandler.sol","156":"src/mock/MockFeeJuicePortal.sol","157":"src/mock/MockVerifier.sol","158":"src/mock/MultiAdder.sol","159":"src/mock/StakingAssetHandler.sol","160":"src/mock/TestERC20.sol","161":"src/mock/coverage/generated/HonkVerifier.sol","162":"src/mock/coverage/zkpassport/Constants.sol","163":"src/mock/coverage/zkpassport/IRootRegistry.sol","164":"src/mock/coverage/zkpassport/Types.sol","165":"src/mock/coverage/zkpassport/ZKPassportHelper.sol","166":"src/mock/coverage/zkpassport/ZKPassportRootVerifier.sol","167":"src/mock/coverage/zkpassport/ZKPassportSubVerifier.sol","168":"src/mock/coverage/zkpassport/ultra-honk-verifiers/OuterCount8.sol","169":"src/mock/libraries/BlobLib.sol","170":"src/mock/staking_asset_handler/MockZKPassportVerifier.sol","171":"src/periphery/DateGatedRelayer.sol","172":"src/periphery/FlushRewarder.sol","173":"src/periphery/RegisterNewRollupVersionPayload.sol","174":"src/periphery/SlashPayload.sol","175":"src/periphery/SlashPayloadCloneable.sol","176":"src/periphery/interfaces/IDateGatedRelayer.sol","177":"src/periphery/interfaces/IFlushRewarder.sol","178":"src/shared/interfaces/IMintableERC20.sol","179":"src/shared/libraries/BN254Lib.sol","180":"src/shared/libraries/CompressedTimeMath.sol","181":"src/shared/libraries/SignatureLib.sol","182":"src/shared/libraries/TimeMath.sol","183":"test/governance/governance/TestPayloads.sol"},"language":"Solidity"}