From 15fceef8dd4e9d0c79f9afe9cf840f720d35ed1a Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 14:53:53 +0800 Subject: [PATCH 1/6] fix issue in mainnet deployment script --- packages/protocol/script/layer1/DeployProtocolOnL1.s.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol index 8e0f49b0ad1..c49b25a218c 100644 --- a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol +++ b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol @@ -22,6 +22,7 @@ import "src/layer1/devnet/DevnetTaikoL1.sol"; import "src/layer1/devnet/DevnetTierProvider.sol"; import "src/layer1/mainnet/rollup/MainnetGuardianProver.sol"; import "src/layer1/mainnet/rollup/MainnetTaikoL1.sol"; +import "src/layer1/mainnet/rollup/MainnetTierRouter.sol"; import "src/layer1/mainnet/rollup/verifiers/MainnetSgxVerifier.sol"; import "src/layer1/mainnet/multirollup/MainnetBridge.sol"; import "src/layer1/mainnet/multirollup/MainnetERC1155Vault.sol"; @@ -30,7 +31,6 @@ import "src/layer1/mainnet/multirollup/MainnetERC721Vault.sol"; import "src/layer1/mainnet/multirollup/MainnetSignalService.sol"; import "src/layer1/provers/GuardianProver.sol"; import "src/layer1/provers/ProverSet.sol"; -import "src/layer1/tiers/TierProviderV2.sol"; import "src/layer1/token/TaikoToken.sol"; import "src/layer1/verifiers/Risc0Verifier.sol"; import "src/layer1/verifiers/SP1Verifier.sol"; @@ -433,7 +433,7 @@ contract DeployProtocolOnL1 is DeployCapability { } else if (keccak256(abi.encode(tierProviderName)) == keccak256(abi.encode("testnet"))) { return address(new TestTierProvider()); } else if (keccak256(abi.encode(tierProviderName)) == keccak256(abi.encode("mainnet"))) { - return address(new TierProviderV2()); + return address(new MainnetTierRouter()); } else { revert("invalid tier provider"); } From c955880b542eb8fc66555e76c83545e63863efaa Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 15:01:28 +0800 Subject: [PATCH 2/6] Update DeployProtocolOnL1.s.sol --- .../protocol/script/layer1/DeployProtocolOnL1.s.sol | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol index c49b25a218c..60f8b0e7076 100644 --- a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol +++ b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol @@ -291,8 +291,7 @@ contract DeployProtocolOnL1 is DeployCapability { }); TaikoL1 taikoL1; - if (keccak256(abi.encode(vm.envString("TIER_PROVIDER"))) == keccak256(abi.encode("devnet"))) - { + if (keccak256(abi.encode(vm.envString("TIER_ROUTER"))) == keccak256(abi.encode("devnet"))) { taikoL1 = TaikoL1(address(new DevnetTaikoL1())); } else { taikoL1 = TaikoL1(address(new TaikoL1())); @@ -353,7 +352,7 @@ contract DeployProtocolOnL1 is DeployCapability { register( rollupAddressManager, "tier_router", - address(deployTierProvider(vm.envString("TIER_PROVIDER"))) + address(deployTierRouter(vm.envString("TIER_ROUTER"))) ); address[] memory guardians = vm.envAddress("GUARDIAN_PROVERS", ","); @@ -427,12 +426,12 @@ contract DeployProtocolOnL1 is DeployCapability { }); } - function deployTierProvider(string memory tierProviderName) private returns (address) { - if (keccak256(abi.encode(tierProviderName)) == keccak256(abi.encode("devnet"))) { + function deployTierRouter(string memory tierRouterName) private returns (address) { + if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("devnet"))) { return address(new DevnetTierProvider()); - } else if (keccak256(abi.encode(tierProviderName)) == keccak256(abi.encode("testnet"))) { + } else if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("testnet"))) { return address(new TestTierProvider()); - } else if (keccak256(abi.encode(tierProviderName)) == keccak256(abi.encode("mainnet"))) { + } else if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("mainnet"))) { return address(new MainnetTierRouter()); } else { revert("invalid tier provider"); From edc02785ee4edc2bd8edf7baea55322771580523 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 15:06:04 +0800 Subject: [PATCH 3/6] rename --- .../{DevnetTierProvider.sol => DevnetTierRouter.sol} | 4 ++-- .../protocol/script/layer1/DeployProtocolOnL1.s.sol | 8 ++++---- packages/protocol/test/layer1/TaikoL1Test.sol | 2 +- .../protocol/test/layer1/based/TaikoL1TestBase.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup1.t.sol | 12 ++++++------ .../test/layer1/based/TaikoL1TestGroup2.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup3.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup4.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup5.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup6.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup7.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup9.t.sol | 4 ++-- .../{TestTierProvider.sol => TestTierRouter.sol} | 4 ++-- 13 files changed, 37 insertions(+), 37 deletions(-) rename packages/protocol/contracts/layer1/devnet/{DevnetTierProvider.sol => DevnetTierRouter.sol} (89%) rename packages/protocol/test/layer1/based/{TestTierProvider.sol => TestTierRouter.sol} (96%) diff --git a/packages/protocol/contracts/layer1/devnet/DevnetTierProvider.sol b/packages/protocol/contracts/layer1/devnet/DevnetTierRouter.sol similarity index 89% rename from packages/protocol/contracts/layer1/devnet/DevnetTierProvider.sol rename to packages/protocol/contracts/layer1/devnet/DevnetTierRouter.sol index 0b842926633..0f63411dbdf 100644 --- a/packages/protocol/contracts/layer1/devnet/DevnetTierProvider.sol +++ b/packages/protocol/contracts/layer1/devnet/DevnetTierRouter.sol @@ -4,9 +4,9 @@ pragma solidity ^0.8.24; import "../tiers/TierProviderBase.sol"; import "../tiers/ITierRouter.sol"; -/// @title DevnetTierProvider +/// @title DevnetTierRouter /// @custom:security-contact security@taiko.xyz -contract DevnetTierProvider is TierProviderBase, ITierRouter { +contract DevnetTierRouter is TierProviderBase, ITierRouter { /// @inheritdoc ITierRouter function getProvider(uint256) external view returns (address) { return address(this); diff --git a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol index 60f8b0e7076..093a937168d 100644 --- a/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol +++ b/packages/protocol/script/layer1/DeployProtocolOnL1.s.sol @@ -19,7 +19,7 @@ import "src/layer1/automata-attestation/AutomataDcapV3Attestation.sol"; import "src/layer1/automata-attestation/lib/PEMCertChainLib.sol"; import "src/layer1/automata-attestation/utils/SigVerifyLib.sol"; import "src/layer1/devnet/DevnetTaikoL1.sol"; -import "src/layer1/devnet/DevnetTierProvider.sol"; +import "src/layer1/devnet/DevnetTierRouter.sol"; import "src/layer1/mainnet/rollup/MainnetGuardianProver.sol"; import "src/layer1/mainnet/rollup/MainnetTaikoL1.sol"; import "src/layer1/mainnet/rollup/MainnetTierRouter.sol"; @@ -34,7 +34,7 @@ import "src/layer1/provers/ProverSet.sol"; import "src/layer1/token/TaikoToken.sol"; import "src/layer1/verifiers/Risc0Verifier.sol"; import "src/layer1/verifiers/SP1Verifier.sol"; -import "test/layer1/based/TestTierProvider.sol"; +import "test/layer1/based/TestTierRouter.sol"; import "test/shared/token/FreeMintERC20.sol"; import "test/shared/token/MayFailFreeMintERC20.sol"; import "test/shared/DeployCapability.sol"; @@ -428,9 +428,9 @@ contract DeployProtocolOnL1 is DeployCapability { function deployTierRouter(string memory tierRouterName) private returns (address) { if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("devnet"))) { - return address(new DevnetTierProvider()); + return address(new DevnetTierRouter()); } else if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("testnet"))) { - return address(new TestTierProvider()); + return address(new TestTierRouter()); } else if (keccak256(abi.encode(tierRouterName)) == keccak256(abi.encode("mainnet"))) { return address(new MainnetTierRouter()); } else { diff --git a/packages/protocol/test/layer1/TaikoL1Test.sol b/packages/protocol/test/layer1/TaikoL1Test.sol index 5f660fee478..e77e24220b9 100644 --- a/packages/protocol/test/layer1/TaikoL1Test.sol +++ b/packages/protocol/test/layer1/TaikoL1Test.sol @@ -9,7 +9,7 @@ import "src/layer1/verifiers/Risc0Verifier.sol"; import "src/layer1/provers/GuardianProver.sol"; import "src/layer1/team/airdrop/ERC20Airdrop.sol"; import "src/shared/bridge/QuotaManager.sol"; -import "../layer1/based/TestTierProvider.sol"; +import "../layer1/based/TestTierRouter.sol"; import "../shared/TaikoTest.sol"; abstract contract TaikoL1Test is TaikoTest { } diff --git a/packages/protocol/test/layer1/based/TaikoL1TestBase.sol b/packages/protocol/test/layer1/based/TaikoL1TestBase.sol index f3620aaad02..852cde22450 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestBase.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestBase.sol @@ -14,7 +14,7 @@ abstract contract TaikoL1TestBase is TaikoTest { SP1Verifier public sp1; SgxVerifier public sv; GuardianProver public gp; - TestTierProvider public cp; + TestTierRouter public cp; Bridge public bridge; bytes32 public GENESIS_BLOCK_HASH = keccak256("GENESIS_BLOCK_HASH"); @@ -75,7 +75,7 @@ abstract contract TaikoL1TestBase is TaikoTest { setupGuardianProverMultisig(); - cp = new TestTierProvider(); + cp = new TestTierRouter(); bridge = Bridge( payable( diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol index 93aff49bbe5..abef1b3c7d2 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol @@ -14,7 +14,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -117,7 +117,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -212,7 +212,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -263,7 +263,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -314,7 +314,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -364,7 +364,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol index 9bb5f5cf8a7..6f8c16475ca 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol @@ -17,8 +17,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -123,8 +123,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol index 000fefb99ea..78466dc9205 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol @@ -18,8 +18,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -131,8 +131,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol index 01b503f5cd6..c5eb69dfd34 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol @@ -16,8 +16,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -95,8 +95,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol index ac7d7fc0efe..2197f91123e 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol @@ -135,7 +135,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -223,7 +223,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol index 15fa6b57fb0..7f5975072fc 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol @@ -15,8 +15,8 @@ contract TaikoL1TestGroup6 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol index d255a89328d..f2062a7cfb4 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol @@ -13,7 +13,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -52,7 +52,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol index 563512ef66b..fff22decb10 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol @@ -159,7 +159,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -249,7 +249,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Carol, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TestTierProvider.sol b/packages/protocol/test/layer1/based/TestTierRouter.sol similarity index 96% rename from packages/protocol/test/layer1/based/TestTierProvider.sol rename to packages/protocol/test/layer1/based/TestTierRouter.sol index 09beb43d033..8eb53a868b8 100644 --- a/packages/protocol/test/layer1/based/TestTierProvider.sol +++ b/packages/protocol/test/layer1/based/TestTierRouter.sol @@ -6,10 +6,10 @@ import "src/layer1/tiers/ITierProvider.sol"; import "src/layer1/tiers/LibTiers.sol"; import "src/layer1/tiers/ITierRouter.sol"; -/// @title TestTierProvider +/// @title TestTierRouter /// @dev Labeled in AddressResolver as "tier_router" /// @custom:security-contact security@taiko.xyz -contract TestTierProvider is ITierProvider, ITierRouter { +contract TestTierRouter is ITierProvider, ITierRouter { uint256[50] private __gap; /// @inheritdoc ITierRouter From d4840fdac1efc1c04e5a871a46146fc2a5cd7f44 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 15:09:52 +0800 Subject: [PATCH 4/6] more --- .../test/layer1/based/TaikoL1TestGroup1.t.sol | 12 ++++++------ .../test/layer1/based/TaikoL1TestGroup2.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup3.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup4.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup5.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup6.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup7.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup9.t.sol | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol index abef1b3c7d2..24bfbcb445c 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol @@ -14,7 +14,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -117,7 +117,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -212,7 +212,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -263,7 +263,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -314,7 +314,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -364,7 +364,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol index 6f8c16475ca..e9f100b4c17 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol @@ -17,8 +17,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -123,8 +123,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol index 78466dc9205..7deff115ea4 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol @@ -18,8 +18,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -131,8 +131,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol index c5eb69dfd34..bfd786201be 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol @@ -16,8 +16,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -95,8 +95,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol index 2197f91123e..d56c846d17c 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol @@ -135,7 +135,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -223,7 +223,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol index 7f5975072fc..f421f7a4413 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol @@ -15,8 +15,8 @@ contract TaikoL1TestGroup6 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = TestTierRouter(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol index f2062a7cfb4..c1413e592bd 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol @@ -13,7 +13,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -52,7 +52,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol index fff22decb10..e6b99cc2390 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol @@ -159,7 +159,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -249,7 +249,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Carol, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = TestTierRouter(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); From bb6d80f62270aec82c92ac468ced9c72e4b2925c Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 15:15:03 +0800 Subject: [PATCH 5/6] rename --- packages/protocol/test/layer1/based/TaikoL1.t.sol | 4 ++-- .../protocol/test/layer1/based/TaikoL1TestBase.sol | 6 +++--- .../test/layer1/based/TaikoL1TestGroup1.t.sol | 12 ++++++------ .../test/layer1/based/TaikoL1TestGroup2.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup3.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup4.t.sol | 8 ++++---- .../test/layer1/based/TaikoL1TestGroup5.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup6.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup7.t.sol | 4 ++-- .../test/layer1/based/TaikoL1TestGroup9.t.sol | 4 ++-- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/protocol/test/layer1/based/TaikoL1.t.sol b/packages/protocol/test/layer1/based/TaikoL1.t.sol index 39918e9d14a..ede0cffa22f 100644 --- a/packages/protocol/test/layer1/based/TaikoL1.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1.t.sol @@ -225,13 +225,13 @@ contract TaikoL1Tests is TaikoL1TestBase { } function test_getTierIds() external { - uint16[] memory tiers = cp.getTierIds(); + uint16[] memory tiers = tr.getTierIds(); assertEq(tiers[0], LibTiers.TIER_OPTIMISTIC); assertEq(tiers[1], LibTiers.TIER_SGX); assertEq(tiers[2], LibTiers.TIER_GUARDIAN); vm.expectRevert(); - cp.getTier(123); + tr.getTier(123); } function proposeButRevert(address proposer, uint24 txListSize, bytes4 revertReason) internal { diff --git a/packages/protocol/test/layer1/based/TaikoL1TestBase.sol b/packages/protocol/test/layer1/based/TaikoL1TestBase.sol index 852cde22450..8dad90a69e0 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestBase.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestBase.sol @@ -14,7 +14,7 @@ abstract contract TaikoL1TestBase is TaikoTest { SP1Verifier public sp1; SgxVerifier public sv; GuardianProver public gp; - TestTierRouter public cp; + TestTierRouter public tr; Bridge public bridge; bytes32 public GENESIS_BLOCK_HASH = keccak256("GENESIS_BLOCK_HASH"); @@ -75,7 +75,7 @@ abstract contract TaikoL1TestBase is TaikoTest { setupGuardianProverMultisig(); - cp = new TestTierRouter(); + tr = new TestTierRouter(); bridge = Bridge( payable( @@ -91,7 +91,7 @@ abstract contract TaikoL1TestBase is TaikoTest { registerAddress("taiko", address(L1)); registerAddress("tier_sgx", address(sv)); registerAddress("tier_guardian", address(gp)); - registerAddress("tier_router", address(cp)); + registerAddress("tier_router", address(tr)); registerAddress("signal_service", address(ss)); registerL2Address("taiko", address(L2)); registerL2Address("signal_service", address(L2SS)); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol index 24bfbcb445c..a6725bc2296 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup1.t.sol @@ -14,7 +14,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -117,7 +117,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -212,7 +212,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -263,7 +263,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -314,7 +314,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -364,7 +364,7 @@ contract TaikoL1TestGroup1 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol index e9f100b4c17..49cee986060 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup2.t.sol @@ -17,8 +17,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -123,8 +123,8 @@ contract TaikoL1TestGroup2 is TaikoL1TestGroupBase { giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol index 7deff115ea4..832aa341988 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup3.t.sol @@ -18,8 +18,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -131,8 +131,8 @@ contract TaikoL1TestGroup3 is TaikoL1TestGroupBase { giveEthAndTko(James, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol index bfd786201be..ce0bbdde373 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup4.t.sol @@ -16,8 +16,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -95,8 +95,8 @@ contract TaikoL1TestGroup4 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol index d56c846d17c..ebbaa4eea57 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup5.t.sol @@ -135,7 +135,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -223,7 +223,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(David, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol index f421f7a4413..cb42f8ea7a2 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup6.t.sol @@ -15,8 +15,8 @@ contract TaikoL1TestGroup6 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); - ITierProvider.Tier memory tierSgx = ITierProvider(cp).getTier(LibTiers.TIER_SGX); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierSgx = ITierProvider(tr).getTier(LibTiers.TIER_SGX); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol index c1413e592bd..78c85f1a00b 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup7.t.sol @@ -13,7 +13,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -52,7 +52,7 @@ contract TaikoL1TestGroup7 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Taylor, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); diff --git a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol index e6b99cc2390..ba98ebd1799 100644 --- a/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol +++ b/packages/protocol/test/layer1/based/TaikoL1TestGroup9.t.sol @@ -159,7 +159,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); @@ -249,7 +249,7 @@ contract TaikoL1TestGroup5 is TaikoL1TestGroupBase { giveEthAndTko(Alice, 10_000 ether, 1000 ether); giveEthAndTko(Carol, 10_000 ether, 1000 ether); giveEthAndTko(William, 10_000 ether, 1000 ether); - ITierProvider.Tier memory tierOp = ITierProvider(cp).getTier(LibTiers.TIER_OPTIMISTIC); + ITierProvider.Tier memory tierOp = ITierProvider(tr).getTier(LibTiers.TIER_OPTIMISTIC); console2.log("====== Alice propose a block"); TaikoData.BlockMetadata memory meta = proposeBlock(Alice, ""); From 6492aab3dbec5265adfc908cdfad401e14bb427a Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 23 Oct 2024 16:08:50 +0800 Subject: [PATCH 6/6] fix --- packages/protocol/script/layer1/deploy_protocol_on_l1.sh | 2 +- packages/taiko-client/integration_test/l1_env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protocol/script/layer1/deploy_protocol_on_l1.sh b/packages/protocol/script/layer1/deploy_protocol_on_l1.sh index b225c2279a6..391fd31cca2 100755 --- a/packages/protocol/script/layer1/deploy_protocol_on_l1.sh +++ b/packages/protocol/script/layer1/deploy_protocol_on_l1.sh @@ -21,7 +21,7 @@ PAUSE_TAIKO_L1=true \ PAUSE_BRIDGE=true \ NUM_MIN_MAJORITY_GUARDIANS=7 \ NUM_MIN_MINORITY_GUARDIANS=2 \ -TIER_PROVIDER="devnet" \ +TIER_ROUTER="devnet" \ FOUNDRY_PROFILE="layer1" \ forge script ./script/layer1/DeployProtocolOnL1.s.sol:DeployProtocolOnL1 \ --fork-url http://localhost:8545 \ diff --git a/packages/taiko-client/integration_test/l1_env.sh b/packages/taiko-client/integration_test/l1_env.sh index 3fd0923f49b..7bde57f70aa 100755 --- a/packages/taiko-client/integration_test/l1_env.sh +++ b/packages/taiko-client/integration_test/l1_env.sh @@ -10,7 +10,7 @@ export PROVER_SET_ADMIN=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 export TAIKO_TOKEN_PREMINT_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 export TAIKO_TOKEN_NAME="Taiko Token Test" export TAIKO_TOKEN_SYMBOL="TTKOt" -export TIER_PROVIDER="devnet" +export TIER_ROUTER="devnet" export PAUSE_TAIKO_L1="false" export PAUSE_BRIDGE="false" export TAIKO_TOKEN=0x0000000000000000000000000000000000000000