From 8f62b9f6f55a0763d71314ae55957df3ef56fb29 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:57:32 +0800 Subject: [PATCH 01/16] feat(protocol): introduce prover market for Proposer-Prover Separation (#19273) --- packages/protocol/contract_layout_layer1.md | 1385 ---------------- packages/protocol/contract_layout_layer2.md | 716 --------- .../contracts/layer1/based/ITaikoInbox.sol | 10 +- .../contracts/layer1/based/TaikoInbox.sol | 70 +- .../contracts/layer1/devnet/DevnetInbox.sol | 5 +- .../contracts/layer1/hekla/HeklaInbox.sol | 5 +- .../contracts/layer1/mainnet/MainnetInbox.sol | 5 +- .../layer1/preconf/impl/PreconfRouter.sol | 2 +- .../layer1/prover-market/IProverMarket.sol | 24 + .../layer1/prover-market/ProverMarket.sol | 194 +++ .../test_inbox_measure_gas_used.txt | 5 - packages/protocol/foundry.toml | 1 + ...h_provermarket_diff_prover_and_proposer.md | 5 + ..._prover_and_proposer_fee_above_liveness.md | 5 + .../gas-reports/inbox_without_provermarket.md | 5 + .../layer1-contracts.txt} | 106 +- packages/protocol/layout/layer1-contracts.md | 1389 +++++++++++++++++ packages/protocol/layout/layer2-contracts.md | 699 +++++++++ packages/protocol/package.json | 2 +- packages/protocol/script/gen-layouts.sh | 3 +- .../layer1/based/DeployProtocolOnL1.s.sol | 21 +- .../layer1/based/deploy_protocol_on_l1.sh | 1 + .../script/layer1/devnet/DeployPacayaL1.s.sol | 4 +- .../layer1/devnet/UpgradeDevnetPacayaL1.s.sol | 5 +- .../layer1/hekla/DeployHeklaPacayaL1.s.sol | 6 +- packages/protocol/test/layer1/Layer1Test.sol | 13 +- .../test/layer1/based/InboxTestBase.sol | 32 + .../test/layer1/based/InboxTest_Params.t.sol | 1 + .../based/InboxTest_ProposeAndProve.t.sol | 251 ++- .../layer1/preconf/mocks/MockTaikoInbox.sol | 5 +- .../layer1/preconf/router/PreconfRouter.t.sol | 8 +- .../layer1/prover-market/ProverMarket.t.sol | 245 +++ 32 files changed, 3013 insertions(+), 2215 deletions(-) delete mode 100644 packages/protocol/contract_layout_layer1.md delete mode 100644 packages/protocol/contract_layout_layer2.md create mode 100644 packages/protocol/contracts/layer1/prover-market/IProverMarket.sol create mode 100644 packages/protocol/contracts/layer1/prover-market/ProverMarket.sol delete mode 100644 packages/protocol/deployments/test_inbox_measure_gas_used.txt create mode 100644 packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md create mode 100644 packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md create mode 100644 packages/protocol/gas-reports/inbox_without_provermarket.md rename packages/protocol/{.gas-snapshot => gas-reports/layer1-contracts.txt} (78%) create mode 100644 packages/protocol/layout/layer1-contracts.md create mode 100644 packages/protocol/layout/layer2-contracts.md create mode 100644 packages/protocol/test/layer1/prover-market/ProverMarket.t.sol diff --git a/packages/protocol/contract_layout_layer1.md b/packages/protocol/contract_layout_layer1.md deleted file mode 100644 index b2b0d8eb4b2..00000000000 --- a/packages/protocol/contract_layout_layer1.md +++ /dev/null @@ -1,1385 +0,0 @@ -## ERC1155Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+========================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -| -| __gap | uint256[50] | 401 | 0 | 1600 | -| -| __gap | uint256[50] | 451 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - - -## ERC20Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+====================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | -| -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | -| -| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | -| -| __gap | uint256[45] | 306 | 0 | 1440 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - - -## ERC20VaultOriginal - -╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+============================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | -| -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | -| -| __gap | uint256[46] | 305 | 0 | 1472 | -╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ - - -## ERC721Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+======================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - - -## BridgedERC20 - -╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| _balances | mapping(address => uint256) | 251 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | -| -| _totalSupply | uint256 | 253 | 0 | 32 | -| -| _name | string | 254 | 0 | 32 | -| -| _symbol | string | 255 | 0 | 32 | -| -| __gap | uint256[45] | 256 | 0 | 1440 | -| -| srcToken | address | 301 | 0 | 20 | -| -| __srcDecimals | uint8 | 301 | 20 | 1 | -| -| srcChainId | uint256 | 302 | 0 | 32 | -| -| migratingAddress | address | 303 | 0 | 20 | -| -| migratingInbound | bool | 303 | 20 | 1 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - - -## BridgedERC20V2 - -╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==============================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| _balances | mapping(address => uint256) | 251 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | -| -| _totalSupply | uint256 | 253 | 0 | 32 | -| -| _name | string | 254 | 0 | 32 | -| -| _symbol | string | 255 | 0 | 32 | -| -| __gap | uint256[45] | 256 | 0 | 1440 | -| -| srcToken | address | 301 | 0 | 20 | -| -| __srcDecimals | uint8 | 301 | 20 | 1 | -| -| srcChainId | uint256 | 302 | 0 | 32 | -| -| migratingAddress | address | 303 | 0 | 20 | -| -| migratingInbound | bool | 303 | 20 | 1 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -| -| _hashedName | bytes32 | 351 | 0 | 32 | -| -| _hashedVersion | bytes32 | 352 | 0 | 32 | -| -| _name | string | 353 | 0 | 32 | -| -| _version | string | 354 | 0 | 32 | -| -| __gap | uint256[48] | 355 | 0 | 1536 | -| -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | -| -| __gap | uint256[49] | 404 | 0 | 1568 | -╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - - -## BridgedERC721 - -╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| _name | string | 301 | 0 | 32 | -| -| _symbol | string | 302 | 0 | 32 | -| -| _owners | mapping(uint256 => address) | 303 | 0 | 32 | -| -| _balances | mapping(address => uint256) | 304 | 0 | 32 | -| -| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | -| -| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | -| -| __gap | uint256[44] | 307 | 0 | 1408 | -| -| srcToken | address | 351 | 0 | 20 | -| -| srcChainId | uint256 | 352 | 0 | 32 | -| -| __gap | uint256[48] | 353 | 0 | 1536 | -╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - - -## BridgedERC1155 - -╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=======================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | -| -| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | -| -| _uri | string | 303 | 0 | 32 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -| -| srcToken | address | 351 | 0 | 20 | -| -| srcChainId | uint256 | 352 | 0 | 32 | -| -| symbol | string | 353 | 0 | 32 | -| -| name | string | 354 | 0 | 32 | -| -| __gap | uint256[46] | 355 | 0 | 1472 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - - -## Bridge - -╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __reserved1 | uint64 | 251 | 0 | 8 | -| -| nextMessageId | uint64 | 251 | 8 | 8 | -| -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | -| -| __ctx | struct IBridge.Context | 253 | 0 | 64 | -| -| __reserved2 | uint256 | 255 | 0 | 32 | -| -| __reserved3 | uint256 | 256 | 0 | 32 | -| -| __gap | uint256[44] | 257 | 0 | 1408 | -╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ - - -## QuotaManager - -╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | -| -| quotaPeriod | uint24 | 252 | 0 | 3 | -| -| __gap | uint256[48] | 253 | 0 | 1536 | -╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - - -## DefaultResolver - -╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=====================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | -| -| __gap | uint256[49] | 252 | 0 | 1568 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - - -## EssentialContract - -╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ - - -## SignalService - -╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | -| -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | -| -| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - - -## TaikoToken - -╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | -| -| _balances | mapping(address => uint256) | 301 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | -| -| _totalSupply | uint256 | 303 | 0 | 32 | -| -| _name | string | 304 | 0 | 32 | -| -| _symbol | string | 305 | 0 | 32 | -| -| __gap | uint256[45] | 306 | 0 | 1440 | -| -| _hashedName | bytes32 | 351 | 0 | 32 | -| -| _hashedVersion | bytes32 | 352 | 0 | 32 | -| -| _name | string | 353 | 0 | 32 | -| -| _version | string | 354 | 0 | 32 | -| -| __gap | uint256[48] | 355 | 0 | 1536 | -| -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | -| -| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | -| -| __gap | uint256[49] | 405 | 0 | 1568 | -| -| _delegates | mapping(address => address) | 454 | 0 | 32 | -| -| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | -| -| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | -| -| __gap | uint256[47] | 457 | 0 | 1504 | -| -| __gap | uint256[50] | 504 | 0 | 1600 | -╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╯ - - -## SgxAndZkVerifier - -╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==============================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| __gap | uint256[50] | 301 | 0 | 1600 | -╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╯ - - -## Risc0Verifier - -╭-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=============================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | -| -| __gap | uint256[49] | 252 | 0 | 1568 | -╰-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╯ - - -## SP1Verifier - -╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | -| -| __gap | uint256[49] | 252 | 0 | 1568 | -╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ - - -## SgxVerifier - -╭-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| nextInstanceId | uint256 | 251 | 0 | 32 | -| -| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | -| -| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╯ - - -## AutomataDcapV3Attestation - -╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=======================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| sigVerifyLib | contract ISigVerifyLib | 251 | 0 | 20 | -| -| pemCertLib | contract IPEMCertChainLib | 252 | 0 | 20 | -| -| checkLocalEnclaveReport | bool | 252 | 20 | 1 | -| -| trustedUserMrEnclave | mapping(bytes32 => bool) | 253 | 0 | 32 | -| -| trustedUserMrSigner | mapping(bytes32 => bool) | 254 | 0 | 32 | -| -| serialNumIsRevoked | mapping(uint256 => mapping(bytes => bool)) | 255 | 0 | 32 | -| -| tcbInfo | mapping(string => struct TCBInfoStruct.TCBInfo) | 256 | 0 | 32 | -| -| qeIdentity | struct EnclaveIdStruct.EnclaveId | 257 | 0 | 128 | -| -| __gap | uint256[39] | 261 | 0 | 1248 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╯ - - -## TaikoInbox - -╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| state | struct ITaikoInbox.State | 251 | 0 | 1600 | -| -| __gap | uint256[50] | 301 | 0 | 1600 | -╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ - - -## HeklaInbox - -╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| state | struct ITaikoInbox.State | 251 | 0 | 1600 | -| -| __gap | uint256[50] | 301 | 0 | 1600 | -╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ - - -## MainnetBridge - -╭-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+======================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __reserved1 | uint64 | 251 | 0 | 8 | -| -| nextMessageId | uint64 | 251 | 8 | 8 | -| -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | -| -| __ctx | struct IBridge.Context | 253 | 0 | 64 | -| -| __reserved2 | uint256 | 255 | 0 | 32 | -| -| __reserved3 | uint256 | 256 | 0 | 32 | -| -| __gap | uint256[44] | 257 | 0 | 1408 | -╰-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╯ - - -## MainnetSignalService - -╭-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==========================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | -| -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | -| -| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╯ - - -## MainnetERC20Vault - -╭-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | -| -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | -| -| __gap | uint256[46] | 305 | 0 | 1472 | -╰-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╯ - - -## MainnetERC1155Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===============================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -| -| __gap | uint256[50] | 401 | 0 | 1600 | -| -| __gap | uint256[50] | 451 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╯ - - -## MainnetERC721Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=============================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╯ - - -## MainnetInbox - -╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| state | struct ITaikoInbox.State | 251 | 0 | 1600 | -| -| __gap | uint256[50] | 301 | 0 | 1600 | -╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ - - -## TokenUnlock - -╭-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| amountVested | uint256 | 251 | 0 | 32 | -| -| recipient | address | 252 | 0 | 20 | -| -| tgeTimestamp | uint64 | 252 | 20 | 8 | -| -| isProverSet | mapping(address => bool) | 253 | 0 | 32 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╯ - - -## ProverSet - -╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| isProver | mapping(address => bool) | 251 | 0 | 32 | -| -| admin | address | 252 | 0 | 20 | -| -| __gap | uint256[48] | 253 | 0 | 1536 | -╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ - - -## ForkRouter - -╭---------------+-------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==============================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -╰---------------+-------------+------+--------+-------+--------------------------------------------------------╯ - - -## TaikoWrapper - -╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ - - -## ForcedInclusionStore - -╭-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==========================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| queue | mapping(uint256 => struct IForcedInclusionStore.ForcedInclusion) | 251 | 0 | 32 | -| -| head | uint64 | 252 | 0 | 8 | -| -| tail | uint64 | 252 | 8 | 8 | -| -| lastProcessedAtBatchId | uint64 | 252 | 16 | 8 | -| -| __reserved1 | uint64 | 252 | 24 | 8 | -| -| __gap | uint256[48] | 253 | 0 | 1536 | -╰-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╯ - - -## PreconfRouter - -╭-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -╰-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╯ - - -## PreconfWhitelist - -╭-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+======================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| operators | mapping(address => struct PreconfWhitelist.OperatorInfo) | 251 | 0 | 32 | -| -| operatorMapping | mapping(uint256 => address) | 252 | 0 | 32 | -| -| operatorCount | uint8 | 253 | 0 | 1 | -| -| operatorChangeDelay | uint8 | 253 | 1 | 1 | -| -| havingPerfectOperators | bool | 253 | 2 | 1 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╯ - - -## TaikoTreasuryVault - -╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╯ - - diff --git a/packages/protocol/contract_layout_layer2.md b/packages/protocol/contract_layout_layer2.md deleted file mode 100644 index 736a7d7267a..00000000000 --- a/packages/protocol/contract_layout_layer2.md +++ /dev/null @@ -1,716 +0,0 @@ -## ERC1155Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+========================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -| -| __gap | uint256[50] | 401 | 0 | 1600 | -| -| __gap | uint256[50] | 451 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - - -## ERC20Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+====================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | -| -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | -| -| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | -| -| __gap | uint256[45] | 306 | 0 | 1440 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - - -## ERC20VaultOriginal - -╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+============================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | -| -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | -| -| __gap | uint256[46] | 305 | 0 | 1472 | -╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ - - -## ERC721Vault - -╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+======================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | -| -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | -| -| __gap | uint256[48] | 303 | 0 | 1536 | -| -| __gap | uint256[50] | 351 | 0 | 1600 | -╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - - -## BridgedERC20 - -╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| _balances | mapping(address => uint256) | 251 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | -| -| _totalSupply | uint256 | 253 | 0 | 32 | -| -| _name | string | 254 | 0 | 32 | -| -| _symbol | string | 255 | 0 | 32 | -| -| __gap | uint256[45] | 256 | 0 | 1440 | -| -| srcToken | address | 301 | 0 | 20 | -| -| __srcDecimals | uint8 | 301 | 20 | 1 | -| -| srcChainId | uint256 | 302 | 0 | 32 | -| -| migratingAddress | address | 303 | 0 | 20 | -| -| migratingInbound | bool | 303 | 20 | 1 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - - -## BridgedERC20V2 - -╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==============================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| _balances | mapping(address => uint256) | 251 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | -| -| _totalSupply | uint256 | 253 | 0 | 32 | -| -| _name | string | 254 | 0 | 32 | -| -| _symbol | string | 255 | 0 | 32 | -| -| __gap | uint256[45] | 256 | 0 | 1440 | -| -| srcToken | address | 301 | 0 | 20 | -| -| __srcDecimals | uint8 | 301 | 20 | 1 | -| -| srcChainId | uint256 | 302 | 0 | 32 | -| -| migratingAddress | address | 303 | 0 | 20 | -| -| migratingInbound | bool | 303 | 20 | 1 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -| -| _hashedName | bytes32 | 351 | 0 | 32 | -| -| _hashedVersion | bytes32 | 352 | 0 | 32 | -| -| _name | string | 353 | 0 | 32 | -| -| _version | string | 354 | 0 | 32 | -| -| __gap | uint256[48] | 355 | 0 | 1536 | -| -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | -| -| __gap | uint256[49] | 404 | 0 | 1568 | -╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - - -## BridgedERC721 - -╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| _name | string | 301 | 0 | 32 | -| -| _symbol | string | 302 | 0 | 32 | -| -| _owners | mapping(uint256 => address) | 303 | 0 | 32 | -| -| _balances | mapping(address => uint256) | 304 | 0 | 32 | -| -| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | -| -| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | -| -| __gap | uint256[44] | 307 | 0 | 1408 | -| -| srcToken | address | 351 | 0 | 20 | -| -| srcChainId | uint256 | 352 | 0 | 32 | -| -| __gap | uint256[48] | 353 | 0 | 1536 | -╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - - -## BridgedERC1155 - -╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=======================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __gap | uint256[50] | 251 | 0 | 1600 | -| -| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | -| -| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | -| -| _uri | string | 303 | 0 | 32 | -| -| __gap | uint256[47] | 304 | 0 | 1504 | -| -| srcToken | address | 351 | 0 | 20 | -| -| srcChainId | uint256 | 352 | 0 | 32 | -| -| symbol | string | 353 | 0 | 32 | -| -| name | string | 354 | 0 | 32 | -| -| __gap | uint256[46] | 355 | 0 | 1472 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - - -## Bridge - -╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __reserved1 | uint64 | 251 | 0 | 8 | -| -| nextMessageId | uint64 | 251 | 8 | 8 | -| -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | -| -| __ctx | struct IBridge.Context | 253 | 0 | 64 | -| -| __reserved2 | uint256 | 255 | 0 | 32 | -| -| __reserved3 | uint256 | 256 | 0 | 32 | -| -| __gap | uint256[44] | 257 | 0 | 1408 | -╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ - - -## QuotaManager - -╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | -| -| quotaPeriod | uint24 | 252 | 0 | 3 | -| -| __gap | uint256[48] | 253 | 0 | 1536 | -╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - - -## DefaultResolver - -╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=====================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | -| -| __gap | uint256[49] | 252 | 0 | 1568 | -╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - - -## EssentialContract - -╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+=====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ - - -## SignalService - -╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+===============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | -| -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | -| -| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | -╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - - -## BridgedTaikoToken - -╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+==============================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | -| -| _balances | mapping(address => uint256) | 301 | 0 | 32 | -| -| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | -| -| _totalSupply | uint256 | 303 | 0 | 32 | -| -| _name | string | 304 | 0 | 32 | -| -| _symbol | string | 305 | 0 | 32 | -| -| __gap | uint256[45] | 306 | 0 | 1440 | -| -| _hashedName | bytes32 | 351 | 0 | 32 | -| -| _hashedVersion | bytes32 | 352 | 0 | 32 | -| -| _name | string | 353 | 0 | 32 | -| -| _version | string | 354 | 0 | 32 | -| -| __gap | uint256[48] | 355 | 0 | 1536 | -| -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | -| -| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | -| -| __gap | uint256[49] | 405 | 0 | 1568 | -| -| _delegates | mapping(address => address) | 454 | 0 | 32 | -| -| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | -| -| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | -| -| __gap | uint256[47] | 457 | 0 | 1504 | -| -| __gap | uint256[50] | 504 | 0 | 1600 | -╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╯ - - -## DelegateOwner - -╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+======================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| remoteChainId | uint64 | 251 | 0 | 8 | -| -| admin | address | 251 | 8 | 20 | -| -| nextTxId | uint64 | 252 | 0 | 8 | -| -| remoteOwner | address | 252 | 8 | 20 | -| -| __gap | uint256[48] | 253 | 0 | 1536 | -╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------╯ - - -## TaikoAnchor - -╭-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | -+========================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | -| -| _initializing | bool | 0 | 1 | 1 | -| -| __gap | uint256[50] | 1 | 0 | 1600 | -| -| _owner | address | 51 | 0 | 20 | -| -| __gap | uint256[49] | 52 | 0 | 1568 | -| -| _pendingOwner | address | 101 | 0 | 20 | -| -| __gap | uint256[49] | 102 | 0 | 1568 | -| -| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | -| -| __reentry | uint8 | 201 | 0 | 1 | -| -| __paused | uint8 | 201 | 1 | 1 | -| -| __gap | uint256[49] | 202 | 0 | 1568 | -| -| _blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | -| -| publicInputHash | bytes32 | 252 | 0 | 32 | -| -| parentGasExcess | uint64 | 253 | 0 | 8 | -| -| lastSyncedBlock | uint64 | 253 | 8 | 8 | -| -| parentTimestamp | uint64 | 253 | 16 | 8 | -| -| parentGasTarget | uint64 | 253 | 24 | 8 | -| -| l1ChainId | uint64 | 254 | 0 | 8 | -| -| __gap | uint256[46] | 255 | 0 | 1472 | -╰-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╯ - - diff --git a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol index 89f5517c9c8..24683d370b2 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol @@ -26,6 +26,8 @@ interface ITaikoInbox { // the timestamp of the parent block in the same batch. For the first block in a batch, // there is not parent block in the same batch, so the time shift should be 0. uint8 timeShift; + // A value used to mark the block. + uint8 marker; // Signals sent on L1 and need to sync to this L2 block. bytes32[] signalSlots; } @@ -54,6 +56,7 @@ interface ITaikoInbox { uint64 anchorBlockId; uint64 lastBlockTimestamp; bool revertIfNotFirstProposal; + bool optInProverMarket; // Specifies the number of blocks to be generated from this batch. BlobParams blobParams; BlockParams[] blocks; @@ -66,8 +69,9 @@ interface ITaikoInbox { // Data to build L2 blocks BlockParams[] blocks; bytes32[] blobHashes; - bytes32 extraData; + bytes32[] extraDataList; address coinbase; + address proposer; uint64 proposedIn; // Used by node/client uint64 blobCreatedIn; uint32 blobByteOffset; @@ -86,7 +90,7 @@ interface ITaikoInbox { /// @dev This struct holds batch metadata essential for proving the batch. struct BatchMetadata { bytes32 infoHash; - address proposer; + address prover; uint64 batchId; uint64 proposedAt; // Used by node/client } @@ -264,6 +268,7 @@ interface ITaikoInbox { error BlockNotFound(); error BlobNotSpecified(); error ContractPaused(); + error CurrentProverCannotWithdraw(); error CustomProposerMissing(); error CustomProposerNotAllowed(); error EtherNotPaidAsBond(); @@ -280,6 +285,7 @@ interface ITaikoInbox { error MetaHashMismatch(); error MsgValueNotZero(); error NoBlocksToProve(); + error NoProverAvailable(); error NotFirstProposal(); error NotInboxWrapper(); error ParentMetaHashMismatch(); diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index c4df0051d77..879de8fbd62 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -10,6 +10,7 @@ import "src/shared/libs/LibNetwork.sol"; import "src/shared/libs/LibStrings.sol"; import "src/shared/signal/ISignalService.sol"; import "src/layer1/verifiers/IVerifier.sol"; +import "src/layer1/prover-market/IProverMarket.sol"; import "./ITaikoInbox.sol"; import "./IProposeBatch.sol"; @@ -34,17 +35,20 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I address public immutable verifier; address public immutable bondToken; ISignalService public immutable signalService; + IProverMarket public immutable proverMarket; State public state; // storage layout much match Ontake fork uint256[50] private __gap; // External functions ------------------------------------------------------------------------ + /// @dev proverMarket is optional, so we can pass in address(0) constructor( address _inboxWrapper, address _verifier, address _bondToken, - address _signalService + address _signalService, + address _proverMarket ) nonZeroAddr(_verifier) nonZeroAddr(_signalService) @@ -54,6 +58,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I verifier = _verifier; bondToken = _bondToken; signalService = ISignalService(_signalService); + proverMarket = IProverMarket(_proverMarket); } function init(address _owner, bytes32 _genesisBlockHash) external initializer { @@ -152,14 +157,16 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I // use // the following approach to calculate a block's difficulty: // `keccak256(abi.encode("TAIKO_DIFFICULTY", block.number))` + info_ = BatchInfo({ txsHash: bytes32(0), // to be initialised later // // Data to build L2 blocks blocks: params.blocks, blobHashes: new bytes32[](0), // to be initialised later - extraData: bytes32(uint256(config.baseFeeConfig.sharingPctg)), + extraDataList: new bytes32[](0), // to be initliaised later coinbase: params.coinbase, + proposer: params.proposer, proposedIn: uint64(block.number), blobCreatedIn: params.blobParams.createdIn, blobByteOffset: params.blobParams.byteOffset, @@ -174,22 +181,54 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I baseFeeConfig: config.baseFeeConfig }); + uint64 nBlocks = uint64(params.blocks.length); + info_.extraDataList = new bytes32[](nBlocks); + + for (uint256 i; i < nBlocks; ++i) { + info_.extraDataList[i] = + _encodeExtraData(config.baseFeeConfig.sharingPctg, params.blocks[i].marker); + } + require(info_.anchorBlockHash != 0, ZeroAnchorBlockHash()); info_.lastBlockId = stats2.numBatches == config.forkHeights.pacaya - ? stats2.numBatches + uint64(params.blocks.length) - 1 - : lastBatch.lastBlockId + uint64(params.blocks.length); + ? stats2.numBatches + nBlocks - 1 + : lastBatch.lastBlockId + nBlocks; (info_.txsHash, info_.blobHashes) = _calculateTxsHash(keccak256(_txList), params.blobParams); meta_ = BatchMetadata({ infoHash: keccak256(abi.encode(info_)), - proposer: params.proposer, + prover: info_.proposer, batchId: stats2.numBatches, proposedAt: uint64(block.timestamp) }); + if (address(proverMarket) != address(0) && params.optInProverMarket) { + uint256 proverFee; + (meta_.prover, proverFee) = proverMarket.getCurrentProver(); + require(meta_.prover != address(0), NoProverAvailable()); + + if (info_.proposer == meta_.prover) { + // proposer is the same as the prover, no need to pay the prover fee. + _debitBond(meta_.prover, config.livenessBondBase); + } else { + // proposer pay the prover fee. + _debitBond(info_.proposer, proverFee); + + if (proverFee < config.livenessBondBase) { + _debitBond(meta_.prover, config.livenessBondBase - proverFee); + } else { + _creditBond(meta_.prover, proverFee - config.livenessBondBase); + } + proverMarket.onProverAssigned(meta_.prover, proverFee, meta_.batchId); + } + } else { + // proposer is the same as the prover, no need to pay the prover fee. + _debitBond(meta_.prover, config.livenessBondBase); + } + Batch storage batch = state.batches[stats2.numBatches % config.batchRingBufferSize]; // SSTORE #1 @@ -204,8 +243,6 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I batch.reserved4 = 0; // SSTORE }} - _debitBond(params.proposer, config.livenessBondBase); - // SSTORE #3 {{ batch.lastBlockId = info_.lastBlockId; batch.reserved3 = 0; @@ -331,7 +368,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } ts.inProvingWindow = inProvingWindow; - ts.prover = inProvingWindow ? meta.proposer : msg.sender; + ts.prover = inProvingWindow ? meta.prover : msg.sender; ts.createdAt = uint48(block.timestamp); if (tid == 1) { @@ -381,6 +418,11 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I /// @inheritdoc ITaikoInbox function withdrawBond(uint256 _amount) external whenNotPaused { + if (address(proverMarket) != address(0)) { + (address currentProver,) = proverMarket.getCurrentProver(); + require(msg.sender != currentProver, CurrentProverCannotWithdraw()); + } + uint256 balance = state.bondBalance[msg.sender]; require(balance >= _amount, InsufficientBond()); @@ -759,9 +801,9 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I view returns (uint64 anchorBlockId_, uint64 lastBlockTimestamp_) { - uint256 blocksLength = _params.blocks.length; - require(blocksLength != 0, BlockNotFound()); - require(blocksLength <= _maxBlocksPerBatch, TooManyBlocks()); + uint256 nBlocks = _params.blocks.length; + require(nBlocks != 0, BlockNotFound()); + require(nBlocks <= _maxBlocksPerBatch, TooManyBlocks()); unchecked { if (_params.anchorBlockId == 0) { @@ -788,7 +830,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I uint64 totalShift; - for (uint256 i; i < blocksLength; ++i) { + for (uint256 i; i < nBlocks; ++i) { totalShift += _params.blocks[i].timeShift; uint256 numSignals = _params.blocks[i].signalSlots.length; @@ -826,6 +868,10 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } } + function _encodeExtraData(uint8 _sharingPctg, uint8 _marker) internal pure returns (bytes32) { + return bytes32(uint256(_marker) << 8 | _sharingPctg); + } + // Memory-only structs ---------------------------------------------------------------------- struct SyncBlock { diff --git a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol index a8c307c0c0f..81e8f6c83be 100644 --- a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol +++ b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol @@ -16,9 +16,10 @@ contract DevnetInbox is TaikoInbox { address _wrapper, address _verifier, address _bondToken, - address _signalService + address _signalService, + address _proverMarket ) - TaikoInbox(_wrapper, _verifier, _bondToken, _signalService) + TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { chainId = _chainId; cooldownWindow = _cooldownWindow; diff --git a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol index 75183dc2a24..bb03e606365 100644 --- a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol +++ b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol @@ -17,9 +17,10 @@ contract HeklaInbox is TaikoInbox { address _wrapper, address _verifier, address _bondToken, - address _signalService + address _signalService, + address _proverMarket ) - TaikoInbox(_wrapper, _verifier, _bondToken, _signalService) + TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } /// @notice Manually write a transition for a batch. diff --git a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol index c8ae9d28617..289cb7fce54 100644 --- a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol +++ b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol @@ -15,9 +15,10 @@ contract MainnetInbox is TaikoInbox { address _wrapper, address _verifier, address _bondToken, - address _signalService + address _signalService, + address _proverMarket ) - TaikoInbox(_wrapper, _verifier, _bondToken, _signalService) + TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } function pacayaConfig() public pure override returns (ITaikoInbox.Config memory) { diff --git a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol index 29654bed7ae..14592eedf20 100644 --- a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol +++ b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol @@ -52,6 +52,6 @@ contract PreconfRouter is EssentialContract, IPreconfRouter { (info_, meta_) = proposeBatchEntrypoint.proposeBatch(_params, _txList); // Verify that the sender had set itself as the proposer - require(meta_.proposer == msg.sender, ProposerIsNotPreconfer()); + require(info_.proposer == msg.sender, ProposerIsNotPreconfer()); } } diff --git a/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol new file mode 100644 index 00000000000..2293e730315 --- /dev/null +++ b/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +/// @title IProverMarket +/// @custom:security-contact security@taiko.xyz +interface IProverMarket { + /// @notice Emitted when a new prover wins the auction. + event ProverChanged(address indexed prover, uint256 fee, uint256 exitTimestamp); + + /// @notice Emitted when the prover is used by TaikoInbox for a given batch. + event ProverAssigned(address indexed prover, uint256 fee, uint64 indexed batchId); + + /// @notice Returns the current winning prover and proving fee per batch. + /// @dev address(0) and 0 will be returned if there is no current prover. + /// @return prover_ The address of the current winning prover. + /// @return fee_ The proving fee per batch. + function getCurrentProver() external view returns (address prover_, uint256 fee_); + + /// @notice Called by TaikoInbox when the prover market is used. + /// @param _prover The address of the prover. + /// @param _fee The proving fee per batch. + /// @param _batchId The batch id. + function onProverAssigned(address _prover, uint256 _fee, uint64 _batchId) external; +} diff --git a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol new file mode 100644 index 00000000000..66ac255f1b9 --- /dev/null +++ b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol @@ -0,0 +1,194 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import "src/shared/common/EssentialContract.sol"; +import "src/shared/libs/LibMath.sol"; +import "src/layer1/based/ITaikoInbox.sol"; +import "./IProverMarket.sol"; + +/// @title ProverMarket +/// @custom:security-contact security@taiko.xyz +contract ProverMarket is EssentialContract, IProverMarket { + using SafeERC20 for IERC20; + using LibMath for uint256; + + error CannotFitToUint64(); + error FeeLargerThanAllowed(); + error FeeLargerThanMax(); + error FeeNotDivisibleByFeeUnit(); + error InsufficientBondBalance(); + error InvalidThresholds(); + error NotCurrentProver(); + error TooEarly(); + + uint256 public constant FEE_CHANGE_FACTOR = 100; + uint16 public constant FEE_CHANGE_THRESHOLD = 10; + uint256 public constant MAX_FEE_MULTIPLIER = 2; + uint256 public constant NEW_BID_PERCENTAGE = 95; + uint256 internal constant GWEI = 10 ** 9; + + struct Prover { + uint64 exitTimestamp; + } + + ITaikoInbox public immutable inbox; + /// @dev If a prover’s available bond balance is below this threshold, they are not eligible + /// to participate in the bidding process. + uint256 public immutable biddingThreshold; + /// @dev If the current prover’s bond balance falls below this value, they can be outbid by + /// another prover even if the new bid offers the same proving fee or only a slightly higher one + /// (e.g., 1.01× or 1.05× the current fee). + uint256 public immutable outbidThreshold; + /// @dev If the current prover’s bond balance drops below this threshold, they are considered + /// disqualified (evicted), and the active prover is reset to address(0). + uint256 public immutable provingThreshold; + /// @dev The minimum delay required before a prover can exit the prover market. + uint256 public immutable minExitDelay; + + /// @dev Slot 1 + mapping(address account => Prover prover) public provers; + + /// @dev Slot 2 + address internal prover; + uint64 internal feeInGwei; // proving fee per batch + + /// @dev Slot 3 + uint64 public avgFeeInGwei; // moving average of fees + uint16 internal assignmentCount; // number of assignments + + uint256[47] private __gap; + + modifier validExitTimestamp(uint256 _exitTimestamp) { + require(_exitTimestamp >= block.timestamp + minExitDelay, TooEarly()); + _; + } + + constructor( + address _inbox, + uint256 _biddingThreshold, + uint256 _outbidThreshold, + uint256 _provingThreshold, + uint256 _minExitDelay + ) + nonZeroAddr(_inbox) + nonZeroValue(_minExitDelay) + EssentialContract(address(0)) + { + require(_biddingThreshold > _outbidThreshold, InvalidThresholds()); + require(_outbidThreshold > _provingThreshold, InvalidThresholds()); + require(_provingThreshold > 0, InvalidThresholds()); + + inbox = ITaikoInbox(_inbox); + + biddingThreshold = _biddingThreshold; + outbidThreshold = _outbidThreshold; + provingThreshold = _provingThreshold; + minExitDelay = _minExitDelay; + } + + /// @notice Initializes the contract. + /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. + function init(address _owner) external initializer { + __Essential_init(_owner); + } + + function bid(uint256 _fee, uint64 _exitTimestamp) external validExitTimestamp(_exitTimestamp) { + require(_fee > 0 && _fee % GWEI == 0, FeeNotDivisibleByFeeUnit()); + require(_fee / GWEI <= type(uint64).max, CannotFitToUint64()); + + uint256 maxFee = getMaxFee(); + require(maxFee == 0 || _fee <= maxFee, FeeLargerThanMax()); + + uint64 _newFeeInGwei = uint64(_fee / GWEI); + + require(inbox.bondBalanceOf(msg.sender) >= biddingThreshold, InsufficientBondBalance()); + + (address currentProver, uint64 currentFeeInGwei) = _getCurrentProverAndFeeInGwei(); + + // If there is no prover, the new prover can set any fee. + if (currentProver != address(0)) { + uint256 maxFeeInGwei; + + if (inbox.bondBalanceOf(currentProver) < outbidThreshold) { + // The current prover has less than outbidThreshold, so the new prover can set any + // fee as long as it's not larger than the current fee + maxFeeInGwei = currentFeeInGwei; + } else { + // The current prover has more than outbidThreshold, so the new prover can set any + // fee as long as it's not larger than 95% of the current fee + maxFeeInGwei = currentFeeInGwei * NEW_BID_PERCENTAGE / 100; + } + + require(_newFeeInGwei <= maxFeeInGwei, FeeLargerThanAllowed()); + } + + prover = msg.sender; + feeInGwei = _newFeeInGwei; + provers[msg.sender].exitTimestamp = _exitTimestamp; + assignmentCount = 0; + + emit ProverChanged(msg.sender, _fee, _exitTimestamp); + } + + function requestExit(uint64 _exitTimestamp) external validExitTimestamp(_exitTimestamp) { + (address currentProver, uint64 currentFeeInGwei) = _getCurrentProverAndFeeInGwei(); + + require(currentProver != address(0) && msg.sender == currentProver, NotCurrentProver()); + + provers[msg.sender].exitTimestamp = _exitTimestamp; + emit ProverChanged(msg.sender, currentFeeInGwei * GWEI, _exitTimestamp); + } + + /// @inheritdoc IProverMarket + function getCurrentProver() public view returns (address, uint256) { + (address currentProver, uint64 currentFeeInGwei) = _getCurrentProverAndFeeInGwei(); + return + currentProver == address(0) ? (address(0), 0) : (currentProver, currentFeeInGwei * GWEI); + } + + /// @inheritdoc IProverMarket + function onProverAssigned( + address, /*_prover*/ + uint256 _fee, + uint64 _batchId + ) + external + onlyFrom(address(inbox)) + { + emit ProverAssigned(msg.sender, _fee, _batchId); + + if (assignmentCount > FEE_CHANGE_THRESHOLD) { + // No need to update assignmentCount nor avgFee + return; + } + + if (++assignmentCount <= FEE_CHANGE_THRESHOLD) { + uint64 _avgFeeInGwei = avgFeeInGwei; + uint64 _feeInGwei = uint64(_fee / GWEI); + + unchecked { + avgFeeInGwei = _avgFeeInGwei == 0 + ? _feeInGwei + : uint64(((FEE_CHANGE_FACTOR - 1) * _avgFeeInGwei + _feeInGwei) / FEE_CHANGE_FACTOR); + } + } + } + + function getMaxFee() public view returns (uint256) { + return (MAX_FEE_MULTIPLIER * avgFeeInGwei).min(type(uint64).max) * GWEI; + } + + function _getCurrentProverAndFeeInGwei() internal view returns (address, uint64) { + address currentProver = prover; + if ( + currentProver == address(0) // no bidding + || block.timestamp >= provers[currentProver].exitTimestamp // exited already + || inbox.bondBalanceOf(currentProver) < provingThreshold // not eligible + ) { + return (address(0), 0); + } else { + return (currentProver, feeInGwei); + } + } +} diff --git a/packages/protocol/deployments/test_inbox_measure_gas_used.txt b/packages/protocol/deployments/test_inbox_measure_gas_used.txt deleted file mode 100644 index ab0d11fb2c4..00000000000 --- a/packages/protocol/deployments/test_inbox_measure_gas_used.txt +++ /dev/null @@ -1,5 +0,0 @@ -See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol - -Gas per proposeBatches: 654399 -Gas per proveBatches: 48449 -Total: 702848 \ No newline at end of file diff --git a/packages/protocol/foundry.toml b/packages/protocol/foundry.toml index 4c37fe185a1..0612192f2fa 100644 --- a/packages/protocol/foundry.toml +++ b/packages/protocol/foundry.toml @@ -35,6 +35,7 @@ block_gas_limit = 80_000_000 fs_permissions = [ { access = "read", path = "./out" }, { access = "read-write", path = "./deployments" }, + { access = "read-write", path = "./gas-reports" }, { access = "read", path = "./test" }, { access = "read", path = "./script/" }, { access = "read", path = "./genesis" }, diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md new file mode 100644 index 00000000000..d32d4e21303 --- /dev/null +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md @@ -0,0 +1,5 @@ +See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol + +Gas per proposing: 206854 +Gas per proving + verification: 158743 +Total: 365597 diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md new file mode 100644 index 00000000000..98bfbbe085a --- /dev/null +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md @@ -0,0 +1,5 @@ +See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol + +Gas per proposing: 206703 +Gas per proving + verification: 158749 +Total: 365452 diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.md b/packages/protocol/gas-reports/inbox_without_provermarket.md new file mode 100644 index 00000000000..3f6978d4af0 --- /dev/null +++ b/packages/protocol/gas-reports/inbox_without_provermarket.md @@ -0,0 +1,5 @@ +See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol + +Gas per proposing: 177000 +Gas per proving + verification: 154408 +Total: 331408 diff --git a/packages/protocol/.gas-snapshot b/packages/protocol/gas-reports/layer1-contracts.txt similarity index 78% rename from packages/protocol/.gas-snapshot rename to packages/protocol/gas-reports/layer1-contracts.txt index 8262ae21a95..f8f7c3aead4 100644 --- a/packages/protocol/.gas-snapshot +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,56 +23,72 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 995871) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 989883) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1017926) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 991932) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 280618) -InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 272766) -InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 144397) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1070230) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1064270) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1092290) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1066324) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 285997) +InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 286210) +InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154897) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98492) InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95903) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96709) -InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 131088) -InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 165995) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 998485) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1713021) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1025378) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 894468) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12312732) -InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 144306) -InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 64074) +InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141644) +InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166993) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1074659) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1863356) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1099814) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 968906) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 14485579) +InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157750) +InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74574) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18884) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25676) -InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 51368) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 265104) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 895582) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132346) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 143784) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 308340) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 316984) -InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 132431) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 265388) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 7872023) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8182505) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 15776493) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8566208) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 11825288) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 9844312) -InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124684) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1025645) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5826068) -InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40321) -InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109975) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1285560) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7611998) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1199889) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 14705853) -InboxTest_ProposeAndProve:test_proposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 165337) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8162653) -PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 374389) -PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325555) -PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373120) +InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61924) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 268984) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 969643) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133323) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144859) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 314157) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 324585) +InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133408) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 269268) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8628830) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8959436) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9782439) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 9259331) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 14018375) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10554506) +InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124764) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1101599) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 6286080) +InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40343) +InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109953) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1360035) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 8278033) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1274363) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15990492) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9937632) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9937677) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9851309) +InboxTest_ProposeAndProve:test_proposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166185) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8834867) +PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 377529) +PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 326150) +PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 375746) +ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116237) +ProverMarketTest:test_averageFeeCalculation() (gas: 155271) +ProverMarketTest:test_bid() (gas: 90235) +ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 40644) +ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37191) +ProverMarketTest:test_feeLargerThanMax_reverts() (gas: 179645) +ProverMarketTest:test_feeNotDivisibleByUnit_reverts() (gas: 36986) +ProverMarketTest:test_getMaxFee() (gas: 155528) +ProverMarketTest:test_invalidThresholds_reverts() (gas: 63631) +ProverMarketTest:test_outbidWithHigherBond() (gas: 151197) +ProverMarketTest:test_outbidWithLowerBond() (gas: 144743) +ProverMarketTest:test_outbidWithSameBond() (gas: 144764) +ProverMarketTest:test_requestExit() (gas: 95561) SendMessageToDelegateOwner:testAddress1() (gas: 2391) TestAutomataDcapV3Attestation:testAttestation() (gas: 4848498) TestAutomataDcapV3Attestation:testParsedCustomQuoteBinAttestation() (gas: 4553350) diff --git a/packages/protocol/layout/layer1-contracts.md b/packages/protocol/layout/layer1-contracts.md new file mode 100644 index 00000000000..5fc5236cc4c --- /dev/null +++ b/packages/protocol/layout/layer1-contracts.md @@ -0,0 +1,1389 @@ +## ERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +| +| **gap | uint256[50] | 401 | 0 | 1600 | +| +| **gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + +## ERC20Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | +| +| \_\_gap | uint256[45] | 306 | 0 | 1440 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + +## ERC20VaultOriginal + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++============================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| \_\_gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ + +## ERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + +## BridgedERC20 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| \_totalSupply | uint256 | 253 | 0 | 32 | +| +| \_name | string | 254 | 0 | 32 | +| +| \_symbol | string | 255 | 0 | 32 | +| +| **gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| **srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + +## BridgedERC20V2 + +╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| \_totalSupply | uint256 | 253 | 0 | 32 | +| +| \_name | string | 254 | 0 | 32 | +| +| \_symbol | string | 255 | 0 | 32 | +| +| **gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| **srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +| +| \_hashedName | bytes32 | 351 | 0 | 32 | +| +| \_hashedVersion | bytes32 | 352 | 0 | 32 | +| +| \_name | string | 353 | 0 | 32 | +| +| \_version | string | 354 | 0 | 32 | +| +| **gap | uint256[48] | 355 | 0 | 1536 | +| +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| **gap | uint256[49] | 404 | 0 | 1568 | +╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + +## BridgedERC721 + +╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| \_name | string | 301 | 0 | 32 | +| +| \_symbol | string | 302 | 0 | 32 | +| +| \_owners | mapping(uint256 => address) | 303 | 0 | 32 | +| +| \_balances | mapping(address => uint256) | 304 | 0 | 32 | +| +| \_tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| +| **gap | uint256[44] | 307 | 0 | 1408 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| **gap | uint256[48] | 353 | 0 | 1536 | +╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + +## BridgedERC1155 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| \_balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| +| \_uri | string | 303 | 0 | 32 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| symbol | string | 353 | 0 | 32 | +| +| name | string | 354 | 0 | 32 | +| +| **gap | uint256[46] | 355 | 0 | 1472 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + +## Bridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| **ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| **reserved2 | uint256 | 255 | 0 | 32 | +| +| **reserved3 | uint256 | 256 | 0 | 32 | +| +| **gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ + +## QuotaManager + +╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| +| quotaPeriod | uint24 | 252 | 0 | 3 | +| +| **gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + +## DefaultResolver + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| +| \_\_gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + +## EssentialContract + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| \_\_gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + +## SignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| \_receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + +## TaikoToken + +╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++================================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| +| \_balances | mapping(address => uint256) | 301 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| +| \_totalSupply | uint256 | 303 | 0 | 32 | +| +| \_name | string | 304 | 0 | 32 | +| +| \_symbol | string | 305 | 0 | 32 | +| +| **gap | uint256[45] | 306 | 0 | 1440 | +| +| \_hashedName | bytes32 | 351 | 0 | 32 | +| +| \_hashedVersion | bytes32 | 352 | 0 | 32 | +| +| \_name | string | 353 | 0 | 32 | +| +| \_version | string | 354 | 0 | 32 | +| +| **gap | uint256[48] | 355 | 0 | 1536 | +| +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| \_PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| +| **gap | uint256[49] | 405 | 0 | 1568 | +| +| \_delegates | mapping(address => address) | 454 | 0 | 32 | +| +| \_checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| +| \_totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| +| **gap | uint256[47] | 457 | 0 | 1504 | +| +| \_\_gap | uint256[50] | 504 | 0 | 1600 | +╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╯ + +## SgxAndZkVerifier + +╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| \_\_gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╯ + +## Risc0Verifier + +╭-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| +| **gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╯ + +## SP1Verifier + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| +| **gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ + +## SgxVerifier + +╭-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| nextInstanceId | uint256 | 251 | 0 | 32 | +| +| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | +| +| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╯ + +## AutomataDcapV3Attestation + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| sigVerifyLib | contract ISigVerifyLib | 251 | 0 | 20 | +| +| pemCertLib | contract IPEMCertChainLib | 252 | 0 | 20 | +| +| checkLocalEnclaveReport | bool | 252 | 20 | 1 | +| +| trustedUserMrEnclave | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| trustedUserMrSigner | mapping(bytes32 => bool) | 254 | 0 | 32 | +| +| serialNumIsRevoked | mapping(uint256 => mapping(bytes => bool)) | 255 | 0 | 32 | +| +| tcbInfo | mapping(string => struct TCBInfoStruct.TCBInfo) | 256 | 0 | 32 | +| +| qeIdentity | struct EnclaveIdStruct.EnclaveId | 257 | 0 | 128 | +| +| **gap | uint256[39] | 261 | 0 | 1248 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╯ + +## TaikoInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| **gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + +## HeklaInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| **gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + +## MainnetBridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| **ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| **reserved2 | uint256 | 255 | 0 | 32 | +| +| **reserved3 | uint256 | 256 | 0 | 32 | +| +| **gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╯ + +## MainnetSignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==========================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| \_receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╯ + +## MainnetERC20Vault + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| \_\_gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╯ + +## MainnetERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +| +| **gap | uint256[50] | 401 | 0 | 1600 | +| +| **gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╯ + +## MainnetERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╯ + +## MainnetInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| **gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ + +## TokenUnlock + +╭-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| amountVested | uint256 | 251 | 0 | 32 | +| +| recipient | address | 252 | 0 | 20 | +| +| tgeTimestamp | uint64 | 252 | 20 | 8 | +| +| isProverSet | mapping(address => bool) | 253 | 0 | 32 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╯ + +## ProverSet + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| isProver | mapping(address => bool) | 251 | 0 | 32 | +| +| admin | address | 252 | 0 | 20 | +| +| **gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + +## ForkRouter + +╭---------------+-------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| \_\_gap | uint256[49] | 102 | 0 | 1568 | +╰---------------+-------------+------+--------+-------+--------------------------------------------------------╯ + +## TaikoWrapper + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + +## ForcedInclusionStore + +╭-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==========================================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| queue | mapping(uint256 => struct IForcedInclusionStore.ForcedInclusion) | 251 | 0 | 32 | +| +| head | uint64 | 252 | 0 | 8 | +| +| tail | uint64 | 252 | 8 | 8 | +| +| lastProcessedAtBatchId | uint64 | 252 | 16 | 8 | +| +| **reserved1 | uint64 | 252 | 24 | 8 | +| +| \_\_gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╯ + +## PreconfRouter + +╭-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╯ + +## PreconfWhitelist + +╭-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| operators | mapping(address => struct PreconfWhitelist.OperatorInfo) | 251 | 0 | 32 | +| +| operatorMapping | mapping(uint256 => address) | 252 | 0 | 32 | +| +| operatorCount | uint8 | 253 | 0 | 1 | +| +| operatorChangeDelay | uint8 | 253 | 1 | 1 | +| +| havingPerfectOperators | bool | 253 | 2 | 1 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╯ + +## ProverMarket + +╭-----------------------------+------------------------------------------------+------+--------+-------+--------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| provers | mapping(address => struct ProverMarket.Prover) | 251 | 0 | 32 | +| +| prover | address | 252 | 0 | 20 | +| +| feeInGwei | uint64 | 252 | 20 | 8 | +| +| avgFeeInGwei | uint64 | 253 | 0 | 8 | +| +| assignmentCount | uint16 | 253 | 8 | 2 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+------------------------------------------------+------+--------+-------+--------------------------------------------------------------╯ + +## TaikoTreasuryVault + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| \_\_gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╯ diff --git a/packages/protocol/layout/layer2-contracts.md b/packages/protocol/layout/layer2-contracts.md new file mode 100644 index 00000000000..379903b27c4 --- /dev/null +++ b/packages/protocol/layout/layer2-contracts.md @@ -0,0 +1,699 @@ +## ERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +| +| **gap | uint256[50] | 401 | 0 | 1600 | +| +| **gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + +## ERC20Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | +| +| \_\_gap | uint256[45] | 306 | 0 | 1440 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + +## ERC20VaultOriginal + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++============================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| \_\_gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ + +## ERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| **gap | uint256[48] | 303 | 0 | 1536 | +| +| **gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + +## BridgedERC20 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| \_totalSupply | uint256 | 253 | 0 | 32 | +| +| \_name | string | 254 | 0 | 32 | +| +| \_symbol | string | 255 | 0 | 32 | +| +| **gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| **srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + +## BridgedERC20V2 + +╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| \_totalSupply | uint256 | 253 | 0 | 32 | +| +| \_name | string | 254 | 0 | 32 | +| +| \_symbol | string | 255 | 0 | 32 | +| +| **gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| **srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +| +| \_hashedName | bytes32 | 351 | 0 | 32 | +| +| \_hashedVersion | bytes32 | 352 | 0 | 32 | +| +| \_name | string | 353 | 0 | 32 | +| +| \_version | string | 354 | 0 | 32 | +| +| **gap | uint256[48] | 355 | 0 | 1536 | +| +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| **gap | uint256[49] | 404 | 0 | 1568 | +╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + +## BridgedERC721 + +╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| \_name | string | 301 | 0 | 32 | +| +| \_symbol | string | 302 | 0 | 32 | +| +| \_owners | mapping(uint256 => address) | 303 | 0 | 32 | +| +| \_balances | mapping(address => uint256) | 304 | 0 | 32 | +| +| \_tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| +| **gap | uint256[44] | 307 | 0 | 1408 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| **gap | uint256[48] | 353 | 0 | 1536 | +╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + +## BridgedERC1155 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **gap | uint256[50] | 251 | 0 | 1600 | +| +| \_balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| +| \_uri | string | 303 | 0 | 32 | +| +| **gap | uint256[47] | 304 | 0 | 1504 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| symbol | string | 353 | 0 | 32 | +| +| name | string | 354 | 0 | 32 | +| +| **gap | uint256[46] | 355 | 0 | 1472 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + +## Bridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| **ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| **reserved2 | uint256 | 255 | 0 | 32 | +| +| **reserved3 | uint256 | 256 | 0 | 32 | +| +| **gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ + +## QuotaManager + +╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| +| quotaPeriod | uint24 | 252 | 0 | 3 | +| +| **gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + +## DefaultResolver + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| +| \_\_gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + +## EssentialContract + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| \_\_gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + +## SignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| \_receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| **gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + +## BridgedTaikoToken + +╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| **slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| +| \_balances | mapping(address => uint256) | 301 | 0 | 32 | +| +| \_allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| +| \_totalSupply | uint256 | 303 | 0 | 32 | +| +| \_name | string | 304 | 0 | 32 | +| +| \_symbol | string | 305 | 0 | 32 | +| +| **gap | uint256[45] | 306 | 0 | 1440 | +| +| \_hashedName | bytes32 | 351 | 0 | 32 | +| +| \_hashedVersion | bytes32 | 352 | 0 | 32 | +| +| \_name | string | 353 | 0 | 32 | +| +| \_version | string | 354 | 0 | 32 | +| +| **gap | uint256[48] | 355 | 0 | 1536 | +| +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| \_PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| +| **gap | uint256[49] | 405 | 0 | 1568 | +| +| \_delegates | mapping(address => address) | 454 | 0 | 32 | +| +| \_checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| +| \_totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| +| **gap | uint256[47] | 457 | 0 | 1504 | +| +| \_\_gap | uint256[50] | 504 | 0 | 1600 | +╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╯ + +## DelegateOwner + +╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| remoteChainId | uint64 | 251 | 0 | 8 | +| +| admin | address | 251 | 8 | 20 | +| +| nextTxId | uint64 | 252 | 0 | 8 | +| +| remoteOwner | address | 252 | 8 | 20 | +| +| **gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------╯ + +## TaikoAnchor + +╭-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================+ +| \_initialized | uint8 | 0 | 0 | 1 | +| +| \_initializing | bool | 0 | 1 | 1 | +| +| **gap | uint256[50] | 1 | 0 | 1600 | +| +| \_owner | address | 51 | 0 | 20 | +| +| **gap | uint256[49] | 52 | 0 | 1568 | +| +| \_pendingOwner | address | 101 | 0 | 20 | +| +| **gap | uint256[49] | 102 | 0 | 1568 | +| +| **gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| **reentry | uint8 | 201 | 0 | 1 | +| +| **paused | uint8 | 201 | 1 | 1 | +| +| **gap | uint256[49] | 202 | 0 | 1568 | +| +| \_blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | +| +| publicInputHash | bytes32 | 252 | 0 | 32 | +| +| parentGasExcess | uint64 | 253 | 0 | 8 | +| +| lastSyncedBlock | uint64 | 253 | 8 | 8 | +| +| parentTimestamp | uint64 | 253 | 16 | 8 | +| +| parentGasTarget | uint64 | 253 | 24 | 8 | +| +| l1ChainId | uint64 | 254 | 0 | 8 | +| +| **gap | uint256[46] | 255 | 0 | 1472 | +╰-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╯ diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 28314d436d7..0de9f68d406 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -13,7 +13,7 @@ "test:l1": "FOUNDRY_PROFILE=layer1 forge test --extra-output storage-layout --match-path 'test/layer1/**/*.t.sol'", "test:l2": "FOUNDRY_PROFILE=layer2 forge test --extra-output storage-layout --match-path 'test/layer2/**/*.t.sol'", "test:shared": "FOUNDRY_PROFILE=shared forge test --extra-output storage-layout --match-path 'test/shared/**/*.t.sol'", - "snapshot:l1": "pnpm test:l1 && FOUNDRY_PROFILE=layer1 forge snapshot", + "snapshot:l1": "pnpm test:l1 && FOUNDRY_PROFILE=layer1 forge snapshot --snap gas-reports/layer1-contracts.txt", "test": "pnpm test:l1 && pnpm test:l2 && pnpm test:shared", "layout:l1": "./script/gen-layouts.sh layer1", "layout:l2": "./script/gen-layouts.sh layer2", diff --git a/packages/protocol/script/gen-layouts.sh b/packages/protocol/script/gen-layouts.sh index bf08da4c9ca..ea227654024 100755 --- a/packages/protocol/script/gen-layouts.sh +++ b/packages/protocol/script/gen-layouts.sh @@ -42,6 +42,7 @@ contracts_layer1=( "contracts/layer1/forced-inclusion/ForcedInclusionStore.sol:ForcedInclusionStore" "contracts/layer1/preconf/impl/PreconfRouter.sol:PreconfRouter" "contracts/layer1/preconf/impl/PreconfWhitelist.sol:PreconfWhitelist" +"contracts/layer1/prover-market/ProverMarket.sol:ProverMarket" "contracts/layer1/governance/TaikoTreasuryVault.sol:TaikoTreasuryVault" ) @@ -66,7 +67,7 @@ else fi # Empty the output file initially -output_file="contract_layout_${profile}.md" +output_file="layout/${profile}-contracts.md" > $output_file # Loop over each contract diff --git a/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol b/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol index 860b997474d..d4e861f2140 100644 --- a/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol +++ b/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol @@ -288,7 +288,8 @@ contract DeployProtocolOnL1 is DeployCapability { address(0), proofVerifier, IResolver(_sharedResolver).resolve(uint64(block.chainid), "bond_token", false), - IResolver(_sharedResolver).resolve(uint64(block.chainid), "signal_service", false) + IResolver(_sharedResolver).resolve(uint64(block.chainid), "signal_service", false), + address(0) // proverMarket ) ), data: abi.encodeCall(TaikoInbox.init, (owner, vm.envBytes32("L2_GENESIS_HASH"))) @@ -305,7 +306,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(_sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(_sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } @@ -321,7 +323,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(_sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(_sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } else { @@ -334,7 +337,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(_sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(_sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } @@ -527,7 +531,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } @@ -544,7 +549,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } else { @@ -557,7 +563,8 @@ contract DeployProtocolOnL1 is DeployCapability { IResolver(sharedResolver).resolve(uint64(block.chainid), "bond_token", false), IResolver(sharedResolver).resolve( uint64(block.chainid), "signal_service", false - ) + ), + address(0) // proverMarket ) ); } diff --git a/packages/protocol/script/layer1/based/deploy_protocol_on_l1.sh b/packages/protocol/script/layer1/based/deploy_protocol_on_l1.sh index f1a2be1044b..80118ac0fd5 100755 --- a/packages/protocol/script/layer1/based/deploy_protocol_on_l1.sh +++ b/packages/protocol/script/layer1/based/deploy_protocol_on_l1.sh @@ -19,6 +19,7 @@ PAUSE_BRIDGE=true \ FOUNDRY_PROFILE="layer1" \ DEPLOY_PRECONF_CONTRACTS=true \ PRECONF_INBOX=false \ +PROVER_MARKET=0x0000000000000000000000000000000000000000 \ INCLUSION_WINDOW=24 \ INCLUSION_FEE_IN_GWEI=100 \ forge script ./script/layer1/based/DeployProtocolOnL1.s.sol:DeployProtocolOnL1 \ diff --git a/packages/protocol/script/layer1/devnet/DeployPacayaL1.s.sol b/packages/protocol/script/layer1/devnet/DeployPacayaL1.s.sol index 894404588fa..6d845ece19c 100644 --- a/packages/protocol/script/layer1/devnet/DeployPacayaL1.s.sol +++ b/packages/protocol/script/layer1/devnet/DeployPacayaL1.s.sol @@ -53,6 +53,7 @@ contract DeployPacayaL1 is DeployCapability { address public automata = vm.envAddress("AUTOMATA_DCAP_ATTESTATION"); address public oldFork = vm.envAddress("OLD_FORK"); address public proverSet = vm.envAddress("PROVER_SET"); + address public proverMarket = vm.envAddress("PROVER_MARKET"); modifier broadcast() { require(privateKey != 0, "invalid private key"); @@ -160,7 +161,8 @@ contract DeployPacayaL1 is DeployCapability { taikoWrapper, proofVerifier, taikoToken, - signalService + signalService, + proverMarket ) ); UUPSUpgradeable(taikoInbox).upgradeTo(address(new PacayaForkRouter(oldFork, newFork))); diff --git a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol index 27c65488f2d..16487b531b4 100644 --- a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol +++ b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol @@ -44,6 +44,7 @@ contract UpgradeDevnetPacayaL1 is DeployCapability { address public taikoToken = vm.envAddress("TAIKO_TOKEN"); uint256 public inclusionWindow = vm.envUint("INCLUSION_WINDOW"); uint256 public inclusionFeeInGwei = vm.envUint("INCLUSION_FEE_IN_GWEI"); + address public proverMarket = vm.envAddress("PROVER_MARKET"); address public quotaManager = vm.envAddress("QUOTA_MANAGER"); modifier broadcast() { @@ -145,8 +146,8 @@ contract UpgradeDevnetPacayaL1 is DeployCapability { taikoWrapper, proofVerifier, taikoToken, - signalService - ) + signalService, + proverMarket) ); UUPSUpgradeable(taikoInbox).upgradeTo(address(new PacayaForkRouter(oldFork, newFork))); register(rollupResolver, "taiko", taikoInbox); diff --git a/packages/protocol/script/layer1/hekla/DeployHeklaPacayaL1.s.sol b/packages/protocol/script/layer1/hekla/DeployHeklaPacayaL1.s.sol index 8abcd500f35..70b81e579cc 100644 --- a/packages/protocol/script/layer1/hekla/DeployHeklaPacayaL1.s.sol +++ b/packages/protocol/script/layer1/hekla/DeployHeklaPacayaL1.s.sol @@ -59,6 +59,7 @@ contract DeployHeklaPacayaL1 is DeployCapability { address public automata = vm.envAddress("AUTOMATA_DCAP_ATTESTATION"); address public oldFork = vm.envAddress("OLD_FORK"); address public proverSet = vm.envAddress("PROVER_SET"); + address public proverMarket = vm.envAddress("PROVER_MARKET"); modifier broadcast() { require(privateKey != 0, "invalid private key"); @@ -149,8 +150,9 @@ contract DeployHeklaPacayaL1 is DeployCapability { }); // Register taiko - address newFork = - address(new HeklaInbox(taikoWrapper, proofVerifier, taikoToken, signalService)); + address newFork = address( + new HeklaInbox(taikoWrapper, proofVerifier, taikoToken, signalService, proverMarket) + ); UUPSUpgradeable(taikoInbox).upgradeTo(address(new PacayaForkRouter(oldFork, newFork))); register(rollupResolver, "taiko", taikoInbox); diff --git a/packages/protocol/test/layer1/Layer1Test.sol b/packages/protocol/test/layer1/Layer1Test.sol index 6fa238cdfed..c99c24b9e2a 100644 --- a/packages/protocol/test/layer1/Layer1Test.sol +++ b/packages/protocol/test/layer1/Layer1Test.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.24; import "src/layer1/based/TaikoInbox.sol"; import "src/layer1/forced-inclusion/TaikoWrapper.sol"; import "src/layer1/forced-inclusion/ForcedInclusionStore.sol"; +import "src/layer1/prover-market/ProverMarket.sol"; import "src/layer1/token/TaikoToken.sol"; import "src/layer1/verifiers/SgxVerifier.sol"; import "src/layer1/verifiers/SP1Verifier.sol"; @@ -20,9 +21,10 @@ contract ConfigurableInbox is TaikoInbox { address _wrapper, address _verifier, address _bondToken, - address _signalService + address _signalService, + address _proverMarket ) - TaikoInbox(_wrapper, _verifier, _bondToken, _signalService) + TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } function initWithConfig( @@ -60,6 +62,7 @@ abstract contract Layer1Test is CommonTest { address _verifier, address _bondToken, address _signalService, + address _proverMarket, ITaikoInbox.Config memory _config ) internal @@ -68,7 +71,11 @@ abstract contract Layer1Test is CommonTest { return TaikoInbox( deploy({ name: "taiko", - impl: address(new ConfigurableInbox(address(0), _verifier, _bondToken, _signalService)), + impl: address( + new ConfigurableInbox( + address(0), _verifier, _bondToken, _signalService, _proverMarket + ) + ), data: abi.encodeCall( ConfigurableInbox.initWithConfig, (address(0), _genesisBlockHash, _config) ) diff --git a/packages/protocol/test/layer1/based/InboxTestBase.sol b/packages/protocol/test/layer1/based/InboxTestBase.sol index a8a9eade600..495537ecb65 100644 --- a/packages/protocol/test/layer1/based/InboxTestBase.sol +++ b/packages/protocol/test/layer1/based/InboxTestBase.sol @@ -10,6 +10,7 @@ abstract contract InboxTestBase is Layer1Test { ITaikoInbox internal inbox; TaikoToken internal bondToken; + ProverMarket internal proverMarket; SignalService internal signalService; uint256 genesisBlockProposedAt; uint256 genesisBlockProposedIn; @@ -42,14 +43,45 @@ abstract contract InboxTestBase is Layer1Test { address verifierAddr = address(new Verifier_ToggleStub()); resolver.registerAddress(block.chainid, "proof_verifier", verifierAddr); + // Firs prover market impl. deployment without the known inbox address - cause there is a + // circular dependency at deployment. ProverMarket needs Inbox, Inbox needs ProverMarket. + address dummyInboxAddress = address(0x1); // Just a placeholder + address proverMarketImpl = address( + new ProverMarket( + dummyInboxAddress, + 200 ether, //BIDDING_THRESHOLD + 100 ether, //OUTBID_THRESHOLD + 50 ether, // PROVING_THRESHOLD + 1 days //MIN_EXIT_DELAY + ) + ); + + address proverMarketProxy = address( + new ERC1967Proxy(proverMarketImpl, abi.encodeCall(ProverMarket.init, (address(0)))) + ); + inbox = deployInbox( correctBlockhash(0), verifierAddr, address(bondToken), address(signalService), + proverMarketProxy, pacayaConfig() ); + address realProverMarketImpl = address( + new ProverMarket( + address(inbox), + 200 ether, //BIDDING_THRESHOLD + 100 ether, //OUTBID_THRESHOLD + 50 ether, // PROVING_THRESHOLD + 1 days //MIN_EXIT_DELAY + ) + ); + + UUPSUpgradeable(proverMarketProxy).upgradeTo(realProverMarketImpl); + proverMarket = ProverMarket(proverMarketProxy); + signalService.authorize(address(inbox), true); mineOneBlockAndWrap(12 seconds); diff --git a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol index a1173918836..7f9d37c6fbf 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol @@ -91,6 +91,7 @@ contract InboxTest_Params is InboxTestBase { blocks[0] = ITaikoInbox.BlockParams({ numTransactions: 0, timeShift: 0, + marker: 0, signalSlots: new bytes32[](0) }); diff --git a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol index 03adf46e2c2..306b0520be4 100644 --- a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol @@ -574,46 +574,253 @@ contract InboxTest_ProposeAndProve is InboxTestBase { WhenMultipleBatchesAreProvedWithCorrectTransitions(1, 10) WhenLogAllBatchesAndTransitions { - uint64 count = 10; + ITaikoInbox.BatchParams memory batchParams; + batchParams.blocks = new ITaikoInbox.BlockParams[](10); vm.startSnapshotGas("proposeBatch"); + (, ITaikoInbox.BatchMetadata memory meta) = + inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); - uint64[] memory batchIds = _proposeBatchesWithDefaultParameters(count); + ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); + metas[0] = meta; - uint256 gasProposeBatches = vm.stopSnapshotGas("proposeBatch"); - console2.log("Gas per batch - proposing:", gasProposeBatches / count); + ITaikoInbox.Transition[] memory transitions = new ITaikoInbox.Transition[](1); + transitions[0].parentHash = correctBlockhash(meta.batchId - 1); + transitions[0].blockHash = correctBlockhash(meta.batchId); + transitions[0].stateRoot = correctStateRoot(meta.batchId); - ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](count); - ITaikoInbox.Transition[] memory transitions = new ITaikoInbox.Transition[](count); + vm.startSnapshotGas("proveBatches"); + inbox.proveBatches(abi.encode(metas, transitions), "proof"); + uint256 gas2 = vm.stopSnapshotGas("proveBatches"); - for (uint256 i; i < batchIds.length; ++i) { - (metas[i],) = _loadMetadataAndInfo(batchIds[i]); + _logAllBatchesAndTransitions(); - transitions[i].parentHash = correctBlockhash(batchIds[i] - 1); - transitions[i].blockHash = correctBlockhash(batchIds[i]); - transitions[i].stateRoot = correctStateRoot(batchIds[i]); - } + string memory str = string( + abi.encodePacked( + "See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol\n", + "\nGas per proposing: ", + Strings.toString(gas1), + "\nGas per proving + verification: ", + Strings.toString(gas2), + "\nTotal: ", + Strings.toString((gas1 + gas2)) + ) + ); + + console2.log(str); + vm.writeFile("./gas-reports/inbox_without_provermarket.md", str); + } + + function test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() + external + transactBy(Alice) + WhenMultipleBatchesAreProposedWithDefaultParameters(9) + WhenMultipleBatchesAreProvedWithCorrectTransitions(1, 10) + WhenLogAllBatchesAndTransitions + { + uint256 fee = 1 ether; + uint64 exitTimestamp = uint64(block.timestamp + 2 days); + + vm.stopPrank(); + + uint256 initialBondBalance = 100_000 ether; + uint256 bondAmount = 100_000 ether; + + setupBondTokenState(Bob, initialBondBalance, bondAmount); + + vm.prank(Bob); + proverMarket.bid(fee, exitTimestamp); + + // Check if Alice's and Bob's bonds are correctly deducted ! + uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); + uint256 bob_bond_before_propose = inbox.bondBalanceOf(Bob); + + vm.startPrank(Alice); + + ITaikoInbox.BatchParams memory batchParams; + batchParams.blocks = new ITaikoInbox.BlockParams[](10); + batchParams.optInProverMarket = true; + + vm.startSnapshotGas("proposeBatch"); + (, ITaikoInbox.BatchMetadata memory meta) = + inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); + + ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); + metas[0] = meta; + + ITaikoInbox.Transition[] memory transitions = new ITaikoInbox.Transition[](1); + transitions[0].parentHash = correctBlockhash(meta.batchId - 1); + transitions[0].blockHash = correctBlockhash(meta.batchId); + transitions[0].stateRoot = correctStateRoot(meta.batchId); + + uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + // Check if Alice's bond is correctly deducted - only fee + assertEq(alice_bond_after_propose, alice_bond_before_propose - fee); + + uint256 bob_bond_after_propose = inbox.bondBalanceOf(Bob); + // Since prover fee is smaller than config.liveness, just deduct the diff of the 2. + assertEq(bob_bond_after_propose, bob_bond_before_propose - (125e18 - fee)); vm.startSnapshotGas("proveBatches"); inbox.proveBatches(abi.encode(metas, transitions), "proof"); - uint256 gasProveBatches = vm.stopSnapshotGas("proveBatches"); - console2.log("Gas per batch - proving:", gasProveBatches / count); - console2.log("Gas per batch - total:", (gasProposeBatches + gasProveBatches) / count); + uint256 gas2 = vm.stopSnapshotGas("proveBatches"); _logAllBatchesAndTransitions(); string memory str = string( abi.encodePacked( - "See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol\n", - "\nGas per proposeBatches: ", - Strings.toString(gasProposeBatches / count), - "\nGas per proveBatches: ", - Strings.toString(gasProveBatches / count), + "See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol\n", + "\nGas per proposing: ", + Strings.toString(gas1), + "\nGas per proving + verification: ", + Strings.toString(gas2), "\nTotal: ", - Strings.toString((gasProposeBatches + gasProveBatches) / count) + Strings.toString((gas1 + gas2)) ) ); - vm.writeFile("./deployments/test_inbox_measure_gas_used.txt", str); + console2.log(str); + vm.writeFile("./gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md", str); + } + + function test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used( + ) + external + transactBy(Alice) + WhenMultipleBatchesAreProposedWithDefaultParameters(9) + WhenMultipleBatchesAreProvedWithCorrectTransitions(1, 10) + WhenLogAllBatchesAndTransitions + { + uint256 fee = 130 ether; // above the liveness bond + uint64 exitTimestamp = uint64(block.timestamp + 2 days); + + vm.stopPrank(); + + uint256 initialBondBalance = 100_000 ether; + uint256 bondAmount = 100_000 ether; + + setupBondTokenState(Bob, initialBondBalance, bondAmount); + + vm.prank(Bob); + proverMarket.bid(fee, exitTimestamp); + + // Check if Alice's bond is correctly deducted ! + uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); + // Check if Bob's bond is correctly deducted ! + uint256 bob_bond_before_propose = inbox.bondBalanceOf(Bob); + + vm.startPrank(Alice); + + ITaikoInbox.BatchParams memory batchParams; + batchParams.blocks = new ITaikoInbox.BlockParams[](10); + batchParams.optInProverMarket = true; + + vm.startSnapshotGas("proposeBatch"); + (, ITaikoInbox.BatchMetadata memory meta) = + inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); + + ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); + metas[0] = meta; + + ITaikoInbox.Transition[] memory transitions = new ITaikoInbox.Transition[](1); + transitions[0].parentHash = correctBlockhash(meta.batchId - 1); + transitions[0].blockHash = correctBlockhash(meta.batchId); + transitions[0].stateRoot = correctStateRoot(meta.batchId); + + uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + // Check if Alice's bond is correctly deducted - only fee + assertEq(alice_bond_after_propose, alice_bond_before_propose - fee); + + uint256 bob_bond_after_propose = inbox.bondBalanceOf(Bob); + // Since prover fee is bigger than config.liveness, just add the diff of the 2. + assertEq(bob_bond_after_propose, bob_bond_before_propose + (fee - 125e18)); + + vm.startSnapshotGas("proveBatches"); + inbox.proveBatches(abi.encode(metas, transitions), "proof"); + uint256 gas2 = vm.stopSnapshotGas("proveBatches"); + + _logAllBatchesAndTransitions(); + + string memory str = string( + abi.encodePacked( + "See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol\n", + "\nGas per proposing: ", + Strings.toString(gas1), + "\nGas per proving + verification: ", + Strings.toString(gas2), + "\nTotal: ", + Strings.toString((gas1 + gas2)) + ) + ); + + console2.log(str); + vm.writeFile( + "./gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md", + str + ); + } + + function test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() + external + transactBy(Alice) + WhenMultipleBatchesAreProposedWithDefaultParameters(9) + WhenMultipleBatchesAreProvedWithCorrectTransitions(1, 10) + WhenLogAllBatchesAndTransitions + { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + 2 days); + + proverMarket.bid(fee, exitTimestamp); + + // Check if Alice's bond is correctly deducted ! + uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); + + ITaikoInbox.BatchParams memory batchParams; + batchParams.blocks = new ITaikoInbox.BlockParams[](10); + batchParams.optInProverMarket = true; + + vm.startSnapshotGas("proposeBatch"); + (, ITaikoInbox.BatchMetadata memory meta) = + inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); + + // Check if Alice's bond is correctly deducted - only liveness bond base + uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + assertEq(alice_bond_after_propose, alice_bond_before_propose - 125e18); + + ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); + metas[0] = meta; + + ITaikoInbox.Transition[] memory transitions = new ITaikoInbox.Transition[](1); + transitions[0].parentHash = correctBlockhash(meta.batchId - 1); + transitions[0].blockHash = correctBlockhash(meta.batchId); + transitions[0].stateRoot = correctStateRoot(meta.batchId); + + vm.startSnapshotGas("proveBatches"); + inbox.proveBatches(abi.encode(metas, transitions), "proof"); + uint256 gas2 = vm.stopSnapshotGas("proveBatches"); + + _logAllBatchesAndTransitions(); + + string memory str = string( + abi.encodePacked( + "See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol\n", + "\nGas per proposing: ", + Strings.toString(gas1), + "\nGas per proving + verification: ", + Strings.toString(gas2), + "\nTotal: ", + Strings.toString((gas1 + gas2)) + ) + ); + + console2.log(str); + vm.writeFile( + "./gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md", + str + ); } } diff --git a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol index f1107447d07..86a7b6637ba 100644 --- a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol +++ b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol @@ -28,8 +28,9 @@ contract MockTaikoInbox is EssentialContract { blobHashes: new bytes32[](0), blobByteOffset: 0, blobByteSize: 0, - extraData: bytes32(0), + extraDataList: new bytes32[](params.blocks.length), coinbase: params.coinbase == address(0) ? params.proposer : params.coinbase, + proposer: params.proposer, gasLimit: 0, // Mock value lastBlockId: 0, lastBlockTimestamp: 0, @@ -49,7 +50,7 @@ contract MockTaikoInbox is EssentialContract { meta_ = ITaikoInbox.BatchMetadata({ batchId: 0, - proposer: params.proposer, + prover: params.proposer, proposedAt: uint64(block.timestamp), infoHash: keccak256(abi.encode(info_)) }); diff --git a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol index 12acf8e8c9e..bf943cf6a34 100644 --- a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol +++ b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol @@ -33,6 +33,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { blockParams[0] = ITaikoInbox.BlockParams({ numTransactions: 1, timeShift: 1, + marker: 0, signalSlots: new bytes32[](0) }); @@ -46,6 +47,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { anchorBlockId: 0, lastBlockTimestamp: uint64(block.timestamp), revertIfNotFirstProposal: false, + optInProverMarket: false, blobParams: blobParams, blocks: blockParams }); @@ -55,10 +57,10 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as Carol (selected operator) and propose blocks vm.prank(Carol); - (, ITaikoInbox.BatchMetadata memory meta) = router.proposeBatch(abi.encode(params), ""); + (ITaikoInbox.BatchInfo memory info,) = router.proposeBatch(abi.encode(params), ""); // Assert the proposer was set correctly in the metadata - assertEq(meta.proposer, Carol); + assertEq(info.proposer, Carol); } function test_preconfRouter_proposeBatch_notOperator() external { @@ -119,6 +121,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { blockParams[0] = ITaikoInbox.BlockParams({ numTransactions: 1, timeShift: 1, + marker: 0, signalSlots: new bytes32[](0) }); @@ -132,6 +135,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { anchorBlockId: 0, lastBlockTimestamp: uint64(block.timestamp), revertIfNotFirstProposal: false, + optInProverMarket: false, blobParams: blobParams, blocks: blockParams }); diff --git a/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol new file mode 100644 index 00000000000..e68800d2392 --- /dev/null +++ b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol @@ -0,0 +1,245 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "../../shared/CommonTest.sol"; +import "../../../contracts/layer1/prover-market/ProverMarket.sol"; + +// To mock balances +contract MockInbox { + mapping(address => uint256) public bondBalances; + + function setBondBalance(address _prover, uint256 _amount) external { + bondBalances[_prover] = _amount; + } + + function bondBalanceOf(address _prover) external view returns (uint256) { + return bondBalances[_prover]; + } +} + +contract ProverMarketTest is CommonTest { + ProverMarket internal market; + MockInbox internal mockInbox; + + address internal constant PROVER1 = address(0x1); + address internal constant PROVER2 = address(0x2); + + uint256 internal constant BIDDING_THRESHOLD = 200 ether; + uint256 internal constant OUTBID_THRESHOLD = 100 ether; + uint256 internal constant PROVING_THRESHOLD = 50 ether; + uint256 internal constant MIN_EXIT_DELAY = 1 days; + + function setUp() public override { + mockInbox = new MockInbox(); + + market = new ProverMarket( + address(mockInbox), + BIDDING_THRESHOLD, + OUTBID_THRESHOLD, + PROVING_THRESHOLD, + MIN_EXIT_DELAY + ); + } + + function test_bid() public { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + + vm.prank(PROVER1); + market.bid(fee, exitTimestamp); + + (address currentProver, uint256 currentFee) = market.getCurrentProver(); + assertEq(currentProver, PROVER1); + assertEq(currentFee, fee); + } + + function test_bid_with_insufficientBondBalance() public { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD - 1); + + vm.prank(PROVER1); + vm.expectRevert(ProverMarket.InsufficientBondBalance.selector); + market.bid(fee, exitTimestamp); + } + + function test_outbidWithLowerBond() public { + uint256 fee1 = 10 gwei; + uint64 exitTimestamp1 = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee1, exitTimestamp1); + + // lower bond for current prover + mockInbox.setBondBalance(PROVER1, OUTBID_THRESHOLD - 1); + + uint256 fee2 = 9 gwei; + uint64 exitTimestamp2 = uint64(block.timestamp + MIN_EXIT_DELAY + 2); + mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); + + vm.prank(PROVER2); + market.bid(fee2, exitTimestamp2); + + (address currentProver, uint256 currentFee) = market.getCurrentProver(); + assertEq(currentProver, PROVER2); + assertEq(currentFee, fee2); + } + + function test_outbidWithHigherBond() public { + uint256 fee1 = 10 gwei; + uint64 exitTimestamp1 = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee1, exitTimestamp1); + + // higher bond for current prover + mockInbox.setBondBalance(PROVER1, OUTBID_THRESHOLD + 1); + + // must be <= 95% of current fee -> should revert + uint256 fee2 = 10 gwei; + uint64 exitTimestamp2 = uint64(block.timestamp + MIN_EXIT_DELAY + 2); + mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); + + vm.prank(PROVER2); + vm.expectRevert(ProverMarket.FeeLargerThanAllowed.selector); + market.bid(fee2, exitTimestamp2); + + // try again with a <= 95% -> success + fee2 = 9 gwei; + vm.prank(PROVER2); + market.bid(fee2, exitTimestamp2); + + (address currentProver, uint256 currentFee) = market.getCurrentProver(); + assertEq(currentProver, PROVER2); + assertEq(currentFee, fee2); + } + + function test_outbidWithSameBond() public { + uint256 fee1 = 10 gwei; + uint64 exitTimestamp1 = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee1, exitTimestamp1); + + // lower bond for current prover + mockInbox.setBondBalance(PROVER1, OUTBID_THRESHOLD - 1); + + uint256 fee2 = 10 gwei; + uint64 exitTimestamp2 = uint64(block.timestamp + MIN_EXIT_DELAY + 2); + mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); + + vm.prank(PROVER2); + market.bid(fee2, exitTimestamp2); + + (address currentProver, uint256 currentFee) = market.getCurrentProver(); + assertEq(currentProver, PROVER2); + assertEq(currentFee, fee2); + } + + function test_requestExit() public { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee, exitTimestamp); + + uint64 newExitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 2); + vm.prank(PROVER1); + market.requestExit(newExitTimestamp); + + // exit by non-current prover should fail + vm.prank(PROVER2); + vm.expectRevert(ProverMarket.NotCurrentProver.selector); + market.requestExit(newExitTimestamp); + } + + function test_averageFeeCalculation() public { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee, exitTimestamp); + + for (uint16 i = 0; i < 10; i++) { + vm.prank(address(mockInbox)); + market.onProverAssigned(PROVER1, fee, i); + } + + uint64 avgFee = market.avgFeeInGwei(); + assertEq(avgFee, 10); + } + + function test_getMaxFee() public { + uint256 fee = 10 gwei; + uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); + + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(fee, exitTimestamp); + + for (uint16 i = 0; i < 10; i++) { + vm.prank(address(mockInbox)); + market.onProverAssigned(PROVER1, fee, i); + } + + uint256 maxFee = market.getMaxFee(); + assertEq(maxFee, 20 gwei); // MAX_FEE_MULTIPLIER is 2 + } + + function test_invalidThresholds_reverts() public { + vm.expectRevert(ProverMarket.InvalidThresholds.selector); + new ProverMarket(address(mockInbox), 100 ether, 200 ether, 50 ether, MIN_EXIT_DELAY); + } + + function test_cannotFitToUint64_reverts() public { + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + + uint256 tooLargeFee = (uint256(type(uint64).max) + 1) * 1 gwei; + + vm.prank(PROVER1); + vm.expectRevert(ProverMarket.CannotFitToUint64.selector); + market.bid(tooLargeFee, uint64(block.timestamp + MIN_EXIT_DELAY + 1)); + } + + function test_FeeLargerThanAllowed_reverts() public { + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(10 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 1)); + + mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); + vm.prank(PROVER2); + vm.expectRevert(ProverMarket.FeeLargerThanAllowed.selector); + market.bid(11 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 2)); + } + + function test_feeLargerThanMax_reverts() public { + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + market.bid(10 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 1)); + + for (uint16 i = 0; i < 10; i++) { + vm.prank(address(mockInbox)); + market.onProverAssigned(PROVER1, 10 gwei, i); + } + + mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); + vm.prank(PROVER2); + vm.expectRevert(ProverMarket.FeeLargerThanMax.selector); + market.bid(25 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 2)); // 2x avg is 20 gwei + } + + function test_feeNotDivisibleByUnit_reverts() public { + mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); + vm.prank(PROVER1); + vm.expectRevert(ProverMarket.FeeNotDivisibleByFeeUnit.selector); + market.bid(1 wei, uint64(block.timestamp + MIN_EXIT_DELAY + 1)); + } +} From 1882356322a141e9679f1d506d8222d89adf6b7a Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 18 Apr 2025 21:08:39 +0800 Subject: [PATCH 02/16] chore(protocol): add URC (https://github.com/eth-fabric/urc main branch) dependency (#19287) --- .../layer1/preconf/impl/PreconfRouter.sol | 1 + ...ith_provermarket_diff_prover_and_proposer.md | 2 +- ...ff_prover_and_proposer_fee_above_liveness.md | 2 +- .../gas-reports/inbox_without_provermarket.md | 2 +- ..._same_prover_as_proposer_measure_gas_used.md | 5 +++++ packages/protocol/package.json | 1 + .../layer1/devnet/UpgradeDevnetPacayaL1.s.sol | 3 ++- pnpm-lock.yaml | 17 +++++++++++++---- 8 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md diff --git a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol index 14592eedf20..a5646626947 100644 --- a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol +++ b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; +// import "urc/src/IRegistry.sol"; import "src/shared/common/EssentialContract.sol"; import "../iface/IPreconfRouter.sol"; import "../iface/IPreconfWhitelist.sol"; diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md index d32d4e21303..dccd7d9158d 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md @@ -2,4 +2,4 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in Gas per proposing: 206854 Gas per proving + verification: 158743 -Total: 365597 +Total: 365597 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md index 98bfbbe085a..8b622acc039 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md @@ -2,4 +2,4 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_me Gas per proposing: 206703 Gas per proving + verification: 158749 -Total: 365452 +Total: 365452 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.md b/packages/protocol/gas-reports/inbox_without_provermarket.md index 3f6978d4af0..4b692d5494f 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.md +++ b/packages/protocol/gas-reports/inbox_without_provermarket.md @@ -2,4 +2,4 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol Gas per proposing: 177000 Gas per proving + verification: 154408 -Total: 331408 +Total: 331408 \ No newline at end of file diff --git a/packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md b/packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md new file mode 100644 index 00000000000..565255f385e --- /dev/null +++ b/packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md @@ -0,0 +1,5 @@ +See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol + +Gas per proposing: 180523 +Gas per proving + verification: 156532 +Total: 337055 \ No newline at end of file diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 0de9f68d406..05406ba3114 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -55,6 +55,7 @@ "p256-verifier": "github:taikoxyz/p256-verifier#v0.1.0", "risc0-ethereum": "github:risc0/risc0-ethereum#v2.0.0-rc.3", "solady": "github:Vectorized/solady#v0.0.231", + "urc": "github:eth-fabric/urc#main", "sp1-contracts": "github:succinctlabs/sp1-contracts#v4.0.0" } } diff --git a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol index 16487b531b4..e0556d60ef4 100644 --- a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol +++ b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol @@ -147,7 +147,8 @@ contract UpgradeDevnetPacayaL1 is DeployCapability { proofVerifier, taikoToken, signalService, - proverMarket) + proverMarket + ) ); UUPSUpgradeable(taikoInbox).upgradeTo(address(new PacayaForkRouter(oldFork, newFork))); register(rollupResolver, "taiko", taikoInbox); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 41e2af64a82..65013b2daae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: version: 2.6.2(@types/react@18.3.3)(react@18.3.1) '@web3modal/wagmi': specifier: ^4.1.11 - version: 4.1.11(465hcphkttv2p5txznqylpmnwa) + version: 4.1.11(9ecc8b7aeee8c74c3518124cbf094f4f) '@zerodevx/svelte-toast': specifier: ^0.9.5 version: 0.9.5(svelte@4.2.15) @@ -449,6 +449,9 @@ importers: sp1-contracts: specifier: github:succinctlabs/sp1-contracts#v4.0.0 version: sp1-contracts#v4.0.0@https://codeload.github.com/succinctlabs/sp1-contracts/tar.gz/26651fdb1c1d6513443560d42888dedc3f68bde6 + urc: + specifier: github:eth-fabric/urc#main + version: urc#main@https://codeload.github.com/eth-fabric/urc/tar.gz/e0c5c8a8212a04e8844df0268c7de17b9e6b8896 devDependencies: '@types/node': specifier: ^20.11.30 @@ -749,7 +752,7 @@ importers: version: 4.1.11 '@web3modal/wagmi': specifier: ^4.1.1 - version: 4.1.11(nhv3btjcneav7vr3ub73tnaqau) + version: 4.1.11(eda42001c1d6ea60fc09d76f6c806d0c) '@zerodevx/svelte-toast': specifier: ^0.9.5 version: 0.9.5(svelte@4.2.15) @@ -11755,6 +11758,10 @@ packages: uqr@0.1.2: resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==} + urc#main@https://codeload.github.com/eth-fabric/urc/tar.gz/e0c5c8a8212a04e8844df0268c7de17b9e6b8896: + resolution: {tarball: https://codeload.github.com/eth-fabric/urc/tar.gz/e0c5c8a8212a04e8844df0268c7de17b9e6b8896} + version: 0.0.0 + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -20413,7 +20420,7 @@ snapshots: lit: 3.1.0 qrcode: 1.5.3 - '@web3modal/wagmi@4.1.11(465hcphkttv2p5txznqylpmnwa)': + '@web3modal/wagmi@4.1.11(9ecc8b7aeee8c74c3518124cbf094f4f)': dependencies: '@wagmi/connectors': 4.3.3(@types/react@18.3.3)(@wagmi/core@2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.17.2)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) '@wagmi/core': 2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) @@ -20430,7 +20437,7 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@web3modal/wagmi@4.1.11(nhv3btjcneav7vr3ub73tnaqau)': + '@web3modal/wagmi@4.1.11(eda42001c1d6ea60fc09d76f6c806d0c)': dependencies: '@wagmi/connectors': 4.3.3(@types/react@18.3.3)(@wagmi/core@2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6))(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.17.2)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6) '@wagmi/core': 2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6) @@ -28706,6 +28713,8 @@ snapshots: uqr@0.1.2: {} + urc#main@https://codeload.github.com/eth-fabric/urc/tar.gz/e0c5c8a8212a04e8844df0268c7de17b9e6b8896: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 From 3daa9453ea4693559b87d0aac334bcfe12e23794 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 18 Apr 2025 22:19:38 +0800 Subject: [PATCH 03/16] chore(protocol): use txt files for logging gas and layout tables (#19306) --- ...provermarket_diff_prover_and_proposer.txt} | 0 ...rover_and_proposer_fee_above_liveness.txt} | 0 ...e_prover_as_proposer_measure_gas_used.txt} | 0 ...rket.md => inbox_without_provermarket.txt} | 0 packages/protocol/layout/layer1-contracts.md | 0 packages/protocol/layout/layer1-contracts.txt | 1426 +++++++++++++++++ packages/protocol/layout/layer2-contracts.md | 0 packages/protocol/layout/layer2-contracts.txt | 716 +++++++++ packages/protocol/script/gen-layouts.sh | 2 +- .../based/InboxTest_ProposeAndProve.t.sol | 8 +- 10 files changed, 2147 insertions(+), 5 deletions(-) rename packages/protocol/gas-reports/{inbox_with_provermarket_diff_prover_and_proposer.md => inbox_with_provermarket_diff_prover_and_proposer.txt} (100%) rename packages/protocol/gas-reports/{inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md => inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt} (100%) rename packages/protocol/gas-reports/{test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md => inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt} (100%) rename packages/protocol/gas-reports/{inbox_without_provermarket.md => inbox_without_provermarket.txt} (100%) delete mode 100644 packages/protocol/layout/layer1-contracts.md create mode 100644 packages/protocol/layout/layer1-contracts.txt delete mode 100644 packages/protocol/layout/layer2-contracts.md create mode 100644 packages/protocol/layout/layer2-contracts.txt diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt similarity index 100% rename from packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md rename to packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt similarity index 100% rename from packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md rename to packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt diff --git a/packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt similarity index 100% rename from packages/protocol/gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md rename to packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.md b/packages/protocol/gas-reports/inbox_without_provermarket.txt similarity index 100% rename from packages/protocol/gas-reports/inbox_without_provermarket.md rename to packages/protocol/gas-reports/inbox_without_provermarket.txt diff --git a/packages/protocol/layout/layer1-contracts.md b/packages/protocol/layout/layer1-contracts.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/protocol/layout/layer1-contracts.txt b/packages/protocol/layout/layer1-contracts.txt new file mode 100644 index 00000000000..30587a9ce4f --- /dev/null +++ b/packages/protocol/layout/layer1-contracts.txt @@ -0,0 +1,1426 @@ +## ERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +| +| __gap | uint256[50] | 401 | 0 | 1600 | +| +| __gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + + +## ERC20Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | +| +| __gap | uint256[45] | 306 | 0 | 1440 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + + +## ERC20VaultOriginal + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++============================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| __gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ + + +## ERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + + +## BridgedERC20 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| _totalSupply | uint256 | 253 | 0 | 32 | +| +| _name | string | 254 | 0 | 32 | +| +| _symbol | string | 255 | 0 | 32 | +| +| __gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| __srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + + +## BridgedERC20V2 + +╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| _totalSupply | uint256 | 253 | 0 | 32 | +| +| _name | string | 254 | 0 | 32 | +| +| _symbol | string | 255 | 0 | 32 | +| +| __gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| __srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +| +| _hashedName | bytes32 | 351 | 0 | 32 | +| +| _hashedVersion | bytes32 | 352 | 0 | 32 | +| +| _name | string | 353 | 0 | 32 | +| +| _version | string | 354 | 0 | 32 | +| +| __gap | uint256[48] | 355 | 0 | 1536 | +| +| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| __gap | uint256[49] | 404 | 0 | 1568 | +╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + + +## BridgedERC721 + +╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| _name | string | 301 | 0 | 32 | +| +| _symbol | string | 302 | 0 | 32 | +| +| _owners | mapping(uint256 => address) | 303 | 0 | 32 | +| +| _balances | mapping(address => uint256) | 304 | 0 | 32 | +| +| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| +| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| +| __gap | uint256[44] | 307 | 0 | 1408 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| __gap | uint256[48] | 353 | 0 | 1536 | +╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + + +## BridgedERC1155 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| +| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| +| _uri | string | 303 | 0 | 32 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| symbol | string | 353 | 0 | 32 | +| +| name | string | 354 | 0 | 32 | +| +| __gap | uint256[46] | 355 | 0 | 1472 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + + +## Bridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| __reserved2 | uint256 | 255 | 0 | 32 | +| +| __reserved3 | uint256 | 256 | 0 | 32 | +| +| __gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ + + +## QuotaManager + +╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| +| quotaPeriod | uint24 | 252 | 0 | 3 | +| +| __gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + + +## DefaultResolver + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| +| __gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + + +## EssentialContract + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + + +## SignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + + +## TaikoToken + +╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| +| _balances | mapping(address => uint256) | 301 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| +| _totalSupply | uint256 | 303 | 0 | 32 | +| +| _name | string | 304 | 0 | 32 | +| +| _symbol | string | 305 | 0 | 32 | +| +| __gap | uint256[45] | 306 | 0 | 1440 | +| +| _hashedName | bytes32 | 351 | 0 | 32 | +| +| _hashedVersion | bytes32 | 352 | 0 | 32 | +| +| _name | string | 353 | 0 | 32 | +| +| _version | string | 354 | 0 | 32 | +| +| __gap | uint256[48] | 355 | 0 | 1536 | +| +| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| +| __gap | uint256[49] | 405 | 0 | 1568 | +| +| _delegates | mapping(address => address) | 454 | 0 | 32 | +| +| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| +| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| +| __gap | uint256[47] | 457 | 0 | 1504 | +| +| __gap | uint256[50] | 504 | 0 | 1600 | +╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╯ + + +## SgxAndZkVerifier + +╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| __gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╯ + + +## Risc0Verifier + +╭-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| +| __gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+--------------------------+------+--------+-------+------------------------------------------------------------╯ + + +## SP1Verifier + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| +| __gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ + + +## SgxVerifier + +╭-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| nextInstanceId | uint256 | 251 | 0 | 32 | +| +| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | +| +| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╯ + + +## AutomataDcapV3Attestation + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| sigVerifyLib | contract ISigVerifyLib | 251 | 0 | 20 | +| +| pemCertLib | contract IPEMCertChainLib | 252 | 0 | 20 | +| +| checkLocalEnclaveReport | bool | 252 | 20 | 1 | +| +| trustedUserMrEnclave | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| trustedUserMrSigner | mapping(bytes32 => bool) | 254 | 0 | 32 | +| +| serialNumIsRevoked | mapping(uint256 => mapping(bytes => bool)) | 255 | 0 | 32 | +| +| tcbInfo | mapping(string => struct TCBInfoStruct.TCBInfo) | 256 | 0 | 32 | +| +| qeIdentity | struct EnclaveIdStruct.EnclaveId | 257 | 0 | 128 | +| +| __gap | uint256[39] | 261 | 0 | 1248 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╯ + + +## TaikoInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| __gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + + +## HeklaInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| __gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + + +## MainnetBridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| __reserved2 | uint256 | 255 | 0 | 32 | +| +| __reserved3 | uint256 | 256 | 0 | 32 | +| +| __gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╯ + + +## MainnetSignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==========================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╯ + + +## MainnetERC20Vault + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| __gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╯ + + +## MainnetERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +| +| __gap | uint256[50] | 401 | 0 | 1600 | +| +| __gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╯ + + +## MainnetERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╯ + + +## MainnetInbox + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| state | struct ITaikoInbox.State | 251 | 0 | 1600 | +| +| __gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ + + +## TokenUnlock + +╭-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| amountVested | uint256 | 251 | 0 | 32 | +| +| recipient | address | 252 | 0 | 20 | +| +| tgeTimestamp | uint64 | 252 | 20 | 8 | +| +| isProverSet | mapping(address => bool) | 253 | 0 | 32 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+--------------------------+------+--------+-------+---------------------------------------------------╯ + + +## ProverSet + +╭-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| isProver | mapping(address => bool) | 251 | 0 | 32 | +| +| admin | address | 252 | 0 | 20 | +| +| __gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ + + +## ForkRouter + +╭---------------+-------------+------+--------+-------+--------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +╰---------------+-------------+------+--------+-------+--------------------------------------------------------╯ + + +## TaikoWrapper + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + + +## ForcedInclusionStore + +╭-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==========================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| queue | mapping(uint256 => struct IForcedInclusionStore.ForcedInclusion) | 251 | 0 | 32 | +| +| head | uint64 | 252 | 0 | 8 | +| +| tail | uint64 | 252 | 8 | 8 | +| +| lastProcessedAtBatchId | uint64 | 252 | 16 | 8 | +| +| __reserved1 | uint64 | 252 | 24 | 8 | +| +| __gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+------------------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╯ + + +## PreconfRouter + +╭-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +╰-----------------------------+-------------+------+--------+-------+---------------------------------------------------------------╯ + + +## PreconfWhitelist + +╭-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| operators | mapping(address => struct PreconfWhitelist.OperatorInfo) | 251 | 0 | 32 | +| +| operatorMapping | mapping(uint256 => address) | 252 | 0 | 32 | +| +| operatorCount | uint8 | 253 | 0 | 1 | +| +| operatorChangeDelay | uint8 | 253 | 1 | 1 | +| +| havingPerfectOperators | bool | 253 | 2 | 1 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+----------------------------------------------------------+------+--------+-------+---------------------------------------------------------------------╯ + + +## ProverMarket + +╭-----------------------------+------------------------------------------------+------+--------+-------+--------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| provers | mapping(address => struct ProverMarket.Prover) | 251 | 0 | 32 | +| +| prover | address | 252 | 0 | 20 | +| +| feeInGwei | uint64 | 252 | 20 | 8 | +| +| avgFeeInGwei | uint64 | 253 | 0 | 8 | +| +| assignmentCount | uint16 | 253 | 8 | 2 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+------------------------------------------------+------+--------+-------+--------------------------------------------------------------╯ + + +## TaikoTreasuryVault + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------------╯ + + diff --git a/packages/protocol/layout/layer2-contracts.md b/packages/protocol/layout/layer2-contracts.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/protocol/layout/layer2-contracts.txt b/packages/protocol/layout/layer2-contracts.txt new file mode 100644 index 00000000000..736a7d7267a --- /dev/null +++ b/packages/protocol/layout/layer2-contracts.txt @@ -0,0 +1,716 @@ +## ERC1155Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +| +| __gap | uint256[50] | 401 | 0 | 1600 | +| +| __gap | uint256[50] | 451 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + + +## ERC20Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++====================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| solverConditionToSolver | mapping(bytes32 => address) | 305 | 0 | 32 | +| +| __gap | uint256[45] | 306 | 0 | 1440 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + + +## ERC20VaultOriginal + +╭-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++============================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct ERC20VaultOriginal.CanonicalERC20) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| +| __gap | uint256[46] | 305 | 0 | 1472 | +╰-----------------------------+--------------------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------╯ + + +## ERC721Vault + +╭-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| +| __gap | uint256[48] | 303 | 0 | 1536 | +| +| __gap | uint256[50] | 351 | 0 | 1600 | +╰-----------------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + + +## BridgedERC20 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| _totalSupply | uint256 | 253 | 0 | 32 | +| +| _name | string | 254 | 0 | 32 | +| +| _symbol | string | 255 | 0 | 32 | +| +| __gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| __srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ + + +## BridgedERC20V2 + +╭-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| +| _totalSupply | uint256 | 253 | 0 | 32 | +| +| _name | string | 254 | 0 | 32 | +| +| _symbol | string | 255 | 0 | 32 | +| +| __gap | uint256[45] | 256 | 0 | 1440 | +| +| srcToken | address | 301 | 0 | 20 | +| +| __srcDecimals | uint8 | 301 | 20 | 1 | +| +| srcChainId | uint256 | 302 | 0 | 32 | +| +| migratingAddress | address | 303 | 0 | 20 | +| +| migratingInbound | bool | 303 | 20 | 1 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +| +| _hashedName | bytes32 | 351 | 0 | 32 | +| +| _hashedVersion | bytes32 | 352 | 0 | 32 | +| +| _name | string | 353 | 0 | 32 | +| +| _version | string | 354 | 0 | 32 | +| +| __gap | uint256[48] | 355 | 0 | 1536 | +| +| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| __gap | uint256[49] | 404 | 0 | 1568 | +╰-----------------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + + +## BridgedERC721 + +╭-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| _name | string | 301 | 0 | 32 | +| +| _symbol | string | 302 | 0 | 32 | +| +| _owners | mapping(uint256 => address) | 303 | 0 | 32 | +| +| _balances | mapping(address => uint256) | 304 | 0 | 32 | +| +| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| +| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| +| __gap | uint256[44] | 307 | 0 | 1408 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| __gap | uint256[48] | 353 | 0 | 1536 | +╰-----------------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + + +## BridgedERC1155 + +╭-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=======================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __gap | uint256[50] | 251 | 0 | 1600 | +| +| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| +| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| +| _uri | string | 303 | 0 | 32 | +| +| __gap | uint256[47] | 304 | 0 | 1504 | +| +| srcToken | address | 351 | 0 | 20 | +| +| srcChainId | uint256 | 352 | 0 | 32 | +| +| symbol | string | 353 | 0 | 32 | +| +| name | string | 354 | 0 | 32 | +| +| __gap | uint256[46] | 355 | 0 | 1472 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ + + +## Bridge + +╭-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __reserved1 | uint64 | 251 | 0 | 8 | +| +| nextMessageId | uint64 | 251 | 8 | 8 | +| +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| +| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| +| __reserved2 | uint256 | 255 | 0 | 32 | +| +| __reserved3 | uint256 | 256 | 0 | 32 | +| +| __gap | uint256[44] | 257 | 0 | 1408 | +╰-----------------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ + + +## QuotaManager + +╭-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| +| quotaPeriod | uint24 | 252 | 0 | 3 | +| +| __gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ + + +## DefaultResolver + +╭-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| +| __gap | uint256[49] | 252 | 0 | 1568 | +╰-----------------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ + + +## EssentialContract + +╭-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++=====================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +╰-----------------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ + + +## SignalService + +╭-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++===============================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| +| _receivedSignals | mapping(bytes32 => bool) | 253 | 0 | 32 | +| +| __gap | uint256[47] | 254 | 0 | 1504 | +╰-----------------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ + + +## BridgedTaikoToken + +╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++==============================================================================================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| +| _balances | mapping(address => uint256) | 301 | 0 | 32 | +| +| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| +| _totalSupply | uint256 | 303 | 0 | 32 | +| +| _name | string | 304 | 0 | 32 | +| +| _symbol | string | 305 | 0 | 32 | +| +| __gap | uint256[45] | 306 | 0 | 1440 | +| +| _hashedName | bytes32 | 351 | 0 | 32 | +| +| _hashedVersion | bytes32 | 352 | 0 | 32 | +| +| _name | string | 353 | 0 | 32 | +| +| _version | string | 354 | 0 | 32 | +| +| __gap | uint256[48] | 355 | 0 | 1536 | +| +| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| +| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| +| __gap | uint256[49] | 405 | 0 | 1568 | +| +| _delegates | mapping(address => address) | 454 | 0 | 32 | +| +| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| +| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| +| __gap | uint256[47] | 457 | 0 | 1504 | +| +| __gap | uint256[50] | 504 | 0 | 1600 | +╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╯ + + +## DelegateOwner + +╭-----------------------------+-------------+------+--------+-------+--------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++======================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| remoteChainId | uint64 | 251 | 0 | 8 | +| +| admin | address | 251 | 8 | 20 | +| +| nextTxId | uint64 | 252 | 0 | 8 | +| +| remoteOwner | address | 252 | 8 | 20 | +| +| __gap | uint256[48] | 253 | 0 | 1536 | +╰-----------------------------+-------------+------+--------+-------+--------------------------------------------------╯ + + +## TaikoAnchor + +╭-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╮ +| Name | Type | Slot | Offset | Bytes | ++========================================================================================================================================+ +| _initialized | uint8 | 0 | 0 | 1 | +| +| _initializing | bool | 0 | 1 | 1 | +| +| __gap | uint256[50] | 1 | 0 | 1600 | +| +| _owner | address | 51 | 0 | 20 | +| +| __gap | uint256[49] | 52 | 0 | 1568 | +| +| _pendingOwner | address | 101 | 0 | 20 | +| +| __gap | uint256[49] | 102 | 0 | 1568 | +| +| __gapFromOldAddressResolver | uint256[50] | 151 | 0 | 1600 | +| +| __reentry | uint8 | 201 | 0 | 1 | +| +| __paused | uint8 | 201 | 1 | 1 | +| +| __gap | uint256[49] | 202 | 0 | 1568 | +| +| _blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | +| +| publicInputHash | bytes32 | 252 | 0 | 32 | +| +| parentGasExcess | uint64 | 253 | 0 | 8 | +| +| lastSyncedBlock | uint64 | 253 | 8 | 8 | +| +| parentTimestamp | uint64 | 253 | 16 | 8 | +| +| parentGasTarget | uint64 | 253 | 24 | 8 | +| +| l1ChainId | uint64 | 254 | 0 | 8 | +| +| __gap | uint256[46] | 255 | 0 | 1472 | +╰-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╯ + + diff --git a/packages/protocol/script/gen-layouts.sh b/packages/protocol/script/gen-layouts.sh index ea227654024..d154d6ec98a 100755 --- a/packages/protocol/script/gen-layouts.sh +++ b/packages/protocol/script/gen-layouts.sh @@ -67,7 +67,7 @@ else fi # Empty the output file initially -output_file="layout/${profile}-contracts.md" +output_file="layout/${profile}-contracts.txt" > $output_file # Loop over each contract diff --git a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol index 306b0520be4..59b7d498129 100644 --- a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol @@ -609,7 +609,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { ); console2.log(str); - vm.writeFile("./gas-reports/inbox_without_provermarket.md", str); + vm.writeFile("./gas-reports/inbox_without_provermarket.txt", str); } function test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() @@ -682,7 +682,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { ); console2.log(str); - vm.writeFile("./gas-reports/inbox_with_provermarket_diff_prover_and_proposer.md", str); + vm.writeFile("./gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt", str); } function test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used( @@ -758,7 +758,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { console2.log(str); vm.writeFile( - "./gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.md", + "./gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt", str ); } @@ -819,7 +819,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { console2.log(str); vm.writeFile( - "./gas-reports/test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.md", + "./gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt", str ); } From 297e7e6ac18c449b8b835525c2034d615a049a3c Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Sat, 19 Apr 2025 12:42:27 +0800 Subject: [PATCH 04/16] refactor(protocol): refactor TaikoAnchor code (#19291) --- .../contracts/layer2/based/LibL2Config.sol | 21 ---- .../OntakeAnchor.sol} | 19 +++- .../PacayaAnchor.sol} | 101 +++-------------- .../layer2/based/anchor/ShastaAnchor.sol | 97 ++++++++++++++++ .../layer2/based/anchor/TaikoAnchor.sol | 56 ++++++++++ .../layer2/based/{ => eip1559}/LibEIP1559.sol | 0 .../contracts/shared/based/LibSharedData.sol | 1 + packages/protocol/layout/layer2-contracts.txt | 8 +- packages/protocol/script/gen-layouts.sh | 2 +- .../layer2/devnet/UpgradeDevnetPacayaL2.s.sol | 7 +- .../script/layer2/hekla/DeployPacayaL2.s.sol | 8 +- .../test/genesis/GenerateGenesis.g.sol | 7 +- .../test/genesis/data/genesis_config.js | 1 + .../test/genesis/data/genesis_config.json | 55 ++++----- .../test/genesis/generate/interface.ts | 1 + .../test/genesis/generate/taikoAnchor.ts | 104 +++++++++++++++--- packages/protocol/test/genesis/test_config.js | 1 + packages/protocol/test/layer2/Layer2Test.sol | 3 +- .../{ => based/anchor}/TaikoAnchor.t.sol | 8 +- .../{ => based/eip1559}/LibEIP1559.t.sol | 2 +- .../helpers/TaikoAnchor_NoBaseFeeCheck.sol | 4 +- 21 files changed, 330 insertions(+), 176 deletions(-) delete mode 100644 packages/protocol/contracts/layer2/based/LibL2Config.sol rename packages/protocol/contracts/layer2/based/{TaikoAnchorDeprecated.sol => anchor/OntakeAnchor.sol} (71%) rename packages/protocol/contracts/layer2/based/{TaikoAnchor.sol => anchor/PacayaAnchor.sol} (77%) create mode 100644 packages/protocol/contracts/layer2/based/anchor/ShastaAnchor.sol create mode 100644 packages/protocol/contracts/layer2/based/anchor/TaikoAnchor.sol rename packages/protocol/contracts/layer2/based/{ => eip1559}/LibEIP1559.sol (100%) rename packages/protocol/test/layer2/{ => based/anchor}/TaikoAnchor.t.sol (96%) rename packages/protocol/test/layer2/{ => based/eip1559}/LibEIP1559.t.sol (99%) diff --git a/packages/protocol/contracts/layer2/based/LibL2Config.sol b/packages/protocol/contracts/layer2/based/LibL2Config.sol deleted file mode 100644 index f1a7586d7f7..00000000000 --- a/packages/protocol/contracts/layer2/based/LibL2Config.sol +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -/// @dev DEPRECATED but used by node/client for syncing old blocks -/// @title LibL2Config -library LibL2Config { - struct Config { - uint32 gasTargetPerL1Block; - uint8 basefeeAdjustmentQuotient; - } - - /// @notice Returns EIP1559 related configurations. - /// @return config_ struct containing configuration parameters. - function get() internal pure returns (Config memory config_) { - // Assuming we sell 3x more blockspace than Ethereum: 15_000_000 * 4 - // Note that Brecht's concern is that this value may be too large. - // We need to monitor L2 state growth and lower this value when necessary. - config_.gasTargetPerL1Block = 60_000_000; - config_.basefeeAdjustmentQuotient = 8; - } -} diff --git a/packages/protocol/contracts/layer2/based/TaikoAnchorDeprecated.sol b/packages/protocol/contracts/layer2/based/anchor/OntakeAnchor.sol similarity index 71% rename from packages/protocol/contracts/layer2/based/TaikoAnchorDeprecated.sol rename to packages/protocol/contracts/layer2/based/anchor/OntakeAnchor.sol index e6c58d5dadf..f642e89f2dc 100644 --- a/packages/protocol/contracts/layer2/based/TaikoAnchorDeprecated.sol +++ b/packages/protocol/contracts/layer2/based/anchor/OntakeAnchor.sol @@ -1,13 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; +import "src/shared/common/EssentialContract.sol"; import "src/shared/based/LibSharedData.sol"; +import "../IBlockHashProvider.sol"; -/// @title TaikoAnchorDeprecated -/// @notice This contract includes deprecated functions whose ABI are still used by client for old -/// blocks. +/// @title OntakeAnchor +/// @notice Anchoring functions for the Ontake and pre-Ontake fork. /// @custom:security-contact security@taiko.xyz -abstract contract TaikoAnchorDeprecated { +abstract contract OntakeAnchor is EssentialContract, IBlockHashProvider { error L2_DEPRECATED_METHOD(); modifier deprecated() { @@ -57,4 +58,14 @@ abstract contract TaikoAnchorDeprecated { deprecated returns (uint256 basefee_, uint64 parentGasExcess_) { } + + function anchorV2( + uint64 _anchorBlockId, + bytes32 _anchorStateRoot, + uint32 _parentGasUsed, + LibSharedData.BaseFeeConfig calldata _baseFeeConfig + ) + external + deprecated + { } } diff --git a/packages/protocol/contracts/layer2/based/TaikoAnchor.sol b/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol similarity index 77% rename from packages/protocol/contracts/layer2/based/TaikoAnchor.sol rename to packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol index 1e2f2c1fd80..49a900f7997 100644 --- a/packages/protocol/contracts/layer2/based/TaikoAnchor.sol +++ b/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol @@ -4,25 +4,18 @@ pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import "src/shared/common/EssentialContract.sol"; import "src/shared/based/ITaiko.sol"; import "src/shared/libs/LibStrings.sol"; import "src/shared/libs/LibAddress.sol"; import "src/shared/libs/LibMath.sol"; import "src/shared/signal/ISignalService.sol"; -import "./LibEIP1559.sol"; -import "./LibL2Config.sol"; -import "./IBlockHashProvider.sol"; -import "./TaikoAnchorDeprecated.sol"; - -/// @title TaikoAnchor -/// @notice Taiko L2 is a smart contract that handles cross-layer message -/// verification and manages EIP-1559 gas pricing for Layer 2 (L2) operations. -/// It is used to anchor the latest L1 block details to L2 for cross-layer -/// communication, manage EIP-1559 parameters for gas pricing, and store -/// verified L1 block information. +import "../eip1559/LibEIP1559.sol"; +import "./OntakeAnchor.sol"; + +/// @title PacayaAnchor +/// @notice Anchoring functions for the Pacaya fork. /// @custom:security-contact security@taiko.xyz -contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprecated { +abstract contract PacayaAnchor is OntakeAnchor { using LibAddress for address; using LibMath for uint256; using SafeERC20 for IERC20; @@ -32,10 +25,11 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec ISignalService public immutable signalService; uint64 public immutable pacayaForkHeight; + uint64 public immutable shastaForkHeight; /// @notice Mapping from L2 block numbers to their block hashes. All L2 block hashes will /// be saved in this mapping. - mapping(uint256 blockId => bytes32 blockHash) private _blockhashes; + mapping(uint256 blockId => bytes32 blockHash) internal _blockhashes; /// @notice A hash to check the integrity of public inputs. /// @dev Slot 2. @@ -55,6 +49,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec uint64 public parentGasTarget; /// @notice The L1's chain ID. + /// @dev Slot 4. uint64 public l1ChainId; uint256[46] private __gap; @@ -102,40 +97,6 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec pacayaForkHeight = _pacayaForkHeight; } - /// @notice Initializes the contract. - /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. - /// @param _l1ChainId The ID of the base layer. - /// @param _initialGasExcess The initial parentGasExcess. - function init( - address _owner, - uint64 _l1ChainId, - uint64 _initialGasExcess - ) - external - initializer - { - __Essential_init(_owner); - - require(_l1ChainId != 0, L2_INVALID_L1_CHAIN_ID()); - require(_l1ChainId != block.chainid, L2_INVALID_L1_CHAIN_ID()); - require(block.chainid > 1, L2_INVALID_L2_CHAIN_ID()); - require(block.chainid <= type(uint64).max, L2_INVALID_L2_CHAIN_ID()); - - if (block.number == 0) { - // This is the case in real L2 genesis - } else if (block.number == 1) { - // This is the case in tests - uint256 parentHeight = block.number - 1; - _blockhashes[parentHeight] = blockhash(parentHeight); - } else { - revert L2_TOO_LATE(); - } - - l1ChainId = _l1ChainId; - parentGasExcess = _initialGasExcess; - (publicInputHash,) = _calcPublicInputHash(block.number); - } - /// @notice Anchors the latest L1 block details to L2 for cross-layer /// message verification. /// @dev The gas limit for this transaction must be set to 1,000,000 gas. @@ -163,6 +124,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec nonReentrant { require(block.number >= pacayaForkHeight, L2_FORK_ERROR()); + require(shastaForkHeight == 0 || block.number < shastaForkHeight, L2_FORK_ERROR()); uint256 parentId = block.number - 1; _verifyAndUpdatePublicInputHash(parentId); @@ -173,39 +135,6 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec signalService.receiveSignals(_signalSlots); } - /// @notice Anchors the latest L1 block details to L2 for cross-layer - /// message verification. - /// @dev The gas limit for this transaction must be set to 250,000 gas. - /// @dev This function can be called freely as the golden touch private key is publicly known, - /// but the Taiko node guarantees the first transaction of each block is always this anchor - /// transaction, and any subsequent calls will revert with L2_PUBLIC_INPUT_HASH_MISMATCH. - /// @param _anchorBlockId The `anchorBlockId` value in this block's metadata. - /// @param _anchorStateRoot The state root for the L1 block with id equals `_anchorBlockId`. - /// @param _parentGasUsed The gas used in the parent block. - /// @param _baseFeeConfig The base fee configuration. - function anchorV2( - uint64 _anchorBlockId, - bytes32 _anchorStateRoot, - uint32 _parentGasUsed, - LibSharedData.BaseFeeConfig calldata _baseFeeConfig - ) - external - nonZeroBytes32(_anchorStateRoot) - nonZeroValue(_anchorBlockId) - nonZeroValue(_baseFeeConfig.gasIssuancePerSecond) - nonZeroValue(_baseFeeConfig.adjustmentQuotient) - onlyGoldenTouch - nonReentrant - { - require(block.number < pacayaForkHeight, L2_FORK_ERROR()); - - uint256 parentId = block.number - 1; - _verifyAndUpdatePublicInputHash(parentId); - _verifyBaseFeeAndUpdateGasExcess(_parentGasUsed, _baseFeeConfig); - _syncChainData(_anchorBlockId, _anchorStateRoot); - _updateParentHashAndTimestamp(parentId); - } - /// @notice Withdraw token or Ether from this address. /// Note: This contract receives a portion of L2 base fees, while the remainder is directed to /// L2 block's coinbase address. @@ -289,7 +218,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec /// @dev Synchronizes chain data with the given anchor block ID and state root. /// @param _anchorBlockId The ID of the anchor block. /// @param _anchorStateRoot The state root of the anchor block. - function _syncChainData(uint64 _anchorBlockId, bytes32 _anchorStateRoot) private { + function _syncChainData(uint64 _anchorBlockId, bytes32 _anchorStateRoot) internal { /// @dev If the anchor block ID is less than or equal to the last synced block, return /// early. if (_anchorBlockId <= lastSyncedBlock) return; @@ -306,7 +235,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec /// @dev Updates the parent block hash and timestamp. /// @param _parentId The ID of the parent block. - function _updateParentHashAndTimestamp(uint256 _parentId) private { + function _updateParentHashAndTimestamp(uint256 _parentId) internal { // Get the block hash of the parent block. bytes32 parentHash = blockhash(_parentId); @@ -322,7 +251,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec /// @dev Verifies the current ancestor block hash and updates it with a new aggregated hash. /// @param _parentId The ID of the parent block. - function _verifyAndUpdatePublicInputHash(uint256 _parentId) private { + function _verifyAndUpdatePublicInputHash(uint256 _parentId) internal { // Calculate the current and new ancestor hashes based on the parent block ID. (bytes32 currPublicInputHash_, bytes32 newPublicInputHash_) = _calcPublicInputHash(_parentId); @@ -341,7 +270,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec uint32 _parentGasUsed, LibSharedData.BaseFeeConfig calldata _baseFeeConfig ) - private + internal { (uint256 basefee, uint64 newGasTarget, uint64 newGasExcess) = getBasefeeV2(_parentGasUsed, uint64(block.timestamp), _baseFeeConfig); @@ -362,7 +291,7 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec /// @return currPublicInputHash_ The public input hash for the previous state. /// @return newPublicInputHash_ The public input hash for the new state. function _calcPublicInputHash(uint256 _blockId) - private + internal view returns (bytes32 currPublicInputHash_, bytes32 newPublicInputHash_) { diff --git a/packages/protocol/contracts/layer2/based/anchor/ShastaAnchor.sol b/packages/protocol/contracts/layer2/based/anchor/ShastaAnchor.sol new file mode 100644 index 00000000000..1bf42bdfc7e --- /dev/null +++ b/packages/protocol/contracts/layer2/based/anchor/ShastaAnchor.sol @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "src/shared/based/LibSharedData.sol"; +import "./PacayaAnchor.sol"; + +/// @title ShastaAnchor +/// @notice Anchoring functions for the Shasta fork. +/// @custom:security-contact security@taiko.xyz +abstract contract ShastaAnchor is PacayaAnchor { + error InvalidForkHeight(); + + uint256[50] private __gap; + + constructor( + address _resolver, + address _signalService, + uint64 _pacayaForkHeight, + uint64 _shastaForkHeight + ) + PacayaAnchor(_resolver, _signalService, _pacayaForkHeight) + { + require( + _shastaForkHeight == 0 || _shastaForkHeight > _pacayaForkHeight, InvalidForkHeight() + ); + shastaForkHeight = _shastaForkHeight; + } + + /// @notice Anchors the latest L1 block details to L2 for cross-layer + /// message verification. + /// @dev The gas limit for this transaction must be set to 1,000,000 gas. + /// @dev This function can be called freely as the golden touch private key is publicly known, + /// but the Taiko node guarantees the first transaction of each block is always this anchor + /// transaction, and any subsequent calls will revert with L2_PUBLIC_INPUT_HASH_MISMATCH. + /// @param _anchorBlockId The `anchorBlockId` value in this block's metadata. + /// @param _anchorStateRoot The state root for the L1 block with id equals `_anchorBlockId`. + /// @param _parentGasUsed The gas used in the parent block. + /// @param _baseFeeConfig The base fee configuration. + /// @param _signalSlots The signal slots to mark as received. + function v4Anchor( + uint64 _anchorBlockId, + bytes32 _anchorStateRoot, + uint256, /*_parentBaseFee*/ + uint32 _parentGasUsed, + LibSharedData.BaseFeeConfig calldata _baseFeeConfig, + bytes32[] calldata _signalSlots + ) + external + nonZeroBytes32(_anchorStateRoot) + nonZeroValue(_anchorBlockId) + nonZeroValue(_baseFeeConfig.gasIssuancePerSecond) + nonZeroValue(_baseFeeConfig.adjustmentQuotient) + onlyGoldenTouch + nonReentrant + { + require(block.number >= shastaForkHeight, L2_FORK_ERROR()); + + uint256 parentId = block.number - 1; + _verifyAndUpdatePublicInputHash(parentId); + _verifyBaseFeeAndUpdateGasExcess(_parentGasUsed, _baseFeeConfig); + _syncChainData(_anchorBlockId, _anchorStateRoot); + _updateParentHashAndTimestamp(parentId); + + signalService.receiveSignals(_signalSlots); + } + + function v4GetBaseFee( + uint32 _parentGasUsed, + uint64 _blockTimestamp, + LibSharedData.BaseFeeConfig calldata _baseFeeConfig + ) + public + view + returns (uint256 basefee_, uint64 newGasTarget_, uint64 newGasExcess_) + { + // uint32 * uint8 will never overflow + uint64 newGasTarget = + uint64(_baseFeeConfig.gasIssuancePerSecond) * _baseFeeConfig.adjustmentQuotient; + + (newGasTarget_, newGasExcess_) = + LibEIP1559.adjustExcess(parentGasTarget, newGasTarget, parentGasExcess); + + uint64 gasIssuance = + (_blockTimestamp - parentTimestamp) * _baseFeeConfig.gasIssuancePerSecond; + + if ( + _baseFeeConfig.maxGasIssuancePerBlock != 0 + && gasIssuance > _baseFeeConfig.maxGasIssuancePerBlock + ) { + gasIssuance = _baseFeeConfig.maxGasIssuancePerBlock; + } + + (basefee_, newGasExcess_) = LibEIP1559.calc1559BaseFee( + newGasTarget_, newGasExcess_, gasIssuance, _parentGasUsed, _baseFeeConfig.minGasExcess + ); + } +} diff --git a/packages/protocol/contracts/layer2/based/anchor/TaikoAnchor.sol b/packages/protocol/contracts/layer2/based/anchor/TaikoAnchor.sol new file mode 100644 index 00000000000..d3b1369982a --- /dev/null +++ b/packages/protocol/contracts/layer2/based/anchor/TaikoAnchor.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "./ShastaAnchor.sol"; + +/// @title TaikoAnchor +/// @notice TaikoAnchor is a smart contract that handles cross-layer message +/// verification and manages EIP-1559 gas pricing for Layer 2 (L2) operations. +/// It is used to anchor the latest L1 block details to L2 for cross-layer +/// communication, manage EIP-1559 parameters for gas pricing, and store +/// verified L1 block information +/// @custom:security-contact security@taiko.xyz +contract TaikoAnchor is ShastaAnchor { + constructor( + address _resolver, + address _signalService, + uint64 _pacayaForkHeight, + uint64 _shastaForkHeight + ) + ShastaAnchor(_resolver, _signalService, _pacayaForkHeight, _shastaForkHeight) + { } + + /// @notice Initializes the contract. + /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. + /// @param _l1ChainId The ID of the base layer. + /// @param _initialGasExcess The initial parentGasExcess. + function init( + address _owner, + uint64 _l1ChainId, + uint64 _initialGasExcess + ) + external + initializer + { + __Essential_init(_owner); + + require(_l1ChainId != 0, L2_INVALID_L1_CHAIN_ID()); + require(_l1ChainId != block.chainid, L2_INVALID_L1_CHAIN_ID()); + require(block.chainid > 1, L2_INVALID_L2_CHAIN_ID()); + require(block.chainid <= type(uint64).max, L2_INVALID_L2_CHAIN_ID()); + + if (block.number == 0) { + // This is the case in real L2 genesis + } else if (block.number == 1) { + // This is the case in tests + uint256 parentHeight = block.number - 1; + _blockhashes[parentHeight] = blockhash(parentHeight); + } else { + revert L2_TOO_LATE(); + } + + l1ChainId = _l1ChainId; + parentGasExcess = _initialGasExcess; + (publicInputHash,) = _calcPublicInputHash(block.number); + } +} diff --git a/packages/protocol/contracts/layer2/based/LibEIP1559.sol b/packages/protocol/contracts/layer2/based/eip1559/LibEIP1559.sol similarity index 100% rename from packages/protocol/contracts/layer2/based/LibEIP1559.sol rename to packages/protocol/contracts/layer2/based/eip1559/LibEIP1559.sol diff --git a/packages/protocol/contracts/shared/based/LibSharedData.sol b/packages/protocol/contracts/shared/based/LibSharedData.sol index 3bf9e665fd9..c4c10928d57 100644 --- a/packages/protocol/contracts/shared/based/LibSharedData.sol +++ b/packages/protocol/contracts/shared/based/LibSharedData.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.24; library LibSharedData { /// @dev Struct that represents L2 basefee configurations struct BaseFeeConfig { + // This is the base fee change denominator per 12 second window. uint8 adjustmentQuotient; uint8 sharingPctg; uint32 gasIssuancePerSecond; diff --git a/packages/protocol/layout/layer2-contracts.txt b/packages/protocol/layout/layer2-contracts.txt index 736a7d7267a..0fc7bb55a4b 100644 --- a/packages/protocol/layout/layer2-contracts.txt +++ b/packages/protocol/layout/layer2-contracts.txt @@ -671,9 +671,9 @@ ## TaikoAnchor -╭-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╮ +╭-----------------------------+-----------------------------+------+--------+-------+-----------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | -+========================================================================================================================================+ ++===============================================================================================================================================+ | _initialized | uint8 | 0 | 0 | 1 | | | _initializing | bool | 0 | 1 | 1 | @@ -711,6 +711,8 @@ | l1ChainId | uint64 | 254 | 0 | 8 | | | __gap | uint256[46] | 255 | 0 | 1472 | -╰-----------------------------+-----------------------------+------+--------+-------+----------------------------------------------------╯ +| +| __gap | uint256[50] | 301 | 0 | 1600 | +╰-----------------------------+-----------------------------+------+--------+-------+-----------------------------------------------------------╯ diff --git a/packages/protocol/script/gen-layouts.sh b/packages/protocol/script/gen-layouts.sh index d154d6ec98a..66e549ac76c 100755 --- a/packages/protocol/script/gen-layouts.sh +++ b/packages/protocol/script/gen-layouts.sh @@ -50,7 +50,7 @@ contracts_layer1=( contracts_layer2=( "contracts/layer2/token/BridgedTaikoToken.sol:BridgedTaikoToken" "contracts/layer2/DelegateOwner.sol:DelegateOwner" -"contracts/layer2/based/TaikoAnchor.sol:TaikoAnchor" +"contracts/layer2/based/anchor/TaikoAnchor.sol:TaikoAnchor" ) profile=$1 diff --git a/packages/protocol/script/layer2/devnet/UpgradeDevnetPacayaL2.s.sol b/packages/protocol/script/layer2/devnet/UpgradeDevnetPacayaL2.s.sol index 7c2e757c3e1..3e5a977cfa8 100644 --- a/packages/protocol/script/layer2/devnet/UpgradeDevnetPacayaL2.s.sol +++ b/packages/protocol/script/layer2/devnet/UpgradeDevnetPacayaL2.s.sol @@ -12,11 +12,12 @@ import "src/shared/tokenvault/BridgedERC721.sol"; import "src/shared/tokenvault/ERC1155Vault.sol"; import "src/shared/tokenvault/ERC20Vault.sol"; import "src/shared/tokenvault/ERC721Vault.sol"; -import "src/layer2/based/TaikoAnchor.sol"; +import "src/layer2/based/anchor/TaikoAnchor.sol"; contract UpgradeDevnetPacayaL2 is DeployCapability { uint256 public privateKey = vm.envUint("PRIVATE_KEY"); uint64 public pacayaForkHeight = uint64(vm.envUint("PACAYA_FORK_HEIGHT")); + uint64 public shastaForkHeight = uint64(vm.envUint("SHASTA_FORK_HEIGHT")); address public taikoAnchor = vm.envAddress("TAIKO_ANCHOR"); address public sharedResolver = vm.envAddress("SHARED_RESOLVER"); address public bridgeL2 = vm.envAddress("BRIDGE_L2"); @@ -64,7 +65,9 @@ contract UpgradeDevnetPacayaL2 is DeployCapability { // Taiko Anchor UUPSUpgradeable(taikoAnchor).upgradeTo( - address(new TaikoAnchor(sharedResolver, signalService, pacayaForkHeight)) + address( + new TaikoAnchor(sharedResolver, signalService, pacayaForkHeight, shastaForkHeight) + ) ); } } diff --git a/packages/protocol/script/layer2/hekla/DeployPacayaL2.s.sol b/packages/protocol/script/layer2/hekla/DeployPacayaL2.s.sol index f231c9ac404..f91602715eb 100644 --- a/packages/protocol/script/layer2/hekla/DeployPacayaL2.s.sol +++ b/packages/protocol/script/layer2/hekla/DeployPacayaL2.s.sol @@ -12,11 +12,12 @@ import "src/shared/tokenvault/BridgedERC721.sol"; import "src/shared/tokenvault/ERC1155Vault.sol"; import "src/shared/tokenvault/ERC20Vault.sol"; import "src/shared/tokenvault/ERC721Vault.sol"; -import "src/layer2/based/TaikoAnchor.sol"; +import "src/layer2/based/anchor/TaikoAnchor.sol"; contract DeployPacayaL2 is DeployCapability { uint256 public privateKey = vm.envUint("PRIVATE_KEY"); uint64 public pacayaForkHeight = uint64(vm.envUint("PACAYA_FORK_HEIGHT")); + uint64 public shastaForkHeight = uint64(vm.envUint("SHASTA_FORK_HEIGHT")); address public signalService = vm.envAddress("SIGNAL_SERVICE"); modifier broadcast() { @@ -99,8 +100,9 @@ contract DeployPacayaL2 is DeployCapability { address signalServiceImpl = address(new SignalService(sharedResolver)); console2.log("signalService", signalServiceImpl); // Taiko Anchor - address taikoAnchorImpl = - address(new TaikoAnchor(sharedResolver, signalService, pacayaForkHeight)); + address taikoAnchorImpl = address( + new TaikoAnchor(sharedResolver, signalService, pacayaForkHeight, shastaForkHeight) + ); console2.log("taikoAnchor", taikoAnchorImpl); } } diff --git a/packages/protocol/test/genesis/GenerateGenesis.g.sol b/packages/protocol/test/genesis/GenerateGenesis.g.sol index 99ff6096f5c..3150d0ddf91 100644 --- a/packages/protocol/test/genesis/GenerateGenesis.g.sol +++ b/packages/protocol/test/genesis/GenerateGenesis.g.sol @@ -13,7 +13,7 @@ import "src/shared/tokenvault/BridgedERC20.sol"; import "src/shared/tokenvault/BridgedERC721.sol"; import "src/shared/tokenvault/BridgedERC1155.sol"; import "src/shared/signal/SignalService.sol"; -import "src/layer2/based/TaikoAnchor.sol"; +import "src/layer2/based/anchor/TaikoAnchor.sol"; import "../shared/helpers/RegularERC20.sol"; contract TestGenerateGenesis is Test { @@ -26,6 +26,7 @@ contract TestGenerateGenesis is Test { address private contractOwner = configJSON.readAddress(".contractOwner"); uint256 private l1ChainId = configJSON.readUint(".l1ChainId"); uint256 private pacayaForkHeight = configJSON.readUint(".pacayaForkHeight"); + uint256 private shastaForkHeight = configJSON.readUint(".shastaForkHeight"); function testSharedContractsDeployment() public { assertEq(block.chainid, 167); @@ -114,6 +115,7 @@ contract TestGenerateGenesis is Test { assertEq(contractOwner, taikoAnchorProxy.owner()); assertEq(l1ChainId, taikoAnchorProxy.l1ChainId()); assertEq(uint64(pacayaForkHeight), taikoAnchorProxy.pacayaForkHeight()); + assertEq(uint64(shastaForkHeight), taikoAnchorProxy.shastaForkHeight()); assertEq( getPredeployedContractAddress("SignalService"), address(taikoAnchorProxy.signalService()) @@ -126,7 +128,8 @@ contract TestGenerateGenesis is Test { new TaikoAnchor( getPredeployedContractAddress("RollupResolver"), getPredeployedContractAddress("SignalService"), - uint64(pacayaForkHeight) + uint64(pacayaForkHeight), + uint64(shastaForkHeight) ) ) ); diff --git a/packages/protocol/test/genesis/data/genesis_config.js b/packages/protocol/test/genesis/data/genesis_config.js index f3b991a4ebf..b48da3c1f9f 100644 --- a/packages/protocol/test/genesis/data/genesis_config.js +++ b/packages/protocol/test/genesis/data/genesis_config.js @@ -52,6 +52,7 @@ module.exports = { // Option to pre-deploy an ERC-20 token. predeployERC20: true, pacayaForkHeight: 1024, + shastaForkHeight: 2048, }; function getConstantAddress(prefix, suffix) { diff --git a/packages/protocol/test/genesis/data/genesis_config.json b/packages/protocol/test/genesis/data/genesis_config.json index d53784fb5f8..3e448fc83ee 100644 --- a/packages/protocol/test/genesis/data/genesis_config.json +++ b/packages/protocol/test/genesis/data/genesis_config.json @@ -1,36 +1,37 @@ { - "contractOwner": "0x661690Da28C8b78B0199019771771bAfb6A93969", - "chainId": 167010, + "contractOwner": "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39", + "chainId": 167, "seedAccounts": [ - { "0x661690Da28C8b78B0199019771771bAfb6A93969": 1000 }, + { "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39": 1000 }, { "0x79fcdef22feed20eddacbb2587640e45491b757f": 1000 } ], - "l1ChainId": 7014190335, - "ownerSecurityCouncil": "0x661690Da28C8b78B0199019771771bAfb6A93969", - "ownerTimelockController": "0x661690Da28C8b78B0199019771771bAfb6A93969", + "l1ChainId": 31337, + "ownerSecurityCouncil": "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39", + "ownerTimelockController": "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39", "contractAddresses": { - "BridgeImpl": "0x0167010000000000000000000000000000000001", - "ERC20VaultImpl": "0x0167010000000000000000000000000000000002", - "ERC721VaultImpl": "0x0167010000000000000000000000000000000003", - "ERC1155VaultImpl": "0x0167010000000000000000000000000000000004", - "SignalServiceImpl": "0x0167010000000000000000000000000000000005", - "SharedResolverImpl": "0x0167010000000000000000000000000000000006", - "BridgedERC20Impl": "0x0167010000000000000000000000000000010096", - "BridgedERC721Impl": "0x0167010000000000000000000000000000010097", - "BridgedERC1155Impl": "0x0167010000000000000000000000000000010098", - "RegularERC20": "0x0167010000000000000000000000000000010099", - "TaikoAnchorImpl": "0x0167010000000000000000000000000000010001", - "RollupResolverImpl": "0x0167010000000000000000000000000000010002", - "Bridge": "0x1670100000000000000000000000000000000001", - "ERC20Vault": "0x1670100000000000000000000000000000000002", - "ERC721Vault": "0x1670100000000000000000000000000000000003", - "ERC1155Vault": "0x1670100000000000000000000000000000000004", - "SignalService": "0x1670100000000000000000000000000000000005", - "SharedResolver": "0x1670100000000000000000000000000000000006", - "TaikoAnchor": "0x1670100000000000000000000000000000010001", - "RollupResolver": "0x1670100000000000000000000000000000010002" + "BridgeImpl": "0x0167000000000000000000000000000000000001", + "ERC20VaultImpl": "0x0167000000000000000000000000000000000002", + "ERC721VaultImpl": "0x0167000000000000000000000000000000000003", + "ERC1155VaultImpl": "0x0167000000000000000000000000000000000004", + "SignalServiceImpl": "0x0167000000000000000000000000000000000005", + "SharedResolverImpl": "0x0167000000000000000000000000000000000006", + "BridgedERC20Impl": "0x0167000000000000000000000000000000010096", + "BridgedERC721Impl": "0x0167000000000000000000000000000000010097", + "BridgedERC1155Impl": "0x0167000000000000000000000000000000010098", + "RegularERC20": "0x0167000000000000000000000000000000010099", + "TaikoAnchorImpl": "0x0167000000000000000000000000000000010001", + "RollupResolverImpl": "0x0167000000000000000000000000000000010002", + "Bridge": "0x1670000000000000000000000000000000000001", + "ERC20Vault": "0x1670000000000000000000000000000000000002", + "ERC721Vault": "0x1670000000000000000000000000000000000003", + "ERC1155Vault": "0x1670000000000000000000000000000000000004", + "SignalService": "0x1670000000000000000000000000000000000005", + "SharedResolver": "0x1670000000000000000000000000000000000006", + "TaikoAnchor": "0x1670000000000000000000000000000000010001", + "RollupResolver": "0x1670000000000000000000000000000000010002" }, "param1559": { "gasExcess": 1 }, "predeployERC20": true, - "pacayaForkHeight": 0 + "pacayaForkHeight": 1024, + "shastaForkHeight": 2048 } diff --git a/packages/protocol/test/genesis/generate/interface.ts b/packages/protocol/test/genesis/generate/interface.ts index d7beb2d1057..8c642b8ee7f 100644 --- a/packages/protocol/test/genesis/generate/interface.ts +++ b/packages/protocol/test/genesis/generate/interface.ts @@ -9,6 +9,7 @@ export interface Config { contractAddresses: Object; param1559: Object; pacayaForkHeight: number; + shastaForkHeight: number; } export interface Result { diff --git a/packages/protocol/test/genesis/generate/taikoAnchor.ts b/packages/protocol/test/genesis/generate/taikoAnchor.ts index dc75aa11cfa..4d36d028600 100644 --- a/packages/protocol/test/genesis/generate/taikoAnchor.ts +++ b/packages/protocol/test/genesis/generate/taikoAnchor.ts @@ -45,6 +45,7 @@ export async function deployTaikoAnchor( config.contractAddresses, config.param1559, config.pacayaForkHeight, + config.shastaForkHeight, ); const storageLayouts: any = {}; @@ -116,7 +117,8 @@ async function generateContractConfigs( chainId: number, hardCodedAddresses: any, param1559: any, - pacayaForkHeight: number, // TODO: fix this value + pacayaForkHeight: number, + shastaForkHeight: number, ): Promise { const contractArtifacts: any = { // ============ Contracts ============ @@ -195,10 +197,12 @@ async function generateContractConfigs( "UUPSUpgradeable", ["__self"], ); - const taikoAnchorReferencesMap: any = getImmutableReference("TaikoAnchor", [ - "pacayaForkHeight", - "signalService", - ]); + const taikoAnchorReferencesMap: any = Object.assign( + {}, + getImmutableReference("PacayaAnchor", ["signalService"]), + getImmutableReference("PacayaAnchor", ["pacayaForkHeight"]), + getImmutableReference("ShastaAnchor", ["shastaForkHeight"]), + ); const bridgeReferencesMap: any = getImmutableReference("Bridge", [ "signalService", "quotaManager", @@ -637,6 +641,13 @@ async function generateContractConfigs( 32, ), }, + { + id: taikoAnchorReferencesMap.shastaForkHeight.id, + value: ethers.utils.hexZeroPad( + ethers.utils.hexlify(shastaForkHeight), + 32, + ), + }, ]), addressMap, ), @@ -778,23 +789,80 @@ function getImmutableReference( immutableValueNames: Array, ) { const references: any = {}; - const artifact = require( - path.join(ARTIFACTS_PATH, `./${contractName}.sol/${contractName}.json`), + const artifactPath = path.join( + ARTIFACTS_PATH, + `./${contractName}.sol/${contractName}.json`, ); - for (const node of artifact.ast.nodes) { - if (node.nodeType !== "ContractDefinition") continue; - - for (const immutableValueName of immutableValueNames) { - for (const subNode of node.nodes) { - if (subNode.name !== immutableValueName) continue; - references[immutableValueName] = { - name: immutableValueName, - id: subNode.id, - }; - break; + console.log(`Loading artifact from: ${artifactPath}`); + const artifact = require(artifactPath); + + if (!artifact.ast || !artifact.ast.nodes) { + console.error(`No AST found in artifact for ${contractName}`); + throw new Error(`No AST found in artifact for ${contractName}`); + } + + for (const immutableValueName of immutableValueNames) { + let found = false; + for (const node of artifact.ast.nodes) { + if (node.nodeType !== "ContractDefinition") continue; + + // Search in the current contract and its base contracts + const searchInContract = (contractNode: any) => { + for (const subNode of contractNode.nodes || []) { + if (subNode.name !== immutableValueName) continue; + references[immutableValueName] = { + name: immutableValueName, + id: subNode.id, + }; + found = true; + console.log( + `Found immutable reference for ${immutableValueName} with id ${subNode.id} in contract ${contractNode.name}`, + ); + return true; + } + return false; + }; + + // Check current contract + if (searchInContract(node)) break; + + // Check base contracts + if (node.baseContracts) { + for (const baseContract of node.baseContracts) { + const baseContractName = baseContract.baseName.name; + console.log(`Checking base contract: ${baseContractName}`); + try { + const baseArtifact = require( + path.join( + ARTIFACTS_PATH, + `./${baseContractName}.sol/${baseContractName}.json`, + ), + ); + for (const baseNode of baseArtifact.ast.nodes) { + if ( + baseNode.nodeType !== "ContractDefinition" || + baseNode.name !== baseContractName + ) + continue; + if (searchInContract(baseNode)) break; + } + } catch (e) { + console.log( + `Could not load base contract ${baseContractName}: ${e}`, + ); + } + } } } + if (!found) { + console.error( + `Could not find immutable reference for ${immutableValueName} in ${contractName} or its base contracts`, + ); + throw new Error( + `Could not find immutable reference for ${immutableValueName} in ${contractName} or its base contracts`, + ); + } } return references; diff --git a/packages/protocol/test/genesis/test_config.js b/packages/protocol/test/genesis/test_config.js index 78b9d4f60d2..171e617640d 100644 --- a/packages/protocol/test/genesis/test_config.js +++ b/packages/protocol/test/genesis/test_config.js @@ -114,6 +114,7 @@ module.exports = { }, predeployERC20: true, pacayaForkHeight: 1024, + shastaForkHeight: 2048, }; function getConstantAddress(prefix, suffix) { diff --git a/packages/protocol/test/layer2/Layer2Test.sol b/packages/protocol/test/layer2/Layer2Test.sol index 954d4ed0922..e2962e358a3 100644 --- a/packages/protocol/test/layer2/Layer2Test.sol +++ b/packages/protocol/test/layer2/Layer2Test.sol @@ -2,8 +2,7 @@ pragma solidity ^0.8.24; import "src/layer2/DelegateOwner.sol"; -import "src/layer2/based/LibEIP1559.sol"; -import "src/layer2/based/TaikoAnchor.sol"; +import "src/layer2/based/anchor/TaikoAnchor.sol"; import "test/layer2/LibAnchorSigner.sol"; import "test/shared/CommonTest.sol"; diff --git a/packages/protocol/test/layer2/TaikoAnchor.t.sol b/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol similarity index 96% rename from packages/protocol/test/layer2/TaikoAnchor.t.sol rename to packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol index 0be4fe4386f..610cd3baf53 100644 --- a/packages/protocol/test/layer2/TaikoAnchor.t.sol +++ b/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "./Layer2Test.sol"; -import "./helpers/TaikoAnchor_NoBaseFeeCheck.sol"; +import "test/layer2/Layer2Test.sol"; +import "test/layer2/helpers/TaikoAnchor_NoBaseFeeCheck.sol"; contract TestTaikoAnchor is Layer2Test { uint32 public constant BLOCK_GAS_LIMIT = 30_000_000; @@ -38,14 +38,14 @@ contract TestTaikoAnchor is Layer2Test { _anchorV3(BLOCK_GAS_LIMIT); vm.prank(anchor.GOLDEN_TOUCH_ADDRESS()); - vm.expectRevert(TaikoAnchor.L2_PUBLIC_INPUT_HASH_MISMATCH.selector); + vm.expectRevert(PacayaAnchor.L2_PUBLIC_INPUT_HASH_MISMATCH.selector); _anchorV3(BLOCK_GAS_LIMIT); } // calling anchor in the same block more than once should fail function test_anchor_AnchorTx_revert_from_wrong_signer() external onTaiko { vm.fee(1); - vm.expectRevert(TaikoAnchor.L2_INVALID_SENDER.selector); + vm.expectRevert(PacayaAnchor.L2_INVALID_SENDER.selector); _anchorV3(BLOCK_GAS_LIMIT); } diff --git a/packages/protocol/test/layer2/LibEIP1559.t.sol b/packages/protocol/test/layer2/based/eip1559/LibEIP1559.t.sol similarity index 99% rename from packages/protocol/test/layer2/LibEIP1559.t.sol rename to packages/protocol/test/layer2/based/eip1559/LibEIP1559.t.sol index db65b908e29..a3d6d4720ed 100644 --- a/packages/protocol/test/layer2/LibEIP1559.t.sol +++ b/packages/protocol/test/layer2/based/eip1559/LibEIP1559.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "./Layer2Test.sol"; +import "test/layer2/Layer2Test.sol"; contract TestLibEIP1559 is Layer2Test { using LibMath for uint256; diff --git a/packages/protocol/test/layer2/helpers/TaikoAnchor_NoBaseFeeCheck.sol b/packages/protocol/test/layer2/helpers/TaikoAnchor_NoBaseFeeCheck.sol index defb9389c2b..00ff00957a7 100644 --- a/packages/protocol/test/layer2/helpers/TaikoAnchor_NoBaseFeeCheck.sol +++ b/packages/protocol/test/layer2/helpers/TaikoAnchor_NoBaseFeeCheck.sol @@ -1,14 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "src/layer2/based/TaikoAnchor.sol"; +import "src/layer2/based/anchor/TaikoAnchor.sol"; contract TaikoAnchor_NoBaseFeeCheck is TaikoAnchor { constructor( address _resolver, address _signalService ) - TaikoAnchor(_resolver, _signalService, 0) + TaikoAnchor(_resolver, _signalService, 0, 0) { } function skipFeeCheck() public pure override returns (bool) { From 42ed3ce6f26bb087041dabbb6274f812152fee5e Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Sat, 19 Apr 2025 20:51:27 +0800 Subject: [PATCH 05/16] feat(protocol): introduce ShastaForkRouter with ITaikoInbox's functions named (#19253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Co-authored-by: Keszey Dániel Co-authored-by: adaki2004 <51912515+adaki2004@users.noreply.github.com> Co-authored-by: Gavin Yu --- .../contracts/layer1/based/IBondManager.sol | 44 +++++ .../contracts/layer1/based/IProposeBatch.sol | 4 +- .../contracts/layer1/based/IProveBatches.sol | 14 ++ .../contracts/layer1/based/ITaikoInbox.sol | 81 +++----- .../contracts/layer1/based/TaikoInbox.sol | 86 ++++---- .../contracts/layer1/devnet/DevnetInbox.sol | 2 +- .../forced-inclusion/ForcedInclusionStore.sol | 2 +- .../layer1/forced-inclusion/TaikoWrapper.sol | 6 +- .../layer1/fork-router/ShastaForkRouter.sol | 58 ++++++ .../contracts/layer1/hekla/HeklaInbox.sol | 4 +- .../contracts/layer1/mainnet/MainnetInbox.sol | 2 +- .../layer1/preconf/impl/PreconfRouter.sol | 6 +- .../layer1/prover-market/ProverMarket.sol | 6 +- .../contracts/layer1/provers/ProverSet.sol | 6 +- .../layer1/provers/ProverSetBase.sol | 4 +- .../layer2/based/anchor/PacayaAnchor.sol | 2 +- .../contracts/shared/based/ITaiko.sol | 2 +- .../shared/tokenvault/ERC20Vault.sol | 4 +- .../deployments/hekla-contract-logs.md | 2 + ..._provermarket_diff_prover_and_proposer.txt | 6 +- ...prover_and_proposer_fee_above_liveness.txt | 6 +- ...me_prover_as_proposer_measure_gas_used.txt | 6 +- .../inbox_without_provermarket.txt | 6 +- .../protocol/gas-reports/layer1-contracts.txt | 122 ++++++------ .../layer1/based/DeployProtocolOnL1.s.sol | 10 +- .../layer1/devnet/UpgradeDevnetPacayaL1.s.sol | 2 +- packages/protocol/test/layer1/Layer1Test.sol | 2 +- .../test/layer1/based/InboxTestBase.sol | 24 +-- .../based/InboxTest_BondMechanics.t.sol | 41 ++-- .../layer1/based/InboxTest_BondToken.t.sol | 49 ++--- .../based/InboxTest_CalldataForTxList.t.sol | 8 +- .../layer1/based/InboxTest_Cooldown.t.sol | 10 +- .../layer1/based/InboxTest_EtherAsBond.t.sol | 49 ++--- .../test/layer1/based/InboxTest_Params.t.sol | 30 +-- .../based/InboxTest_ProposeAndProve.t.sol | 140 ++++++------- .../layer1/based/InboxTest_StopBatch.t.sol | 6 +- .../test/layer1/based/helpers/StubInbox.sol | 32 +-- .../ForcedInclusionStore.t.sol | 2 +- .../layer1/preconf/mocks/MockTaikoInbox.sol | 2 +- .../layer1/preconf/router/PreconfRouter.t.sol | 6 +- .../layer1/prover-market/ProverMarket.t.sol | 2 +- .../tokenunlock/TokenUnlock_ProverSet.t.sol | 186 ------------------ .../test/layer1/verifiers/SP1Verifier.t.sol | 2 +- .../test/shared/tokenvault/ERC20Vault.h.sol | 4 +- 44 files changed, 493 insertions(+), 595 deletions(-) create mode 100644 packages/protocol/contracts/layer1/based/IBondManager.sol create mode 100644 packages/protocol/contracts/layer1/based/IProveBatches.sol create mode 100644 packages/protocol/contracts/layer1/fork-router/ShastaForkRouter.sol delete mode 100644 packages/protocol/test/layer1/team/tokenunlock/TokenUnlock_ProverSet.t.sol diff --git a/packages/protocol/contracts/layer1/based/IBondManager.sol b/packages/protocol/contracts/layer1/based/IBondManager.sol new file mode 100644 index 00000000000..aa354afcb46 --- /dev/null +++ b/packages/protocol/contracts/layer1/based/IBondManager.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +/// @title IBondManager +/// @custom:security-contact security@taiko.xyz +interface IBondManager { + /// @notice Emitted when tokens are deposited into a user's bond balance. + /// @param user The address of the user who deposited the tokens. + /// @param amount The amount of tokens deposited. + event BondDeposited(address indexed user, uint256 amount); + + /// @notice Emitted when tokens are withdrawn from a user's bond balance. + /// @param user The address of the user who withdrew the tokens. + /// @param amount The amount of tokens withdrawn. + event BondWithdrawn(address indexed user, uint256 amount); + + /// @notice Emitted when a token is credited back to a user's bond balance. + /// @param user The address of the user whose bond balance is credited. + /// @param amount The amount of tokens credited. + event BondCredited(address indexed user, uint256 amount); + + /// @notice Emitted when a token is debited from a user's bond balance. + /// @param user The address of the user whose bond balance is debited. + /// @param amount The amount of tokens debited. + event BondDebited(address indexed user, uint256 amount); + + /// @notice Deposits TAIKO tokens into the contract to be used as liveness bond. + /// @param _amount The amount of TAIKO tokens to deposit. + function v4DepositBond(uint256 _amount) external payable; + + /// @notice Withdraws a specified amount of TAIKO tokens from the contract. + /// @param _amount The amount of TAIKO tokens to withdraw. + function v4WithdrawBond(uint256 _amount) external; + + /// @notice Returns the TAIKO token balance of a specific user. + /// @param _user The address of the user. + /// @return The TAIKO token balance of the user. + function v4BondBalanceOf(address _user) external view returns (uint256); + + /// @notice Retrieves the Bond token address. If Ether is used as bond, this function returns + /// address(0). + /// @return The Bond token address. + function v4BondToken() external view returns (address); +} diff --git a/packages/protocol/contracts/layer1/based/IProposeBatch.sol b/packages/protocol/contracts/layer1/based/IProposeBatch.sol index 97b2f0146fd..e4bf1bea498 100644 --- a/packages/protocol/contracts/layer1/based/IProposeBatch.sol +++ b/packages/protocol/contracts/layer1/based/IProposeBatch.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import "./ITaikoInbox.sol"; /// @title IProposeBatch -/// @notice This interface defines the proposeBatch function that is also part of the ITaikoInbox +/// @notice This interface defines the v4ProposeBatch function that is also part of the ITaikoInbox /// interface. /// @custom:security-contact security@taiko.xyz interface IProposeBatch { @@ -14,7 +14,7 @@ interface IProposeBatch { /// for data availability. /// @return info_ The info of the proposed batch. /// @return meta_ The mmetadata of the proposed batch. - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) diff --git a/packages/protocol/contracts/layer1/based/IProveBatches.sol b/packages/protocol/contracts/layer1/based/IProveBatches.sol new file mode 100644 index 00000000000..774327c498d --- /dev/null +++ b/packages/protocol/contracts/layer1/based/IProveBatches.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +/// @title IProveBatches +/// @notice This interface defines the v4ProveBatches function. +/// @custom:security-contact security@taiko.xyz +interface IProveBatches { + /// @notice Proves state transitions for multiple batches with a single aggregated proof. + /// @param _params ABI-encoded parameter containing: + /// - metas: Array of metadata for each batch being proved. + /// - transitions: Array of batch transitions to be proved. + /// @param _proof The aggregated cryptographic proof proving the batches transitions. + function v4ProveBatches(bytes calldata _params, bytes calldata _proof) external; +} diff --git a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol index 24683d370b2..675b8d6af3b 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.24; import "src/shared/based/LibSharedData.sol"; +import "./IBondManager.sol"; +import "./IProveBatches.sol"; /// @title TaikoInbox /// @notice Acts as the inbox for the Taiko Alethia protocol, a simplified version of the @@ -16,7 +18,7 @@ import "src/shared/based/LibSharedData.sol"; /// /// @dev Registered in the address resolver as "taiko". /// @custom:security-contact security@taiko.xyz -interface ITaikoInbox { +interface ITaikoInbox is IBondManager, IProveBatches { struct BlockParams { // the max number of transactions in this block. Note that if there are not enough // transactions in calldata or blobs, the block will contains as many transactions as @@ -147,10 +149,10 @@ interface ITaikoInbox { } struct ForkHeights { - uint64 ontake; // measured with block number. - uint64 pacaya; // measured with the batch Id, not block number. - uint64 shasta; // measured with the batch Id, not block number. - uint64 unzen; // measured with the batch Id, not block number. + uint64 ontake; // v2, measured with block number. + uint64 pacaya; // v3, measured with the batch Id, not block number. + uint64 shasta; // v4, measured with the batch Id, not block number. + uint64 unzen; // v5, measured with the batch Id, not block number. } /// @notice Struct holding Taiko configuration parameters. See {TaikoConfig}. @@ -206,26 +208,6 @@ interface ITaikoInbox { uint256[43] __gap; } - /// @notice Emitted when tokens are deposited into a user's bond balance. - /// @param user The address of the user who deposited the tokens. - /// @param amount The amount of tokens deposited. - event BondDeposited(address indexed user, uint256 amount); - - /// @notice Emitted when tokens are withdrawn from a user's bond balance. - /// @param user The address of the user who withdrew the tokens. - /// @param amount The amount of tokens withdrawn. - event BondWithdrawn(address indexed user, uint256 amount); - - /// @notice Emitted when a token is credited back to a user's bond balance. - /// @param user The address of the user whose bond balance is credited. - /// @param amount The amount of tokens credited. - event BondCredited(address indexed user, uint256 amount); - - /// @notice Emitted when a token is debited from a user's bond balance. - /// @param user The address of the user whose bond balance is debited. - /// @param amount The amount of tokens debited. - event BondDebited(address indexed user, uint256 amount); - /// @notice Emitted when a batch is synced. /// @param stats1 The Stats1 data structure. event Stats1Updated(Stats1 stats1); @@ -306,57 +288,38 @@ interface ITaikoInbox { /// for data availability. /// @return info_ The info of the proposed batch. /// @return meta_ The metadata of the proposed batch. - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_); - /// @notice Proves state transitions for multiple batches with a single aggregated proof. - /// @param _params ABI-encoded parameter containing: - /// - metas: Array of metadata for each batch being proved. - /// - transitions: Array of batch transitions to be proved. - /// @param _proof The aggregated cryptographic proof proving the batches transitions. - function proveBatches(bytes calldata _params, bytes calldata _proof) external; - - /// @notice Deposits TAIKO tokens into the contract to be used as liveness bond. - /// @param _amount The amount of TAIKO tokens to deposit. - function depositBond(uint256 _amount) external payable; - - /// @notice Withdraws a specified amount of TAIKO tokens from the contract. - /// @param _amount The amount of TAIKO tokens to withdraw. - function withdrawBond(uint256 _amount) external; - - /// @notice Returns the TAIKO token balance of a specific user. - /// @param _user The address of the user. - /// @return The TAIKO token balance of the user. - function bondBalanceOf(address _user) external view returns (uint256); - - /// @notice Retrieves the Bond token address. If Ether is used as bond, this function returns - /// address(0). - /// @return The Bond token address. - function bondToken() external view returns (address); + /// @notice Verify batches by providing the length of the batches to verify. + /// @dev This function is necessary to upgrade from this fork to the next one. + /// @param _length Specifis how many batches to verify. The max number of batches to verify is + /// `v4GetConfig().maxBatchesToVerify * _length`. + function v4VerifyBatches(uint64 _length) external; /// @notice Retrieves the first set of protocol statistics. /// @return Stats1 structure containing the statistics. - function getStats1() external view returns (Stats1 memory); + function v4GetStats1() external view returns (Stats1 memory); /// @notice Retrieves the second set of protocol statistics. /// @return Stats2 structure containing the statistics. - function getStats2() external view returns (Stats2 memory); + function v4GetStats2() external view returns (Stats2 memory); /// @notice Retrieves data about a specific batch. /// @param _batchId The ID of the batch to retrieve. /// @return batch_ The batch data. - function getBatch(uint64 _batchId) external view returns (Batch memory batch_); + function v4GetBatch(uint64 _batchId) external view returns (Batch memory batch_); /// @notice Retrieves a specific transition by batch ID and transition ID. This function may /// revert if the transition is not found. /// @param _batchId The batch ID. /// @param _tid The transition ID. /// @return The specified transition state. - function getTransitionById( + function v4GetTransitionById( uint64 _batchId, uint24 _tid ) @@ -369,7 +332,7 @@ interface ITaikoInbox { /// @param _batchId The batch ID. /// @param _parentHash The parent hash. /// @return The specified transition state. - function getTransitionByParentHash( + function v4GetTransitionByParentHash( uint64 _batchId, bytes32 _parentHash ) @@ -381,7 +344,7 @@ interface ITaikoInbox { /// @return batchId_ The batch ID of the last verified transition. /// @return blockId_ The block ID of the last verified block. /// @return ts_ The last verified transition. - function getLastVerifiedTransition() + function v4GetLastVerifiedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory ts_); @@ -390,7 +353,7 @@ interface ITaikoInbox { /// @return batchId_ The batch ID of the last synced transition. /// @return blockId_ The block ID of the last synced block. /// @return ts_ The last synced transition. - function getLastSyncedTransition() + function v4GetLastSyncedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory ts_); @@ -398,12 +361,12 @@ interface ITaikoInbox { /// @notice Retrieves the transition used for verifying a batch. /// @param _batchId The batch ID. /// @return The transition used for verifying the batch. - function getBatchVerifyingTransition(uint64 _batchId) + function v4GetBatchVerifyingTransition(uint64 _batchId) external view returns (TransitionState memory); /// @notice Retrieves the current protocol configuration. /// @return The current configuration. - function pacayaConfig() external view returns (Config memory); + function v4GetConfig() external view returns (Config memory); } diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 879de8fbd62..536a5800ec0 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -16,8 +16,8 @@ import "./IProposeBatch.sol"; /// @title TaikoInbox /// @notice Acts as the inbox for the Taiko Alethia protocol, a simplified version of the -/// original Taiko-Based Contestable Rollup (BCR). The tier-based proof system and -/// contestation mechanisms have been removed. +/// original Taiko-Based Contestable Rollup (BCR) but with the tier-based proof system and +/// contestation mechanisms removed. /// /// Key assumptions of this protocol: /// - Block proposals and proofs are asynchronous. Proofs are not available at proposal time, @@ -33,7 +33,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I address public immutable inboxWrapper; address public immutable verifier; - address public immutable bondToken; + address internal immutable bondToken; ISignalService public immutable signalService; IProverMarket public immutable proverMarket; @@ -61,7 +61,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I proverMarket = IProverMarket(_proverMarket); } - function init(address _owner, bytes32 _genesisBlockHash) external initializer { + function v4Init(address _owner, bytes32 _genesisBlockHash) external initializer { __Taiko_init(_owner, _genesisBlockHash); } @@ -72,7 +72,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I /// @return info_ Information of the proposed batch, which is used for constructing blocks /// offchain. /// @return meta_ Metadata of the proposed batch, which is used for proving the batch. - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) @@ -82,7 +82,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I returns (BatchInfo memory info_, BatchMetadata memory meta_) { Stats2 memory stats2 = state.stats2; - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); require(stats2.numBatches >= config.forkHeights.pacaya, ForkNotActivated()); unchecked { @@ -262,12 +262,8 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I _verifyBatches(config, stats2, 1); } - /// @notice Proves multiple batches with a single aggregated proof. - /// @param _params ABI-encoded parameter containing: - /// - metas: Array of metadata for each batch being proved. - /// - transitions: Array of batch transitions to be proved. - /// @param _proof The aggregated cryptographic proof proving the batches transitions. - function proveBatches(bytes calldata _params, bytes calldata _proof) external nonReentrant { + /// @inheritdoc IProveBatches + function v4ProveBatches(bytes calldata _params, bytes calldata _proof) external nonReentrant { (BatchMetadata[] memory metas, Transition[] memory trans) = abi.decode(_params, (BatchMetadata[], Transition[])); @@ -278,7 +274,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I Stats2 memory stats2 = state.stats2; require(!stats2.paused, ContractPaused()); - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); IVerifier.Context[] memory ctxs = new IVerifier.Context[](metasLength); bool hasConflictingProof; @@ -398,26 +394,23 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } } - /// @notice Verify batches by providing the length of the batches to verify. - /// @dev This function is necessary to upgrade from this fork to the next one. - /// @param _length Specifis how many batches to verify. The max number of batches to verify is - /// `pacayaConfig().maxBatchesToVerify * _length`. - function verifyBatches(uint64 _length) + /// @inheritdoc ITaikoInbox + function v4VerifyBatches(uint64 _length) external nonZeroValue(_length) nonReentrant whenNotPaused { - _verifyBatches(pacayaConfig(), state.stats2, _length); + _verifyBatches(v4GetConfig(), state.stats2, _length); } - /// @inheritdoc ITaikoInbox - function depositBond(uint256 _amount) external payable whenNotPaused { + /// @inheritdoc IBondManager + function v4DepositBond(uint256 _amount) external payable whenNotPaused { state.bondBalance[msg.sender] += _handleDeposit(msg.sender, _amount); } - /// @inheritdoc ITaikoInbox - function withdrawBond(uint256 _amount) external whenNotPaused { + /// @inheritdoc IBondManager + function v4WithdrawBond(uint256 _amount) external whenNotPaused { if (address(proverMarket) != address(0)) { (address currentProver,) = proverMarket.getCurrentProver(); require(msg.sender != currentProver, CurrentProverCannotWithdraw()); @@ -437,18 +430,23 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } } + /// @inheritdoc IBondManager + function v4BondToken() external view returns (address) { + return bondToken; + } + /// @inheritdoc ITaikoInbox - function getStats1() external view returns (Stats1 memory) { + function v4GetStats1() external view returns (Stats1 memory) { return state.stats1; } /// @inheritdoc ITaikoInbox - function getStats2() external view returns (Stats2 memory) { + function v4GetStats2() external view returns (Stats2 memory) { return state.stats2; } /// @inheritdoc ITaikoInbox - function getTransitionById( + function v4GetTransitionById( uint64 _batchId, uint24 _tid ) @@ -456,7 +454,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I view returns (TransitionState memory) { - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); uint256 slot = _batchId % config.batchRingBufferSize; Batch storage batch = state.batches[slot]; require(batch.batchId == _batchId, BatchNotFound()); @@ -466,7 +464,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } /// @inheritdoc ITaikoInbox - function getTransitionByParentHash( + function v4GetTransitionByParentHash( uint64 _batchId, bytes32 _parentHash ) @@ -474,7 +472,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I view returns (TransitionState memory) { - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); uint256 slot = _batchId % config.batchRingBufferSize; Batch storage batch = state.batches[slot]; require(batch.batchId == _batchId, BatchNotFound()); @@ -498,37 +496,37 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } /// @inheritdoc ITaikoInbox - function getLastVerifiedTransition() + function v4GetLastVerifiedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory ts_) { batchId_ = state.stats2.lastVerifiedBatchId; - require(batchId_ >= pacayaConfig().forkHeights.pacaya, BatchNotFound()); - blockId_ = getBatch(batchId_).lastBlockId; - ts_ = getBatchVerifyingTransition(batchId_); + require(batchId_ >= v4GetConfig().forkHeights.pacaya, BatchNotFound()); + blockId_ = v4GetBatch(batchId_).lastBlockId; + ts_ = v4GetBatchVerifyingTransition(batchId_); } /// @inheritdoc ITaikoInbox - function getLastSyncedTransition() + function v4GetLastSyncedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory ts_) { batchId_ = state.stats1.lastSyncedBatchId; - blockId_ = getBatch(batchId_).lastBlockId; - ts_ = getBatchVerifyingTransition(batchId_); + blockId_ = v4GetBatch(batchId_).lastBlockId; + ts_ = v4GetBatchVerifyingTransition(batchId_); } - /// @inheritdoc ITaikoInbox - function bondBalanceOf(address _user) external view returns (uint256) { + /// @inheritdoc IBondManager + function v4BondBalanceOf(address _user) external view returns (uint256) { return state.bondBalance[_user]; } /// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or /// Layer 2 (L2). /// @return True if the contract is operating on L1, false if on L2. - function isOnL1() external pure override returns (bool) { + function v4IsOnL1() external pure override returns (bool) { return true; } @@ -540,20 +538,20 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } /// @inheritdoc ITaikoInbox - function getBatch(uint64 _batchId) public view returns (Batch memory batch_) { - Config memory config = pacayaConfig(); + function v4GetBatch(uint64 _batchId) public view returns (Batch memory batch_) { + Config memory config = v4GetConfig(); batch_ = state.batches[_batchId % config.batchRingBufferSize]; require(batch_.batchId == _batchId, BatchNotFound()); } /// @inheritdoc ITaikoInbox - function getBatchVerifyingTransition(uint64 _batchId) + function v4GetBatchVerifyingTransition(uint64 _batchId) public view returns (TransitionState memory ts_) { - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); uint64 slot = _batchId % config.batchRingBufferSize; Batch storage batch = state.batches[slot]; @@ -565,7 +563,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } /// @inheritdoc ITaikoInbox - function pacayaConfig() public view virtual returns (Config memory); + function v4GetConfig() public view virtual returns (Config memory); // Internal functions ---------------------------------------------------------------------- diff --git a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol index 81e8f6c83be..f48aea16f89 100644 --- a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol +++ b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol @@ -26,7 +26,7 @@ contract DevnetInbox is TaikoInbox { } /// @inheritdoc ITaikoInbox - function pacayaConfig() public view override returns (ITaikoInbox.Config memory) { + function v4GetConfig() public view override returns (ITaikoInbox.Config memory) { return ITaikoInbox.Config({ chainId: chainId, maxUnverifiedBatches: 324_000, diff --git a/packages/protocol/contracts/layer1/forced-inclusion/ForcedInclusionStore.sol b/packages/protocol/contracts/layer1/forced-inclusion/ForcedInclusionStore.sol index 9c1ec004f40..3ab918c094a 100644 --- a/packages/protocol/contracts/layer1/forced-inclusion/ForcedInclusionStore.sol +++ b/packages/protocol/contracts/layer1/forced-inclusion/ForcedInclusionStore.sol @@ -147,6 +147,6 @@ contract ForcedInclusionStore is EssentialContract, IForcedInclusionStore { } function _nextBatchId() private view returns (uint64) { - return inbox.getStats2().numBatches; + return inbox.v4GetStats2().numBatches; } } diff --git a/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol b/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol index c25c7a64e5c..6a574ddbf0f 100644 --- a/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol +++ b/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol @@ -74,7 +74,7 @@ contract TaikoWrapper is EssentialContract, IProposeBatch { } /// @inheritdoc IProposeBatch - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) @@ -89,11 +89,11 @@ contract TaikoWrapper is EssentialContract, IProposeBatch { require(!forcedInclusionStore.isOldestForcedInclusionDue(), OldestForcedInclusionDue()); } else { _validateForcedInclusionParams(forcedInclusionStore, bytesX); - inbox.proposeBatch(bytesX, ""); + inbox.v4ProposeBatch(bytesX, ""); } // Propose the normal batch after the potential forced inclusion batch. - return inbox.proposeBatch(bytesY, _txList); + return inbox.v4ProposeBatch(bytesY, _txList); } function _validateForcedInclusionParams( diff --git a/packages/protocol/contracts/layer1/fork-router/ShastaForkRouter.sol b/packages/protocol/contracts/layer1/fork-router/ShastaForkRouter.sol new file mode 100644 index 00000000000..df15e81f38a --- /dev/null +++ b/packages/protocol/contracts/layer1/fork-router/ShastaForkRouter.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.24; + +import "./ForkRouter.sol"; + +/// @title IPacayaFork +/// @dev Derived from TaikoInbox.sol in the Pacaya fork +/// https://github.com/taikoxyz/taiko-mono/tree/taiko-alethia-protocol-v2.2.0 +/// @custom:security-contact security@taiko.xyz +interface IPacayaFork { + // Return value types, visibility, or mutability modifiers do not affect the function selector. + function proposeBatch(bytes calldata, bytes calldata) external; + function proveBatches(bytes calldata, bytes calldata) external; + function verifyBatches(uint64) external; + function depositBond(uint256) external; + function withdrawBond(uint256) external; + function bondBalanceOf(address) external; + function bondToken() external; + function getStats1() external; + function getStats2() external; + function getBatch(uint64) external; + function getTransitionById(uint64, uint24) external; + function getTransitionByParentHash(uint64, bytes32) external; + function getLastVerifiedTransition() external; + function getLastSyncedTransition() external; + function getBatchVerifyingTransition(uint64) external; + function pacayaConfig() external; +} + +/// @title ShastaForkRouter +/// @notice This contract routes calls to the current fork. +/// @custom:security-contact security@taiko.xyz +contract ShastaForkRouter is ForkRouter { + constructor(address _oldFork, address _newFork) ForkRouter(_oldFork, _newFork) { } + + function shouldRouteToOldFork(bytes4 _selector) public pure override returns (bool) { + if ( + _selector == IPacayaFork.proposeBatch.selector + || _selector == IPacayaFork.proveBatches.selector + || _selector == IPacayaFork.verifyBatches.selector + || _selector == IPacayaFork.depositBond.selector + || _selector == IPacayaFork.withdrawBond.selector + || _selector == IPacayaFork.bondBalanceOf.selector + || _selector == IPacayaFork.bondToken.selector + || _selector == IPacayaFork.getStats1.selector + || _selector == IPacayaFork.getStats2.selector + || _selector == IPacayaFork.getBatch.selector + || _selector == IPacayaFork.getTransitionById.selector + || _selector == IPacayaFork.getTransitionByParentHash.selector + || _selector == IPacayaFork.getLastVerifiedTransition.selector + || _selector == IPacayaFork.getLastSyncedTransition.selector + || _selector == IPacayaFork.getBatchVerifyingTransition.selector + || _selector == IPacayaFork.pacayaConfig.selector + ) return true; + + return false; + } +} diff --git a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol index bb03e606365..cf98a7ec6fa 100644 --- a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol +++ b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol @@ -42,7 +42,7 @@ contract HeklaInbox is TaikoInbox { require(_stateRoot != 0, InvalidParams()); require(_batchId > state.stats2.lastVerifiedBatchId, BatchVerified()); - Config memory config = pacayaConfig(); + Config memory config = v4GetConfig(); uint256 slot = _batchId % config.batchRingBufferSize; Batch storage batch = state.batches[slot]; require(batch.batchId == _batchId, BatchNotFound()); @@ -79,7 +79,7 @@ contract HeklaInbox is TaikoInbox { ); } - function pacayaConfig() public pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() public pure override returns (ITaikoInbox.Config memory) { return ITaikoInbox.Config({ chainId: LibNetwork.TAIKO_HEKLA, // Never change this value as ring buffer is being reused!!! diff --git a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol index 289cb7fce54..77710f0e556 100644 --- a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol +++ b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol @@ -21,7 +21,7 @@ contract MainnetInbox is TaikoInbox { TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } - function pacayaConfig() public pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() public pure override returns (ITaikoInbox.Config memory) { // All hard-coded configurations: // - treasury: the actual TaikoL2 address. // - anchorGasLimit: 1_000_000 diff --git a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol index a5646626947..a91d65513e5 100644 --- a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol +++ b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol @@ -34,7 +34,7 @@ contract PreconfRouter is EssentialContract, IPreconfRouter { } /// @inheritdoc IProposeBatch - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) @@ -49,8 +49,8 @@ contract PreconfRouter is EssentialContract, IPreconfRouter { require(msg.sender == fallbackPreconfer, NotFallbackPreconfer()); } - // Both TaikoInbox and TaikoWrapper implement the same ABI for proposeBatch. - (info_, meta_) = proposeBatchEntrypoint.proposeBatch(_params, _txList); + // Both TaikoInbox and TaikoWrapper implement the same ABI for IProposeBatch. + (info_, meta_) = proposeBatchEntrypoint.v4ProposeBatch(_params, _txList); // Verify that the sender had set itself as the proposer require(info_.proposer == msg.sender, ProposerIsNotPreconfer()); diff --git a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol index 66ac255f1b9..72d269b94d3 100644 --- a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol +++ b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol @@ -102,7 +102,7 @@ contract ProverMarket is EssentialContract, IProverMarket { uint64 _newFeeInGwei = uint64(_fee / GWEI); - require(inbox.bondBalanceOf(msg.sender) >= biddingThreshold, InsufficientBondBalance()); + require(inbox.v4BondBalanceOf(msg.sender) >= biddingThreshold, InsufficientBondBalance()); (address currentProver, uint64 currentFeeInGwei) = _getCurrentProverAndFeeInGwei(); @@ -110,7 +110,7 @@ contract ProverMarket is EssentialContract, IProverMarket { if (currentProver != address(0)) { uint256 maxFeeInGwei; - if (inbox.bondBalanceOf(currentProver) < outbidThreshold) { + if (inbox.v4BondBalanceOf(currentProver) < outbidThreshold) { // The current prover has less than outbidThreshold, so the new prover can set any // fee as long as it's not larger than the current fee maxFeeInGwei = currentFeeInGwei; @@ -184,7 +184,7 @@ contract ProverMarket is EssentialContract, IProverMarket { if ( currentProver == address(0) // no bidding || block.timestamp >= provers[currentProver].exitTimestamp // exited already - || inbox.bondBalanceOf(currentProver) < provingThreshold // not eligible + || inbox.v4BondBalanceOf(currentProver) < provingThreshold // not eligible ) { return (address(0), 0); } else { diff --git a/packages/protocol/contracts/layer1/provers/ProverSet.sol b/packages/protocol/contracts/layer1/provers/ProverSet.sol index 3e8cb41b35b..ad6a882f3c2 100644 --- a/packages/protocol/contracts/layer1/provers/ProverSet.sol +++ b/packages/protocol/contracts/layer1/provers/ProverSet.sol @@ -26,7 +26,7 @@ contract ProverSet is ProverSetBase, IProposeBatch { // ================ Pacaya calls ================ /// @notice Propose a batch of Taiko blocks. - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) @@ -34,12 +34,12 @@ contract ProverSet is ProverSetBase, IProposeBatch { onlyProver returns (ITaikoInbox.BatchInfo memory, ITaikoInbox.BatchMetadata memory) { - return IProposeBatch(entrypoint).proposeBatch(_params, _txList); + return IProposeBatch(entrypoint).v4ProposeBatch(_params, _txList); } /// @notice Proves multiple Taiko batches. function proveBatches(bytes calldata _params, bytes calldata _proof) external onlyProver { - ITaikoInbox(inbox).proveBatches(_params, _proof); + ITaikoInbox(inbox).v4ProveBatches(_params, _proof); } // ================ Ontake calls ================ diff --git a/packages/protocol/contracts/layer1/provers/ProverSetBase.sol b/packages/protocol/contracts/layer1/provers/ProverSetBase.sol index 9b38da471d3..4212c2ff9c9 100644 --- a/packages/protocol/contracts/layer1/provers/ProverSetBase.sol +++ b/packages/protocol/contracts/layer1/provers/ProverSetBase.sol @@ -95,12 +95,12 @@ abstract contract ProverSetBase is EssentialContract, IERC1271 { /// @notice Deposits Taiko token to Taiko contract. function depositBond(uint256 _amount) external onlyAuthorized { - ITaikoInbox(inbox).depositBond(_amount); + ITaikoInbox(inbox).v4DepositBond(_amount); } /// @notice Withdraws Taiko token from Taiko contract. function withdrawBond(uint256 _amount) external onlyAuthorized { - ITaikoInbox(inbox).withdrawBond(_amount); + ITaikoInbox(inbox).v4WithdrawBond(_amount); } /// @notice Delegates token voting right to a delegatee. diff --git a/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol b/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol index 49a900f7997..a324f4e5e2b 100644 --- a/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol +++ b/packages/protocol/contracts/layer2/based/anchor/PacayaAnchor.sol @@ -205,7 +205,7 @@ abstract contract PacayaAnchor is OntakeAnchor { /// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or /// Layer 2 (L2). /// @return True if the contract is operating on L1, false if on L2. - function isOnL1() external pure returns (bool) { + function v4IsOnL1() external pure returns (bool) { return false; } diff --git a/packages/protocol/contracts/shared/based/ITaiko.sol b/packages/protocol/contracts/shared/based/ITaiko.sol index 22a5320b1b4..17f6a305f7d 100644 --- a/packages/protocol/contracts/shared/based/ITaiko.sol +++ b/packages/protocol/contracts/shared/based/ITaiko.sol @@ -9,5 +9,5 @@ interface ITaiko { /// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or /// Layer 2 (L2). /// @return True if the contract is operating on L1, false if on L2. - function isOnL1() external pure returns (bool); + function v4IsOnL1() external pure returns (bool); } diff --git a/packages/protocol/contracts/shared/tokenvault/ERC20Vault.sol b/packages/protocol/contracts/shared/tokenvault/ERC20Vault.sol index 5181e283ecd..bf0f10bdaea 100644 --- a/packages/protocol/contracts/shared/tokenvault/ERC20Vault.sol +++ b/packages/protocol/contracts/shared/tokenvault/ERC20Vault.sol @@ -444,9 +444,9 @@ contract ERC20Vault is BaseVault { if (_op.l2BatchMetaHash != 0) { // Verify that the required L2 batch containing the intent transaction has been proposed address taiko = resolve(LibStrings.B_TAIKO, false); - if (!ITaiko(taiko).isOnL1()) revert VAULT_NOT_ON_L1(); + if (!ITaiko(taiko).v4IsOnL1()) revert VAULT_NOT_ON_L1(); - bytes32 l2BatchMetaHash = ITaikoInbox(taiko).getBatch(_op.l2BatchId).metaHash; + bytes32 l2BatchMetaHash = ITaikoInbox(taiko).v4GetBatch(_op.l2BatchId).metaHash; if (l2BatchMetaHash != _op.l2BatchMetaHash) revert VAULT_METAHASH_MISMATCH(); } diff --git a/packages/protocol/deployments/hekla-contract-logs.md b/packages/protocol/deployments/hekla-contract-logs.md index d652f6ad7f9..5daaf588247 100644 --- a/packages/protocol/deployments/hekla-contract-logs.md +++ b/packages/protocol/deployments/hekla-contract-logs.md @@ -438,6 +438,7 @@ - upgraded on Oct 29, 2024 at commit `3d12cb2` ### shared_resolver + - proxy: `0xF2880d5F0dF947Ab5A08B43D0b6B2841757CB25e` - impl: `0x823904Ab163192661e9f9e95b43351cD38319F28` - owner: `0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190` @@ -469,6 +470,7 @@ - upgraded on Oct 29, 2024 at commit `3d12cb2` ### rollup_resolver + - proxy: `0x4a10e91F528F1EeA44C6E5744607BB5F3904d539` - impl: `0x76a5bfbfe60DBdDBeaB5048efeaADcfACD66f621` - owner: `0x1D2D1bb9D180541E88a6a682aCf3f61c1605B190` diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index dccd7d9158d..f4d681a32b7 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 206854 -Gas per proving + verification: 158743 -Total: 365597 \ No newline at end of file +Gas per proposing: 206845 +Gas per proving + verification: 158573 +Total: 365418 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index 8b622acc039..6b37ec8aa47 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 206703 -Gas per proving + verification: 158749 -Total: 365452 \ No newline at end of file +Gas per proposing: 206694 +Gas per proving + verification: 158579 +Total: 365273 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index 565255f385e..accd8ec3d44 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 180523 -Gas per proving + verification: 156532 -Total: 337055 \ No newline at end of file +Gas per proposing: 180514 +Gas per proving + verification: 156437 +Total: 336951 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index 4b692d5494f..7133df72971 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 177000 -Gas per proving + verification: 154408 -Total: 331408 \ No newline at end of file +Gas per proposing: 177066 +Gas per proving + verification: 154388 +Total: 331454 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index f8f7c3aead4..31f16dccf55 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,72 +23,72 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1070230) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1064270) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1092290) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1066324) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 285997) -InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 286210) -InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154897) -InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98492) -InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95903) -InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96709) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1070052) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1064167) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1090908) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1065017) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 286063) +InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285610) +InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154747) +InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) +InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) +InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141644) -InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166993) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1074659) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1863356) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1099814) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 968906) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 14485579) -InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157750) -InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74574) -InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18884) -InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25676) +InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 167060) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1074706) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1863469) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1099861) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 968953) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 14486248) +InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157150) +InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74424) +InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) +InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61924) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 268984) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 969643) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133323) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 269050) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 969775) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133389) InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144859) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 314157) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 324585) -InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133408) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 269268) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8628830) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8959436) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9782439) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 9259331) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 14018375) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10554506) -InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124764) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1101599) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 6286080) -InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40343) -InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109953) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1360035) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 8278033) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1274363) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15990492) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9937632) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9937677) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9851309) -InboxTest_ProposeAndProve:test_proposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166185) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8834867) -PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 377529) -PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 326150) -PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 375746) -ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116237) -ProverMarketTest:test_averageFeeCalculation() (gas: 155271) -ProverMarketTest:test_bid() (gas: 90235) -ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 40644) -ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37191) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 314355) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 324783) +InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133474) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 269334) +InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166230) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8629642) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8960290) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9782987) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 9259890) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 14018956) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10554931) +InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1101647) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 6286514) +InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40278) +InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 110084) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1360225) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 8278661) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1274531) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15991745) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9937731) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9937776) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9851579) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8835492) +PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 377573) +PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 326172) +PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 375790) +ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116105) +ProverMarketTest:test_averageFeeCalculation() (gas: 155249) +ProverMarketTest:test_bid() (gas: 90169) +ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 40622) +ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37213) ProverMarketTest:test_feeLargerThanMax_reverts() (gas: 179645) -ProverMarketTest:test_feeNotDivisibleByUnit_reverts() (gas: 36986) -ProverMarketTest:test_getMaxFee() (gas: 155528) +ProverMarketTest:test_feeNotDivisibleByUnit_reverts() (gas: 37008) +ProverMarketTest:test_getMaxFee() (gas: 155506) ProverMarketTest:test_invalidThresholds_reverts() (gas: 63631) -ProverMarketTest:test_outbidWithHigherBond() (gas: 151197) -ProverMarketTest:test_outbidWithLowerBond() (gas: 144743) -ProverMarketTest:test_outbidWithSameBond() (gas: 144764) -ProverMarketTest:test_requestExit() (gas: 95561) +ProverMarketTest:test_outbidWithHigherBond() (gas: 150911) +ProverMarketTest:test_outbidWithLowerBond() (gas: 144589) +ProverMarketTest:test_outbidWithSameBond() (gas: 144610) +ProverMarketTest:test_requestExit() (gas: 95451) SendMessageToDelegateOwner:testAddress1() (gas: 2391) TestAutomataDcapV3Attestation:testAttestation() (gas: 4848498) TestAutomataDcapV3Attestation:testParsedCustomQuoteBinAttestation() (gas: 4553350) diff --git a/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol b/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol index d4e861f2140..eb14b6218f7 100644 --- a/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol +++ b/packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol @@ -86,7 +86,7 @@ contract DeployProtocolOnL1 is DeployCapability { SignalService(signalServiceAddr).authorize(taikoInboxAddr, true); } - uint64 l2ChainId = taikoInbox.pacayaConfig().chainId; + uint64 l2ChainId = taikoInbox.v4GetConfig().chainId; require(l2ChainId != block.chainid, "same chainid"); console2.log("------------------------------------------"); @@ -292,7 +292,7 @@ contract DeployProtocolOnL1 is DeployCapability { address(0) // proverMarket ) ), - data: abi.encodeCall(TaikoInbox.init, (owner, vm.envBytes32("L2_GENESIS_HASH"))) + data: abi.encodeCall(TaikoInbox.v4Init, (owner, vm.envBytes32("L2_GENESIS_HASH"))) }); address oldFork = vm.envAddress("OLD_FORK_TAIKO_INBOX"); @@ -353,8 +353,8 @@ contract DeployProtocolOnL1 is DeployCapability { }); TaikoInbox taikoInbox = TaikoInbox(payable(taikoInboxAddr)); - taikoInbox.init(msg.sender, vm.envBytes32("L2_GENESIS_HASH")); - uint64 l2ChainId = taikoInbox.pacayaConfig().chainId; + taikoInbox.v4Init(msg.sender, vm.envBytes32("L2_GENESIS_HASH")); + uint64 l2ChainId = taikoInbox.v4GetConfig().chainId; require(l2ChainId != block.chainid, "same chainid"); // Other verifiers @@ -384,7 +384,7 @@ contract DeployProtocolOnL1 is DeployCapability { name: "prover_set", impl: address( new ProverSet( - address(rollupResolver), taikoInboxAddr, taikoInbox.bondToken(), taikoInboxAddr + address(rollupResolver), taikoInboxAddr, taikoInbox.v4BondToken(), taikoInboxAddr ) ), data: abi.encodeCall(ProverSetBase.init, (address(0), vm.envAddress("PROVER_SET_ADMIN"))), diff --git a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol index e0556d60ef4..50c8a2f7e64 100644 --- a/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol +++ b/packages/protocol/script/layer1/devnet/UpgradeDevnetPacayaL1.s.sol @@ -157,7 +157,7 @@ contract UpgradeDevnetPacayaL1 is DeployCapability { address(new ProverSet(rollupResolver, taikoInbox, taikoToken, taikoWrapper)) ); TaikoInbox taikoInboxImpl = TaikoInbox(newFork); - uint64 l2ChainId = taikoInboxImpl.pacayaConfig().chainId; + uint64 l2ChainId = taikoInboxImpl.v4GetConfig().chainId; require(l2ChainId != block.chainid, "same chainid"); // Other verifiers diff --git a/packages/protocol/test/layer1/Layer1Test.sol b/packages/protocol/test/layer1/Layer1Test.sol index c99c24b9e2a..770a6d629cd 100644 --- a/packages/protocol/test/layer1/Layer1Test.sol +++ b/packages/protocol/test/layer1/Layer1Test.sol @@ -39,7 +39,7 @@ contract ConfigurableInbox is TaikoInbox { __config = _config; } - function pacayaConfig() public view override returns (ITaikoInbox.Config memory) { + function v4GetConfig() public view override returns (ITaikoInbox.Config memory) { return __config; } diff --git a/packages/protocol/test/layer1/based/InboxTestBase.sol b/packages/protocol/test/layer1/based/InboxTestBase.sol index 495537ecb65..55bcc91c96d 100644 --- a/packages/protocol/test/layer1/based/InboxTestBase.sol +++ b/packages/protocol/test/layer1/based/InboxTestBase.sol @@ -16,7 +16,7 @@ abstract contract InboxTestBase is Layer1Test { uint256 genesisBlockProposedIn; uint256 private __blocksPerBatch; - function pacayaConfig() internal view virtual returns (ITaikoInbox.Config memory); + function v4GetConfig() internal view virtual returns (ITaikoInbox.Config memory); modifier transactBy(address transactor) override { vm.deal(transactor, 100 ether); @@ -66,7 +66,7 @@ abstract contract InboxTestBase is Layer1Test { address(bondToken), address(signalService), proverMarketProxy, - pacayaConfig() + v4GetConfig() ); address realProverMarketImpl = address( @@ -168,7 +168,7 @@ abstract contract InboxTestBase is Layer1Test { for (uint256 i; i < numBatchesToPropose; ++i) { (ITaikoInbox.BatchInfo memory info, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(batchParams), txList); + inbox.v4ProposeBatch(abi.encode(batchParams), txList); _saveMetadataAndInfo(meta, info); batchIds[i] = meta.batchId; } @@ -185,7 +185,7 @@ abstract contract InboxTestBase is Layer1Test { transitions[i].stateRoot = correctStateRoot(batchIds[i]); } - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); } function _proveBatchesWithWrongTransitions(uint64[] memory batchIds) internal { @@ -199,16 +199,16 @@ abstract contract InboxTestBase is Layer1Test { transitions[i].stateRoot = randBytes32(); } - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); } function _logAllBatchesAndTransitions() internal view { console2.log(unicode"|───────────────────────────────────────────────────────────────"); - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); console2.log("Stats1 - lastSyncedBatchId:", stats1.lastSyncedBatchId); console2.log("Stats1 - lastSyncedAt:", stats1.lastSyncedAt); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); console2.log("Stats2 - numBatches:", stats2.numBatches); console2.log("Stats2 - lastVerifiedBatchId:", stats2.lastVerifiedBatchId); console2.log("Stats2 - paused:", stats2.paused); @@ -218,12 +218,12 @@ abstract contract InboxTestBase is Layer1Test { // console2.log("stats2.numBatches:", stats2.numBatches); // console2.log("getConfig().maxUnverifiedBatches:", getConfig().maxUnverifiedBatches); - uint64 firstBatchId = stats2.numBatches > pacayaConfig().maxUnverifiedBatches - ? stats2.numBatches - pacayaConfig().maxUnverifiedBatches + uint64 firstBatchId = stats2.numBatches > v4GetConfig().maxUnverifiedBatches + ? stats2.numBatches - v4GetConfig().maxUnverifiedBatches : 0; for (uint64 i = firstBatchId; i < stats2.numBatches; ++i) { - ITaikoInbox.Batch memory batch = inbox.getBatch(i); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(i); if (batch.batchId <= stats2.lastVerifiedBatchId) { console2.log(unicode"|─ ✔ batch#", batch.batchId); } else { @@ -238,7 +238,7 @@ abstract contract InboxTestBase is Layer1Test { console2.log(unicode"│ |── verifiedTransitionId:", batch.verifiedTransitionId); for (uint24 j = 1; j < batch.nextTransitionId; ++j) { - ITaikoInbox.TransitionState memory ts = inbox.getTransitionById(batch.batchId, j); + ITaikoInbox.TransitionState memory ts = inbox.v4GetTransitionById(batch.batchId, j); console2.log(unicode"│ |── transition#", j); console2.log( unicode"│ │ |── parentHash:", @@ -307,6 +307,6 @@ abstract contract InboxTestBase is Layer1Test { bondToken.approve(address(inbox), bondAmount); vm.prank(user); - inbox.depositBond(bondAmount); + inbox.v4DepositBond(bondAmount); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol index c48f41e0125..d4d8adf5561 100644 --- a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol @@ -5,7 +5,7 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_BondMechanics is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -46,16 +46,16 @@ contract InboxTest_BondMechanics is InboxTestBase { setupBondTokenState(Alice, initialBondBalance, bondBalance); - ITaikoInbox.Config memory config = pacayaConfig(); + ITaikoInbox.Config memory config = v4GetConfig(); vm.prank(Alice); uint64[] memory batchIds = _proposeBatchesWithDefaultParameters(1); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase); vm.prank(Alice); _proveBatchesWithCorrectTransitions(batchIds); - assertEq(inbox.bondBalanceOf(Alice), bondBalance); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance); } function test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() @@ -68,17 +68,17 @@ contract InboxTest_BondMechanics is InboxTestBase { setupBondTokenState(Alice, initialBondBalance, bondBalance); - ITaikoInbox.Config memory config = pacayaConfig(); + ITaikoInbox.Config memory config = v4GetConfig(); vm.prank(Alice); uint64[] memory batchIds = _proposeBatchesWithDefaultParameters(1); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase); vm.prank(Bob); _proveBatchesWithCorrectTransitions(batchIds); - assertEq(inbox.bondBalanceOf(Alice), bondBalance); - assertEq(inbox.bondBalanceOf(Bob), 0); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance); + assertEq(inbox.v4BondBalanceOf(Bob), 0); } function test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() external { @@ -89,17 +89,17 @@ contract InboxTest_BondMechanics is InboxTestBase { setupBondTokenState(Alice, initialBondBalance, bondBalance); - ITaikoInbox.Config memory config = pacayaConfig(); + ITaikoInbox.Config memory config = v4GetConfig(); vm.prank(Alice); uint64[] memory batchIds = _proposeBatchesWithDefaultParameters(1); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase); - vm.warp(block.timestamp + pacayaConfig().provingWindow + 1); + vm.warp(block.timestamp + config.provingWindow + 1); vm.prank(Alice); _proveBatchesWithCorrectTransitions(batchIds); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase / 2); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase / 2); } function test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() external { @@ -110,29 +110,30 @@ contract InboxTest_BondMechanics is InboxTestBase { setupBondTokenState(Alice, initialBondBalance, bondBalance); - ITaikoInbox.Config memory config = pacayaConfig(); + ITaikoInbox.Config memory config = v4GetConfig(); vm.prank(Alice); uint64[] memory batchIds = _proposeBatchesWithDefaultParameters(1); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase); - vm.warp(block.timestamp + pacayaConfig().provingWindow + 1); + vm.warp(block.timestamp + config.provingWindow + 1); vm.prank(Bob); _proveBatchesWithCorrectTransitions(batchIds); - assertEq(inbox.bondBalanceOf(Alice), bondBalance - config.livenessBondBase); - assertEq(inbox.bondBalanceOf(Bob), config.livenessBondBase / 2); + assertEq(inbox.v4BondBalanceOf(Alice), bondBalance - config.livenessBondBase); + assertEq(inbox.v4BondBalanceOf(Bob), config.livenessBondBase / 2); } function test_inbox_bonds_multiple_blocks_per_batch() external transactBy(Alice) { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](2); - (, ITaikoInbox.BatchMetadata memory meta) = inbox.proposeBatch(abi.encode(params), "txList"); + (, ITaikoInbox.BatchMetadata memory meta) = + inbox.v4ProposeBatch(abi.encode(params), "txList"); - ITaikoInbox.Batch memory batch = inbox.getBatch(meta.batchId); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(meta.batchId); - ITaikoInbox.Config memory config = pacayaConfig(); + ITaikoInbox.Config memory config = v4GetConfig(); assertEq(batch.livenessBond, config.livenessBondBase); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol b/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol index 8135939b4ec..2504d78be8f 100644 --- a/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol @@ -5,7 +5,7 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_BondToken is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -53,12 +53,12 @@ contract InboxTest_BondToken is InboxTestBase { bondToken.approve(address(inbox), depositAmount); vm.prank(Alice); - inbox.depositBond(depositAmount); - assertEq(inbox.bondBalanceOf(Alice), depositAmount); + inbox.v4DepositBond(depositAmount); + assertEq(inbox.v4BondBalanceOf(Alice), depositAmount); vm.prank(Alice); - inbox.withdrawBond(withdrawAmount); - assertEq(inbox.bondBalanceOf(Alice), depositAmount - withdrawAmount); + inbox.v4WithdrawBond(withdrawAmount); + assertEq(inbox.v4BondBalanceOf(Alice), depositAmount - withdrawAmount); } function test_inbox_withdraw_more_than_bond_balance() external { @@ -75,11 +75,11 @@ contract InboxTest_BondToken is InboxTestBase { bondToken.approve(address(inbox), depositAmount); vm.prank(Alice); - inbox.depositBond(depositAmount); + inbox.v4DepositBond(depositAmount); vm.prank(Alice); vm.expectRevert(ITaikoInbox.InsufficientBond.selector); - inbox.withdrawBond(withdrawAmount); + inbox.v4WithdrawBond(withdrawAmount); } function test_inbox_insufficient_approval() external { @@ -97,7 +97,7 @@ contract InboxTest_BondToken is InboxTestBase { vm.prank(Alice); vm.expectRevert("ERC20: insufficient allowance"); - inbox.depositBond(depositAmount); + inbox.v4DepositBond(depositAmount); } function test_inbox_exceeding_token_balance() external { @@ -114,7 +114,7 @@ contract InboxTest_BondToken is InboxTestBase { vm.prank(Alice); vm.expectRevert("ERC20: transfer amount exceeds balance"); - inbox.depositBond(depositAmount); + inbox.v4DepositBond(depositAmount); } function test_inbox_no_value_sent_on_deposit() external { @@ -131,7 +131,7 @@ contract InboxTest_BondToken is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.MsgValueNotZero.selector); - inbox.depositBond{ value: 1 }(depositAmount); + inbox.v4DepositBond{ value: 1 }(depositAmount); } function test_inbox_deposit_and_withdraw_from_multiple_users() external { @@ -161,44 +161,45 @@ contract InboxTest_BondToken is InboxTestBase { bondToken.approve(address(inbox), aliceFirstDeposit); vm.prank(Alice); - inbox.depositBond(aliceFirstDeposit); - assertEq(inbox.bondBalanceOf(Alice), aliceFirstDeposit); + inbox.v4DepositBond(aliceFirstDeposit); + assertEq(inbox.v4BondBalanceOf(Alice), aliceFirstDeposit); vm.prank(Bob); bondToken.approve(address(inbox), bobDeposit); vm.prank(Bob); - inbox.depositBond(bobDeposit); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit); + inbox.v4DepositBond(bobDeposit); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit); vm.prank(Alice); bondToken.approve(address(inbox), aliceSecondDeposit); vm.prank(Alice); - inbox.depositBond(aliceSecondDeposit); - assertEq(inbox.bondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit); + inbox.v4DepositBond(aliceSecondDeposit); + assertEq(inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit); vm.prank(Bob); - inbox.withdrawBond(bobWithdraw); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit - bobWithdraw); + inbox.v4WithdrawBond(bobWithdraw); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit - bobWithdraw); vm.prank(Alice); - inbox.withdrawBond(aliceFirstWithdraw); + inbox.v4WithdrawBond(aliceFirstWithdraw); assertEq( - inbox.bondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw + inbox.v4BondBalanceOf(Alice), + aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw ); vm.prank(Alice); - inbox.withdrawBond(aliceSecondWithdraw); + inbox.v4WithdrawBond(aliceSecondWithdraw); assertEq( - inbox.bondBalanceOf(Alice), + inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw - aliceSecondWithdraw ); assertEq( - inbox.bondBalanceOf(Alice), + inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw - aliceSecondWithdraw ); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit - bobWithdraw); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit - bobWithdraw); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol index 1dfb664da23..e128b07b5ca 100644 --- a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol @@ -5,7 +5,7 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_CalldataForTxList is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -77,7 +77,7 @@ contract InboxTest_CalldataForTxList is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.BlobNotSpecified.selector); // With empty txList - inbox.proposeBatch(abi.encode(params), ""); + inbox.v4ProposeBatch(abi.encode(params), ""); } function test_propose_batch_with_empty_txlist_and_valid_blobindex() external { @@ -96,7 +96,7 @@ contract InboxTest_CalldataForTxList is InboxTestBase { // With empty txList (ITaikoInbox.BatchInfo memory info, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(params), ""); + inbox.v4ProposeBatch(abi.encode(params), ""); assertTrue(info.txsHash != 0, "txsHash should not be zero for valid blobIndex"); _saveMetadataAndInfo(meta, info); @@ -163,6 +163,6 @@ contract InboxTest_CalldataForTxList is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.MetaHashMismatch.selector); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol b/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol index c32fada6f54..7a2b36ade0f 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_Cooldownis is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -46,21 +46,21 @@ contract InboxTest_Cooldownis is InboxTestBase { WhenLogAllBatchesAndTransitions { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 0); assertEq(stats1.lastSyncedAt, 0); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 10); assertEq(stats2.lastVerifiedBatchId, 0); assertEq(stats2.paused, false); assertEq(stats2.lastProposedIn, block.number); assertEq(stats2.lastUnpausedAt, 0); - vm.warp(block.timestamp + pacayaConfig().cooldownWindow); + vm.warp(block.timestamp + v4GetConfig().cooldownWindow); _proveBatchesWithWrongTransitions(range(1, 10)); - stats2 = inbox.getStats2(); + stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 10); assertEq(stats2.lastVerifiedBatchId, 9); } diff --git a/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol b/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol index 527a2e317ff..24f19f674bc 100644 --- a/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol @@ -5,7 +5,7 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_EtherAsBond is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -48,12 +48,12 @@ contract InboxTest_EtherAsBond is InboxTestBase { uint256 withdrawAmount = 0.5 ether; vm.prank(Alice); - inbox.depositBond{ value: depositAmount }(depositAmount); - assertEq(inbox.bondBalanceOf(Alice), depositAmount); + inbox.v4DepositBond{ value: depositAmount }(depositAmount); + assertEq(inbox.v4BondBalanceOf(Alice), depositAmount); vm.prank(Alice); - inbox.withdrawBond(withdrawAmount); - assertEq(inbox.bondBalanceOf(Alice), depositAmount - withdrawAmount); + inbox.v4WithdrawBond(withdrawAmount); + assertEq(inbox.v4BondBalanceOf(Alice), depositAmount - withdrawAmount); } function test_inbox_withdraw_more_than_bond_balance() external { @@ -64,11 +64,11 @@ contract InboxTest_EtherAsBond is InboxTestBase { uint256 withdrawAmount = 2 ether; vm.prank(Alice); - inbox.depositBond{ value: depositAmount }(depositAmount); + inbox.v4DepositBond{ value: depositAmount }(depositAmount); vm.prank(Alice); vm.expectRevert(ITaikoInbox.InsufficientBond.selector); - inbox.withdrawBond(withdrawAmount); + inbox.v4WithdrawBond(withdrawAmount); } // TODO: this test fail on Github but pass locally! @@ -80,7 +80,7 @@ contract InboxTest_EtherAsBond is InboxTestBase { // vm.prank(Alice); // vm.expectRevert(); - // inbox.depositBond{ value: depositAmount }(depositAmount); + // inbox.DepositBond{ value: depositAmount }(depositAmount); // } function test_inbox_overpayment_of_ether() external { @@ -91,7 +91,7 @@ contract InboxTest_EtherAsBond is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.EtherNotPaidAsBond.selector); - inbox.depositBond{ value: depositAmount + 1 }(depositAmount); + inbox.v4DepositBond{ value: depositAmount + 1 }(depositAmount); } function test_inbox_eth_not_paid_as_bond_on_deposit() external { @@ -102,7 +102,7 @@ contract InboxTest_EtherAsBond is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.EtherNotPaidAsBond.selector); - inbox.depositBond{ value: 0 }(depositAmount); + inbox.v4DepositBond{ value: 0 }(depositAmount); } function test_inbox_bond_balance_after_multiple_operations() external { @@ -119,38 +119,39 @@ contract InboxTest_EtherAsBond is InboxTestBase { uint256 bobWithdraw = 2 ether; vm.prank(Alice); - inbox.depositBond{ value: aliceFirstDeposit }(aliceFirstDeposit); - assertEq(inbox.bondBalanceOf(Alice), aliceFirstDeposit); + inbox.v4DepositBond{ value: aliceFirstDeposit }(aliceFirstDeposit); + assertEq(inbox.v4BondBalanceOf(Alice), aliceFirstDeposit); vm.prank(Bob); - inbox.depositBond{ value: bobDeposit }(bobDeposit); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit); + inbox.v4DepositBond{ value: bobDeposit }(bobDeposit); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit); vm.prank(Alice); - inbox.depositBond{ value: aliceSecondDeposit }(aliceSecondDeposit); - assertEq(inbox.bondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit); + inbox.v4DepositBond{ value: aliceSecondDeposit }(aliceSecondDeposit); + assertEq(inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit); vm.prank(Bob); - inbox.withdrawBond(bobWithdraw); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit - bobWithdraw); + inbox.v4WithdrawBond(bobWithdraw); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit - bobWithdraw); vm.prank(Alice); - inbox.withdrawBond(aliceFirstWithdraw); + inbox.v4WithdrawBond(aliceFirstWithdraw); assertEq( - inbox.bondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw + inbox.v4BondBalanceOf(Alice), + aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw ); vm.prank(Alice); - inbox.withdrawBond(aliceSecondWithdraw); + inbox.v4WithdrawBond(aliceSecondWithdraw); assertEq( - inbox.bondBalanceOf(Alice), + inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw - aliceSecondWithdraw ); assertEq( - inbox.bondBalanceOf(Alice), + inbox.v4BondBalanceOf(Alice), aliceFirstDeposit + aliceSecondDeposit - aliceFirstWithdraw - aliceSecondWithdraw ); - assertEq(inbox.bondBalanceOf(Bob), bobDeposit - bobWithdraw); + assertEq(inbox.v4BondBalanceOf(Bob), bobDeposit - bobWithdraw); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol index 7f9d37c6fbf..409d3cda43b 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_Params is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -41,7 +41,7 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](1); - (ITaikoInbox.BatchInfo memory info,) = inbox.proposeBatch(abi.encode(params), "txList"); + (ITaikoInbox.BatchInfo memory info,) = inbox.v4ProposeBatch(abi.encode(params), "txList"); // Assert that the default anchorBlockId was set correctly uint64 expectedAnchorBlockId = uint64(block.number - 1); @@ -52,7 +52,7 @@ contract InboxTest_Params is InboxTestBase { external transactBy(Alice) { - ITaikoInbox.Config memory config = inbox.pacayaConfig(); + ITaikoInbox.Config memory config = inbox.v4GetConfig(); // Advance the block number to create the appropriate test scenario vm.roll(config.maxAnchorHeightOffset + 2); @@ -63,7 +63,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = uint64(block.number - config.maxAnchorHeightOffset - 1); vm.expectRevert(ITaikoInbox.AnchorBlockIdTooSmall.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } function test_validateParams_reverts_when_anchorBlockId_too_large() @@ -76,7 +76,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = uint64(block.number); vm.expectRevert(ITaikoInbox.AnchorBlockIdTooLarge.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } function test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() @@ -85,7 +85,7 @@ contract InboxTest_Params is InboxTestBase { { vm.roll(10); _proposeBatchesWithDefaultParameters(1); - ITaikoInbox.Batch memory parent = inbox.getBatch(1); + ITaikoInbox.Batch memory parent = inbox.v4GetBatch(1); ITaikoInbox.BlockParams[] memory blocks = new ITaikoInbox.BlockParams[](1); blocks[0] = ITaikoInbox.BlockParams({ @@ -100,7 +100,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = parent.anchorBlockId - 1; vm.expectRevert(ITaikoInbox.AnchorBlockIdSmallerThanParent.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } function test_validateParams_when_anchorBlockId_is_not_zero() external transactBy(Alice) { @@ -108,7 +108,7 @@ contract InboxTest_Params is InboxTestBase { params.blocks = new ITaikoInbox.BlockParams[](1); params.anchorBlockId = uint64(block.number - 1); - (ITaikoInbox.BatchInfo memory info,) = inbox.proposeBatch(abi.encode(params), "txList"); + (ITaikoInbox.BatchInfo memory info,) = inbox.v4ProposeBatch(abi.encode(params), "txList"); uint64 expectedAnchorBlockId = uint64(block.number - 1); assertEq(info.anchorBlockId, expectedAnchorBlockId, "AnchorBlockId mismatch"); @@ -120,7 +120,7 @@ contract InboxTest_Params is InboxTestBase { params.lastBlockTimestamp = uint64(block.timestamp + 1); vm.expectRevert(ITaikoInbox.TimestampTooLarge.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } function test_validateParams_reverts_when_first_block_time_shift_not_zero() @@ -130,16 +130,16 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](1); params.lastBlockTimestamp = uint64(block.timestamp); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); params.lastBlockTimestamp = uint64(block.timestamp - 1); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); params.blocks[0].timeShift = 1; params.lastBlockTimestamp = uint64(block.timestamp); vm.expectRevert(ITaikoInbox.FirstBlockTimeShiftNotZero.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } function test_validateParams_reverts_when_timestamp_smaller_than_parent() @@ -149,15 +149,15 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](2); params.lastBlockTimestamp = uint64(block.timestamp); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); params.lastBlockTimestamp = uint64(block.timestamp - 1); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); params.blocks[1].timeShift = 1; params.lastBlockTimestamp = uint64(block.timestamp); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol index 59b7d498129..7ceab1cf824 100644 --- a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_ProposeAndProve is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -39,11 +39,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { function test_inbox_query_right_after_genesis_batch() external view { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 0); assertEq(stats1.lastSyncedAt, 0); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 1); assertEq(stats2.lastVerifiedBatchId, 0); assertEq(stats2.paused, false); @@ -51,7 +51,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -60,13 +60,13 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(batch.verifiedTransitionId, 1); (uint64 batchId, uint64 blockId, ITaikoInbox.TransitionState memory ts) = - inbox.getLastVerifiedTransition(); + inbox.v4GetLastVerifiedTransition(); assertEq(batchId, 0); assertEq(blockId, 0); assertEq(ts.blockHash, correctBlockhash(0)); assertEq(ts.stateRoot, bytes32(uint256(0))); - (batchId, blockId, ts) = inbox.getLastSyncedTransition(); + (batchId, blockId, ts) = inbox.v4GetLastSyncedTransition(); assertEq(batchId, 0); assertEq(blockId, 0); assertEq(ts.blockHash, correctBlockhash(0)); @@ -75,7 +75,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { function test_inbox_query_batches_not_exist_will_revert() external { vm.expectRevert(ITaikoInbox.BatchNotFound.selector); - inbox.getBatch(1); + inbox.v4GetBatch(1); } function test_inbox_max_batch_proposal() @@ -86,11 +86,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 0); assertEq(stats1.lastSyncedAt, 0); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 11); assertEq(stats2.lastVerifiedBatchId, 0); assertEq(stats2.paused, false); @@ -98,7 +98,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -108,7 +108,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 1; i <= 10; ++i) { - batch = inbox.getBatch(i); + batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = @@ -147,11 +147,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 0); assertEq(stats1.lastSyncedAt, 0); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 7); assertEq(stats2.lastVerifiedBatchId, 0); assertEq(stats2.paused, false); @@ -159,7 +159,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -169,7 +169,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 1; i < 7; ++i) { - batch = inbox.getBatch(i); + batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = _loadMetadataAndInfo(i); @@ -212,11 +212,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 5); assertEq(stats1.lastSyncedAt, block.timestamp); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 10); assertEq(stats2.lastVerifiedBatchId, 9); assertEq(stats2.paused, false); @@ -224,36 +224,36 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); (uint64 batchId, uint64 blockId, ITaikoInbox.TransitionState memory ts) = - inbox.getLastVerifiedTransition(); + inbox.v4GetLastVerifiedTransition(); assertEq(batchId, 9); assertEq(blockId, 9); assertEq(ts.blockHash, correctBlockhash(9)); assertEq(ts.stateRoot, bytes32(uint256(0))); vm.expectRevert(ITaikoInbox.TransitionNotFound.selector); - ts = inbox.getTransitionById(9, uint24(0)); + ts = inbox.v4GetTransitionById(9, uint24(0)); - ts = inbox.getTransitionById(9, uint24(1)); + ts = inbox.v4GetTransitionById(9, uint24(1)); assertEq(ts.parentHash, correctBlockhash(8)); assertEq(ts.blockHash, correctBlockhash(9)); assertEq(ts.stateRoot, bytes32(uint256(0))); vm.expectRevert(ITaikoInbox.TransitionNotFound.selector); - ts = inbox.getTransitionByParentHash(9, correctBlockhash(9)); + ts = inbox.v4GetTransitionByParentHash(9, correctBlockhash(9)); - ts = inbox.getTransitionByParentHash(9, correctBlockhash(8)); + ts = inbox.v4GetTransitionByParentHash(9, correctBlockhash(8)); assertEq(ts.parentHash, correctBlockhash(8)); assertEq(ts.blockHash, correctBlockhash(9)); assertEq(ts.stateRoot, bytes32(uint256(0))); - (batchId, blockId, ts) = inbox.getLastSyncedTransition(); + (batchId, blockId, ts) = inbox.v4GetLastSyncedTransition(); assertEq(batchId, 5); assertEq(blockId, 5); assertEq(ts.blockHash, correctBlockhash(5)); assertEq(ts.stateRoot, correctStateRoot(5)); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -263,7 +263,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 1; i < 10; ++i) { - batch = inbox.getBatch(i); + batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = _loadMetadataAndInfo(i); @@ -273,7 +273,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(batch.lastBlockTimestamp, block.timestamp); assertEq(batch.anchorBlockId, block.number - 1); assertEq(batch.nextTransitionId, 2); - if (i % pacayaConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { + if (i % v4GetConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { assertEq(batch.verifiedTransitionId, 1); } else { assertEq(batch.verifiedTransitionId, 0); @@ -292,11 +292,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 5); assertEq(stats1.lastSyncedAt, block.timestamp); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 10); assertEq(stats2.lastVerifiedBatchId, 9); assertEq(stats2.paused, false); @@ -304,20 +304,20 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); (uint64 batchId, uint64 blockId, ITaikoInbox.TransitionState memory ts) = - inbox.getLastVerifiedTransition(); + inbox.v4GetLastVerifiedTransition(); assertEq(batchId, 9); assertEq(blockId, 9 * 7); assertEq(ts.blockHash, correctBlockhash(9)); assertEq(ts.stateRoot, bytes32(uint256(0))); - (batchId, blockId, ts) = inbox.getLastSyncedTransition(); + (batchId, blockId, ts) = inbox.v4GetLastSyncedTransition(); assertEq(batchId, 5); assertEq(blockId, 5 * 7); assertEq(ts.blockHash, correctBlockhash(5)); assertEq(ts.stateRoot, correctStateRoot(5)); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -327,7 +327,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 1; i < 10; ++i) { - batch = inbox.getBatch(i); + batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = _loadMetadataAndInfo(i); @@ -338,7 +338,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(batch.lastBlockId, i * 7); assertEq(batch.anchorBlockId, block.number - 1); assertEq(batch.nextTransitionId, 2); - if (i % pacayaConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { + if (i % v4GetConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { assertEq(batch.verifiedTransitionId, 1); } else { assertEq(batch.verifiedTransitionId, 0); @@ -356,11 +356,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 5); assertEq(stats1.lastSyncedAt, block.timestamp); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 10); assertEq(stats2.lastVerifiedBatchId, 9); assertEq(stats2.paused, false); @@ -368,7 +368,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); // - Verify genesis block - ITaikoInbox.Batch memory batch = inbox.getBatch(0); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(0); assertEq(batch.batchId, 0); assertEq(batch.metaHash, bytes32(uint256(1))); assertEq(batch.lastBlockTimestamp, genesisBlockProposedAt); @@ -378,7 +378,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 1; i < 10; ++i) { - batch = inbox.getBatch(i); + batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = _loadMetadataAndInfo(i); @@ -387,7 +387,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(batch.lastBlockTimestamp, block.timestamp); assertEq(batch.anchorBlockId, block.number - 1); assertEq(batch.nextTransitionId, 3); - if (i % pacayaConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { + if (i % v4GetConfig().stateRootSyncInternal == 0 || i == stats2.lastVerifiedBatchId) { assertEq(batch.verifiedTransitionId, 2); } else { assertEq(batch.verifiedTransitionId, 0); @@ -409,11 +409,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { { // - All stats are correct and expected - ITaikoInbox.Stats1 memory stats1 = inbox.getStats1(); + ITaikoInbox.Stats1 memory stats1 = inbox.v4GetStats1(); assertEq(stats1.lastSyncedBatchId, 10); assertEq(stats1.lastSyncedAt, block.timestamp); - ITaikoInbox.Stats2 memory stats2 = inbox.getStats2(); + ITaikoInbox.Stats2 memory stats2 = inbox.v4GetStats2(); assertEq(stats2.numBatches, 18); assertEq(stats2.lastVerifiedBatchId, 10); assertEq(stats2.paused, false); @@ -421,13 +421,13 @@ contract InboxTest_ProposeAndProve is InboxTestBase { assertEq(stats2.lastUnpausedAt, 0); (uint64 batchId, uint64 blockId, ITaikoInbox.TransitionState memory ts) = - inbox.getLastVerifiedTransition(); + inbox.v4GetLastVerifiedTransition(); assertEq(batchId, 10); assertEq(blockId, 10); assertEq(ts.blockHash, correctBlockhash(10)); assertEq(ts.stateRoot, correctStateRoot(10)); - (batchId, blockId, ts) = inbox.getLastSyncedTransition(); + (batchId, blockId, ts) = inbox.v4GetLastSyncedTransition(); assertEq(batchId, 10); assertEq(blockId, 10); assertEq(ts.blockHash, correctBlockhash(10)); @@ -435,7 +435,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Verify block data for (uint64 i = 8; i < 15; ++i) { - ITaikoInbox.Batch memory batch = inbox.getBatch(i); + ITaikoInbox.Batch memory batch = inbox.v4GetBatch(i); assertEq(batch.batchId, i); (ITaikoInbox.BatchMetadata memory meta, ITaikoInbox.BatchInfo memory info) = _loadMetadataAndInfo(i); @@ -478,10 +478,10 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].blockHash = bytes32(uint256(0x101)); transitions[0].stateRoot = bytes32(uint256(0x102)); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); _logAllBatchesAndTransitions(); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); assertTrue(!EssentialContract(address(inbox)).paused()); } @@ -501,11 +501,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].parentHash = bytes32(uint256(0x100)); transitions[0].blockHash = bytes32(uint256(0x101)); transitions[0].stateRoot = bytes32(uint256(0x102)); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); _logAllBatchesAndTransitions(); transitions[0].blockHash = bytes32(uint256(0x103)); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); _logAllBatchesAndTransitions(); assertTrue(EssentialContract(address(inbox)).paused()); @@ -531,10 +531,10 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].stateRoot = correctStateRoot(batchId); // Let the five transition is a conflict one. - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); // Verify the tagged conflict transition. - ITaikoInbox.TransitionState memory ts = inbox.getTransitionById(batchId, uint24(1)); + ITaikoInbox.TransitionState memory ts = inbox.v4GetTransitionById(batchId, uint24(1)); assertEq(ts.blockHash, bytes32(uint256(0))); // Verify the inbox is paused. assertTrue(EssentialContract(address(inbox)).paused()); @@ -545,13 +545,13 @@ contract InboxTest_ProposeAndProve is InboxTestBase { // Correct the blockhash. transitions[0].blockHash = correctBlockhash(batchId); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); // Verify the inbox is not paused. assertFalse(EssentialContract(address(inbox)).paused()); } - function test_proposeBatch_reverts_for_invalid_proposer_and_operator() + function test_ProposeBatch_reverts_for_invalid_proposer_and_operator() external transactBy(Alice) { @@ -559,7 +559,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { params.proposer = Alice; vm.expectRevert(ITaikoInbox.CustomProposerNotAllowed.selector); - inbox.proposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList"); vm.startPrank(deployer); address operator = Bob; @@ -579,7 +579,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -591,7 +591,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].stateRoot = correctStateRoot(meta.batchId); vm.startSnapshotGas("proveBatches"); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); uint256 gas2 = vm.stopSnapshotGas("proveBatches"); _logAllBatchesAndTransitions(); @@ -633,8 +633,8 @@ contract InboxTest_ProposeAndProve is InboxTestBase { proverMarket.bid(fee, exitTimestamp); // Check if Alice's and Bob's bonds are correctly deducted ! - uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); - uint256 bob_bond_before_propose = inbox.bondBalanceOf(Bob); + uint256 alice_bond_before_propose = inbox.v4BondBalanceOf(Alice); + uint256 bob_bond_before_propose = inbox.v4BondBalanceOf(Bob); vm.startPrank(Alice); @@ -644,7 +644,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -655,16 +655,16 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].blockHash = correctBlockhash(meta.batchId); transitions[0].stateRoot = correctStateRoot(meta.batchId); - uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + uint256 alice_bond_after_propose = inbox.v4BondBalanceOf(Alice); // Check if Alice's bond is correctly deducted - only fee assertEq(alice_bond_after_propose, alice_bond_before_propose - fee); - uint256 bob_bond_after_propose = inbox.bondBalanceOf(Bob); + uint256 bob_bond_after_propose = inbox.v4BondBalanceOf(Bob); // Since prover fee is smaller than config.liveness, just deduct the diff of the 2. assertEq(bob_bond_after_propose, bob_bond_before_propose - (125e18 - fee)); vm.startSnapshotGas("proveBatches"); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); uint256 gas2 = vm.stopSnapshotGas("proveBatches"); _logAllBatchesAndTransitions(); @@ -707,9 +707,9 @@ contract InboxTest_ProposeAndProve is InboxTestBase { proverMarket.bid(fee, exitTimestamp); // Check if Alice's bond is correctly deducted ! - uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); + uint256 alice_bond_before_propose = inbox.v4BondBalanceOf(Alice); // Check if Bob's bond is correctly deducted ! - uint256 bob_bond_before_propose = inbox.bondBalanceOf(Bob); + uint256 bob_bond_before_propose = inbox.v4BondBalanceOf(Bob); vm.startPrank(Alice); @@ -719,7 +719,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -730,16 +730,16 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].blockHash = correctBlockhash(meta.batchId); transitions[0].stateRoot = correctStateRoot(meta.batchId); - uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + uint256 alice_bond_after_propose = inbox.v4BondBalanceOf(Alice); // Check if Alice's bond is correctly deducted - only fee assertEq(alice_bond_after_propose, alice_bond_before_propose - fee); - uint256 bob_bond_after_propose = inbox.bondBalanceOf(Bob); + uint256 bob_bond_after_propose = inbox.v4BondBalanceOf(Bob); // Since prover fee is bigger than config.liveness, just add the diff of the 2. assertEq(bob_bond_after_propose, bob_bond_before_propose + (fee - 125e18)); vm.startSnapshotGas("proveBatches"); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); uint256 gas2 = vm.stopSnapshotGas("proveBatches"); _logAllBatchesAndTransitions(); @@ -776,7 +776,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { proverMarket.bid(fee, exitTimestamp); // Check if Alice's bond is correctly deducted ! - uint256 alice_bond_before_propose = inbox.bondBalanceOf(Alice); + uint256 alice_bond_before_propose = inbox.v4BondBalanceOf(Alice); ITaikoInbox.BatchParams memory batchParams; batchParams.blocks = new ITaikoInbox.BlockParams[](10); @@ -784,11 +784,11 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.proposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); // Check if Alice's bond is correctly deducted - only liveness bond base - uint256 alice_bond_after_propose = inbox.bondBalanceOf(Alice); + uint256 alice_bond_after_propose = inbox.v4BondBalanceOf(Alice); assertEq(alice_bond_after_propose, alice_bond_before_propose - 125e18); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -800,7 +800,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { transitions[0].stateRoot = correctStateRoot(meta.batchId); vm.startSnapshotGas("proveBatches"); - inbox.proveBatches(abi.encode(metas, transitions), "proof"); + inbox.v4ProveBatches(abi.encode(metas, transitions), "proof"); uint256 gas2 = vm.stopSnapshotGas("proveBatches"); _logAllBatchesAndTransitions(); diff --git a/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol b/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol index 70ac3ebd61c..efab1a6d43a 100644 --- a/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_StopBatch is InboxTestBase { - function pacayaConfig() internal pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { ITaikoInbox.ForkHeights memory forkHeights; return ITaikoInbox.Config({ @@ -44,7 +44,7 @@ contract InboxTest_StopBatch is InboxTestBase { WhenMultipleBatchesAreProvedWithCorrectTransitions(1, 10) WhenLogAllBatchesAndTransitions { - ITaikoInbox.Stats2 memory _stats2 = inbox.getStats2(); - assertEq(pacayaConfig().maxBatchesToVerify * 9, _stats2.lastVerifiedBatchId); + ITaikoInbox.Stats2 memory _stats2 = inbox.v4GetStats2(); + assertEq(v4GetConfig().maxBatchesToVerify * 9, _stats2.lastVerifiedBatchId); } } diff --git a/packages/protocol/test/layer1/based/helpers/StubInbox.sol b/packages/protocol/test/layer1/based/helpers/StubInbox.sol index 86c498e7b32..ce51faf7f7e 100644 --- a/packages/protocol/test/layer1/based/helpers/StubInbox.sol +++ b/packages/protocol/test/layer1/based/helpers/StubInbox.sol @@ -6,7 +6,7 @@ import "src/layer1/based/ITaikoInbox.sol"; /// @title StubInbox /// @custom:security-contact security@taiko.xyz contract StubInbox is ITaikoInbox { - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) @@ -14,21 +14,23 @@ contract StubInbox is ITaikoInbox { returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_) { } - function proveBatches(bytes calldata _params, bytes calldata _proof) external { } + function v4ProveBatches(bytes calldata _params, bytes calldata _proof) external { } - function depositBond(uint256 _amount) external payable virtual { } + function v4VerifyBatches(uint64 _length) external { } - function withdrawBond(uint256 _amount) external virtual { } + function v4DepositBond(uint256 _amount) external payable virtual { } - function bondBalanceOf(address _user) external view returns (uint256) { } + function v4WithdrawBond(uint256 _amount) external virtual { } - function bondToken() external pure returns (address) { + function v4BondBalanceOf(address _user) external view returns (uint256) { } + + function v4BondToken() external pure returns (address) { return address(0); } - function getBatch(uint64 _batchId) external view virtual returns (ITaikoInbox.Batch memory) { } + function v4GetBatch(uint64 _batchId) external view virtual returns (ITaikoInbox.Batch memory) { } - function getTransitionById( + function v4GetTransitionById( uint64 _batchId, uint24 _tid ) @@ -38,7 +40,7 @@ contract StubInbox is ITaikoInbox { returns (ITaikoInbox.TransitionState memory) { } - function getTransitionByParentHash( + function v4GetTransitionByParentHash( uint64 _batchId, bytes32 _parentHash ) @@ -47,27 +49,27 @@ contract StubInbox is ITaikoInbox { returns (ITaikoInbox.TransitionState memory) { } - function getLastVerifiedTransition() + function v4GetLastVerifiedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory) { } - function getLastSyncedTransition() + function v4GetLastSyncedTransition() external view returns (uint64 batchId_, uint64 blockId_, TransitionState memory) { } - function getBatchVerifyingTransition(uint64 _batchId) + function v4GetBatchVerifyingTransition(uint64 _batchId) external view returns (TransitionState memory) { } - function getStats1() external view returns (Stats1 memory) { } + function v4GetStats1() external view returns (Stats1 memory) { } - function getStats2() external view returns (Stats2 memory) { } + function v4GetStats2() external view returns (Stats2 memory) { } - function pacayaConfig() external pure virtual returns (ITaikoInbox.Config memory) { } + function v4GetConfig() external pure virtual returns (ITaikoInbox.Config memory) { } } diff --git a/packages/protocol/test/layer1/forced-inclusion/ForcedInclusionStore.t.sol b/packages/protocol/test/layer1/forced-inclusion/ForcedInclusionStore.t.sol index 8d943d119e5..48199ff10d0 100644 --- a/packages/protocol/test/layer1/forced-inclusion/ForcedInclusionStore.t.sol +++ b/packages/protocol/test/layer1/forced-inclusion/ForcedInclusionStore.t.sol @@ -30,7 +30,7 @@ contract MockInbox { numBatches = _numBatches; } - function getStats2() external view returns (ITaikoInbox.Stats2 memory stats2_) { + function v4GetStats2() external view returns (ITaikoInbox.Stats2 memory stats2_) { stats2_.numBatches = numBatches; } } diff --git a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol index 86a7b6637ba..3c19173cb7a 100644 --- a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol +++ b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol @@ -13,7 +13,7 @@ contract MockTaikoInbox is EssentialContract { __Essential_init(_owner); } - function proposeBatch( + function v4ProposeBatch( bytes calldata _params, bytes calldata _txList ) diff --git a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol index bf943cf6a34..745f74e71ea 100644 --- a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol +++ b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol @@ -57,7 +57,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as Carol (selected operator) and propose blocks vm.prank(Carol); - (ITaikoInbox.BatchInfo memory info,) = router.proposeBatch(abi.encode(params), ""); + (ITaikoInbox.BatchInfo memory info,) = router.v4ProposeBatch(abi.encode(params), ""); // Assert the proposer was set correctly in the metadata assertEq(info.proposer, Carol); @@ -91,7 +91,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as David (not the selected operator) and propose blocks vm.prank(David); vm.expectRevert(IPreconfRouter.NotPreconfer.selector); - router.proposeBatch("", ""); + router.v4ProposeBatch("", ""); } function test_preconfRouter_proposeBatch_proposerNotSender() external { @@ -146,6 +146,6 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as Carol (selected operator) and propose blocks vm.prank(Carol); vm.expectRevert(IPreconfRouter.ProposerIsNotPreconfer.selector); - router.proposeBatch(abi.encode(params), ""); + router.v4ProposeBatch(abi.encode(params), ""); } } diff --git a/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol index e68800d2392..d9f82629d97 100644 --- a/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol +++ b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol @@ -12,7 +12,7 @@ contract MockInbox { bondBalances[_prover] = _amount; } - function bondBalanceOf(address _prover) external view returns (uint256) { + function v4BondBalanceOf(address _prover) external view returns (uint256) { return bondBalances[_prover]; } } diff --git a/packages/protocol/test/layer1/team/tokenunlock/TokenUnlock_ProverSet.t.sol b/packages/protocol/test/layer1/team/tokenunlock/TokenUnlock_ProverSet.t.sol deleted file mode 100644 index 6b51ede9667..00000000000 --- a/packages/protocol/test/layer1/team/tokenunlock/TokenUnlock_ProverSet.t.sol +++ /dev/null @@ -1,186 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -// import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; -// import "src/layer1/team/TokenUnlock.sol"; -// import "../../based/InboxTestBase.sol"; - -// contract TokenUnlock_ProverSet is InboxTestBase { -// uint64 private constant TGE = 1_000_000; -// uint96 private constant livenessBond = 125 ether; - -// address private taikoL1 = randAddress(); - -// TokenUnlock private target; -// TaikoToken private taikoToken; - -// function getConfig() internal pure override returns (ITaikoInbox.Config memory) { -// return ITaikoInbox.Config({ -// chainId: LibNetwork.TAIKO_MAINNET, -// maxUnverifiedBatches: 10, -// batchRingBufferSize: 15, -// maxBatchesToVerify: 5, -// blockMaxGasLimit: 240_000_000, -// livenessBond: livenessBond, // 125 Taiko token -// stateRootSyncInternal: 5, -// maxAnchorHeightOffset: 64, -// baseFeeConfig: LibSharedData.BaseFeeConfig({ -// adjustmentQuotient: 8, -// sharingPctg: 75, -// gasIssuancePerSecond: 5_000_000, -// minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee -// maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 -// }), -// provingWindow: 1 hours, -// cooldownWindow: 0 hours, -// maxSignalsToReceive: 16, -// forkHeights: ITaikoInbox.ForkHeights({ ontake: 0, pacaya: 0 }) -// }); -// } - -// function setUpOnEthereum() internal override { -// super.setUpOnEthereum(); -// taikoToken = deployBondToken(); - -// register("taiko_token", address(taikoToken)); -// register("prover_set", address(new ProverSet())); - -// target = TokenUnlock( -// deploy({ -// name: "token_unlock", -// impl: address(new TokenUnlock()), -// data: abi.encodeCall(TokenUnlock.init, (Alice, address(resolver), Bob, TGE)) -// }) -// ); -// } - -// function setUp() public override { -// super.setUp(); - -// vm.warp(TGE); - -// vm.prank(Alice); -// taikoToken.approve(address(target), 1_000_000_000 ether); -// } - -// function test_tokenunlock_proverset() public { -// taikoToken.transfer(Alice, 1000 ether); - -// vm.startPrank(Alice); -// target.vest(100 ether); -// taikoToken.transfer(address(target), 20 ether); -// vm.warp(TGE + target.ONE_YEAR() * 2); - -// vm.expectRevert(TokenUnlock.PERMISSION_DENIED.selector); -// target.createProverSet(); -// vm.stopPrank(); - -// vm.startPrank(Bob); -// vm.expectRevert(TokenUnlock.NOT_PROVER_SET.selector); -// target.depositToProverSet(vm.addr(0x1234), 1 ether); - -// ProverSet set1 = ProverSet(payable(target.createProverSet())); -// assertEq(set1.owner(), target.owner()); -// assertEq(set1.admin(), address(target)); - -// assertTrue(target.isProverSet(address(set1))); - -// vm.expectRevert(); // ERC20: transfer amount exceeds balance -// target.depositToProverSet(address(set1), 121 ether); - -// target.depositToProverSet(address(set1), 120 ether); -// assertEq(taikoToken.balanceOf(address(set1)), 120 ether); -// assertEq(taikoToken.balanceOf(address(target)), 0 ether); -// assertEq(target.amountVested(), 100 ether); -// assertEq(target.amountWithdrawable(), 0 ether); - -// vm.expectRevert(); // ERC20: transfer amount exceeds balance -// set1.withdrawToAdmin(121 ether); - -// set1.withdrawToAdmin(120 ether); -// assertEq(taikoToken.balanceOf(address(set1)), 0 ether); -// assertEq(taikoToken.balanceOf(address(target)), 120 ether); -// assertEq(target.amountVested(), 100 ether); -// assertEq(target.amountWithdrawable(), 70 ether); - -// set1.enableProver(Carol, true); -// assertTrue(set1.isProver(Carol)); - -// vm.expectRevert(ProverSet.INVALID_STATUS.selector); -// set1.enableProver(Carol, true); - -// set1.delegate(Carol); -// assertEq(taikoToken.delegates(address(set1)), Carol); - -// // create another one -// target.createProverSet(); - -// vm.stopPrank(); - -// vm.prank(target.owner()); -// vm.expectRevert(TokenUnlock.PERMISSION_DENIED.selector); -// set1.enableProver(David, true); - -// vm.prank(David); -// vm.expectRevert(TokenUnlock.PERMISSION_DENIED.selector); -// set1.enableProver(Carol, true); -// } - -// function test_tokenunlock_proverset_propose_and_prove_blocks() public { -// uint256 initialBondBalance = 200 ether; - -// taikoToken.transfer(Alice, 1000 ether); - -// vm.startPrank(Alice); -// target.vest(100 ether); -// taikoToken.transfer(address(target), 100 ether); -// vm.warp(TGE + target.ONE_YEAR() * 2); - -// vm.startPrank(Bob); -// ProverSet set = ProverSet(payable(target.createProverSet())); -// target.depositToProverSet(address(set), initialBondBalance); - -// vm.expectRevert(); // ERC20: transfer amount exceeds balance -// set.depositBond(201 ether); - -// set.depositBond(200 ether); - -// set.enableProver(Carol, true); -// assertTrue(set.isProver(Carol)); -// vm.stopPrank(); - -// // Only prover in ProverSet can propose taiko blocks -// vm.prank(Alice); -// vm.expectRevert(TokenUnlock.PERMISSION_DENIED.selector); -// ITaikoInbox.BlockParamsV3[] memory paramsArray = new ITaikoInbox.BlockParamsV3[](1); -// set.proposeBatches(paramsArray, "txList", false); - -// vm.prank(Carol); -// ITaikoInbox.BlockMetadataV3[] memory metas = -// set.proposeBatches(paramsArray, "txList", false); - -// vm.startPrank(Bob); -// vm.expectRevert(); -// set.withdrawBond(initialBondBalance); -// set.withdrawBond(initialBondBalance - livenessBond); -// vm.stopPrank(); - -// // Only prover in ProverSet can prove taiko blocks -// ITaikoInbox.TransitionV3[] memory transitions = new ITaikoInbox.TransitionV3[](1); -// for (uint256 i; i < metas.length; ++i) { -// transitions[i].parentHash = correctBlockhash(metas[i].blockId - 1); -// transitions[i].blockHash = correctBlockhash(metas[i].blockId); -// transitions[i].stateRoot = correctStateRoot(metas[i].blockId); -// } - -// vm.prank(Alice); -// vm.expectRevert(TokenUnlock.PERMISSION_DENIED.selector); -// set.proveBatches(metas, transitions, "proof"); - -// vm.prank(Carol); -// set.proveBatches(metas, transitions, "proof"); - -// vm.startPrank(Bob); -// set.withdrawBond(livenessBond); -// } -// } diff --git a/packages/protocol/test/layer1/verifiers/SP1Verifier.t.sol b/packages/protocol/test/layer1/verifiers/SP1Verifier.t.sol index cb8f0d4b84b..9e1fbf1a0ca 100644 --- a/packages/protocol/test/layer1/verifiers/SP1Verifier.t.sol +++ b/packages/protocol/test/layer1/verifiers/SP1Verifier.t.sol @@ -5,7 +5,7 @@ import { SP1Verifier as SP1RemoteVerifier } from "@sp1-contracts/src/v3.0.0/SP1V import "../Layer1Test.sol"; contract TaikoStub_ReturnMainnetChainId { - function getConfig() external pure returns (ITaikoInbox.Config memory config) { + function v4GetConfig() external pure returns (ITaikoInbox.Config memory config) { config.chainId = 167_000; } } diff --git a/packages/protocol/test/shared/tokenvault/ERC20Vault.h.sol b/packages/protocol/test/shared/tokenvault/ERC20Vault.h.sol index 568744621f1..d5e4a5685a0 100644 --- a/packages/protocol/test/shared/tokenvault/ERC20Vault.h.sol +++ b/packages/protocol/test/shared/tokenvault/ERC20Vault.h.sol @@ -16,11 +16,11 @@ contract PrankTaikoInbox { batch = _batch; } - function getBatch(uint64) external view returns (ITaikoInbox.Batch memory) { + function v4GetBatch(uint64) external view returns (ITaikoInbox.Batch memory) { return batch; } - function isOnL1() external pure returns (bool) { + function v4IsOnL1() external pure returns (bool) { return true; } } From 5d0bdaf67bf49368b7dd1f1e05f5214c27af2c53 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Sun, 20 Apr 2025 13:26:41 +0800 Subject: [PATCH 06/16] revert(protocol): remove marker from batch parameter (#19309) --- .../contracts/layer1/based/ITaikoInbox.sol | 4 +- .../contracts/layer1/based/TaikoInbox.sol | 12 +-- ..._provermarket_diff_prover_and_proposer.txt | 6 +- ...prover_and_proposer_fee_above_liveness.txt | 6 +- ...me_prover_as_proposer_measure_gas_used.txt | 6 +- .../inbox_without_provermarket.txt | 6 +- .../protocol/gas-reports/layer1-contracts.txt | 78 +++++++++---------- .../test/layer1/based/InboxTest_Params.t.sol | 1 - .../layer1/preconf/mocks/MockTaikoInbox.sol | 2 +- .../layer1/preconf/router/PreconfRouter.t.sol | 2 - 10 files changed, 54 insertions(+), 69 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol index 675b8d6af3b..26dfe1ab8a4 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol @@ -28,8 +28,6 @@ interface ITaikoInbox is IBondManager, IProveBatches { // the timestamp of the parent block in the same batch. For the first block in a batch, // there is not parent block in the same batch, so the time shift should be 0. uint8 timeShift; - // A value used to mark the block. - uint8 marker; // Signals sent on L1 and need to sync to this L2 block. bytes32[] signalSlots; } @@ -71,7 +69,7 @@ interface ITaikoInbox is IBondManager, IProveBatches { // Data to build L2 blocks BlockParams[] blocks; bytes32[] blobHashes; - bytes32[] extraDataList; + bytes32 extraData; address coinbase; address proposer; uint64 proposedIn; // Used by node/client diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 536a5800ec0..58f6f3712c9 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -164,7 +164,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I // Data to build L2 blocks blocks: params.blocks, blobHashes: new bytes32[](0), // to be initialised later - extraDataList: new bytes32[](0), // to be initliaised later + extraData: bytes32(uint256(config.baseFeeConfig.sharingPctg)), coinbase: params.coinbase, proposer: params.proposer, proposedIn: uint64(block.number), @@ -182,12 +182,6 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I }); uint64 nBlocks = uint64(params.blocks.length); - info_.extraDataList = new bytes32[](nBlocks); - - for (uint256 i; i < nBlocks; ++i) { - info_.extraDataList[i] = - _encodeExtraData(config.baseFeeConfig.sharingPctg, params.blocks[i].marker); - } require(info_.anchorBlockHash != 0, ZeroAnchorBlockHash()); @@ -866,10 +860,6 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } } - function _encodeExtraData(uint8 _sharingPctg, uint8 _marker) internal pure returns (bytes32) { - return bytes32(uint256(_marker) << 8 | _sharingPctg); - } - // Memory-only structs ---------------------------------------------------------------------- struct SyncBlock { diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index f4d681a32b7..abbb74fc6bb 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 206845 -Gas per proving + verification: 158573 -Total: 365418 \ No newline at end of file +Gas per proposing: 189605 +Gas per proving + verification: 158541 +Total: 348146 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index 6b37ec8aa47..d0e66aa44fc 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 206694 -Gas per proving + verification: 158579 -Total: 365273 \ No newline at end of file +Gas per proposing: 189454 +Gas per proving + verification: 158547 +Total: 348001 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index accd8ec3d44..47e0a13dd87 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 180514 -Gas per proving + verification: 156437 -Total: 336951 \ No newline at end of file +Gas per proposing: 163274 +Gas per proving + verification: 156407 +Total: 319681 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index 7133df72971..f57beda864f 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 177066 -Gas per proving + verification: 154388 -Total: 331454 \ No newline at end of file +Gas per proposing: 159827 +Gas per proving + verification: 154358 +Total: 314185 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 31f16dccf55..4962744367c 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,59 +23,59 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1070052) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1064167) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1090908) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1065017) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 286063) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019109) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013224) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1039965) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014074) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281649) InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285610) InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154747) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141644) -InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 167060) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1074706) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1863469) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1099861) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 968953) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 14486248) +InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166440) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022373) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760441) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1048923) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 918014) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12529546) InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157150) InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74424) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61924) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 269050) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 969775) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133389) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144859) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 314355) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 324783) -InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133474) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 269334) -InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166230) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8629642) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8960290) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9782987) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 9259890) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 14018956) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10554931) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266156) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919301) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132790) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144260) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310268) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 318914) +InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 132875) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266440) +InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 165781) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8107718) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8422743) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9303728) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8784271) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12044215) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10066881) InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1101647) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 6286514) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049667) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5970959) InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40278) InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 110084) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1360225) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 8278661) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1274531) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15991745) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9937731) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9937776) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9851579) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8835492) -PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 377573) -PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 326172) -PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 375790) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309240) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823621) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223576) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15112348) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9458460) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9458507) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9372313) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8375381) +PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375143) +PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325702) +PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373818) ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116105) ProverMarketTest:test_averageFeeCalculation() (gas: 155249) ProverMarketTest:test_bid() (gas: 90169) diff --git a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol index 409d3cda43b..0ab6fd5b44b 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol @@ -91,7 +91,6 @@ contract InboxTest_Params is InboxTestBase { blocks[0] = ITaikoInbox.BlockParams({ numTransactions: 0, timeShift: 0, - marker: 0, signalSlots: new bytes32[](0) }); diff --git a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol index 3c19173cb7a..23bf44fdd33 100644 --- a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol +++ b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol @@ -28,7 +28,7 @@ contract MockTaikoInbox is EssentialContract { blobHashes: new bytes32[](0), blobByteOffset: 0, blobByteSize: 0, - extraDataList: new bytes32[](params.blocks.length), + extraData: 0, coinbase: params.coinbase == address(0) ? params.proposer : params.coinbase, proposer: params.proposer, gasLimit: 0, // Mock value diff --git a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol index 745f74e71ea..7ee21ba2157 100644 --- a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol +++ b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol @@ -33,7 +33,6 @@ contract PreconfRouterTest is PreconfRouterTestBase { blockParams[0] = ITaikoInbox.BlockParams({ numTransactions: 1, timeShift: 1, - marker: 0, signalSlots: new bytes32[](0) }); @@ -121,7 +120,6 @@ contract PreconfRouterTest is PreconfRouterTestBase { blockParams[0] = ITaikoInbox.BlockParams({ numTransactions: 1, timeShift: 1, - marker: 0, signalSlots: new bytes32[](0) }); From 7729aad40890a9bc6e2f465f73eee03ac9f7acbe Mon Sep 17 00:00:00 2001 From: Anshu Jalan Date: Tue, 22 Apr 2025 15:08:43 +0530 Subject: [PATCH 07/16] chore(protocol): remove unused packages and add urc remapping (#19321) --- packages/protocol/foundry.toml | 3 +- packages/protocol/package.json | 2 - pnpm-lock.yaml | 862 ++------------------------------- 3 files changed, 38 insertions(+), 829 deletions(-) diff --git a/packages/protocol/foundry.toml b/packages/protocol/foundry.toml index 0612192f2fa..28d5cc24392 100644 --- a/packages/protocol/foundry.toml +++ b/packages/protocol/foundry.toml @@ -20,8 +20,7 @@ remappings = [ "forge-std/=node_modules/forge-std/", "ds-test/=node_modules/ds-test/src/", "@p256-verifier/contracts/=node_modules/p256-verifier/src/", - "eigenlayer-middleware/=node_modules/eigenlayer-middleware/", - "eigenlayer-contracts/=node_modules/eigenlayer-contracts/", + "@eth-fabric/urc/=node_modules/urc/src/", "src/=contracts/", "test/=test/", "script/=script/", diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 05406ba3114..b052ac7fe50 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -47,8 +47,6 @@ "@openzeppelin/contracts": "4.9.6", "@openzeppelin/contracts-upgradeable": "4.9.6", "ds-test": "github:dapphub/ds-test#e282159d5170298eb2455a6c05280ab5a73a4ef0", - "eigenlayer-contracts": "github:Layr-labs/eigenlayer-contracts#dev", - "eigenlayer-middleware": "github:layr-Labs/eigenlayer-middleware#mainnet", "forge-std": "github:foundry-rs/forge-std#v1.9.5", "merkletreejs": "^0.4.0", "optimism": "github:ethereum-optimism/optimism#v1.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 65013b2daae..410b1216d9d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: version: 2.6.2(@types/react@18.3.3)(react@18.3.1) '@web3modal/wagmi': specifier: ^4.1.11 - version: 4.1.11(9ecc8b7aeee8c74c3518124cbf094f4f) + version: 4.1.11(465hcphkttv2p5txznqylpmnwa) '@zerodevx/svelte-toast': specifier: ^0.9.5 version: 0.9.5(svelte@4.2.15) @@ -422,12 +422,6 @@ importers: ds-test: specifier: github:dapphub/ds-test#e282159d5170298eb2455a6c05280ab5a73a4ef0 version: https://codeload.github.com/dapphub/ds-test/tar.gz/e282159d5170298eb2455a6c05280ab5a73a4ef0 - eigenlayer-contracts: - specifier: github:Layr-labs/eigenlayer-contracts#dev - version: https://codeload.github.com/Layr-labs/eigenlayer-contracts/tar.gz/ecaff6304de6cb0f43b42024ad55d0e8a0430790(hardhat@2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - eigenlayer-middleware: - specifier: github:layr-Labs/eigenlayer-middleware#mainnet - version: https://codeload.github.com/layr-Labs/eigenlayer-middleware/tar.gz/fe5834371caed60c1d26ab62b5519b0cbdcb42fa forge-std: specifier: github:foundry-rs/forge-std#v1.9.5 version: https://codeload.github.com/foundry-rs/forge-std/tar.gz/b93cf4bc34ff214c099dc970b153f85ade8c9f66 @@ -752,7 +746,7 @@ importers: version: 4.1.11 '@web3modal/wagmi': specifier: ^4.1.1 - version: 4.1.11(eda42001c1d6ea60fc09d76f6c806d0c) + version: 4.1.11(nhv3btjcneav7vr3ub73tnaqau) '@zerodevx/svelte-toast': specifier: ^0.9.5 version: 0.9.5(svelte@4.2.15) @@ -3322,10 +3316,6 @@ packages: resolution: {integrity: sha512-whiUMPlAOrVGmX8aKYVPvlKyG4CpQXiNNyt74vE1xb5sPvmx5oA7B/kOi/JdBvhGQq97U1/AVdXEdk2zkP8qyA==} engines: {node: '>=14.0.0'} - '@metamask/eth-sig-util@4.0.1': - resolution: {integrity: sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==} - engines: {node: '>=12.0.0'} - '@metamask/json-rpc-engine@7.3.3': resolution: {integrity: sha512-dwZPq8wx9yV3IX2caLi9q9xZBw2XeIoYqdyihDDDpuHVCEiqadJLwqM3zy+uwf6F1QYQ65A8aOMQg1Uw7LMLNg==} engines: {node: '>=16.0.0'} @@ -3569,96 +3559,6 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nomicfoundation/edr-darwin-arm64@0.6.4': - resolution: {integrity: sha512-QNQErISLgssV9+qia8sIjRANqtbW8snSDvjspixT/kSQ5ZSGxxctTg7x72wPSrcu8+EBEveIe5uqENIp5GH8HQ==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-darwin-x64@0.6.4': - resolution: {integrity: sha512-cjVmREiwByyc9+oGfvAh49IAw+oVJHF9WWYRD+Tm/ZlSpnEVWxrGNBak2bd/JSYjn+mZE7gmWS4SMRi4nKaLUg==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-linux-arm64-gnu@0.6.4': - resolution: {integrity: sha512-96o9kRIVD6W5VkgKvUOGpWyUGInVQ5BRlME2Fa36YoNsRQMaKtmYJEU0ACosYES6ZTpYC8U5sjMulvPtVoEfOA==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-linux-arm64-musl@0.6.4': - resolution: {integrity: sha512-+JVEW9e5plHrUfQlSgkEj/UONrIU6rADTEk+Yp9pbe+mzNkJdfJYhs5JYiLQRP4OjxH4QOrXI97bKU6FcEbt5Q==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-linux-x64-gnu@0.6.4': - resolution: {integrity: sha512-nzYWW+fO3EZItOeP4CrdMgDXfaGBIBkKg0Y/7ySpUxLqzut40O4Mb0/+quqLAFkacUSWMlFp8nsmypJfOH5zoA==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-linux-x64-musl@0.6.4': - resolution: {integrity: sha512-QFRoE9qSQ2boRrVeQ1HdzU+XN7NUgwZ1SIy5DQt4d7jCP+5qTNsq8LBNcqhRBOATgO63nsweNUhxX/Suj5r1Sw==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr-win32-x64-msvc@0.6.4': - resolution: {integrity: sha512-2yopjelNkkCvIjUgBGhrn153IBPLwnsDeNiq6oA0WkeM8tGmQi4td+PGi9jAriUDAkc59Yoi2q9hYA6efiY7Zw==} - engines: {node: '>= 18'} - - '@nomicfoundation/edr@0.6.4': - resolution: {integrity: sha512-YgrSuT3yo5ZQkbvBGqQ7hG+RDvz3YygSkddg4tb1Z0Y6pLXFzwrcEwWaJCFAVeeZxdxGfCgGMUYgRVneK+WXkw==} - engines: {node: '>= 18'} - - '@nomicfoundation/ethereumjs-common@4.0.4': - resolution: {integrity: sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==} - - '@nomicfoundation/ethereumjs-rlp@5.0.4': - resolution: {integrity: sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==} - engines: {node: '>=18'} - hasBin: true - - '@nomicfoundation/ethereumjs-tx@5.0.4': - resolution: {integrity: sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==} - engines: {node: '>=18'} - peerDependencies: - c-kzg: ^2.1.2 - peerDependenciesMeta: - c-kzg: - optional: true - - '@nomicfoundation/ethereumjs-util@9.0.4': - resolution: {integrity: sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==} - engines: {node: '>=18'} - peerDependencies: - c-kzg: ^2.1.2 - peerDependenciesMeta: - c-kzg: - optional: true - - '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2': - resolution: {integrity: sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2': - resolution: {integrity: sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2': - resolution: {integrity: sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2': - resolution: {integrity: sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2': - resolution: {integrity: sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2': - resolution: {integrity: sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2': - resolution: {integrity: sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==} - engines: {node: '>= 12'} - - '@nomicfoundation/solidity-analyzer@0.1.2': - resolution: {integrity: sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==} - engines: {node: '>= 12'} - '@openzeppelin/contracts-upgradeable@4.9.6': resolution: {integrity: sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA==} @@ -4132,34 +4032,6 @@ packages: '@scure/bip39@1.3.0': resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} - '@sentry/core@5.30.0': - resolution: {integrity: sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==} - engines: {node: '>=6'} - - '@sentry/hub@5.30.0': - resolution: {integrity: sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==} - engines: {node: '>=6'} - - '@sentry/minimal@5.30.0': - resolution: {integrity: sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==} - engines: {node: '>=6'} - - '@sentry/node@5.30.0': - resolution: {integrity: sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==} - engines: {node: '>=6'} - - '@sentry/tracing@5.30.0': - resolution: {integrity: sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==} - engines: {node: '>=6'} - - '@sentry/types@5.30.0': - resolution: {integrity: sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==} - engines: {node: '>=6'} - - '@sentry/utils@5.30.0': - resolution: {integrity: sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==} - engines: {node: '>=6'} - '@shikijs/core@1.12.1': resolution: {integrity: sha512-biCz/mnkMktImI6hMfMX3H9kOeqsInxWEyCHbSlL8C/2TR1FqfmGxTLRNwYCKsyCyxWLbB8rEqXRVZuyxuLFmA==} @@ -4748,9 +4620,6 @@ packages: '@types/babel__traverse@7.20.5': resolution: {integrity: sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==} - '@types/bn.js@4.11.6': - resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} - '@types/bn.js@5.1.5': resolution: {integrity: sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==} @@ -4832,9 +4701,6 @@ packages: '@types/lodash@4.17.7': resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==} - '@types/lru-cache@5.1.1': - resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} - '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} @@ -5509,28 +5375,16 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - adm-zip@0.4.16: - resolution: {integrity: sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==} - engines: {node: '>=0.3.0'} - aes-js@3.0.0: resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - agent-base@7.1.1: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} - aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} - ajv-draft-04@1.0.0: resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} peerDependencies: @@ -5558,10 +5412,6 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - ansi-fragments@0.2.1: resolution: {integrity: sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==} @@ -5864,10 +5714,6 @@ packages: bowser@2.11.0: resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} - boxen@5.1.2: - resolution: {integrity: sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==} - engines: {node: '>=10'} - boxen@7.1.1: resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==} engines: {node: '>=14.16'} @@ -5894,9 +5740,6 @@ packages: browser-readablestream-to-it@2.0.7: resolution: {integrity: sha512-g1Aznml3HmqTLSXylZhGwdfnAa67+vlNAYhT9ROJZkAxY7yYmWusND10olvCMPe4sVhZyVwn5tPkRzOg85kBEg==} - browser-stdout@1.3.1: - resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - browserify-aes@1.2.0: resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} @@ -6110,10 +5953,6 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chokidar@4.0.1: - resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} - engines: {node: '>= 14.16.0'} - chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} @@ -6175,14 +6014,6 @@ packages: class-is@1.1.0: resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} - clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} - - cli-boxes@2.2.1: - resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} - engines: {node: '>=6'} - cli-boxes@3.0.0: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} @@ -6210,9 +6041,6 @@ packages: cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} - cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -6366,10 +6194,6 @@ packages: cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} - cookie@0.4.2: - resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} - engines: {node: '>= 0.6'} - cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} @@ -6561,10 +6385,6 @@ packages: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - decamelize@4.0.0: - resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} - engines: {node: '>=10'} - decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} @@ -6778,14 +6598,6 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - eigenlayer-contracts@https://codeload.github.com/Layr-labs/eigenlayer-contracts/tar.gz/ecaff6304de6cb0f43b42024ad55d0e8a0430790: - resolution: {tarball: https://codeload.github.com/Layr-labs/eigenlayer-contracts/tar.gz/ecaff6304de6cb0f43b42024ad55d0e8a0430790} - version: 1.0.0 - - eigenlayer-middleware@https://codeload.github.com/layr-Labs/eigenlayer-middleware/tar.gz/fe5834371caed60c1d26ab62b5519b0cbdcb42fa: - resolution: {tarball: https://codeload.github.com/layr-Labs/eigenlayer-middleware/tar.gz/fe5834371caed60c1d26ab62b5519b0cbdcb42fa} - version: 0.0.0 - electron-fetch@1.9.1: resolution: {integrity: sha512-M9qw6oUILGVrcENMSRRefE1MbHPIz0h79EKIeJWK9v563aT9Qkh8aEHPO1H5vi970wPirNY+jO9OpFoLiMsMGA==} engines: {node: '>=6'} @@ -6845,10 +6657,6 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - env-paths@2.2.1: - resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} - engines: {node: '>=6'} - envinfo@7.13.0: resolution: {integrity: sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q==} engines: {node: '>=4'} @@ -7237,13 +7045,6 @@ packages: ethereum-cryptography@2.1.3: resolution: {integrity: sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA==} - ethereumjs-abi@0.6.8: - resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} - deprecated: This library has been deprecated and usage is discouraged. - - ethereumjs-util@6.2.1: - resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==} - ethereumjs-util@7.1.5: resolution: {integrity: sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==} engines: {node: '>=10.0.0'} @@ -7259,10 +7060,6 @@ packages: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} - ethjs-util@0.1.6: - resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} - engines: {node: '>=6.5.0', npm: '>=3'} - event-emitter@0.3.5: resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} @@ -7427,10 +7224,6 @@ packages: resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} engines: {node: '>=18'} - find-up@2.1.0: - resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} - engines: {node: '>=4'} - find-up@3.0.0: resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} engines: {node: '>=6'} @@ -7458,10 +7251,6 @@ packages: resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==} hasBin: true - flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} @@ -7526,9 +7315,6 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} - fp-ts@1.19.3: - resolution: {integrity: sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==} - fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} @@ -7660,10 +7446,6 @@ packages: engines: {node: 20 || >=22} hasBin: true - glob@7.2.0: - resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} - deprecated: Glob versions prior to v9 are no longer supported - glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} @@ -7738,11 +7520,6 @@ packages: h3@1.11.1: resolution: {integrity: sha512-AbaH6IDnZN6nmbnJOH72y3c5Wwh9P97soSVdGSBbcDACRdkC0FEWf25pzx4f/NuOCK6quHmW18yF2Wx+G4Zi1A==} - handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - har-schema@2.0.0: resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} engines: {node: '>=4'} @@ -7752,18 +7529,6 @@ packages: engines: {node: '>=6'} deprecated: this library is no longer supported - hardhat@2.22.15: - resolution: {integrity: sha512-BpTGa9PE/sKAaHi4s/S1e9WGv63DR1m7Lzfd60C8gSEchDPfAJssVRSq0MZ2v2k76ig9m0kHAwVLf5teYwu/Mw==} - hasBin: true - peerDependencies: - ts-node: '*' - typescript: '*' - peerDependenciesMeta: - ts-node: - optional: true - typescript: - optional: true - has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} @@ -7864,10 +7629,6 @@ packages: hastscript@9.0.0: resolution: {integrity: sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw==} - he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - header-case@2.0.4: resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==} @@ -7945,10 +7706,6 @@ packages: resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - https-proxy-agent@7.0.4: resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} engines: {node: '>= 14'} @@ -8011,9 +7768,6 @@ packages: immediate@3.0.6: resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - immutable@4.3.7: - resolution: {integrity: sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==} - import-fresh@2.0.0: resolution: {integrity: sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==} engines: {node: '>=4'} @@ -8072,9 +7826,6 @@ packages: invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} - io-ts@1.10.4: - resolution: {integrity: sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==} - ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -8574,10 +8325,6 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - json-stream-stringify@3.1.6: - resolution: {integrity: sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==} - engines: {node: '>=7.10.1'} - json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} @@ -8752,10 +8499,6 @@ packages: locate-character@3.0.0: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - locate-path@2.0.0: - resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} - engines: {node: '>=4'} - locate-path@3.0.0: resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} engines: {node: '>=6'} @@ -8857,9 +8600,6 @@ packages: lru-queue@0.1.0: resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} - lru_map@0.3.3: - resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} - lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true @@ -9331,14 +9071,6 @@ packages: mlly@1.7.1: resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} - mnemonist@0.38.5: - resolution: {integrity: sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==} - - mocha@10.7.3: - resolution: {integrity: sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==} - engines: {node: '>= 14.0.0'} - hasBin: true - mock-fs@4.14.0: resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} @@ -9606,9 +9338,6 @@ packages: resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} - obliterator@2.0.4: - resolution: {integrity: sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==} - oboe@2.1.5: resolution: {integrity: sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA==} @@ -9710,10 +9439,6 @@ packages: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} - p-limit@1.3.0: - resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} - engines: {node: '>=4'} - p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} @@ -9734,10 +9459,6 @@ packages: resolution: {integrity: sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==} engines: {node: '>=18'} - p-locate@2.0.0: - resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} - engines: {node: '>=4'} - p-locate@3.0.0: resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} engines: {node: '>=6'} @@ -9758,10 +9479,6 @@ packages: resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} engines: {node: '>=6'} - p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} - p-map@7.0.2: resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} engines: {node: '>=18'} @@ -9774,10 +9491,6 @@ packages: resolution: {integrity: sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==} engines: {node: '>=14.16'} - p-try@1.0.0: - resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} - engines: {node: '>=4'} - p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} @@ -10369,10 +10082,6 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} - readdirp@4.0.2: - resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} - engines: {node: '>= 14.16.0'} - readline@1.3.0: resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} @@ -10528,9 +10237,6 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve@1.17.0: - resolution: {integrity: sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==} - resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -10725,9 +10431,6 @@ packages: resolution: {integrity: sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==} engines: {node: '>=0.10.0'} - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} engines: {node: '>= 0.8.0'} @@ -10877,11 +10580,6 @@ packages: engines: {node: '>=10.0.0'} hasBin: true - solc@0.8.26: - resolution: {integrity: sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==} - engines: {node: '>=10.0.0'} - hasBin: true - solhint@4.5.4: resolution: {integrity: sha512-Cu1XiJXub2q1eCr9kkJ9VPv1sGcmj3V7Zb76B0CoezDOB9bu3DxKIFFH7ggCl9fWpEPD6xBmRLfZrYijkVmujQ==} hasBin: true @@ -10890,14 +10588,6 @@ packages: resolution: {integrity: sha512-WrnG6T+/UduuzSWsSOAbfq1ywLUDwNea3Gd5hg6PS+pLUm8lz2ECNr0beX609clBxmDeZ3676AiA9nPDljmbJQ==} hasBin: true - solidity-ast@0.4.59: - resolution: {integrity: sha512-I+CX0wrYUN9jDfYtcgWSe+OAowaXy8/1YQy7NS4ni5IBDmIYBq7ZzaP/7QqouLjzZapmQtvGLqCaYgoUWqBo5g==} - - solidity-docgen@0.6.0-beta.36: - resolution: {integrity: sha512-f/I5G2iJgU1h0XrrjRD0hHMr7C10u276vYvm//rw1TzFcYQ4xTOyAoi9oNAHRU0JU4mY9eTuxdVc2zahdMuhaQ==} - peerDependencies: - hardhat: ^2.8.0 - solidity-stringutils@https://codeload.github.com/Arachnid/solidity-stringutils/tar.gz/4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461: resolution: {tarball: https://codeload.github.com/Arachnid/solidity-stringutils/tar.gz/4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461} version: 0.0.0 @@ -11465,9 +11155,6 @@ packages: tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - tsort@0.0.1: - resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} - tsutils@3.21.0: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -11484,15 +11171,9 @@ packages: tween-functions@1.2.0: resolution: {integrity: sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==} - tweetnacl-util@0.15.1: - resolution: {integrity: sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==} - tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} - tweetnacl@1.0.3: - resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} - type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -11505,10 +11186,6 @@ packages: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - type-fest@0.7.1: resolution: {integrity: sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==} engines: {node: '>=8'} @@ -11561,11 +11238,6 @@ packages: ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} - uglify-js@3.19.3: - resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} - engines: {node: '>=0.8.0'} - hasBin: true - uint8-varint@2.0.4: resolution: {integrity: sha512-FwpTa7ZGA/f/EssWAb5/YV6pHgVF1fViKdW8cWaEarjB8t7NyofSWBdOTyFPaGuUG4gx3v1O3PQ8etsiOs3lcw==} @@ -12296,10 +11968,6 @@ packages: engines: {node: '>=8'} hasBin: true - widest-line@3.1.0: - resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} - engines: {node: '>=8'} - widest-line@4.0.1: resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} engines: {node: '>=12'} @@ -12312,12 +11980,6 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - - workerpool@6.5.1: - resolution: {integrity: sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==} - wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -12496,26 +12158,14 @@ packages: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} - yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - yargs-unparser@2.0.0: - resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} - engines: {node: '>=10'} - yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} - yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -12711,7 +12361,7 @@ snapshots: '@astrojs/telemetry@3.1.0': dependencies: ci-info: 4.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 dlv: 1.1.3 dset: 3.1.3 is-docker: 3.0.0 @@ -12793,7 +12443,7 @@ snapshots: '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-bucket-endpoint': 3.577.0 '@aws-sdk/middleware-expect-continue': 3.577.0 '@aws-sdk/middleware-flexible-checksums': 3.577.0 @@ -12854,7 +12504,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -12943,7 +12593,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -13011,12 +12661,12 @@ snapshots: '@smithy/util-stream': 3.0.1 tslib: 2.7.0 - '@aws-sdk/credential-provider-ini@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0)': + '@aws-sdk/credential-provider-ini@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0)': dependencies: '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) + '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -13028,13 +12678,13 @@ snapshots: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-node@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0)': + '@aws-sdk/credential-provider-node@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0)': dependencies: '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-http': 3.577.0 - '@aws-sdk/credential-provider-ini': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-ini': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) + '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 @@ -13055,10 +12705,10 @@ snapshots: '@smithy/types': 3.0.0 tslib: 2.7.0 - '@aws-sdk/credential-provider-sso@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': + '@aws-sdk/credential-provider-sso@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))': dependencies: '@aws-sdk/client-sso': 3.577.0 - '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) + '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 @@ -13195,7 +12845,7 @@ snapshots: '@smithy/types': 3.0.0 tslib: 2.6.2 - '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': + '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))': dependencies: '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 @@ -13294,7 +12944,7 @@ snapshots: '@babel/traverse': 7.25.3 '@babel/types': 7.25.2 convert-source-map: 2.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -13388,7 +13038,7 @@ snapshots: '@babel/core': 7.24.5 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.5 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -13399,7 +13049,7 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-compilation-targets': 7.23.6 '@babel/helper-plugin-utils': 7.24.5 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -14819,7 +14469,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.5 '@babel/parser': 7.24.5 '@babel/types': 7.24.5 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -14831,7 +14481,7 @@ snapshots: '@babel/parser': 7.25.3 '@babel/template': 7.25.0 '@babel/types': 7.25.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -15469,7 +15119,7 @@ snapshots: '@eslint/eslintrc@1.4.1': dependencies: ajv: 6.12.6 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -15849,7 +15499,7 @@ snapshots: '@humanwhocodes/config-array@0.9.5': dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -16168,14 +15818,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@metamask/eth-sig-util@4.0.1': - dependencies: - ethereumjs-abi: 0.6.8 - ethereumjs-util: 6.2.1 - ethjs-util: 0.1.6 - tweetnacl: 1.0.3 - tweetnacl-util: 0.15.1 - '@metamask/json-rpc-engine@7.3.3': dependencies: '@metamask/rpc-errors': 6.2.1 @@ -16269,7 +15911,7 @@ snapshots: bufferutil: 4.0.8 cross-fetch: 4.0.0(encoding@0.1.13) date-fns: 2.30.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 eciesjs: 0.3.18 eventemitter2: 6.4.9 readable-stream: 3.6.2 @@ -16284,7 +15926,7 @@ snapshots: bufferutil: 4.0.8 cross-fetch: 4.0.0(encoding@0.1.13) date-fns: 2.30.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 eciesjs: 0.3.18 eventemitter2: 6.4.9 readable-stream: 3.6.2 @@ -16434,7 +16076,7 @@ snapshots: dependencies: '@ethereumjs/tx': 4.2.0 '@types/debug': 4.1.12 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 semver: 7.6.3 superstruct: 1.0.4 transitivePeerDependencies: @@ -16446,7 +16088,7 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 '@types/debug': 4.1.12 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 pony-cause: 2.1.11 semver: 7.6.3 superstruct: 1.0.4 @@ -16681,81 +16323,6 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nomicfoundation/edr-darwin-arm64@0.6.4': {} - - '@nomicfoundation/edr-darwin-x64@0.6.4': {} - - '@nomicfoundation/edr-linux-arm64-gnu@0.6.4': {} - - '@nomicfoundation/edr-linux-arm64-musl@0.6.4': {} - - '@nomicfoundation/edr-linux-x64-gnu@0.6.4': {} - - '@nomicfoundation/edr-linux-x64-musl@0.6.4': {} - - '@nomicfoundation/edr-win32-x64-msvc@0.6.4': {} - - '@nomicfoundation/edr@0.6.4': - dependencies: - '@nomicfoundation/edr-darwin-arm64': 0.6.4 - '@nomicfoundation/edr-darwin-x64': 0.6.4 - '@nomicfoundation/edr-linux-arm64-gnu': 0.6.4 - '@nomicfoundation/edr-linux-arm64-musl': 0.6.4 - '@nomicfoundation/edr-linux-x64-gnu': 0.6.4 - '@nomicfoundation/edr-linux-x64-musl': 0.6.4 - '@nomicfoundation/edr-win32-x64-msvc': 0.6.4 - - '@nomicfoundation/ethereumjs-common@4.0.4': - dependencies: - '@nomicfoundation/ethereumjs-util': 9.0.4 - transitivePeerDependencies: - - c-kzg - - '@nomicfoundation/ethereumjs-rlp@5.0.4': {} - - '@nomicfoundation/ethereumjs-tx@5.0.4': - dependencies: - '@nomicfoundation/ethereumjs-common': 4.0.4 - '@nomicfoundation/ethereumjs-rlp': 5.0.4 - '@nomicfoundation/ethereumjs-util': 9.0.4 - ethereum-cryptography: 0.1.3 - - '@nomicfoundation/ethereumjs-util@9.0.4': - dependencies: - '@nomicfoundation/ethereumjs-rlp': 5.0.4 - ethereum-cryptography: 0.1.3 - - '@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2': - optional: true - - '@nomicfoundation/solidity-analyzer@0.1.2': - optionalDependencies: - '@nomicfoundation/solidity-analyzer-darwin-arm64': 0.1.2 - '@nomicfoundation/solidity-analyzer-darwin-x64': 0.1.2 - '@nomicfoundation/solidity-analyzer-linux-arm64-gnu': 0.1.2 - '@nomicfoundation/solidity-analyzer-linux-arm64-musl': 0.1.2 - '@nomicfoundation/solidity-analyzer-linux-x64-gnu': 0.1.2 - '@nomicfoundation/solidity-analyzer-linux-x64-musl': 0.1.2 - '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.2 - '@openzeppelin/contracts-upgradeable@4.9.6': {} '@openzeppelin/contracts-upgradeable@5.0.2(@openzeppelin/contracts@5.0.2)': @@ -17551,55 +17118,6 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 - '@sentry/core@5.30.0': - dependencies: - '@sentry/hub': 5.30.0 - '@sentry/minimal': 5.30.0 - '@sentry/types': 5.30.0 - '@sentry/utils': 5.30.0 - tslib: 1.14.1 - - '@sentry/hub@5.30.0': - dependencies: - '@sentry/types': 5.30.0 - '@sentry/utils': 5.30.0 - tslib: 1.14.1 - - '@sentry/minimal@5.30.0': - dependencies: - '@sentry/hub': 5.30.0 - '@sentry/types': 5.30.0 - tslib: 1.14.1 - - '@sentry/node@5.30.0': - dependencies: - '@sentry/core': 5.30.0 - '@sentry/hub': 5.30.0 - '@sentry/tracing': 5.30.0 - '@sentry/types': 5.30.0 - '@sentry/utils': 5.30.0 - cookie: 0.4.2 - https-proxy-agent: 5.0.1 - lru_map: 0.3.3 - tslib: 1.14.1 - transitivePeerDependencies: - - supports-color - - '@sentry/tracing@5.30.0': - dependencies: - '@sentry/hub': 5.30.0 - '@sentry/minimal': 5.30.0 - '@sentry/types': 5.30.0 - '@sentry/utils': 5.30.0 - tslib: 1.14.1 - - '@sentry/types@5.30.0': {} - - '@sentry/utils@5.30.0': - dependencies: - '@sentry/types': 5.30.0 - tslib: 1.14.1 - '@shikijs/core@1.12.1': dependencies: '@types/hast': 3.0.4 @@ -18587,10 +18105,6 @@ snapshots: dependencies: '@babel/types': 7.25.2 - '@types/bn.js@4.11.6': - dependencies: - '@types/node': 20.12.8 - '@types/bn.js@5.1.5': dependencies: '@types/node': 20.12.8 @@ -18689,8 +18203,6 @@ snapshots: '@types/lodash@4.17.7': {} - '@types/lru-cache@5.1.1': {} - '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.2 @@ -18854,7 +18366,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -20420,7 +19932,7 @@ snapshots: lit: 3.1.0 qrcode: 1.5.3 - '@web3modal/wagmi@4.1.11(9ecc8b7aeee8c74c3518124cbf094f4f)': + '@web3modal/wagmi@4.1.11(465hcphkttv2p5txznqylpmnwa)': dependencies: '@wagmi/connectors': 4.3.3(@types/react@18.3.3)(@wagmi/core@2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8))(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@23.11.5)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.17.2)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) '@wagmi/core': 2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.9.31(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) @@ -20437,7 +19949,7 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@web3modal/wagmi@4.1.11(eda42001c1d6ea60fc09d76f6c806d0c)': + '@web3modal/wagmi@4.1.11(nhv3btjcneav7vr3ub73tnaqau)': dependencies: '@wagmi/connectors': 4.3.3(@types/react@18.3.3)(@wagmi/core@2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6))(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.3.1(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1))(react-native@0.74.1(@babel/core@7.25.2)(@babel/preset-env@7.24.5(@babel/core@7.25.2))(@types/react@18.3.3)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)(utf-8-validate@5.0.10))(react@18.3.1)(rollup@4.17.2)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6) '@wagmi/core': 2.9.1(@types/react@18.3.3)(bufferutil@4.0.8)(react@18.3.1)(typescript@5.4.5)(utf-8-validate@5.0.10)(viem@2.18.8(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.6))(zod@3.23.6) @@ -20575,29 +20087,16 @@ snapshots: acorn@8.12.1: {} - adm-zip@0.4.16: {} - aes-js@3.0.0: {} aes-js@4.0.0-beta.5: {} - agent-base@6.0.2: - dependencies: - debug: 4.3.6(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - agent-base@7.1.1: dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 transitivePeerDependencies: - supports-color - aggregate-error@3.1.0: - dependencies: - clean-stack: 2.2.0 - indent-string: 4.0.0 - ajv-draft-04@1.0.0(ajv@8.13.0): optionalDependencies: ajv: 8.13.0 @@ -20634,10 +20133,6 @@ snapshots: ansi-colors@4.1.3: {} - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - ansi-fragments@0.2.1: dependencies: colorette: 1.4.0 @@ -20804,7 +20299,7 @@ snapshots: common-ancestor-path: 1.0.1 cookie: 0.6.0 cssesc: 3.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 deterministic-object-hash: 2.0.2 devalue: 5.0.0 diff: 5.2.0 @@ -21076,17 +20571,6 @@ snapshots: bowser@2.11.0: {} - boxen@5.1.2: - dependencies: - ansi-align: 3.0.1 - camelcase: 6.3.0 - chalk: 4.1.2 - cli-boxes: 2.2.1 - string-width: 4.2.3 - type-fest: 0.20.2 - widest-line: 3.1.0 - wrap-ansi: 7.0.0 - boxen@7.1.1: dependencies: ansi-align: 3.0.1 @@ -21119,8 +20603,6 @@ snapshots: browser-readablestream-to-it@2.0.7: {} - browser-stdout@1.3.1: {} - browserify-aes@1.2.0: dependencies: buffer-xor: 1.0.3 @@ -21366,10 +20848,6 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chokidar@4.0.1: - dependencies: - readdirp: 4.0.2 - chownr@1.1.4: {} chownr@2.0.0: {} @@ -21412,10 +20890,6 @@ snapshots: class-is@1.1.0: {} - clean-stack@2.2.0: {} - - cli-boxes@2.2.1: {} - cli-boxes@3.0.0: {} cli-color@2.0.4: @@ -21448,12 +20922,6 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 6.2.0 - cliui@7.0.4: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -21602,8 +21070,6 @@ snapshots: cookie-signature@1.0.6: {} - cookie@0.4.2: {} - cookie@0.6.0: {} core-js-compat@3.37.0: @@ -21800,16 +21266,12 @@ snapshots: dependencies: ms: 2.1.2 - debug@4.3.6(supports-color@8.1.1): + debug@4.3.6: dependencies: ms: 2.1.2 - optionalDependencies: - supports-color: 8.1.1 decamelize@1.2.0: {} - decamelize@4.0.0: {} - decimal.js@10.4.3: {} decode-named-character-reference@1.0.2: @@ -21994,14 +21456,6 @@ snapshots: ee-first@1.1.1: {} - eigenlayer-contracts@https://codeload.github.com/Layr-labs/eigenlayer-contracts/tar.gz/ecaff6304de6cb0f43b42024ad55d0e8a0430790(hardhat@2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): - dependencies: - solidity-docgen: 0.6.0-beta.36(hardhat@2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)) - transitivePeerDependencies: - - hardhat - - eigenlayer-middleware@https://codeload.github.com/layr-Labs/eigenlayer-middleware/tar.gz/fe5834371caed60c1d26ab62b5519b0cbdcb42fa: {} - electron-fetch@1.9.1: dependencies: encoding: 0.1.13 @@ -22056,7 +21510,7 @@ snapshots: engine.io-client@6.5.3(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 engine.io-parser: 5.2.2 ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) xmlhttprequest-ssl: 2.0.0 @@ -22076,8 +21530,6 @@ snapshots: entities@4.5.0: {} - env-paths@2.2.1: {} - envinfo@7.13.0: {} err-code@3.0.1: {} @@ -22205,7 +21657,7 @@ snapshots: esbuild-register@3.6.0(esbuild@0.21.3): dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 esbuild: 0.21.3 transitivePeerDependencies: - supports-color @@ -22553,7 +22005,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 doctrine: 3.0.0 enquirer: 2.4.1 escape-string-regexp: 4.0.0 @@ -22792,21 +22244,6 @@ snapshots: '@scure/bip32': 1.3.3 '@scure/bip39': 1.2.2 - ethereumjs-abi@0.6.8: - dependencies: - bn.js: 4.12.0 - ethereumjs-util: 6.2.1 - - ethereumjs-util@6.2.1: - dependencies: - '@types/bn.js': 4.11.6 - bn.js: 4.12.0 - create-hash: 1.2.0 - elliptic: 6.5.5 - ethereum-cryptography: 0.1.3 - ethjs-util: 0.1.6 - rlp: 2.2.7 - ethereumjs-util@7.1.5: dependencies: '@types/bn.js': 5.1.5 @@ -22869,11 +22306,6 @@ snapshots: bn.js: 4.11.6 number-to-bn: 1.7.0 - ethjs-util@0.1.6: - dependencies: - is-hex-prefixed: 1.0.0 - strip-hex-prefix: 1.0.0 - event-emitter@0.3.5: dependencies: d: 1.0.2 @@ -23096,10 +22528,6 @@ snapshots: find-up-simple@1.0.0: {} - find-up@2.1.0: - dependencies: - locate-path: 2.0.0 - find-up@3.0.0: dependencies: locate-path: 3.0.0 @@ -23134,8 +22562,6 @@ snapshots: dependencies: is-buffer: 2.0.5 - flat@5.0.2: {} - flatted@3.3.1: {} flattie@1.1.1: {} @@ -23148,10 +22574,6 @@ snapshots: optionalDependencies: debug: 4.3.4 - follow-redirects@1.15.6(debug@4.3.6): - optionalDependencies: - debug: 4.3.6(supports-color@8.1.1) - for-each@0.3.3: dependencies: is-callable: 1.2.7 @@ -23187,8 +22609,6 @@ snapshots: forwarded@0.2.0: {} - fp-ts@1.19.3: {} - fraction.js@4.3.7: {} fresh@0.5.2: {} @@ -23328,15 +22748,6 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 2.0.0 - glob@7.2.0: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -23478,15 +22889,6 @@ snapshots: transitivePeerDependencies: - uWebSockets.js - handlebars@4.7.8: - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.19.3 - har-schema@2.0.0: {} har-validator@5.1.5: @@ -23494,61 +22896,6 @@ snapshots: ajv: 6.12.6 har-schema: 2.0.0 - hardhat@2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10): - dependencies: - '@ethersproject/abi': 5.7.0 - '@metamask/eth-sig-util': 4.0.1 - '@nomicfoundation/edr': 0.6.4 - '@nomicfoundation/ethereumjs-common': 4.0.4 - '@nomicfoundation/ethereumjs-tx': 5.0.4 - '@nomicfoundation/ethereumjs-util': 9.0.4 - '@nomicfoundation/solidity-analyzer': 0.1.2 - '@sentry/node': 5.30.0 - '@types/bn.js': 5.1.5 - '@types/lru-cache': 5.1.1 - adm-zip: 0.4.16 - aggregate-error: 3.1.0 - ansi-escapes: 4.3.2 - boxen: 5.1.2 - chalk: 2.4.2 - chokidar: 4.0.1 - ci-info: 2.0.0 - debug: 4.3.6(supports-color@8.1.1) - enquirer: 2.4.1 - env-paths: 2.2.1 - ethereum-cryptography: 1.2.0 - ethereumjs-abi: 0.6.8 - find-up: 2.1.0 - fp-ts: 1.19.3 - fs-extra: 7.0.1 - glob: 7.2.0 - immutable: 4.3.7 - io-ts: 1.10.4 - json-stream-stringify: 3.1.6 - keccak: 3.0.4 - lodash: 4.17.21 - mnemonist: 0.38.5 - mocha: 10.7.3 - p-map: 4.0.0 - raw-body: 2.5.2 - resolve: 1.17.0 - semver: 6.3.1 - solc: 0.8.26(debug@4.3.6) - source-map-support: 0.5.21 - stacktrace-parser: 0.1.10 - tsort: 0.0.1 - undici: 5.28.4 - uuid: 8.3.2 - ws: 7.5.9(bufferutil@4.0.8)(utf-8-validate@5.0.10) - optionalDependencies: - ts-node: 10.9.2(@types/node@20.12.8)(typescript@5.4.5) - typescript: 5.4.5 - transitivePeerDependencies: - - bufferutil - - c-kzg - - supports-color - - utf-8-validate - has-bigints@1.0.2: {} has-flag@3.0.0: {} @@ -23769,8 +23116,6 @@ snapshots: property-information: 6.5.0 space-separated-tokens: 2.0.2 - he@1.2.0: {} - header-case@2.0.4: dependencies: capital-case: 1.0.4 @@ -23860,13 +23205,6 @@ snapshots: quick-lru: 5.1.1 resolve-alpn: 1.2.1 - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.3.6(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - https-proxy-agent@7.0.4: dependencies: agent-base: 7.1.1 @@ -23922,8 +23260,6 @@ snapshots: immediate@3.0.6: {} - immutable@4.3.7: {} - import-fresh@2.0.0: dependencies: caller-path: 2.0.0 @@ -23985,10 +23321,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - io-ts@1.10.4: - dependencies: - fp-ts: 1.19.3 - ipaddr.js@1.9.1: {} ipfs-core-types@0.14.1: @@ -24599,8 +23931,6 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} - json-stream-stringify@3.1.6: {} - json-stringify-safe@5.0.1: {} json-to-ast@2.1.0: @@ -24802,11 +24132,6 @@ snapshots: locate-character@3.0.0: {} - locate-path@2.0.0: - dependencies: - p-locate: 2.0.0 - path-exists: 3.0.0 - locate-path@3.0.0: dependencies: p-locate: 3.0.0 @@ -24902,8 +24227,6 @@ snapshots: dependencies: es5-ext: 0.10.64 - lru_map@0.3.3: {} - lz-string@1.5.0: {} magic-string@0.30.10: @@ -25606,7 +24929,7 @@ snapshots: micromark@4.0.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.1 @@ -25770,33 +25093,6 @@ snapshots: pkg-types: 1.1.3 ufo: 1.5.3 - mnemonist@0.38.5: - dependencies: - obliterator: 2.0.4 - - mocha@10.7.3: - dependencies: - ansi-colors: 4.1.3 - browser-stdout: 1.3.1 - chokidar: 3.6.0 - debug: 4.3.6(supports-color@8.1.1) - diff: 5.2.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 8.1.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.1.6 - ms: 2.1.3 - serialize-javascript: 6.0.2 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.5.1 - yargs: 16.2.0 - yargs-parser: 20.2.9 - yargs-unparser: 2.0.0 - mock-fs@4.14.0: {} moralis@2.26.1(debug@4.3.4): @@ -26043,8 +25339,6 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.0.0 - obliterator@2.0.4: {} - oboe@2.1.5: dependencies: http-https: 1.0.0 @@ -26168,10 +25462,6 @@ snapshots: dependencies: p-map: 2.1.0 - p-limit@1.3.0: - dependencies: - p-try: 1.0.0 - p-limit@2.3.0: dependencies: p-try: 2.2.0 @@ -26192,10 +25482,6 @@ snapshots: dependencies: yocto-queue: 1.1.1 - p-locate@2.0.0: - dependencies: - p-limit: 1.3.0 - p-locate@3.0.0: dependencies: p-limit: 2.3.0 @@ -26214,10 +25500,6 @@ snapshots: p-map@2.1.0: {} - p-map@4.0.0: - dependencies: - aggregate-error: 3.1.0 - p-map@7.0.2: {} p-queue@8.0.1: @@ -26227,8 +25509,6 @@ snapshots: p-timeout@6.1.2: {} - p-try@1.0.0: {} - p-try@2.2.0: {} p256-verifier#v0.1.0@https://codeload.github.com/taikoxyz/p256-verifier/tar.gz/6ef45b117642786b08a37b4c37c6a6ce151166da: {} @@ -26906,8 +26186,6 @@ snapshots: dependencies: picomatch: 2.3.1 - readdirp@4.0.2: {} - readline@1.3.0: {} real-require@0.1.0: {} @@ -27147,10 +26425,6 @@ snapshots: resolve-pkg-maps@1.0.0: {} - resolve@1.17.0: - dependencies: - path-parse: 1.0.7 - resolve@1.22.8: dependencies: is-core-module: 2.13.1 @@ -27384,10 +26658,6 @@ snapshots: serialize-error@2.1.0: {} - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 - serve-static@1.15.0: dependencies: encodeurl: 1.0.2 @@ -27564,7 +26834,7 @@ snapshots: socket.io-client@4.7.5(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 engine.io-client: 6.5.3(bufferutil@4.0.8)(utf-8-validate@5.0.10) socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -27575,7 +26845,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -27595,18 +26865,6 @@ snapshots: transitivePeerDependencies: - debug - solc@0.8.26(debug@4.3.6): - dependencies: - command-exists: 1.2.9 - commander: 8.3.0 - follow-redirects: 1.15.6(debug@4.3.6) - js-sha3: 0.8.0 - memorystream: 0.3.1 - semver: 5.7.2 - tmp: 0.0.33 - transitivePeerDependencies: - - debug - solhint@4.5.4(typescript@5.4.5): dependencies: '@solidity-parser/parser': 0.18.0 @@ -27657,14 +26915,6 @@ snapshots: transitivePeerDependencies: - typescript - solidity-ast@0.4.59: {} - - solidity-docgen@0.6.0-beta.36(hardhat@2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)): - dependencies: - handlebars: 4.7.8 - hardhat: 2.22.15(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.12.8)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10) - solidity-ast: 0.4.59 - solidity-stringutils@https://codeload.github.com/Arachnid/solidity-stringutils/tar.gz/4b2fcc43fa0426e19ce88b1f1ec16f5903a2e461: {} sonic-boom@2.8.0: @@ -28423,8 +27673,6 @@ snapshots: tslib@2.7.0: {} - tsort@0.0.1: {} - tsutils@3.21.0(typescript@5.4.5): dependencies: tslib: 1.14.1 @@ -28438,12 +27686,8 @@ snapshots: tween-functions@1.2.0: {} - tweetnacl-util@0.15.1: {} - tweetnacl@0.14.5: {} - tweetnacl@1.0.3: {} - type-check@0.4.0: dependencies: prelude-ls: 1.2.1 @@ -28452,8 +27696,6 @@ snapshots: type-fest@0.20.2: {} - type-fest@0.21.3: {} - type-fest@0.7.1: {} type-fest@1.4.0: {} @@ -28513,9 +27755,6 @@ snapshots: ufo@1.5.3: {} - uglify-js@3.19.3: - optional: true - uint8-varint@2.0.4: dependencies: uint8arraylist: 2.4.8 @@ -29571,10 +28810,6 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 - widest-line@3.1.0: - dependencies: - string-width: 4.2.3 - widest-line@4.0.1: dependencies: string-width: 5.1.2 @@ -29590,10 +28825,6 @@ snapshots: word-wrap@1.2.5: {} - wordwrap@1.0.0: {} - - workerpool@6.5.1: {} - wrap-ansi@6.2.0: dependencies: ansi-styles: 4.3.0 @@ -29733,17 +28964,8 @@ snapshots: camelcase: 5.3.1 decamelize: 1.2.0 - yargs-parser@20.2.9: {} - yargs-parser@21.1.1: {} - yargs-unparser@2.0.0: - dependencies: - camelcase: 6.3.0 - decamelize: 4.0.0 - flat: 5.0.2 - is-plain-obj: 2.1.0 - yargs@15.4.1: dependencies: cliui: 6.0.0 @@ -29758,16 +28980,6 @@ snapshots: y18n: 4.0.3 yargs-parser: 18.1.3 - yargs@16.2.0: - dependencies: - cliui: 7.0.4 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 - yargs@17.7.2: dependencies: cliui: 8.0.1 From 8ff0d91bc4f459dc1652bb686d8a4f46fde0a3c2 Mon Sep 17 00:00:00 2001 From: D <51912515+adaki2004@users.noreply.github.com> Date: Tue, 22 Apr 2025 11:41:46 +0200 Subject: [PATCH 08/16] feat(protocol): optimize ProverMarket gas cost (#19319) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Keszey Dániel --- .../contracts/layer1/based/TaikoInbox.sol | 14 +++++----- .../layer1/prover-market/ProverMarket.sol | 8 ++---- ..._provermarket_diff_prover_and_proposer.txt | 4 +-- ...prover_and_proposer_fee_above_liveness.txt | 4 +-- .../protocol/gas-reports/layer1-contracts.txt | 26 +++++++++---------- 5 files changed, 26 insertions(+), 30 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 58f6f3712c9..60c4744da01 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -203,7 +203,6 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I uint256 proverFee; (meta_.prover, proverFee) = proverMarket.getCurrentProver(); require(meta_.prover != address(0), NoProverAvailable()); - if (info_.proposer == meta_.prover) { // proposer is the same as the prover, no need to pay the prover fee. _debitBond(meta_.prover, config.livenessBondBase); @@ -211,15 +210,16 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I // proposer pay the prover fee. _debitBond(info_.proposer, proverFee); - if (proverFee < config.livenessBondBase) { - _debitBond(meta_.prover, config.livenessBondBase - proverFee); - } else { - _creditBond(meta_.prover, proverFee - config.livenessBondBase); - } + // if bondDelta is negative (proverFee < livenessBondBase), deduct the diff + // if not then add the diff to the bond balance + int256 bondDelta = int256(proverFee) - int256(uint256(config.livenessBondBase)); + bondDelta < 0 + ? _debitBond(meta_.prover, uint256(-bondDelta)) + : _creditBond(meta_.prover, uint256(bondDelta)); + proverMarket.onProverAssigned(meta_.prover, proverFee, meta_.batchId); } } else { - // proposer is the same as the prover, no need to pay the prover fee. _debitBond(meta_.prover, config.livenessBondBase); } diff --git a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol index 72d269b94d3..c021f7f9eb7 100644 --- a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol +++ b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol @@ -158,16 +158,12 @@ contract ProverMarket is EssentialContract, IProverMarket { { emit ProverAssigned(msg.sender, _fee, _batchId); - if (assignmentCount > FEE_CHANGE_THRESHOLD) { - // No need to update assignmentCount nor avgFee - return; - } - - if (++assignmentCount <= FEE_CHANGE_THRESHOLD) { + if (assignmentCount < FEE_CHANGE_THRESHOLD) { uint64 _avgFeeInGwei = avgFeeInGwei; uint64 _feeInGwei = uint64(_fee / GWEI); unchecked { + assignmentCount++; avgFeeInGwei = _avgFeeInGwei == 0 ? _feeInGwei : uint64(((FEE_CHANGE_FACTOR - 1) * _avgFeeInGwei + _feeInGwei) / FEE_CHANGE_FACTOR); diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index abbb74fc6bb..9ada0e153df 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 189605 +Gas per proposing: 189306 Gas per proving + verification: 158541 -Total: 348146 \ No newline at end of file +Total: 347847 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index d0e66aa44fc..4fdc8f9a6ce 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 189454 +Gas per proposing: 189172 Gas per proving + verification: 158547 -Total: 348001 \ No newline at end of file +Total: 347719 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 4962744367c..c472ab54bd4 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -69,26 +69,26 @@ InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823621) InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223576) InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15112348) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9458460) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9458507) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9372313) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9458184) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9458214) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9372319) InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8375381) PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375143) PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325702) PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373818) -ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116105) -ProverMarketTest:test_averageFeeCalculation() (gas: 155249) -ProverMarketTest:test_bid() (gas: 90169) +ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116111) +ProverMarketTest:test_averageFeeCalculation() (gas: 152585) +ProverMarketTest:test_bid() (gas: 90175) ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 40622) ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37213) -ProverMarketTest:test_feeLargerThanMax_reverts() (gas: 179645) +ProverMarketTest:test_feeLargerThanMax_reverts() (gas: 176981) ProverMarketTest:test_feeNotDivisibleByUnit_reverts() (gas: 37008) -ProverMarketTest:test_getMaxFee() (gas: 155506) -ProverMarketTest:test_invalidThresholds_reverts() (gas: 63631) -ProverMarketTest:test_outbidWithHigherBond() (gas: 150911) -ProverMarketTest:test_outbidWithLowerBond() (gas: 144589) -ProverMarketTest:test_outbidWithSameBond() (gas: 144610) -ProverMarketTest:test_requestExit() (gas: 95451) +ProverMarketTest:test_getMaxFee() (gas: 152842) +ProverMarketTest:test_invalidThresholds_reverts() (gas: 63613) +ProverMarketTest:test_outbidWithHigherBond() (gas: 150923) +ProverMarketTest:test_outbidWithLowerBond() (gas: 144601) +ProverMarketTest:test_outbidWithSameBond() (gas: 144622) +ProverMarketTest:test_requestExit() (gas: 95457) SendMessageToDelegateOwner:testAddress1() (gas: 2391) TestAutomataDcapV3Attestation:testAttestation() (gas: 4848498) TestAutomataDcapV3Attestation:testParsedCustomQuoteBinAttestation() (gas: 4553350) From a835d05c8955c3980e15e6069528cd2d3d520076 Mon Sep 17 00:00:00 2001 From: D <51912515+adaki2004@users.noreply.github.com> Date: Wed, 23 Apr 2025 18:02:51 +0200 Subject: [PATCH 09/16] feat(protocol): some gas optimization for TaikoInbox (#19324) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Keszey Dániel --- .../contracts/layer1/based/TaikoInbox.sol | 10 ++- ..._provermarket_diff_prover_and_proposer.txt | 4 +- ...prover_and_proposer_fee_above_liveness.txt | 4 +- ...me_prover_as_proposer_measure_gas_used.txt | 4 +- .../inbox_without_provermarket.txt | 4 +- .../protocol/gas-reports/layer1-contracts.txt | 62 +++++++++---------- 6 files changed, 43 insertions(+), 45 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 60c4744da01..a8f4d21a4e7 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -823,18 +823,16 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I uint64 totalShift; for (uint256 i; i < nBlocks; ++i) { - totalShift += _params.blocks[i].timeShift; + BlockParams memory blockParams = _params.blocks[i]; + totalShift += blockParams.timeShift; - uint256 numSignals = _params.blocks[i].signalSlots.length; + uint256 numSignals = blockParams.signalSlots.length; if (numSignals == 0) continue; require(numSignals <= _maxSignalsToReceive, TooManySignals()); for (uint256 j; j < numSignals; ++j) { - require( - signalService.isSignalSent(_params.blocks[i].signalSlots[j]), - SignalNotSent() - ); + require(signalService.isSignalSent(blockParams.signalSlots[j]), SignalNotSent()); } } diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index 9ada0e153df..4f1b0032966 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 189306 +Gas per proposing: 188846 Gas per proving + verification: 158541 -Total: 347847 \ No newline at end of file +Total: 347387 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index 4fdc8f9a6ce..f6cb127f307 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 189172 +Gas per proposing: 188712 Gas per proving + verification: 158547 -Total: 347719 \ No newline at end of file +Total: 347259 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index 47e0a13dd87..c669af9957b 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 163274 +Gas per proposing: 162814 Gas per proving + verification: 156407 -Total: 319681 \ No newline at end of file +Total: 319221 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index f57beda864f..09c384ad28d 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 159827 +Gas per proposing: 159367 Gas per proving + verification: 154358 -Total: 314185 \ No newline at end of file +Total: 313725 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index c472ab54bd4..92767140c0f 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,11 +23,11 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019109) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013224) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1039965) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014074) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281649) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019063) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013178) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1039919) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014028) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281557) InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285610) InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154747) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) @@ -35,44 +35,44 @@ InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141644) InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166440) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022373) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760441) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1048923) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 918014) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12529546) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022327) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760349) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1048877) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 917968) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12526648) InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157150) InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74424) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61924) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266156) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919301) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266110) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919255) InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132790) InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144260) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310268) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 318914) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310176) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 318638) InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 132875) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266440) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266394) InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 165781) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8107718) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8422743) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9303728) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8784271) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12044215) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10066881) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8107258) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8422283) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9302854) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8783857) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12041317) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10066467) InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049667) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5970959) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049621) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5970683) InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40278) InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 110084) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309240) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823621) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223576) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15112348) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9458184) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9458214) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9372319) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8375381) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309194) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823207) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223530) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15111566) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9457310) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9457340) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9371445) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8374967) PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375143) PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325702) PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373818) From 76b223dcd12d0b9b2f4d0eea7bafe7c3e437afeb Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 25 Apr 2025 08:18:30 +0800 Subject: [PATCH 10/16] feat(protocol): remove average fee tracking from ProverMarket (#19325) --- .../contracts/layer1/based/TaikoInbox.sol | 9 ++-- .../layer1/prover-market/IProverMarket.sol | 9 ---- .../layer1/prover-market/ProverMarket.sol | 42 +--------------- ..._provermarket_diff_prover_and_proposer.txt | 4 +- ...prover_and_proposer_fee_above_liveness.txt | 4 +- ...me_prover_as_proposer_measure_gas_used.txt | 4 +- .../protocol/gas-reports/layer1-contracts.txt | 39 +++++++-------- packages/protocol/layout/layer1-contracts.txt | 6 +-- .../layer1/prover-market/ProverMarket.t.sol | 50 ------------------- 9 files changed, 31 insertions(+), 136 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index a8f4d21a4e7..67e5318e965 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -213,11 +213,12 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I // if bondDelta is negative (proverFee < livenessBondBase), deduct the diff // if not then add the diff to the bond balance int256 bondDelta = int256(proverFee) - int256(uint256(config.livenessBondBase)); - bondDelta < 0 - ? _debitBond(meta_.prover, uint256(-bondDelta)) - : _creditBond(meta_.prover, uint256(bondDelta)); - proverMarket.onProverAssigned(meta_.prover, proverFee, meta_.batchId); + if (bondDelta < 0) { + _debitBond(meta_.prover, uint256(-bondDelta)); + } else { + _creditBond(meta_.prover, uint256(bondDelta)); + } } } else { _debitBond(meta_.prover, config.livenessBondBase); diff --git a/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol index 2293e730315..d0592a04743 100644 --- a/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol +++ b/packages/protocol/contracts/layer1/prover-market/IProverMarket.sol @@ -7,18 +7,9 @@ interface IProverMarket { /// @notice Emitted when a new prover wins the auction. event ProverChanged(address indexed prover, uint256 fee, uint256 exitTimestamp); - /// @notice Emitted when the prover is used by TaikoInbox for a given batch. - event ProverAssigned(address indexed prover, uint256 fee, uint64 indexed batchId); - /// @notice Returns the current winning prover and proving fee per batch. /// @dev address(0) and 0 will be returned if there is no current prover. /// @return prover_ The address of the current winning prover. /// @return fee_ The proving fee per batch. function getCurrentProver() external view returns (address prover_, uint256 fee_); - - /// @notice Called by TaikoInbox when the prover market is used. - /// @param _prover The address of the prover. - /// @param _fee The proving fee per batch. - /// @param _batchId The batch id. - function onProverAssigned(address _prover, uint256 _fee, uint64 _batchId) external; } diff --git a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol index c021f7f9eb7..b34742ee130 100644 --- a/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol +++ b/packages/protocol/contracts/layer1/prover-market/ProverMarket.sol @@ -15,16 +15,12 @@ contract ProverMarket is EssentialContract, IProverMarket { error CannotFitToUint64(); error FeeLargerThanAllowed(); - error FeeLargerThanMax(); error FeeNotDivisibleByFeeUnit(); error InsufficientBondBalance(); error InvalidThresholds(); error NotCurrentProver(); error TooEarly(); - uint256 public constant FEE_CHANGE_FACTOR = 100; - uint16 public constant FEE_CHANGE_THRESHOLD = 10; - uint256 public constant MAX_FEE_MULTIPLIER = 2; uint256 public constant NEW_BID_PERCENTAGE = 95; uint256 internal constant GWEI = 10 ** 9; @@ -53,11 +49,7 @@ contract ProverMarket is EssentialContract, IProverMarket { address internal prover; uint64 internal feeInGwei; // proving fee per batch - /// @dev Slot 3 - uint64 public avgFeeInGwei; // moving average of fees - uint16 internal assignmentCount; // number of assignments - - uint256[47] private __gap; + uint256[48] private __gap; modifier validExitTimestamp(uint256 _exitTimestamp) { require(_exitTimestamp >= block.timestamp + minExitDelay, TooEarly()); @@ -97,9 +89,6 @@ contract ProverMarket is EssentialContract, IProverMarket { require(_fee > 0 && _fee % GWEI == 0, FeeNotDivisibleByFeeUnit()); require(_fee / GWEI <= type(uint64).max, CannotFitToUint64()); - uint256 maxFee = getMaxFee(); - require(maxFee == 0 || _fee <= maxFee, FeeLargerThanMax()); - uint64 _newFeeInGwei = uint64(_fee / GWEI); require(inbox.v4BondBalanceOf(msg.sender) >= biddingThreshold, InsufficientBondBalance()); @@ -126,7 +115,6 @@ contract ProverMarket is EssentialContract, IProverMarket { prover = msg.sender; feeInGwei = _newFeeInGwei; provers[msg.sender].exitTimestamp = _exitTimestamp; - assignmentCount = 0; emit ProverChanged(msg.sender, _fee, _exitTimestamp); } @@ -147,34 +135,6 @@ contract ProverMarket is EssentialContract, IProverMarket { currentProver == address(0) ? (address(0), 0) : (currentProver, currentFeeInGwei * GWEI); } - /// @inheritdoc IProverMarket - function onProverAssigned( - address, /*_prover*/ - uint256 _fee, - uint64 _batchId - ) - external - onlyFrom(address(inbox)) - { - emit ProverAssigned(msg.sender, _fee, _batchId); - - if (assignmentCount < FEE_CHANGE_THRESHOLD) { - uint64 _avgFeeInGwei = avgFeeInGwei; - uint64 _feeInGwei = uint64(_fee / GWEI); - - unchecked { - assignmentCount++; - avgFeeInGwei = _avgFeeInGwei == 0 - ? _feeInGwei - : uint64(((FEE_CHANGE_FACTOR - 1) * _avgFeeInGwei + _feeInGwei) / FEE_CHANGE_FACTOR); - } - } - } - - function getMaxFee() public view returns (uint256) { - return (MAX_FEE_MULTIPLIER * avgFeeInGwei).min(type(uint64).max) * GWEI; - } - function _getCurrentProverAndFeeInGwei() internal view returns (address, uint64) { address currentProver = prover; if ( diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index 4f1b0032966..43c53716cd0 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 188846 +Gas per proposing: 164789 Gas per proving + verification: 158541 -Total: 347387 \ No newline at end of file +Total: 323330 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index f6cb127f307..e09bc86cd59 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 188712 +Gas per proposing: 164633 Gas per proving + verification: 158547 -Total: 347259 \ No newline at end of file +Total: 323180 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index c669af9957b..03ba456cb78 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 162814 +Gas per proposing: 162791 Gas per proving + verification: 156407 -Total: 319221 \ No newline at end of file +Total: 319198 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 92767140c0f..57b6a86a0e7 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -28,23 +28,23 @@ InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_ InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1039919) InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014028) InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281557) -InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285610) -InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154747) +InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285541) +InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154724) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) -InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141644) +InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141621) InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166440) InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022327) InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760349) InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1048877) InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 917968) InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12526648) -InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157150) -InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74424) +InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157081) +InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74401) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) -InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61924) +InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61901) InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266110) InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919255) InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132790) @@ -69,26 +69,23 @@ InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823207) InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223530) InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15111566) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9457310) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9457340) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9371445) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9430546) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9430598) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9368737) InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8374967) PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375143) PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325702) PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373818) -ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 116111) -ProverMarketTest:test_averageFeeCalculation() (gas: 152585) -ProverMarketTest:test_bid() (gas: 90175) -ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 40622) -ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37213) -ProverMarketTest:test_feeLargerThanMax_reverts() (gas: 176981) +ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 112989) +ProverMarketTest:test_bid() (gas: 87467) +ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 38141) +ProverMarketTest:test_cannotFitToUint64_reverts() (gas: 37235) ProverMarketTest:test_feeNotDivisibleByUnit_reverts() (gas: 37008) -ProverMarketTest:test_getMaxFee() (gas: 152842) -ProverMarketTest:test_invalidThresholds_reverts() (gas: 63613) -ProverMarketTest:test_outbidWithHigherBond() (gas: 150923) -ProverMarketTest:test_outbidWithLowerBond() (gas: 144601) -ProverMarketTest:test_outbidWithSameBond() (gas: 144622) -ProverMarketTest:test_requestExit() (gas: 95457) +ProverMarketTest:test_invalidThresholds_reverts() (gas: 63476) +ProverMarketTest:test_outbidWithHigherBond() (gas: 147093) +ProverMarketTest:test_outbidWithLowerBond() (gas: 141163) +ProverMarketTest:test_outbidWithSameBond() (gas: 141184) +ProverMarketTest:test_requestExit() (gas: 92816) SendMessageToDelegateOwner:testAddress1() (gas: 2391) TestAutomataDcapV3Attestation:testAttestation() (gas: 4848498) TestAutomataDcapV3Attestation:testParsedCustomQuoteBinAttestation() (gas: 4553350) diff --git a/packages/protocol/layout/layer1-contracts.txt b/packages/protocol/layout/layer1-contracts.txt index 30587a9ce4f..f39fd1ad301 100644 --- a/packages/protocol/layout/layer1-contracts.txt +++ b/packages/protocol/layout/layer1-contracts.txt @@ -1387,11 +1387,7 @@ | | feeInGwei | uint64 | 252 | 20 | 8 | | -| avgFeeInGwei | uint64 | 253 | 0 | 8 | -| -| assignmentCount | uint16 | 253 | 8 | 2 | -| -| __gap | uint256[47] | 254 | 0 | 1504 | +| __gap | uint256[48] | 253 | 0 | 1536 | ╰-----------------------------+------------------------------------------------+------+--------+-------+--------------------------------------------------------------╯ diff --git a/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol index d9f82629d97..ed60c4205b6 100644 --- a/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol +++ b/packages/protocol/test/layer1/prover-market/ProverMarket.t.sol @@ -160,40 +160,6 @@ contract ProverMarketTest is CommonTest { market.requestExit(newExitTimestamp); } - function test_averageFeeCalculation() public { - uint256 fee = 10 gwei; - uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); - - mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); - vm.prank(PROVER1); - market.bid(fee, exitTimestamp); - - for (uint16 i = 0; i < 10; i++) { - vm.prank(address(mockInbox)); - market.onProverAssigned(PROVER1, fee, i); - } - - uint64 avgFee = market.avgFeeInGwei(); - assertEq(avgFee, 10); - } - - function test_getMaxFee() public { - uint256 fee = 10 gwei; - uint64 exitTimestamp = uint64(block.timestamp + MIN_EXIT_DELAY + 1); - - mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); - vm.prank(PROVER1); - market.bid(fee, exitTimestamp); - - for (uint16 i = 0; i < 10; i++) { - vm.prank(address(mockInbox)); - market.onProverAssigned(PROVER1, fee, i); - } - - uint256 maxFee = market.getMaxFee(); - assertEq(maxFee, 20 gwei); // MAX_FEE_MULTIPLIER is 2 - } - function test_invalidThresholds_reverts() public { vm.expectRevert(ProverMarket.InvalidThresholds.selector); new ProverMarket(address(mockInbox), 100 ether, 200 ether, 50 ether, MIN_EXIT_DELAY); @@ -220,22 +186,6 @@ contract ProverMarketTest is CommonTest { market.bid(11 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 2)); } - function test_feeLargerThanMax_reverts() public { - mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); - vm.prank(PROVER1); - market.bid(10 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 1)); - - for (uint16 i = 0; i < 10; i++) { - vm.prank(address(mockInbox)); - market.onProverAssigned(PROVER1, 10 gwei, i); - } - - mockInbox.setBondBalance(PROVER2, BIDDING_THRESHOLD); - vm.prank(PROVER2); - vm.expectRevert(ProverMarket.FeeLargerThanMax.selector); - market.bid(25 gwei, uint64(block.timestamp + MIN_EXIT_DELAY + 2)); // 2x avg is 20 gwei - } - function test_feeNotDivisibleByUnit_reverts() public { mockInbox.setBondBalance(PROVER1, BIDDING_THRESHOLD); vm.prank(PROVER1); From 9ef757aa6198b9bb5698385b58fd838ac8f700d6 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:06:45 +0800 Subject: [PATCH 11/16] feat(protocol): add `getEpochTimestamp(uint epochOffset)` (#19338) Co-authored-by: David --- .../contracts/layer1/preconf/libs/LibPreconfUtils.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/protocol/contracts/layer1/preconf/libs/LibPreconfUtils.sol b/packages/protocol/contracts/layer1/preconf/libs/LibPreconfUtils.sol index 82f921145a9..964951b56ad 100644 --- a/packages/protocol/contracts/layer1/preconf/libs/LibPreconfUtils.sol +++ b/packages/protocol/contracts/layer1/preconf/libs/LibPreconfUtils.sol @@ -52,4 +52,11 @@ library LibPreconfUtils { return genesisTimestamp + timePassedUptoCurrentEpoch; } + + /// @notice Calculates the timestamp of a future epoch based on the genesis timestamp. + /// @param _epochOffset The offset from the current epoch. + /// @return The timestamp of the future epoch. + function getEpochTimestamp(uint256 _epochOffset) internal view returns (uint256) { + return getEpochTimestamp() + _epochOffset * LibPreconfConstants.SECONDS_IN_EPOCH; + } } From 304311a7b7eb8d6c6d705e40e9d0fd0b06bbf916 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:07:08 +0800 Subject: [PATCH 12/16] feat(protocol): change IProposeBatch and delete IPreconfRouter (#19337) --- .../contracts/layer1/based/IProposeBatch.sol | 6 +- .../contracts/layer1/based/ITaikoInbox.sol | 8 +- .../contracts/layer1/based/TaikoInbox.sol | 73 +++++++++-------- .../layer1/forced-inclusion/TaikoWrapper.sol | 7 +- .../layer1/preconf/iface/IPreconfRouter.sol | 13 --- .../layer1/preconf/impl/PreconfRouter.sol | 22 +++-- .../contracts/layer1/provers/ProverSet.sol | 5 +- ..._provermarket_diff_prover_and_proposer.txt | 4 +- ...prover_and_proposer_fee_above_liveness.txt | 4 +- ...me_prover_as_proposer_measure_gas_used.txt | 4 +- .../inbox_without_provermarket.txt | 4 +- .../protocol/gas-reports/layer1-contracts.txt | 82 +++++++++---------- .../test/layer1/based/InboxTestBase.sol | 2 +- .../based/InboxTest_BondMechanics.t.sol | 2 +- .../based/InboxTest_CalldataForTxList.t.sol | 4 +- .../test/layer1/based/InboxTest_Params.t.sol | 26 +++--- .../based/InboxTest_ProposeAndProve.t.sol | 10 +-- .../test/layer1/based/helpers/StubInbox.sol | 3 +- .../layer1/preconf/mocks/MockTaikoInbox.sol | 3 +- .../layer1/preconf/router/PreconfRouter.t.sol | 10 +-- 20 files changed, 149 insertions(+), 143 deletions(-) delete mode 100644 packages/protocol/contracts/layer1/preconf/iface/IPreconfRouter.sol diff --git a/packages/protocol/contracts/layer1/based/IProposeBatch.sol b/packages/protocol/contracts/layer1/based/IProposeBatch.sol index e4bf1bea498..620bbb208ec 100644 --- a/packages/protocol/contracts/layer1/based/IProposeBatch.sol +++ b/packages/protocol/contracts/layer1/based/IProposeBatch.sol @@ -12,11 +12,13 @@ interface IProposeBatch { /// @param _params ABI-encoded parameters. /// @param _txList The transaction list in calldata. If the txList is empty, blob will be used /// for data availability. + /// @param _additionalData Additional data to be included in the batch. /// @return info_ The info of the proposed batch. - /// @return meta_ The mmetadata of the proposed batch. + /// @return meta_ The metadata of the proposed batch. function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata _additionalData ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_); diff --git a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol index 26dfe1ab8a4..dbe4501841f 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol @@ -21,12 +21,12 @@ import "./IProveBatches.sol"; interface ITaikoInbox is IBondManager, IProveBatches { struct BlockParams { // the max number of transactions in this block. Note that if there are not enough - // transactions in calldata or blobs, the block will contains as many transactions as + // transactions in calldata or blobs, the block will contain as many transactions as // possible. uint16 numTransactions; // The time difference (in seconds) between the timestamp of this block and // the timestamp of the parent block in the same batch. For the first block in a batch, - // there is not parent block in the same batch, so the time shift should be 0. + // there is no parent block in the same batch, so the time shift should be 0. uint8 timeShift; // Signals sent on L1 and need to sync to this L2 block. bytes32[] signalSlots; @@ -284,11 +284,13 @@ interface ITaikoInbox is IBondManager, IProveBatches { /// @param _params ABI-encoded parameters. /// @param _txList The transaction list in calldata. If the txList is empty, blob will be used /// for data availability. + /// @param _additionalData Additional data to be included in the batch. /// @return info_ The info of the proposed batch. /// @return meta_ The metadata of the proposed batch. function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata _additionalData ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_); diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 67e5318e965..4274ae1ac59 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -74,7 +74,8 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I /// @return meta_ Metadata of the proposed batch, which is used for proving the batch. function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata /*_additionalData*/ ) public override(ITaikoInbox, IProposeBatch) @@ -180,24 +181,25 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I anchorBlockHash: blockhash(anchorBlockId), baseFeeConfig: config.baseFeeConfig }); + { + uint64 nBlocks = uint64(params.blocks.length); - uint64 nBlocks = uint64(params.blocks.length); - - require(info_.anchorBlockHash != 0, ZeroAnchorBlockHash()); + require(info_.anchorBlockHash != 0, ZeroAnchorBlockHash()); - info_.lastBlockId = stats2.numBatches == config.forkHeights.pacaya - ? stats2.numBatches + nBlocks - 1 - : lastBatch.lastBlockId + nBlocks; + info_.lastBlockId = stats2.numBatches == config.forkHeights.pacaya + ? stats2.numBatches + nBlocks - 1 + : lastBatch.lastBlockId + nBlocks; - (info_.txsHash, info_.blobHashes) = - _calculateTxsHash(keccak256(_txList), params.blobParams); + (info_.txsHash, info_.blobHashes) = + _calculateTxsHash(keccak256(_txList), params.blobParams); - meta_ = BatchMetadata({ - infoHash: keccak256(abi.encode(info_)), - prover: info_.proposer, - batchId: stats2.numBatches, - proposedAt: uint64(block.timestamp) - }); + meta_ = BatchMetadata({ + infoHash: keccak256(abi.encode(info_)), + prover: info_.proposer, + batchId: stats2.numBatches, + proposedAt: uint64(block.timestamp) + }); + } if (address(proverMarket) != address(0) && params.optInProverMarket) { uint256 proverFee; @@ -224,26 +226,27 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I _debitBond(meta_.prover, config.livenessBondBase); } - Batch storage batch = state.batches[stats2.numBatches % config.batchRingBufferSize]; - - // SSTORE #1 - batch.metaHash = keccak256(abi.encode(meta_)); - - // SSTORE #2 {{ - batch.batchId = stats2.numBatches; - batch.lastBlockTimestamp = lastBlockTimestamp; - batch.anchorBlockId = anchorBlockId; - batch.nextTransitionId = 1; - batch.verifiedTransitionId = 0; - batch.reserved4 = 0; - // SSTORE }} - - // SSTORE #3 {{ - batch.lastBlockId = info_.lastBlockId; - batch.reserved3 = 0; - batch.livenessBond = config.livenessBondBase; - // SSTORE }} - + { + Batch storage batch = state.batches[stats2.numBatches % config.batchRingBufferSize]; + + // SSTORE #1 + batch.metaHash = keccak256(abi.encode(meta_)); + + // SSTORE #2 {{ + batch.batchId = stats2.numBatches; + batch.lastBlockTimestamp = lastBlockTimestamp; + batch.anchorBlockId = anchorBlockId; + batch.nextTransitionId = 1; + batch.verifiedTransitionId = 0; + batch.reserved4 = 0; + // SSTORE }} + + // SSTORE #3 {{ + batch.lastBlockId = info_.lastBlockId; + batch.reserved3 = 0; + batch.livenessBond = config.livenessBondBase; + // SSTORE }} + } stats2.numBatches += 1; require( config.forkHeights.shasta == 0 || stats2.numBatches < config.forkHeights.shasta, diff --git a/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol b/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol index 6a574ddbf0f..fc431d56791 100644 --- a/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol +++ b/packages/protocol/contracts/layer1/forced-inclusion/TaikoWrapper.sol @@ -76,7 +76,8 @@ contract TaikoWrapper is EssentialContract, IProposeBatch { /// @inheritdoc IProposeBatch function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata ) external onlyFromOptional(preconfRouter) @@ -89,11 +90,11 @@ contract TaikoWrapper is EssentialContract, IProposeBatch { require(!forcedInclusionStore.isOldestForcedInclusionDue(), OldestForcedInclusionDue()); } else { _validateForcedInclusionParams(forcedInclusionStore, bytesX); - inbox.v4ProposeBatch(bytesX, ""); + inbox.v4ProposeBatch(bytesX, "", ""); } // Propose the normal batch after the potential forced inclusion batch. - return inbox.v4ProposeBatch(bytesY, _txList); + return inbox.v4ProposeBatch(bytesY, _txList, ""); } function _validateForcedInclusionParams( diff --git a/packages/protocol/contracts/layer1/preconf/iface/IPreconfRouter.sol b/packages/protocol/contracts/layer1/preconf/iface/IPreconfRouter.sol deleted file mode 100644 index aacbdc9e631..00000000000 --- a/packages/protocol/contracts/layer1/preconf/iface/IPreconfRouter.sol +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; - -import "src/layer1/based/IProposeBatch.sol"; - -/// @title IPreconfRouter -/// @custom:security-contact security@taiko.xyz -interface IPreconfRouter is IProposeBatch { - error ForcedInclusionNotSupported(); - error NotFallbackPreconfer(); - error NotPreconfer(); - error ProposerIsNotPreconfer(); -} diff --git a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol index a91d65513e5..c5f60971b8e 100644 --- a/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol +++ b/packages/protocol/contracts/layer1/preconf/impl/PreconfRouter.sol @@ -3,28 +3,33 @@ pragma solidity ^0.8.24; // import "urc/src/IRegistry.sol"; import "src/shared/common/EssentialContract.sol"; -import "../iface/IPreconfRouter.sol"; +import "src/layer1/based/IProposeBatch.sol"; import "../iface/IPreconfWhitelist.sol"; /// @title PreconfRouter /// @custom:security-contact security@taiko.xyz -contract PreconfRouter is EssentialContract, IPreconfRouter { - IProposeBatch public immutable proposeBatchEntrypoint; +contract PreconfRouter is EssentialContract, IProposeBatch { + IProposeBatch public immutable proposeEntrypoint; IPreconfWhitelist public immutable preconfWhitelist; address public immutable fallbackPreconfer; + error ForcedInclusionNotSupported(); + error NotFallbackPreconfer(); + error NotPreconfer(); + error ProposerIsNotPreconfer(); + uint256[50] private __gap; constructor( - address _proposeBatchEntrypoint, // TaikoInbox or TaikoWrapper + address _proposeEntrypoint, // TaikoInbox or TaikoWrapper address _preconfWhitelist, address _fallbackPreconfer ) - nonZeroAddr(_proposeBatchEntrypoint) + nonZeroAddr(_proposeEntrypoint) nonZeroAddr(_preconfWhitelist) EssentialContract(address(0)) { - proposeBatchEntrypoint = IProposeBatch(_proposeBatchEntrypoint); + proposeEntrypoint = IProposeBatch(_proposeEntrypoint); preconfWhitelist = IPreconfWhitelist(_preconfWhitelist); fallbackPreconfer = _fallbackPreconfer; } @@ -36,7 +41,8 @@ contract PreconfRouter is EssentialContract, IPreconfRouter { /// @inheritdoc IProposeBatch function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata /* _additionalData */ ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_) @@ -50,7 +56,7 @@ contract PreconfRouter is EssentialContract, IPreconfRouter { } // Both TaikoInbox and TaikoWrapper implement the same ABI for IProposeBatch. - (info_, meta_) = proposeBatchEntrypoint.v4ProposeBatch(_params, _txList); + (info_, meta_) = proposeEntrypoint.v4ProposeBatch(_params, _txList, ""); // Verify that the sender had set itself as the proposer require(info_.proposer == msg.sender, ProposerIsNotPreconfer()); diff --git a/packages/protocol/contracts/layer1/provers/ProverSet.sol b/packages/protocol/contracts/layer1/provers/ProverSet.sol index ad6a882f3c2..3346e27d49d 100644 --- a/packages/protocol/contracts/layer1/provers/ProverSet.sol +++ b/packages/protocol/contracts/layer1/provers/ProverSet.sol @@ -28,13 +28,14 @@ contract ProverSet is ProverSetBase, IProposeBatch { /// @notice Propose a batch of Taiko blocks. function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata _additionalData ) external onlyProver returns (ITaikoInbox.BatchInfo memory, ITaikoInbox.BatchMetadata memory) { - return IProposeBatch(entrypoint).v4ProposeBatch(_params, _txList); + return IProposeBatch(entrypoint).v4ProposeBatch(_params, _txList, _additionalData); } /// @notice Proves multiple Taiko batches. diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index 43c53716cd0..1ac7d19efdb 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 164789 +Gas per proposing: 165032 Gas per proving + verification: 158541 -Total: 323330 \ No newline at end of file +Total: 323573 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index e09bc86cd59..40aadaf41bb 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 164633 +Gas per proposing: 164876 Gas per proving + verification: 158547 -Total: 323180 \ No newline at end of file +Total: 323423 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index 03ba456cb78..d92e17fe8a4 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 162791 +Gas per proposing: 163034 Gas per proving + verification: 156407 -Total: 319198 \ No newline at end of file +Total: 319441 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index 09c384ad28d..be183074bf9 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 159367 +Gas per proposing: 159610 Gas per proving + verification: 154358 -Total: 313725 \ No newline at end of file +Total: 313968 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 57b6a86a0e7..71332582ddb 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,59 +23,59 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019063) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013178) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1039919) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014028) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281557) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019306) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013421) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1040162) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014271) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281773) InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285541) InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154724) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141621) -InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166440) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022327) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760349) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1048877) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 917968) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12526648) +InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166671) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022570) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760835) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1049117) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 918211) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12528329) InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157081) InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74401) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61901) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266110) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919255) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132790) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144260) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310176) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 318638) -InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 132875) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266394) -InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 165781) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8107258) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8422283) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9302854) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8783857) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12041317) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10066467) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266348) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919705) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133019) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144467) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310872) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 319334) +InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133104) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266632) +InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166010) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8109680) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8424441) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9304360) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8785430) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12042756) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10067752) InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049621) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5970683) -InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40278) -InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 110084) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309194) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7823207) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223530) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15111566) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9430546) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9430598) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9368737) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8374967) -PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375143) -PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325702) -PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 373818) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049864) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5971635) +InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40256) +InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109996) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309107) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7824965) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223553) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15114509) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9432052) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9432104) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9370243) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8376670) +PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375738) +PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325982) +PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 374415) ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 112989) ProverMarketTest:test_bid() (gas: 87467) ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 38141) diff --git a/packages/protocol/test/layer1/based/InboxTestBase.sol b/packages/protocol/test/layer1/based/InboxTestBase.sol index 55bcc91c96d..f2f531b9bc3 100644 --- a/packages/protocol/test/layer1/based/InboxTestBase.sol +++ b/packages/protocol/test/layer1/based/InboxTestBase.sol @@ -168,7 +168,7 @@ abstract contract InboxTestBase is Layer1Test { for (uint256 i; i < numBatchesToPropose; ++i) { (ITaikoInbox.BatchInfo memory info, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(batchParams), txList); + inbox.v4ProposeBatch(abi.encode(batchParams), txList, ""); _saveMetadataAndInfo(meta, info); batchIds[i] = meta.batchId; } diff --git a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol index d4d8adf5561..036795198ff 100644 --- a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol @@ -129,7 +129,7 @@ contract InboxTest_BondMechanics is InboxTestBase { params.blocks = new ITaikoInbox.BlockParams[](2); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); ITaikoInbox.Batch memory batch = inbox.v4GetBatch(meta.batchId); diff --git a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol index e128b07b5ca..2ee80671282 100644 --- a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol @@ -77,7 +77,7 @@ contract InboxTest_CalldataForTxList is InboxTestBase { vm.prank(Alice); vm.expectRevert(ITaikoInbox.BlobNotSpecified.selector); // With empty txList - inbox.v4ProposeBatch(abi.encode(params), ""); + inbox.v4ProposeBatch(abi.encode(params), "", ""); } function test_propose_batch_with_empty_txlist_and_valid_blobindex() external { @@ -96,7 +96,7 @@ contract InboxTest_CalldataForTxList is InboxTestBase { // With empty txList (ITaikoInbox.BatchInfo memory info, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(params), ""); + inbox.v4ProposeBatch(abi.encode(params), "", ""); assertTrue(info.txsHash != 0, "txsHash should not be zero for valid blobIndex"); _saveMetadataAndInfo(meta, info); diff --git a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol index 0ab6fd5b44b..bb35da2932b 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol @@ -41,7 +41,8 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](1); - (ITaikoInbox.BatchInfo memory info,) = inbox.v4ProposeBatch(abi.encode(params), "txList"); + (ITaikoInbox.BatchInfo memory info,) = + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); // Assert that the default anchorBlockId was set correctly uint64 expectedAnchorBlockId = uint64(block.number - 1); @@ -63,7 +64,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = uint64(block.number - config.maxAnchorHeightOffset - 1); vm.expectRevert(ITaikoInbox.AnchorBlockIdTooSmall.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } function test_validateParams_reverts_when_anchorBlockId_too_large() @@ -76,7 +77,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = uint64(block.number); vm.expectRevert(ITaikoInbox.AnchorBlockIdTooLarge.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } function test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() @@ -99,7 +100,7 @@ contract InboxTest_Params is InboxTestBase { params.anchorBlockId = parent.anchorBlockId - 1; vm.expectRevert(ITaikoInbox.AnchorBlockIdSmallerThanParent.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } function test_validateParams_when_anchorBlockId_is_not_zero() external transactBy(Alice) { @@ -107,7 +108,8 @@ contract InboxTest_Params is InboxTestBase { params.blocks = new ITaikoInbox.BlockParams[](1); params.anchorBlockId = uint64(block.number - 1); - (ITaikoInbox.BatchInfo memory info,) = inbox.v4ProposeBatch(abi.encode(params), "txList"); + (ITaikoInbox.BatchInfo memory info,) = + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); uint64 expectedAnchorBlockId = uint64(block.number - 1); assertEq(info.anchorBlockId, expectedAnchorBlockId, "AnchorBlockId mismatch"); @@ -119,7 +121,7 @@ contract InboxTest_Params is InboxTestBase { params.lastBlockTimestamp = uint64(block.timestamp + 1); vm.expectRevert(ITaikoInbox.TimestampTooLarge.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } function test_validateParams_reverts_when_first_block_time_shift_not_zero() @@ -129,16 +131,16 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](1); params.lastBlockTimestamp = uint64(block.timestamp); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); params.lastBlockTimestamp = uint64(block.timestamp - 1); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); params.blocks[0].timeShift = 1; params.lastBlockTimestamp = uint64(block.timestamp); vm.expectRevert(ITaikoInbox.FirstBlockTimeShiftNotZero.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } function test_validateParams_reverts_when_timestamp_smaller_than_parent() @@ -148,15 +150,15 @@ contract InboxTest_Params is InboxTestBase { ITaikoInbox.BatchParams memory params; params.blocks = new ITaikoInbox.BlockParams[](2); params.lastBlockTimestamp = uint64(block.timestamp); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); params.lastBlockTimestamp = uint64(block.timestamp - 1); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); params.blocks[1].timeShift = 1; params.lastBlockTimestamp = uint64(block.timestamp); vm.expectRevert(ITaikoInbox.TimestampSmallerThanParent.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); } } diff --git a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol index 7ceab1cf824..66f4ac2b98f 100644 --- a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol @@ -559,7 +559,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { params.proposer = Alice; vm.expectRevert(ITaikoInbox.CustomProposerNotAllowed.selector); - inbox.v4ProposeBatch(abi.encode(params), "txList"); + inbox.v4ProposeBatch(abi.encode(params), "txList", ""); vm.startPrank(deployer); address operator = Bob; @@ -579,7 +579,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList"), ""); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -644,7 +644,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList"), ""); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -719,7 +719,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList"), ""); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); ITaikoInbox.BatchMetadata[] memory metas = new ITaikoInbox.BatchMetadata[](1); @@ -784,7 +784,7 @@ contract InboxTest_ProposeAndProve is InboxTestBase { vm.startSnapshotGas("proposeBatch"); (, ITaikoInbox.BatchMetadata memory meta) = - inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList")); + inbox.v4ProposeBatch(abi.encode(batchParams), abi.encodePacked("txList"), ""); uint256 gas1 = vm.stopSnapshotGas("proposeBatch"); // Check if Alice's bond is correctly deducted - only liveness bond base diff --git a/packages/protocol/test/layer1/based/helpers/StubInbox.sol b/packages/protocol/test/layer1/based/helpers/StubInbox.sol index ce51faf7f7e..dd49022d9d6 100644 --- a/packages/protocol/test/layer1/based/helpers/StubInbox.sol +++ b/packages/protocol/test/layer1/based/helpers/StubInbox.sol @@ -8,7 +8,8 @@ import "src/layer1/based/ITaikoInbox.sol"; contract StubInbox is ITaikoInbox { function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata _additionalData ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_) diff --git a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol index 23bf44fdd33..19ff361ee69 100644 --- a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol +++ b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol @@ -15,7 +15,8 @@ contract MockTaikoInbox is EssentialContract { function v4ProposeBatch( bytes calldata _params, - bytes calldata _txList + bytes calldata _txList, + bytes calldata /* _additionalData */ ) external returns (ITaikoInbox.BatchInfo memory info_, ITaikoInbox.BatchMetadata memory meta_) diff --git a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol index 7ee21ba2157..d788804058a 100644 --- a/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol +++ b/packages/protocol/test/layer1/preconf/router/PreconfRouter.t.sol @@ -56,7 +56,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as Carol (selected operator) and propose blocks vm.prank(Carol); - (ITaikoInbox.BatchInfo memory info,) = router.v4ProposeBatch(abi.encode(params), ""); + (ITaikoInbox.BatchInfo memory info,) = router.v4ProposeBatch(abi.encode(params), "", ""); // Assert the proposer was set correctly in the metadata assertEq(info.proposer, Carol); @@ -89,8 +89,8 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as David (not the selected operator) and propose blocks vm.prank(David); - vm.expectRevert(IPreconfRouter.NotPreconfer.selector); - router.v4ProposeBatch("", ""); + vm.expectRevert(PreconfRouter.NotPreconfer.selector); + router.v4ProposeBatch("", "", ""); } function test_preconfRouter_proposeBatch_proposerNotSender() external { @@ -143,7 +143,7 @@ contract PreconfRouterTest is PreconfRouterTestBase { // Prank as Carol (selected operator) and propose blocks vm.prank(Carol); - vm.expectRevert(IPreconfRouter.ProposerIsNotPreconfer.selector); - router.v4ProposeBatch(abi.encode(params), ""); + vm.expectRevert(PreconfRouter.ProposerIsNotPreconfer.selector); + router.v4ProposeBatch(abi.encode(params), "", ""); } } From 60eb4119a07b397a2e5da902fe0f32d18702a2b0 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:41:38 +0800 Subject: [PATCH 13/16] refactor(protocol): optimize inbox tests to share configs (#19345) --- ..._provermarket_diff_prover_and_proposer.txt | 6 ++-- ...prover_and_proposer_fee_above_liveness.txt | 6 ++-- ...me_prover_as_proposer_measure_gas_used.txt | 6 ++-- .../inbox_without_provermarket.txt | 6 ++-- .../protocol/gas-reports/layer1-contracts.txt | 32 +++++++++---------- .../test/layer1/based/InboxTestBase.sol | 28 +++++++++++++++- .../based/InboxTest_BondMechanics.t.sol | 28 ---------------- .../layer1/based/InboxTest_BondToken.t.sol | 28 ---------------- .../based/InboxTest_CalldataForTxList.t.sol | 28 ---------------- .../layer1/based/InboxTest_Cooldown.t.sol | 29 ++--------------- .../layer1/based/InboxTest_EtherAsBond.t.sol | 29 ++--------------- .../test/layer1/based/InboxTest_Params.t.sol | 28 ---------------- .../based/InboxTest_ProposeAndProve.t.sol | 29 ++--------------- .../layer1/based/InboxTest_StopBatch.t.sol | 29 ++--------------- 14 files changed, 67 insertions(+), 245 deletions(-) diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index 1ac7d19efdb..8c9c68d8fad 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 165032 -Gas per proving + verification: 158541 -Total: 323573 \ No newline at end of file +Gas per proposing: 165052 +Gas per proving + verification: 158546 +Total: 323598 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index 40aadaf41bb..2d71f68bb11 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 164876 -Gas per proving + verification: 158547 -Total: 323423 \ No newline at end of file +Gas per proposing: 164896 +Gas per proving + verification: 158552 +Total: 323448 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index d92e17fe8a4..df8ffa0e76b 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 163034 -Gas per proving + verification: 156407 -Total: 319441 \ No newline at end of file +Gas per proposing: 163055 +Gas per proving + verification: 156410 +Total: 319465 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index be183074bf9..b96ae49fea2 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 159610 -Gas per proving + verification: 154358 -Total: 313968 \ No newline at end of file +Gas per proposing: 159631 +Gas per proving + verification: 154362 +Total: 313993 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 71332582ddb..1e067a0d9f7 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -39,7 +39,7 @@ InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022570) InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760835) InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1049117) InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 918211) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12528329) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12531055) InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157081) InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74401) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) @@ -54,25 +54,25 @@ InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent( InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133104) InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266632) InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166010) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8109680) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8424441) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9304360) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8785430) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12042756) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10067752) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8111445) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8426485) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9308016) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8797776) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12056888) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10081328) InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049864) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5971635) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5972619) InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40256) InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109996) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1309107) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7824965) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1223553) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15114509) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9432052) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9432104) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9370243) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8376670) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1311462) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7825893) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1225034) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15123207) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9435712) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9435764) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9373901) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8378716) PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375738) PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325982) PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 374415) diff --git a/packages/protocol/test/layer1/based/InboxTestBase.sol b/packages/protocol/test/layer1/based/InboxTestBase.sol index f2f531b9bc3..f68e0295e02 100644 --- a/packages/protocol/test/layer1/based/InboxTestBase.sol +++ b/packages/protocol/test/layer1/based/InboxTestBase.sol @@ -16,7 +16,33 @@ abstract contract InboxTestBase is Layer1Test { uint256 genesisBlockProposedIn; uint256 private __blocksPerBatch; - function v4GetConfig() internal view virtual returns (ITaikoInbox.Config memory); + function v4GetConfig() internal pure virtual returns (ITaikoInbox.Config memory) { + ITaikoInbox.ForkHeights memory forkHeights; + + return ITaikoInbox.Config({ + chainId: LibNetwork.TAIKO_MAINNET, + maxUnverifiedBatches: 10, + batchRingBufferSize: 15, + maxBatchesToVerify: 5, + blockMaxGasLimit: 240_000_000, + livenessBondBase: 125e18, // 125 Taiko token per batch + livenessBondPerBlock: 0, // deprecated + stateRootSyncInternal: 5, + maxAnchorHeightOffset: 64, + baseFeeConfig: LibSharedData.BaseFeeConfig({ + adjustmentQuotient: 8, + sharingPctg: 75, + gasIssuancePerSecond: 5_000_000, + minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee + maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 + }), + provingWindow: 1 hours, + cooldownWindow: 0 hours, + maxSignalsToReceive: 16, + maxBlocksPerBatch: 768, + forkHeights: forkHeights + }); + } modifier transactBy(address transactor) override { vm.deal(transactor, 100 ether); diff --git a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol index 036795198ff..88b94cedf70 100644 --- a/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_BondMechanics.t.sol @@ -5,34 +5,6 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_BondMechanics is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); - } - function setUpOnEthereum() internal override { bondToken = deployBondToken(); super.setUpOnEthereum(); diff --git a/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol b/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol index 2504d78be8f..6f65f588e91 100644 --- a/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_BondToken.t.sol @@ -5,34 +5,6 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_BondToken is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); - } - function setUpOnEthereum() internal override { bondToken = deployBondToken(); super.setUpOnEthereum(); diff --git a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol index 2ee80671282..3400647e30f 100644 --- a/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_CalldataForTxList.t.sol @@ -5,34 +5,6 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_CalldataForTxList is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); - } - function setUpOnEthereum() internal override { bondToken = deployBondToken(); super.setUpOnEthereum(); diff --git a/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol b/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol index 7a2b36ade0f..544ec6c4a3b 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Cooldown.t.sol @@ -4,32 +4,9 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_Cooldownis is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 20, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 1 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory config_) { + config_ = super.v4GetConfig(); + config_.cooldownWindow = 1 hours; } function setUpOnEthereum() internal override { diff --git a/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol b/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol index 24f19f674bc..69d8d727c2c 100644 --- a/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_EtherAsBond.t.sol @@ -5,32 +5,9 @@ import "contracts/layer1/based/ITaikoInbox.sol"; import "./InboxTestBase.sol"; contract InboxTest_EtherAsBond is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 1 ether, - livenessBondPerBlock: 0.1 ether, - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory config_) { + config_ = super.v4GetConfig(); + config_.livenessBondBase = 1 ether; } function setUpOnEthereum() internal override { diff --git a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol index bb35da2932b..b56493ba6ca 100644 --- a/packages/protocol/test/layer1/based/InboxTest_Params.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_Params.t.sol @@ -4,34 +4,6 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_Params is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); - } - function setUpOnEthereum() internal override { bondToken = deployBondToken(); super.setUpOnEthereum(); diff --git a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol index 66f4ac2b98f..08b17f91f0d 100644 --- a/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_ProposeAndProve.t.sol @@ -4,32 +4,9 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_ProposeAndProve is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 11, - maxBatchesToVerify: 5, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory config_) { + config_ = super.v4GetConfig(); + config_.batchRingBufferSize = 11; } function setUpOnEthereum() internal override { diff --git a/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol b/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol index efab1a6d43a..a02b05d777b 100644 --- a/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol +++ b/packages/protocol/test/layer1/based/InboxTest_StopBatch.t.sol @@ -4,32 +4,9 @@ pragma solidity ^0.8.24; import "./InboxTestBase.sol"; contract InboxTest_StopBatch is InboxTestBase { - function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory) { - ITaikoInbox.ForkHeights memory forkHeights; - - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_MAINNET, - maxUnverifiedBatches: 10, - batchRingBufferSize: 15, - maxBatchesToVerify: 1, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 5, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 75, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee - maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 - }), - provingWindow: 1 hours, - cooldownWindow: 0 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: forkHeights - }); + function v4GetConfig() internal pure override returns (ITaikoInbox.Config memory config_) { + config_ = super.v4GetConfig(); + config_.maxBatchesToVerify = 1; } function setUpOnEthereum() internal override { From 04d7b5289aa53787d74572fadfccc53c7bd8cbb9 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 28 Apr 2025 14:56:04 +0800 Subject: [PATCH 14/16] refactor(protocol): make HeklaInbox inherit MainInbox (#19346) --- .../contracts/layer1/hekla/HeklaInbox.sol | 50 ++++++------------- .../contracts/layer1/mainnet/MainnetInbox.sol | 35 +++++++++---- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol index cf98a7ec6fa..442ef954588 100644 --- a/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol +++ b/packages/protocol/contracts/layer1/hekla/HeklaInbox.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import "../based/TaikoInbox.sol"; +import "../mainnet/MainnetInbox.sol"; /// @title HeklaInbox /// @dev Labeled in address resolver as "taiko" /// @custom:security-contact security@taiko.xyz -contract HeklaInbox is TaikoInbox { +contract HeklaInbox is MainnetInbox { /// @notice Emitted when a transition is written to the state by the owner. /// @param batchId The ID of the batch containing the transition. /// @param tid The ID of the transition within the batch. @@ -20,7 +20,7 @@ contract HeklaInbox is TaikoInbox { address _signalService, address _proverMarket ) - TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) + MainnetInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } /// @notice Manually write a transition for a batch. @@ -79,36 +79,18 @@ contract HeklaInbox is TaikoInbox { ); } - function v4GetConfig() public pure override returns (ITaikoInbox.Config memory) { - return ITaikoInbox.Config({ - chainId: LibNetwork.TAIKO_HEKLA, - // Never change this value as ring buffer is being reused!!! - maxUnverifiedBatches: 324_000, - // Never change this value as ring buffer is being reused!!! - batchRingBufferSize: 324_512, - maxBatchesToVerify: 16, - blockMaxGasLimit: 240_000_000, - livenessBondBase: 125e18, // 125 Taiko token per batch - livenessBondPerBlock: 0, // deprecated - stateRootSyncInternal: 4, - maxAnchorHeightOffset: 64, - baseFeeConfig: LibSharedData.BaseFeeConfig({ - adjustmentQuotient: 8, - sharingPctg: 50, - gasIssuancePerSecond: 5_000_000, - minGasExcess: 1_344_899_430, // 0.01 gwei - maxGasIssuancePerBlock: 600_000_000 // two minutes - }), - provingWindow: 2 hours, - cooldownWindow: 2 hours, - maxSignalsToReceive: 16, - maxBlocksPerBatch: 768, - forkHeights: ITaikoInbox.ForkHeights({ - ontake: 840_512, - pacaya: 1_299_888, - shasta: 0, - unzen: 0 - }) - }); + function _getForkHeights() internal pure override returns (ITaikoInbox.ForkHeights memory) { + return ITaikoInbox.ForkHeights({ ontake: 840_512, pacaya: 1_299_888, shasta: 0, unzen: 0 }); + } + + /// @dev Never change the following two values!!! + function _getRingbufferConfig() + internal + pure + override + returns (uint64 maxUnverifiedBatches_, uint64 batchRingBufferSize_) + { + maxUnverifiedBatches_ = 324_000; + batchRingBufferSize_ = 324_512; } } diff --git a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol index 77710f0e556..300c3243d7d 100644 --- a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol +++ b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol @@ -21,16 +21,18 @@ contract MainnetInbox is TaikoInbox { TaikoInbox(_wrapper, _verifier, _bondToken, _signalService, _proverMarket) { } - function v4GetConfig() public pure override returns (ITaikoInbox.Config memory) { + function v4GetConfig() public pure virtual override returns (ITaikoInbox.Config memory) { // All hard-coded configurations: // - treasury: the actual TaikoL2 address. // - anchorGasLimit: 1_000_000 + + (uint64 maxUnverifiedBatches_, uint64 batchRingBufferSize_) = _getRingbufferConfig(); return ITaikoInbox.Config({ chainId: LibNetwork.TAIKO_MAINNET, // Ring buffers are being reused on the mainnet, therefore the following two // configuration values must NEVER be changed!!! - maxUnverifiedBatches: 324_000, // DO NOT CHANGE!!! - batchRingBufferSize: 360_000, // DO NOT CHANGE!!! + maxUnverifiedBatches: maxUnverifiedBatches_, + batchRingBufferSize: batchRingBufferSize_, maxBatchesToVerify: 16, blockMaxGasLimit: 240_000_000, livenessBondBase: 50e18, // 50 Taiko token per batch @@ -48,12 +50,7 @@ contract MainnetInbox is TaikoInbox { cooldownWindow: 2 hours, maxSignalsToReceive: 16, maxBlocksPerBatch: 768, - forkHeights: ITaikoInbox.ForkHeights({ - ontake: 538_304, - pacaya: 538_304 * 10, // TODO - shasta: 0, - unzen: 0 - }) + forkHeights: _getForkHeights() }); } @@ -64,4 +61,24 @@ contract MainnetInbox is TaikoInbox { function _loadReentryLock() internal view override returns (uint8) { return LibFasterReentryLock.loadReentryLock(); } + + function _getForkHeights() internal pure virtual returns (ITaikoInbox.ForkHeights memory) { + return ITaikoInbox.ForkHeights({ + ontake: 538_304, + pacaya: type(uint64).max, // TODO(david): update this value + shasta: 0, + unzen: 0 + }); + } + + /// @dev Never change the following two values!!! + function _getRingbufferConfig() + internal + pure + virtual + returns (uint64 maxUnverifiedBatches_, uint64 batchRingBufferSize_) + { + maxUnverifiedBatches_ = 324_000; + batchRingBufferSize_ = 360_000; + } } From 3bc59c802733a0b25cad20812a9ba498e06a69fc Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 28 Apr 2025 16:41:17 +0800 Subject: [PATCH 15/16] feat(protocol): enable 3-way base fee sharing (#19348) --- .../protocol/contracts/layer1/based/ITaikoInbox.sol | 6 ++++++ .../protocol/contracts/layer1/based/TaikoInbox.sol | 10 +++++++++- .../protocol/contracts/layer1/devnet/DevnetInbox.sol | 2 +- .../protocol/contracts/layer1/mainnet/MainnetInbox.sol | 2 +- .../protocol/contracts/shared/based/LibSharedData.sol | 1 - packages/protocol/test/layer1/based/InboxTestBase.sol | 2 +- .../test/layer1/preconf/mocks/MockTaikoInbox.sol | 1 - 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol index dbe4501841f..2da689c4cc8 100644 --- a/packages/protocol/contracts/layer1/based/ITaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/ITaikoInbox.sol @@ -184,6 +184,12 @@ interface ITaikoInbox is IBondManager, IProveBatches { uint8 maxSignalsToReceive; /// @notice The maximum number of blocks per batch. uint16 maxBlocksPerBatch; + /// @notice Specifies the base fee sharing percentages. The addresses are predefined in the + /// node software. + /// If address(0) is specified, the base fee will be burned. This allows for distributing + /// the base fee in three ways: for instance, 40% to address-1, 10% to address-2, and the + /// remaining 50% to the coinbase. + uint8[2] baseFeeSharings; /// @notice Historical heights of the forks. ForkHeights forkHeights; } diff --git a/packages/protocol/contracts/layer1/based/TaikoInbox.sol b/packages/protocol/contracts/layer1/based/TaikoInbox.sol index 4274ae1ac59..c62c45ab8df 100644 --- a/packages/protocol/contracts/layer1/based/TaikoInbox.sol +++ b/packages/protocol/contracts/layer1/based/TaikoInbox.sol @@ -165,7 +165,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I // Data to build L2 blocks blocks: params.blocks, blobHashes: new bytes32[](0), // to be initialised later - extraData: bytes32(uint256(config.baseFeeConfig.sharingPctg)), + extraData: _encodeBaseFeeSharings(config.baseFeeSharings), coinbase: params.coinbase, proposer: params.proposer, proposedIn: uint64(block.number), @@ -862,6 +862,14 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, IProposeBatch, I } } + function _encodeBaseFeeSharings(uint8[2] memory _baseFeeSharings) + internal + pure + returns (bytes32) + { + return bytes32(uint256(_baseFeeSharings[1]) << 8 | uint256(_baseFeeSharings[0])); + } + // Memory-only structs ---------------------------------------------------------------------- struct SyncBlock { diff --git a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol index f48aea16f89..4ab83b87ac2 100644 --- a/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol +++ b/packages/protocol/contracts/layer1/devnet/DevnetInbox.sol @@ -39,7 +39,6 @@ contract DevnetInbox is TaikoInbox { maxAnchorHeightOffset: 64, baseFeeConfig: LibSharedData.BaseFeeConfig({ adjustmentQuotient: 8, - sharingPctg: 50, gasIssuancePerSecond: 5_000_000, minGasExcess: 1_344_899_430, // 0.01 gwei maxGasIssuancePerBlock: 600_000_000 @@ -48,6 +47,7 @@ contract DevnetInbox is TaikoInbox { cooldownWindow: cooldownWindow, maxSignalsToReceive: 16, maxBlocksPerBatch: 768, + baseFeeSharings: [uint8(50), uint8(0)], forkHeights: ITaikoInbox.ForkHeights({ ontake: 0, pacaya: 0, shasta: 0, unzen: 0 }) }); } diff --git a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol index 300c3243d7d..bea2a2e1aa7 100644 --- a/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol +++ b/packages/protocol/contracts/layer1/mainnet/MainnetInbox.sol @@ -41,7 +41,6 @@ contract MainnetInbox is TaikoInbox { maxAnchorHeightOffset: 64, baseFeeConfig: LibSharedData.BaseFeeConfig({ adjustmentQuotient: 8, - sharingPctg: 50, gasIssuancePerSecond: 5_000_000, minGasExcess: 1_344_899_430, // 0.01 gwei maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 @@ -50,6 +49,7 @@ contract MainnetInbox is TaikoInbox { cooldownWindow: 2 hours, maxSignalsToReceive: 16, maxBlocksPerBatch: 768, + baseFeeSharings: [uint8(50), uint8(0)], forkHeights: _getForkHeights() }); } diff --git a/packages/protocol/contracts/shared/based/LibSharedData.sol b/packages/protocol/contracts/shared/based/LibSharedData.sol index c4c10928d57..bb5519ba2bf 100644 --- a/packages/protocol/contracts/shared/based/LibSharedData.sol +++ b/packages/protocol/contracts/shared/based/LibSharedData.sol @@ -6,7 +6,6 @@ library LibSharedData { struct BaseFeeConfig { // This is the base fee change denominator per 12 second window. uint8 adjustmentQuotient; - uint8 sharingPctg; uint32 gasIssuancePerSecond; uint64 minGasExcess; uint32 maxGasIssuancePerBlock; diff --git a/packages/protocol/test/layer1/based/InboxTestBase.sol b/packages/protocol/test/layer1/based/InboxTestBase.sol index f68e0295e02..f0a106665dd 100644 --- a/packages/protocol/test/layer1/based/InboxTestBase.sol +++ b/packages/protocol/test/layer1/based/InboxTestBase.sol @@ -31,7 +31,6 @@ abstract contract InboxTestBase is Layer1Test { maxAnchorHeightOffset: 64, baseFeeConfig: LibSharedData.BaseFeeConfig({ adjustmentQuotient: 8, - sharingPctg: 75, gasIssuancePerSecond: 5_000_000, minGasExcess: 1_340_000_000, // correspond to 0.008847185 gwei basefee maxGasIssuancePerBlock: 600_000_000 // two minutes: 5_000_000 * 120 @@ -40,6 +39,7 @@ abstract contract InboxTestBase is Layer1Test { cooldownWindow: 0 hours, maxSignalsToReceive: 16, maxBlocksPerBatch: 768, + baseFeeSharings: [uint8(50), uint8(0)], forkHeights: forkHeights }); } diff --git a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol index 19ff361ee69..acb9c245b1d 100644 --- a/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol +++ b/packages/protocol/test/layer1/preconf/mocks/MockTaikoInbox.sol @@ -42,7 +42,6 @@ contract MockTaikoInbox is EssentialContract { blocks: params.blocks, baseFeeConfig: LibSharedData.BaseFeeConfig({ adjustmentQuotient: 0, - sharingPctg: 0, gasIssuancePerSecond: 0, minGasExcess: 0, maxGasIssuancePerBlock: 0 From 9eb717db7f089bac1436dafeb55ed7ede03ca00a Mon Sep 17 00:00:00 2001 From: D <51912515+adaki2004@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:47:28 +0200 Subject: [PATCH 16/16] feat(protocol): fix anchor tests (#19350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Keszey Dániel --- ..._provermarket_diff_prover_and_proposer.txt | 6 +- ...prover_and_proposer_fee_above_liveness.txt | 6 +- ...me_prover_as_proposer_measure_gas_used.txt | 6 +- .../inbox_without_provermarket.txt | 6 +- .../protocol/gas-reports/layer1-contracts.txt | 84 +++++++++---------- .../layer2/based/anchor/TaikoAnchor.t.sol | 3 - 6 files changed, 54 insertions(+), 57 deletions(-) diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt index 8c9c68d8fad..fa08c9731d5 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 165052 -Gas per proving + verification: 158546 -Total: 323598 \ No newline at end of file +Gas per proposing: 161669 +Gas per proving + verification: 155712 +Total: 317381 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt index 2d71f68bb11..c35f9d12af8 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 164896 -Gas per proving + verification: 158552 -Total: 323448 \ No newline at end of file +Gas per proposing: 161513 +Gas per proving + verification: 155718 +Total: 317231 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt index df8ffa0e76b..2e067084812 100644 --- a/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt +++ b/packages/protocol/gas-reports/inbox_with_provermarket_same_prover_as_proposer_measure_gas_used.txt @@ -1,5 +1,5 @@ See `test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 163055 -Gas per proving + verification: 156410 -Total: 319465 \ No newline at end of file +Gas per proposing: 159672 +Gas per proving + verification: 153577 +Total: 313249 \ No newline at end of file diff --git a/packages/protocol/gas-reports/inbox_without_provermarket.txt b/packages/protocol/gas-reports/inbox_without_provermarket.txt index b96ae49fea2..97c0b74c115 100644 --- a/packages/protocol/gas-reports/inbox_without_provermarket.txt +++ b/packages/protocol/gas-reports/inbox_without_provermarket.txt @@ -1,5 +1,5 @@ See `test_inbox_measure_gas_used` in InboxTest_ProposeAndProve.t.sol -Gas per proposing: 159631 -Gas per proving + verification: 154362 -Total: 313993 \ No newline at end of file +Gas per proposing: 156246 +Gas per proving + verification: 151530 +Total: 307776 \ No newline at end of file diff --git a/packages/protocol/gas-reports/layer1-contracts.txt b/packages/protocol/gas-reports/layer1-contracts.txt index 1e067a0d9f7..0000cf24b33 100644 --- a/packages/protocol/gas-reports/layer1-contracts.txt +++ b/packages/protocol/gas-reports/layer1-contracts.txt @@ -23,59 +23,59 @@ ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_notOperator() (gas: 12 ForcedInclusionStoreTest:test_storeConsumeForcedInclusion_success() (gas: 130906) ForcedInclusionStoreTest:test_storeForcedInclusion_incorrectFee() (gas: 39834) ForcedInclusionStoreTest:test_storeForcedInclusion_only_once_per_tx() (gas: 112138) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 1019306) -InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 1013421) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1040162) -InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 1014271) -InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 281773) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_non_proposer_in_proving_window() (gas: 992879) +InboxTest_BondMechanics:test_inbox_bonds_debit_and_credit_proved_by_proposer_in_proving_window() (gas: 986994) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_non_proposer_out_of_proving_window() (gas: 1013735) +InboxTest_BondMechanics:test_inbox_bonds_half_returned_to_proposer_out_of_proving_window() (gas: 987844) +InboxTest_BondMechanics:test_inbox_bonds_multiple_blocks_per_batch() (gas: 277800) InboxTest_BondToken:test_inbox_deposit_and_withdraw_from_multiple_users() (gas: 285541) InboxTest_BondToken:test_inbox_deposit_withdraw() (gas: 154724) InboxTest_BondToken:test_inbox_exceeding_token_balance() (gas: 98493) InboxTest_BondToken:test_inbox_insufficient_approval() (gas: 95904) InboxTest_BondToken:test_inbox_no_value_sent_on_deposit() (gas: 96710) InboxTest_BondToken:test_inbox_withdraw_more_than_bond_balance() (gas: 141621) -InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 166671) -InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 1022570) -InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1760835) -InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1049117) -InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 918211) -InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12531055) +InboxTest_CalldataForTxList:test_batch_rejection_due_to_missing_txlist_and_blobindex() (gas: 165759) +InboxTest_CalldataForTxList:test_calldata_used_for_txlist_da() (gas: 995730) +InboxTest_CalldataForTxList:test_multiple_blocks_with_different_txlist() (gas: 1708309) +InboxTest_CalldataForTxList:test_propose_batch_with_empty_txlist_and_valid_blobindex() (gas: 1022558) +InboxTest_CalldataForTxList:test_prove_batch_with_mismatched_info_hash() (gas: 891650) +InboxTest_Cooldownis:test_inbox_batches_cannot_verify_inside_cooldown_window() (gas: 12234394) InboxTest_EtherAsBond:test_inbox_bond_balance_after_multiple_operations() (gas: 157081) InboxTest_EtherAsBond:test_inbox_deposit_withdraw() (gas: 74401) InboxTest_EtherAsBond:test_inbox_eth_not_paid_as_bond_on_deposit() (gas: 18885) InboxTest_EtherAsBond:test_inbox_overpayment_of_ether() (gas: 25677) InboxTest_EtherAsBond:test_inbox_withdraw_more_than_bond_balance() (gas: 61901) -InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 266348) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 919705) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 133019) -InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 144467) -InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 310872) -InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 319334) -InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 133104) -InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 266632) -InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 166010) -InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 8111445) -InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8426485) -InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 9308016) -InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8797776) -InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 12056888) -InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 10081328) -InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 124744) -InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1049864) -InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5972619) -InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 40256) -InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 109996) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1311462) -InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7825893) -InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1225034) -InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 15123207) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9435712) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9435764) -InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9373901) -InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8378716) -PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375738) -PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325982) -PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 374415) +InboxTest_Params:test_validateParams_defaults_when_anchorBlockId_is_zero() (gas: 265059) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_smaller_than_parent() (gas: 890410) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_large() (gas: 132086) +InboxTest_Params:test_validateParams_reverts_when_anchorBlockId_too_small() (gas: 141390) +InboxTest_Params:test_validateParams_reverts_when_first_block_time_shift_not_zero() (gas: 303709) +InboxTest_Params:test_validateParams_reverts_when_timestamp_smaller_than_parent() (gas: 312169) +InboxTest_Params:test_validateParams_reverts_when_timestamp_too_large() (gas: 132171) +InboxTest_Params:test_validateParams_when_anchorBlockId_is_not_zero() (gas: 265343) +InboxTest_ProposeAndProve:test_ProposeBatch_reverts_for_invalid_proposer_and_operator() (gas: 165054) +InboxTest_ProposeAndProve:test_inbox_exceed_max_batch_proposal_will_revert() (gas: 7824572) +InboxTest_ProposeAndProve:test_inbox_max_batch_proposal() (gas: 8104387) +InboxTest_ProposeAndProve:test_inbox_measure_gas_used() (gas: 8954923) +InboxTest_ProposeAndProve:test_inbox_propose_1block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 8452410) +InboxTest_ProposeAndProve:test_inbox_propose_7block_per_batch_and_prove_many_blocks_with_first_transition_being_correct() (gas: 11722655) +InboxTest_ProposeAndProve:test_inbox_propose_and_prove_many_blocks_with_second_transition_being_correct() (gas: 9729698) +InboxTest_ProposeAndProve:test_inbox_prove_batch_not_exist_will_revert() (gas: 123880) +InboxTest_ProposeAndProve:test_inbox_prove_verified_batch_will_revert() (gas: 1020095) +InboxTest_ProposeAndProve:test_inbox_prove_with_wrong_transitions_will_not_finalize_blocks() (gas: 5754769) +InboxTest_ProposeAndProve:test_inbox_query_batches_not_exist_will_revert() (gas: 39419) +InboxTest_ProposeAndProve:test_inbox_query_right_after_genesis_batch() (gas: 94956) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_or_state_root_will_pause_inbox() (gas: 1251405) +InboxTest_ProposeAndProve:test_inbox_reprove_by_transition_with_same_parent_hash_but_different_block_hash_will_pause_inbox() (gas: 7539676) +InboxTest_ProposeAndProve:test_inbox_reprove_the_same_batch_with_same_transition_will_do_nothing() (gas: 1176088) +InboxTest_ProposeAndProve:test_inbox_ring_buffer_will_be_reused() (gas: 14525130) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_fee_above_liveness_measure_gas_used() (gas: 9082618) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_diff_prover_and_proposer_measure_gas_used() (gas: 9082670) +InboxTest_ProposeAndProve:test_inbox_with_provermarket_same_prover_as_proposer_measure_gas_used() (gas: 9020808) +InboxTest_StopBatch:test_inbox_num_batches_verified() (gas: 8088608) +PreconfRouterTest:test_preconfRouter_proposeBatch() (gas: 375425) +PreconfRouterTest:test_preconfRouter_proposeBatch_notOperator() (gas: 325907) +PreconfRouterTest:test_preconfRouter_proposeBatch_proposerNotSender() (gas: 374152) ProverMarketTest:test_FeeLargerThanAllowed_reverts() (gas: 112989) ProverMarketTest:test_bid() (gas: 87467) ProverMarketTest:test_bid_with_insufficientBondBalance() (gas: 38141) diff --git a/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol b/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol index 610cd3baf53..769969e4037 100644 --- a/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol +++ b/packages/protocol/test/layer2/based/anchor/TaikoAnchor.t.sol @@ -96,7 +96,6 @@ contract TestTaikoAnchor is Layer2Test { { LibSharedData.BaseFeeConfig memory baseFeeConfig = LibSharedData.BaseFeeConfig({ adjustmentQuotient: _adjustmentQuotient, - sharingPctg: uint8(_sharingPctg % 100), gasIssuancePerSecond: _gasIssuancePerSecond, minGasExcess: _minGasExcess, maxGasIssuancePerBlock: _maxGasIssuancePerBlock @@ -127,7 +126,6 @@ contract TestTaikoAnchor is Layer2Test { LibSharedData.BaseFeeConfig memory baseFeeConfig = LibSharedData.BaseFeeConfig({ adjustmentQuotient: _adjustmentQuotient, - sharingPctg: uint8(_sharingPctg % 100), gasIssuancePerSecond: _gasIssuancePerSecond, minGasExcess: _minGasExcess, maxGasIssuancePerBlock: _maxGasIssuancePerBlock @@ -159,7 +157,6 @@ contract TestTaikoAnchor is Layer2Test { bytes32 anchorStateRoot = randBytes32(); LibSharedData.BaseFeeConfig memory baseFeeConfig = LibSharedData.BaseFeeConfig({ adjustmentQuotient: 8, - sharingPctg: 75, gasIssuancePerSecond: 5_000_000, minGasExcess: 1_340_000_000, maxGasIssuancePerBlock: 600_000_000 // two minutes