From a1b401460bfaa0b4709123b04f77dd5c6a6e7176 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:06:13 +0530 Subject: [PATCH 1/5] CI changes to accommodate Anvil --- .github/matic-cli-config.yml | 4 ++-- .github/workflows/ci.yml | 15 ++++++++++----- integration-tests/fund_ganache_accounts.sh | 19 ------------------- 3 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 integration-tests/fund_ganache_accounts.sh diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index e3200ec8b8..bccace99dd 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -2,7 +2,7 @@ defaultStake: 10000 defaultFee: 2000 borChainId: 15001 heimdallChainId: heimdall-15001 -contractsBranch: mardizzone/node-16 +contractsBranch: anvil-pos genesisContractsBranch: master sprintSize: - '64' @@ -16,7 +16,7 @@ numOfBorArchiveNodes: 0 numOfErigonValidators: 0 numOfErigonSentries: 0 numOfErigonArchiveNodes: 0 -ethURL: http://ganache:9545 +ethURL: http://anvil:9545 ethHostUser: ubuntu devnetType: docker borDockerBuildContext: "../../bor" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c2543b5f3..a8c6a214c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,6 +225,9 @@ jobs: matic-cli/devnet/code/genesis-contracts/package-lock.json matic-cli/devnet/code/genesis-contracts/matic-contracts/package-lock.json + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + - name: Bootstrap devnet run: | cd matic-cli @@ -242,12 +245,14 @@ jobs: - name: Run smoke tests run: | - echo "Funding ganache accounts..." - timeout 10m bash bor/integration-tests/fund_ganache_accounts.sh echo "Deposit 100 matic for each account to bor network" - cd matic-cli/devnet/code/contracts - npm run truffle exec scripts/deposit.js -- --network development $(jq -r .root.tokens.MaticToken contractAddresses.json) 100000000000000000000 - cd - + cd matic-cli/devnet/devnet + SCRIPT_ADDRESS=$(jq -r '.[0].address' signer-dump.json) + SCRIPT_PRIVATE_KEY=$(jq -r '.[0].priv_key' signer-dump.json) + cd ../code/pos-contracts + CONTRACT_ADDRESS=$(jq -r .root.tokens.MaticToken contractAddresses.json) + forge script scripts/matic-cli-scripts/Deposit.s.sol:MaticDeposit --rpc-url http://localhost:9545 --private-key $SCRIPT_PRIVATE_KEY --broadcast --sig "run(address,address,uint256)" $SCRIPT_ADDRESS $CONTRACT_ADDRESS 100000000000000000000 + cd ../../../.. timeout 60m bash bor/integration-tests/smoke_test.sh - name: Run RPC Tests diff --git a/integration-tests/fund_ganache_accounts.sh b/integration-tests/fund_ganache_accounts.sh deleted file mode 100644 index 40daaedd4e..0000000000 --- a/integration-tests/fund_ganache_accounts.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -host='localhost' - -echo "Transferring 1 ETH from ganache account[0] to all others..." - -signersFile="matic-cli/devnet/devnet/signer-dump.json" -signersDump=$(jq . $signersFile) -signersLength=$(jq '. | length' $signersFile) - -rootChainWeb3="http://${host}:9545" - -for ((i = 1; i < signersLength; i++)); do - to_address=$(echo "$signersDump" | jq -r ".[$i].address") - from_address=$(echo "$signersDump" | jq -r ".[0].address") - txReceipt=$(curl $rootChainWeb3 -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"to":"'"$to_address"'","from":"'"$from_address"'","value":"0xDE0B6B3A7640000"}],"id":1}' -H "Content-Type: application/json") - txHash=$(echo "$txReceipt" | jq -r '.result') - echo "Funds transferred from $from_address to $to_address with txHash: $txHash" -done From befc5dbde225410a74f98a83086f52c029d5cb87 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:14:20 +0530 Subject: [PATCH 2/5] Temp changed CI branch for testing anvil compatibility --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8c6a214c3..61097339ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: master + ref: arya/anvil/pos-1869 path: matic-cli - name: Install dependencies on Linux From d6fa743fb6f3b9178a05caa36daabfe83bda0ee3 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 16:53:34 +0530 Subject: [PATCH 3/5] added mnemonics to matic-cli config --- .github/matic-cli-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index bccace99dd..f096c132ca 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -24,3 +24,4 @@ heimdallDockerBuildContext: "https://github.com/maticnetwork/heimdall.git#develo sprintSizeBlockNumber: - '0' devnetBorFlags: config,config,config +mnemonic: 'clock radar mass judge dismiss just intact mind resemble fringe diary casino' From 4d609129d912638da066a37568ca45575a16100c Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:14:55 +0530 Subject: [PATCH 4/5] changed matic-cli branch to master --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61097339ec..a8c6a214c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: uses: actions/checkout@v4 with: repository: maticnetwork/matic-cli - ref: arya/anvil/pos-1869 + ref: master path: matic-cli - name: Install dependencies on Linux From 2085a1f85d0cd0a1281679f2b038fe12dcda7855 Mon Sep 17 00:00:00 2001 From: Arya Lanjewar <102943033+AryaLanjewar3005@users.noreply.github.com> Date: Fri, 28 Feb 2025 21:28:50 +0530 Subject: [PATCH 5/5] added contractsRepo to matic-cli config --- .github/matic-cli-config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/matic-cli-config.yml b/.github/matic-cli-config.yml index f096c132ca..c33854f259 100644 --- a/.github/matic-cli-config.yml +++ b/.github/matic-cli-config.yml @@ -2,6 +2,7 @@ defaultStake: 10000 defaultFee: 2000 borChainId: 15001 heimdallChainId: heimdall-15001 +contractsRepo: https://github.com/0xPolygon/pos-contracts.git contractsBranch: anvil-pos genesisContractsBranch: master sprintSize: