Feat/122 Add TokenBridge e2e tests (#210)

* fix: add mutex in account manager to avoid nonce issue

* fix: optimize global setup

* Limiting number of concurrent traces API requests for the local stack to avoid occasional OOM-s

* Limiting number of verticles for Traces API node

* Add E2E TokenBridge tests

* fixing test and adding concurency

* fixing test and adding concurency

* fixing test and adding concurency

* fixing test and adding concurency

* fixing nonce management

* deploying l2token for the L2 -> L1 test

* adjusting accounts for L2->L1 test

* adjusting l2TestContractAddress

* use nonce management for L1->L2 test

* adjusting the TestERC20 contract and tests

* rebasing with fix/133-improve-e2e-tests-performance

* fix: update jest config to exit even if there are open handles

* Trying out Besu untuned and raising limit per endpoint to 2 for traces

* Trying out Besu untuned and raising limit per endpoint to 2 for traces and Shomei node

* Using besu untuned for arithmetization as well

* Compile once and parallelise setRemoteTokenBridge

* feat: deploy smart contracts from artifacts + change e2e tests setup

* fix: update pnpm

* fix: remove compile contracts gradle task

* fix: remove compileContracts gradle task

* fix: refactor genesis generator dockerfile + downgrade l1-el-node besu version

* fix: move abi from e2e folder to contract folder + refactor contracts deployments scripts

* feat: add deployment script from artifacts for LineaRollupV6

* update pnpm version in get-started.md

* fix: update console log in deployment scripts

* fix: update besu version + fix deployment scripts

* correct addresses

* fix import

* use abi and bytecode for deployments

* use upgradable beacon for BridgedToken ABI deploys

* use saved abi and bytecode for TestERC20 deploy

* correct deployBridgedTokenAndTokenBridge casing

* optimize token bridge e2e calls

* use explicit message event data

* use precomputed nonces for e2e stack

---------

Co-authored-by: VGau <victorien.gauch@consensys.net>
Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: Roman <4833306+Filter94@users.noreply.github.com>
Co-authored-by: thedarkjester <grant.southey@consensys.net>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
This commit is contained in:
Andrei A.
2024-10-31 19:03:53 +02:00
committed by GitHub
parent bf2a760824
commit 390d6ff860
26 changed files with 3237 additions and 18 deletions

View File

@@ -108,6 +108,53 @@ deploy-l2messageservice:
L2MSGSERVICE_RATE_LIMIT_AMOUNT=1000000000000000000000 \
npx ts-node local-deployments-artifacts/deployL2MessageService.ts
deploy-token-bridge-l1:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
RPC_URL=http:\\localhost:8445/ \
REMOTE_CHAIN_ID=1337 \
TOKEN_BRIDGE_L1=true \
TOKEN_BRIDGE_SECURITY_COUNCIL=0x90F79bf6EB2c4f870365E785982E1f101E93b906 \
L2_MESSAGE_SERVICE_ADDRESS=0xe537D669CA013d86EBeF1D64e40fC74CADC91987 \
LINEA_ROLLUP_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \
npx ts-node local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts
deploy-token-bridge-l2:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
SAVE_ADDRESS=true \
PRIVATE_KEY=0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae \
RPC_URL=http:\\localhost:8545/ \
REMOTE_CHAIN_ID=31648428 \
TOKEN_BRIDGE_L1=false \
TOKEN_BRIDGE_SECURITY_COUNCIL=0xf17f52151EbEF6C7334FAD080c5704D77216b732 \
L2_MESSAGE_SERVICE_ADDRESS=0xe537D669CA013d86EBeF1D64e40fC74CADC91987 \
LINEA_ROLLUP_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \
npx ts-node local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts
deploy-l1-test-erc20:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
RPC_URL=http:\\localhost:8445/ \
TEST_ERC20_L1=true \
TEST_ERC20_NAME=TestERC20 \
TEST_ERC20_SYMBOL=TERC20 \
TEST_ERC20_INITIAL_SUPPLY=100000 \
npx ts-node local-deployments-artifacts/deployTestERC20.ts
deploy-l2-test-erc20:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
PRIVATE_KEY=0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae \
RPC_URL=http:\\localhost:8545/ \
TEST_ERC20_L1=false \
TEST_ERC20_NAME=TestERC20 \
TEST_ERC20_SYMBOL=TERC20 \
TEST_ERC20_INITIAL_SUPPLY=100000 \
npx ts-node local-deployments-artifacts/deployTestERC20.ts
upgrade-linea-rollup-on-uat:
cd contracts/; \
rm -f .openzeppelin/goerli.json; \
@@ -153,7 +200,11 @@ deploy-contracts-v4:
$(MAKE) -j2 deploy-linea-rollup-v4 deploy-l2messageservice
deploy-contracts:
$(MAKE) -j2 deploy-linea-rollup-v5 deploy-l2messageservice
cd contracts/; \
export L1_NONCE=$$(npx ts-node local-deployments-artifacts/get-wallet-nonce.ts --wallet-priv-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8445) && \
export L2_NONCE=$$(npx ts-node local-deployments-artifacts/get-wallet-nonce.ts --wallet-priv-key 0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae --rpc-url http://localhost:8545) && \
cd .. && \
$(MAKE) -j6 deploy-linea-rollup-v5 deploy-token-bridge-l1 deploy-l1-test-erc20 deploy-l2messageservice deploy-token-bridge-l2 deploy-l2-test-erc20
testnet-start-l2:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml --profile l2 up -d