From e1251e1878f68cda79984f3a667b47ba62865281 Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Nov 2024 18:01:00 +0100 Subject: [PATCH 01/12] feat: pre-deployed erc20 gas token --- .github/tests/fork12-pessimistic.yml | 1 - .github/tests/gas-token.yml | 2 -- .github/tests/gas-token/auto.yml | 2 ++ .github/tests/gas-token/pre-deployed.yml | 3 +++ .github/workflows/deploy.yml | 7 +++++- docs/upgrade-pp/README.org | 1 - input_parser.star | 8 +++++-- .../contract-deploy/run-contract-setup.sh | 23 +++++++++++-------- 8 files changed, 31 insertions(+), 16 deletions(-) delete mode 100644 .github/tests/gas-token.yml create mode 100644 .github/tests/gas-token/auto.yml create mode 100644 .github/tests/gas-token/pre-deployed.yml diff --git a/.github/tests/fork12-pessimistic.yml b/.github/tests/fork12-pessimistic.yml index bf8e6530b..f8e933e87 100644 --- a/.github/tests/fork12-pessimistic.yml +++ b/.github/tests/fork12-pessimistic.yml @@ -9,6 +9,5 @@ args: consensus_contract_type: pessimistic sequencer_type: erigon erigon_strict_mode: false - zkevm_use_gas_token_contract: false #agglayer_prover_sp1_key: enable_normalcy: true diff --git a/.github/tests/gas-token.yml b/.github/tests/gas-token.yml deleted file mode 100644 index 20e9f8390..000000000 --- a/.github/tests/gas-token.yml +++ /dev/null @@ -1,2 +0,0 @@ -args: - zkevm_use_gas_token_contract: true diff --git a/.github/tests/gas-token/auto.yml b/.github/tests/gas-token/auto.yml new file mode 100644 index 000000000..1712e3840 --- /dev/null +++ b/.github/tests/gas-token/auto.yml @@ -0,0 +1,2 @@ +args: + gas_token_enabled: true diff --git a/.github/tests/gas-token/pre-deployed.yml b/.github/tests/gas-token/pre-deployed.yml new file mode 100644 index 000000000..86d940596 --- /dev/null +++ b/.github/tests/gas-token/pre-deployed.yml @@ -0,0 +1,3 @@ +args: + gas_token_enabled: true + gas_token_address: "" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0987e76ce..b4a6d8528 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -81,7 +81,12 @@ jobs: - id: set-matrix # List all yml files in the .github/tests directory, as well as test combinations, except for the additional-services.yml file. run: | - files=$(ls -R ./.github/tests/combinations/*.yml ./.github/tests/static-ports/custom-static-ports.yml ./.github/tests/static-ports/default-static-ports.yml | grep -v 'additional-services.yml') + files=$(ls -R \ + ./.github/tests/combinations/*.yml \ + ./.github/tests/gas-token/auto.yml \ + ./.github/tests/static-ports/custom-static-ports.yml \ + ./.github/tests/static-ports/default-static-ports.yml \ + | grep -v 'additional-services.yml') matrix=$(echo "$files" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT diff --git a/docs/upgrade-pp/README.org b/docs/upgrade-pp/README.org index 6bfbad06b..4ab4547a0 100644 --- a/docs/upgrade-pp/README.org +++ b/docs/upgrade-pp/README.org @@ -305,7 +305,6 @@ args: consensus_contract_type: pessimistic sequencer_type: erigon erigon_strict_mode: false - zkevm_use_gas_token_contract: false enable_normalcy: true #+end_src diff --git a/input_parser.star b/input_parser.star index 556ca6954..db83ce740 100644 --- a/input_parser.star +++ b/input_parser.star @@ -238,8 +238,12 @@ DEFAULT_ROLLUP_ARGS = { # This flag will enable a stateless executor to verify the execution of the batches. # Set to true to run erigon as the sequencer. "erigon_strict_mode": True, - # Set to true to automatically deploy an ERC20 contract on L1 to be used as the gas token on the rollup. - "zkevm_use_gas_token_contract": False, + # Set to true to use an L1 ERC20 contract as the gas token on the rollup. + # The address of the gas token will be determined by the value of `gas_token_address`. + "gas_token_enabled": False, + # The address of the L1 ERC20 contract that will be used as the gas token on the rollup. + # If the address is empty, a contract will be deployed automatically. + "gas_token_address": "", # Set to true to use Kurtosis dynamic ports (default) and set to false to use static ports. # You can either use the default static ports defined in this file or specify your custom static # ports. diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index 130d47d33..30e9114ca 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -98,7 +98,7 @@ echo_ts "Waiting for the L1 RPC to be available" wait_for_rpc_to_be_available "{{.l1_rpc_url}}" echo_ts "L1 RPC is now available" -echo_ts "Funding important accounts on l1" +echo_ts "Funding important accounts on L1" fund_account_on_l1 "admin" "{{.zkevm_l2_admin_address}}" fund_account_on_l1 "sequencer" "{{.zkevm_l2_sequencer_address}}" fund_account_on_l1 "aggregator" "{{.zkevm_l2_aggregator_address}}" @@ -107,26 +107,31 @@ fund_account_on_l1 "l1testing" "{{.zkevm_l2_l1testing_address}}" echo_ts "Setting up local zkevm-contracts repo for deployment" pushd /opt/zkevm-contracts || exit 1 -# setup a foundry toml in case we do a gas token or dac deployment -printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml - cp /opt/contract-deploy/deploy_parameters.json /opt/zkevm-contracts/deployment/v2/deploy_parameters.json cp /opt/contract-deploy/create_rollup_parameters.json /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json sed -i 's#http://127.0.0.1:8545#{{.l1_rpc_url}}#' hardhat.config.ts # Deploy gas token # TODO in the future this should be configurable. I.e. we should be able to specify a token address that has already been deployed -# {{if .zkevm_use_gas_token_contract}} +# {{if .gas_token_enabled}} +# {{if eq .gas_token_address ""}} +echo_ts "Using L1 pre-deployed gas token: {{ .gas_token_address }}" +# {{else}} +printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml echo_ts "Deploying gas token to L1" forge create \ --json \ --rpc-url "{{.l1_rpc_url}}" \ --mnemonic "{{.l1_preallocated_mnemonic}}" \ contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ - --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" > gasToken-erc20.json - -# In this case, we'll configure the create rollup parameters to have a gas token -jq --slurpfile c gasToken-erc20.json '.gasTokenAddress = $c[0].deployedTo' /opt/contract-deploy/create_rollup_parameters.json > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json + --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" \ + > gasToken-erc20.json +# {{end}} +jq \ + --slurpfile c gasToken-erc20.json \ + '.gasTokenAddress = $c[0].deployedTo' \ + /opt/contract-deploy/create_rollup_parameters.json \ + > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json # {{end}} is_first_rollup=0 # an indicator if this deployment is doing the first setup of the agglayer etc From ecc31a1784a8deccb7c95edfdd9395b0a34eabfe Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Nov 2024 18:06:51 +0100 Subject: [PATCH 02/12] fix: typo --- templates/contract-deploy/run-contract-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index 30e9114ca..317bb47a8 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -115,10 +115,8 @@ sed -i 's#http://127.0.0.1:8545#{{.l1_rpc_url}}#' hardhat.config.ts # TODO in the future this should be configurable. I.e. we should be able to specify a token address that has already been deployed # {{if .gas_token_enabled}} # {{if eq .gas_token_address ""}} -echo_ts "Using L1 pre-deployed gas token: {{ .gas_token_address }}" -# {{else}} -printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml echo_ts "Deploying gas token to L1" +printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml forge create \ --json \ --rpc-url "{{.l1_rpc_url}}" \ @@ -126,6 +124,8 @@ forge create \ contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" \ > gasToken-erc20.json +# {{else}} +echo_ts "Using L1 pre-deployed gas token: {{ .gas_token_address }}" # {{end}} jq \ --slurpfile c gasToken-erc20.json \ From 05d899561dc6a5e6d151e57ce439e6efb962e67e Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 11:29:25 +0100 Subject: [PATCH 03/12] test --- .github/tests/gas-token/pre-deployed.yml | 2 +- .github/workflows/deploy.yml | 80 +++++++++++++++++++ .../contract-deploy/run-contract-setup.sh | 9 ++- 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/.github/tests/gas-token/pre-deployed.yml b/.github/tests/gas-token/pre-deployed.yml index 86d940596..53409ceaf 100644 --- a/.github/tests/gas-token/pre-deployed.yml +++ b/.github/tests/gas-token/pre-deployed.yml @@ -1,3 +1,3 @@ args: gas_token_enabled: true - gas_token_address: "" + gas_token_address: "0xCHANGEME" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b4a6d8528..90c107ba2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -193,6 +193,86 @@ jobs: name: ${{ env.ARCHIVE_NAME }} path: ./dump + pre-deployed-gas-token: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + # This step will only execute if the necessary secrets are available, preventing failures + # on pull requests from forked repositories. + if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }} + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Deploy L1 chain + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . + + - name: Deploy gas token on L1 + run: | + zkevm_contracts_version="v8.0.0-rc.4-fork.12" + echo "Cloning zkevm-contracts $zkevm_contracts_version..." + git clone https://github.com/0xPolygonHermez/zkevm-contracts + pushd zkevm-contracts + git checkout $zkevm_contracts_version + npm install @openzeppelin/contracts@4.8.2 + printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml + + echo "Deploying gas token to L1..." + l1_rpc_url=$(kurtosis port print ${{ env.ENCLAVE_NAME }} el-1-geth-lighthouse rpc) + gas_token_address=$(forge create \ + --json \ + --rpc-url $l1_rpc_url \ + --mnemonic "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete" \ + contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ + --constructor-args "CDK Gas Token" "CDK" "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" "1000000000000000000000000" \ + | jq --raw-output '.deployedTo') + if [[ -z "$gas_token_address" ]]; then + echo "Unable to deploy gas token" + exit 1 + fi + echo "Gas token contract deployed at $gas_token_address on L1" + popd + yq -Y --in-place ".args.gas_token_address = \"$gas_token_address\"" ./.github/tests/gas-token/pre-deployed.yml + + - name: Deploy the rest of the stack + run: | + kurtosis run \ + --enclave=${{ env.ENCLAVE_NAME }} \ + --args-file=./.github/tests/gas-token/pre-deployed.yml \ + . \ + '{"deployment_stages": {"deploy_l1": false}}' + + - name: Inspect enclave + run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} + + - name: Monitor verified batches + working-directory: .github/scripts + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-rpc-001 rpc)" + + - name: Dump enclave + if: ${{ !cancelled() }} + run: kurtosis enclave dump ${{ env.ENCLAVE_NAME }} ./dump + + - name: Upload enclave dump + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: dump_pre_deployed_gas_token${{ github.run_id }} + path: ./dump + additional-services: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index 317bb47a8..f9f970544 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -124,12 +124,17 @@ forge create \ contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" \ > gasToken-erc20.json +jq \ + --slurpfile c gasToken-erc20.json \ + '.gasTokenAddress = $c[0].deployedTo' \ + /opt/contract-deploy/create_rollup_parameters.json \ + > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json # {{else}} echo_ts "Using L1 pre-deployed gas token: {{ .gas_token_address }}" # {{end}} jq \ - --slurpfile c gasToken-erc20.json \ - '.gasTokenAddress = $c[0].deployedTo' \ + --arg c "{{ .gas_token_address }}" \ + '.gasTokenAddress = $c' \ /opt/contract-deploy/create_rollup_parameters.json \ > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json # {{end}} From 7f6124ceaba1ab305ab5180d13586d8191660bfd Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 14:44:15 +0100 Subject: [PATCH 04/12] ci: enable debug mode in ci --- .github/workflows/deploy.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 90c107ba2..b74c4f375 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,8 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Run Starlark - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -121,7 +122,8 @@ jobs: run: ./combine-ymls.sh - name: Run Starlark - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -215,7 +217,8 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . '{"args": {"verbosity": "debug"}}' - name: Deploy gas token on L1 run: | @@ -250,7 +253,7 @@ jobs: --enclave=${{ env.ENCLAVE_NAME }} \ --args-file=./.github/tests/gas-token/pre-deployed.yml \ . \ - '{"deployment_stages": {"deploy_l1": false}}' + '{"deployment_stages": {"deploy_l1": false}, "args": {"verbosity": "debug"}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -295,7 +298,8 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Run Starlark - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/additional-services.yml --show-enclave-inspect=false . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/additional-services.yml --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -398,10 +402,12 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain and a first CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"args": {"verbosity": "debug"}}' - name: Attach a second CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/attach-second-cdk.yml . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/attach-second-cdk.yml . '{"args": {"verbosity": "debug"}}' - name: Update the agglayer config run: | @@ -467,11 +473,12 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain - run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . + run: | + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . '{"args": {"verbosity": "debug"}}' - name: Deploy to local L1 chain run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"deployment_stages": {"deploy_l1": false}}' + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"deployment_stages": {"deploy_l1": false}, "args": {"verbosity": "debug"}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} From 957d6db3b81276936687b307999a12686c646901 Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 14:47:52 +0100 Subject: [PATCH 05/12] test --- templates/contract-deploy/run-contract-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index f9f970544..ccddaa9f2 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -114,6 +114,7 @@ sed -i 's#http://127.0.0.1:8545#{{.l1_rpc_url}}#' hardhat.config.ts # Deploy gas token # TODO in the future this should be configurable. I.e. we should be able to specify a token address that has already been deployed # {{if .gas_token_enabled}} + # {{if eq .gas_token_address ""}} echo_ts "Deploying gas token to L1" printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml @@ -131,7 +132,6 @@ jq \ > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json # {{else}} echo_ts "Using L1 pre-deployed gas token: {{ .gas_token_address }}" -# {{end}} jq \ --arg c "{{ .gas_token_address }}" \ '.gasTokenAddress = $c' \ @@ -139,6 +139,8 @@ jq \ > /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json # {{end}} +# {{end}} + is_first_rollup=0 # an indicator if this deployment is doing the first setup of the agglayer etc if [[ ! -e /opt/zkevm/combined.json ]]; then echo_ts "It looks like this is the first rollup so we'll deploy the LxLy and Rollup Manager" From 5ea1f8d6f9e4882eed53a56259f86c6138bafda7 Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 15:03:51 +0100 Subject: [PATCH 06/12] Revert "ci: enable debug mode in ci" This reverts commit 7f6124ceaba1ab305ab5180d13586d8191660bfd. --- .github/workflows/deploy.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b74c4f375..90c107ba2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,8 +38,7 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Run Starlark - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -122,8 +121,7 @@ jobs: run: ./combine-ymls.sh - name: Run Starlark - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -217,8 +215,7 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . - name: Deploy gas token on L1 run: | @@ -253,7 +250,7 @@ jobs: --enclave=${{ env.ENCLAVE_NAME }} \ --args-file=./.github/tests/gas-token/pre-deployed.yml \ . \ - '{"deployment_stages": {"deploy_l1": false}, "args": {"verbosity": "debug"}}' + '{"deployment_stages": {"deploy_l1": false}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -298,8 +295,7 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Run Starlark - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/additional-services.yml --show-enclave-inspect=false . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/additional-services.yml --show-enclave-inspect=false . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -402,12 +398,10 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain and a first CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . - name: Attach a second CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/attach-second-cdk.yml . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/attach-second-cdk.yml . - name: Update the agglayer config run: | @@ -473,12 +467,11 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . '{"args": {"verbosity": "debug"}}' + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-local-l1.yml . - name: Deploy to local L1 chain run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"deployment_stages": {"deploy_l1": false}, "args": {"verbosity": "debug"}}' + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"deployment_stages": {"deploy_l1": false}}' - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} From 17c673e9fc1f06f43b0b231bccbe183babd0bbf2 Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 15:06:09 +0100 Subject: [PATCH 07/12] ci: enable debug verbosity --- .github/tests/additional-services.yml | 1 + .github/tests/attach-second-cdk.yml | 1 + .../tests/combinations/fork11-legacy-zkevm-stack-rollup.yml | 1 + .../tests/combinations/fork11-new-cdk-stack-cdk-validium.yml | 1 + .github/tests/combinations/fork11-new-cdk-stack-rollup.yml | 1 + .../tests/combinations/fork12-new-cdk-stack-cdk-validium.yml | 1 + .github/tests/combinations/fork12-new-cdk-stack-rollup.yml | 1 + .../tests/combinations/fork13-new-cdk-stack-cdk-validium.yml | 1 + .github/tests/combinations/fork13-new-cdk-stack-rollup.yml | 1 + .../combinations/fork9-legacy-zkevm-stack-cdk-validium.yml | 1 + .github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml | 1 + .../tests/combinations/fork9-new-cdk-stack-cdk-validium.yml | 1 + .github/tests/combinations/fork9-new-cdk-stack-rollup.yml | 1 + .github/tests/external-l1/deploy-cdk-to-sepolia.yml | 2 ++ .github/tests/external-l1/deploy-local-l1.yml | 3 +++ .github/tests/forks/fork11.yml | 2 ++ .github/tests/forks/fork12.yml | 2 ++ .github/tests/forks/fork13.yml | 2 ++ .github/tests/forks/fork9.yml | 2 ++ .github/tests/gas-token/auto.yml | 1 + .github/tests/gas-token/pre-deployed.yml | 1 + .../cardona-sepolia-testnet-pless-zkevm-node.yml | 1 + .../custom-static-ports-cdk-erigon-sequencer-ds.yml | 1 + .github/tests/static-ports/custom-static-ports.yml | 1 + .github/tests/static-ports/default-static-ports.yml | 1 + 25 files changed, 32 insertions(+) diff --git a/.github/tests/additional-services.yml b/.github/tests/additional-services.yml index b0211bfd9..4fcf1e6d3 100644 --- a/.github/tests/additional-services.yml +++ b/.github/tests/additional-services.yml @@ -1,4 +1,5 @@ args: + verbosity: debug additional_services: - arpeggio # - blockscout # blockscout experiences Out of Memory (OOM) termination when deployed inside github runners. diff --git a/.github/tests/attach-second-cdk.yml b/.github/tests/attach-second-cdk.yml index 8e6da6f28..5f0671804 100644 --- a/.github/tests/attach-second-cdk.yml +++ b/.github/tests/attach-second-cdk.yml @@ -3,6 +3,7 @@ deployment_stages: deploy_agglayer: false args: + verbosity: debug deployment_suffix: "-002" zkevm_rollup_chain_id: 20202 zkevm_rollup_id: 2 diff --git a/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml b/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml index b93f043e4..3327b95b8 100644 --- a/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml +++ b/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.4-fork.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml index 160ecb9af..5abd7f5cb 100644 --- a/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml +++ b/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.4-fork.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml index b968f0f58..b82263aa0 100644 --- a/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml +++ b/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.4-fork.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml index 073dc3db3..7f8a50fab 100644 --- a/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml +++ b/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC14-fork.12 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml index 332c12c7d..c7a0ca2c6 100644 --- a/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml +++ b/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC14-fork.12 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork13-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork13-new-cdk-stack-cdk-validium.yml index 788a71657..b3dce8bc6 100644 --- a/.github/tests/combinations/fork13-new-cdk-stack-cdk-validium.yml +++ b/.github/tests/combinations/fork13-new-cdk-stack-cdk-validium.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v8.1.0-rc.1-fork.13 zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC2-fork.13 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork13-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork13-new-cdk-stack-rollup.yml index b928d8d6c..c2865d05f 100644 --- a/.github/tests/combinations/fork13-new-cdk-stack-rollup.yml +++ b/.github/tests/combinations/fork13-new-cdk-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v8.1.0-rc.1-fork.13 zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC2-fork.13 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta10 diff --git a/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml b/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml index 57b0c018f..9c214e570 100644 --- a/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml +++ b/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.8 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.1.2 diff --git a/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml b/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml index a45c95f12..8838c4430 100644 --- a/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml +++ b/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.8 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.1.2 diff --git a/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml index bce7eae49..f2f98d460 100644 --- a/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml +++ b/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.8 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.1.2 diff --git a/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml index 50d21e7b4..b908bfb22 100644 --- a/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml +++ b/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml @@ -1,4 +1,5 @@ args: + verbosity: debug zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.8 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.1.2 diff --git a/.github/tests/external-l1/deploy-cdk-to-sepolia.yml b/.github/tests/external-l1/deploy-cdk-to-sepolia.yml index 97090d28c..aab5b2b07 100644 --- a/.github/tests/external-l1/deploy-cdk-to-sepolia.yml +++ b/.github/tests/external-l1/deploy-cdk-to-sepolia.yml @@ -3,6 +3,8 @@ deployment_stages: deploy_l1: false args: + verbosity: debug + ## L1 Config l1_chain_id: 11155111 # TODO: Create another mnemonic seed phrase for running the contract deployment on L1. diff --git a/.github/tests/external-l1/deploy-local-l1.yml b/.github/tests/external-l1/deploy-local-l1.yml index b81e14c65..ebf92de31 100644 --- a/.github/tests/external-l1/deploy-local-l1.yml +++ b/.github/tests/external-l1/deploy-local-l1.yml @@ -7,3 +7,6 @@ deployment_stages: deploy_agglayer: false deploy_cdk_erigon_node: false deploy_l2_contracts: false + +args: + verbosity: debug diff --git a/.github/tests/forks/fork11.yml b/.github/tests/forks/fork11.yml index 631d9ff23..9a3f24557 100644 --- a/.github/tests/forks/fork11.yml +++ b/.github/tests/forks/fork11.yml @@ -1,4 +1,6 @@ args: + verbosity: debug + # https://hub.docker.com/repository/docker/leovct/zkevm-contracts/tags?name=fork.11 zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 diff --git a/.github/tests/forks/fork12.yml b/.github/tests/forks/fork12.yml index 9ae135ac0..d6276030d 100644 --- a/.github/tests/forks/fork12.yml +++ b/.github/tests/forks/fork12.yml @@ -1,4 +1,6 @@ args: + verbosity: debug + # https://hub.docker.com/repository/docker/leovct/zkevm-contracts/tags?name=fork.12 zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 diff --git a/.github/tests/forks/fork13.yml b/.github/tests/forks/fork13.yml index a32de8f82..ab8cc3e02 100644 --- a/.github/tests/forks/fork13.yml +++ b/.github/tests/forks/fork13.yml @@ -1,4 +1,6 @@ args: + verbosity: debug + # https://hub.docker.com/repository/docker/leovct/zkevm-contracts/tags?name=fork.12 zkevm_contracts_image: leovct/zkevm-contracts:v8.1.0-rc.1-fork.13 diff --git a/.github/tests/forks/fork9.yml b/.github/tests/forks/fork9.yml index 5f9f7265f..1dc145d06 100644 --- a/.github/tests/forks/fork9.yml +++ b/.github/tests/forks/fork9.yml @@ -1,4 +1,6 @@ args: + verbosity: debug + # https://hub.docker.com/repository/docker/leovct/zkevm-contracts/tags?name=fork.9 zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 diff --git a/.github/tests/gas-token/auto.yml b/.github/tests/gas-token/auto.yml index 1712e3840..4461f0ea7 100644 --- a/.github/tests/gas-token/auto.yml +++ b/.github/tests/gas-token/auto.yml @@ -1,2 +1,3 @@ args: + verbosity: debug gas_token_enabled: true diff --git a/.github/tests/gas-token/pre-deployed.yml b/.github/tests/gas-token/pre-deployed.yml index 53409ceaf..5d12b8b31 100644 --- a/.github/tests/gas-token/pre-deployed.yml +++ b/.github/tests/gas-token/pre-deployed.yml @@ -1,3 +1,4 @@ args: + verbosity: debug gas_token_enabled: true gas_token_address: "0xCHANGEME" diff --git a/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml b/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml index 720bc3d63..14f7e6a93 100644 --- a/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml +++ b/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml @@ -9,6 +9,7 @@ deployment_stages: deploy_l2_contracts: false args: + verbosity: debug additional_services: - pless_zkevm_node l1_rpc_url: CHANGE_ME diff --git a/.github/tests/static-ports/custom-static-ports-cdk-erigon-sequencer-ds.yml b/.github/tests/static-ports/custom-static-ports-cdk-erigon-sequencer-ds.yml index 621cda386..cf0f69981 100644 --- a/.github/tests/static-ports/custom-static-ports-cdk-erigon-sequencer-ds.yml +++ b/.github/tests/static-ports/custom-static-ports-cdk-erigon-sequencer-ds.yml @@ -1,6 +1,7 @@ # Only expose the datastream port of the cdk-erigon sequencer to a static public port. # All the other ports will be allocated dynamically using Kurtosis. args: + verbosity: debug use_dynamic_ports: false static_ports: cdk_erigon_sequencer_start_port: 61700 diff --git a/.github/tests/static-ports/custom-static-ports.yml b/.github/tests/static-ports/custom-static-ports.yml index b20b3d117..372af9f63 100644 --- a/.github/tests/static-ports/custom-static-ports.yml +++ b/.github/tests/static-ports/custom-static-ports.yml @@ -2,6 +2,7 @@ # - L1 services will be exposed on the range 60000-60999. # - L2 services on the range 61000-61999. args: + verbosity: debug use_dynamic_ports: false static_ports: # L1 public ports (60000-60999). diff --git a/.github/tests/static-ports/default-static-ports.yml b/.github/tests/static-ports/default-static-ports.yml index 3b45befb6..952e15154 100644 --- a/.github/tests/static-ports/default-static-ports.yml +++ b/.github/tests/static-ports/default-static-ports.yml @@ -2,4 +2,5 @@ # - L1 services will be exposed on the range 50000-50999. # - L2 services on the range 51000-51999. args: + verbosity: debug use_dynamic_ports: false From 0e591d66c5bfe3f7bc6fb2fc84dbc17d3e9bf19d Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 21 Nov 2024 15:09:59 +0100 Subject: [PATCH 08/12] ci: clean up --- .github/tests/external-l1/deploy-cdk-to-local-l1.yml | 6 ++++++ .github/workflows/deploy.yml | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .github/tests/external-l1/deploy-cdk-to-local-l1.yml diff --git a/.github/tests/external-l1/deploy-cdk-to-local-l1.yml b/.github/tests/external-l1/deploy-cdk-to-local-l1.yml new file mode 100644 index 000000000..e7a075db3 --- /dev/null +++ b/.github/tests/external-l1/deploy-cdk-to-local-l1.yml @@ -0,0 +1,6 @@ +deployment_stages: + # Disable local L1. + deploy_l1: false + +args: + verbosity: debug diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 90c107ba2..cccc7bf45 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -246,11 +246,8 @@ jobs: - name: Deploy the rest of the stack run: | - kurtosis run \ - --enclave=${{ env.ENCLAVE_NAME }} \ - --args-file=./.github/tests/gas-token/pre-deployed.yml \ - . \ - '{"deployment_stages": {"deploy_l1": false}}' + yq -Y --in-place ".deployment_stages.deploy_l1 = false" ./.github/tests/gas-token/pre-deployed.yml + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/gas-token/pre-deployed.yml . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} @@ -471,7 +468,7 @@ jobs: - name: Deploy to local L1 chain run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} . '{"deployment_stages": {"deploy_l1": false}}' + kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/external-l1/deploy-cdk-to-local-l1.yml . - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} From dfcf9315e3d54fb4627c6e42ca4b64f9c81469ec Mon Sep 17 00:00:00 2001 From: leovct Date: Mon, 25 Nov 2024 14:15:23 +0100 Subject: [PATCH 09/12] chore: move foundry project setup outside of conditionals --- templates/contract-deploy/run-contract-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index ccddaa9f2..81d28980f 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -109,7 +109,10 @@ echo_ts "Setting up local zkevm-contracts repo for deployment" pushd /opt/zkevm-contracts || exit 1 cp /opt/contract-deploy/deploy_parameters.json /opt/zkevm-contracts/deployment/v2/deploy_parameters.json cp /opt/contract-deploy/create_rollup_parameters.json /opt/zkevm-contracts/deployment/v2/create_rollup_parameters.json +# Set up the hardhat environment. sed -i 's#http://127.0.0.1:8545#{{.l1_rpc_url}}#' hardhat.config.ts +# Set up a foundry project in case we do a gas token or dac deployment. +printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml # Deploy gas token # TODO in the future this should be configurable. I.e. we should be able to specify a token address that has already been deployed @@ -117,7 +120,6 @@ sed -i 's#http://127.0.0.1:8545#{{.l1_rpc_url}}#' hardhat.config.ts # {{if eq .gas_token_address ""}} echo_ts "Deploying gas token to L1" -printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules']\n" > foundry.toml forge create \ --json \ --rpc-url "{{.l1_rpc_url}}" \ From a2aee74042cf85e16f9c6bcbdbfc39b64d7160ce Mon Sep 17 00:00:00 2001 From: leovct Date: Mon, 25 Nov 2024 14:21:51 +0100 Subject: [PATCH 10/12] chore: validate gas token args --- input_parser.star | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/input_parser.star b/input_parser.star index d45bd3f03..47bf73e0f 100644 --- a/input_parser.star +++ b/input_parser.star @@ -334,6 +334,15 @@ def parse_args(plan, args): global_log_level = args.get("global_log_level", "") validate_log_level("global log level", global_log_level) + gas_token_enabled = args.get("gas_token_enabled", false) + gas_token_address = args.get("gas_token_address", "") + if not gas_token_enabled and gas_token_address != "": + fail( + "Gas token address set to '{}' but gas token is not enabled".format( + gas_token_address + ) + ) + # Determine fork id from the zkevm contracts image tag. zkevm_contracts_image = args.get("zkevm_contracts_image", "") (fork_id, fork_name) = get_fork_id(zkevm_contracts_image) From e066b1f52034ba5f7ff23b4f928cb92686608543 Mon Sep 17 00:00:00 2001 From: leovct Date: Mon, 25 Nov 2024 15:38:17 +0100 Subject: [PATCH 11/12] fix: typo --- input_parser.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input_parser.star b/input_parser.star index 47bf73e0f..957cb4665 100644 --- a/input_parser.star +++ b/input_parser.star @@ -334,7 +334,7 @@ def parse_args(plan, args): global_log_level = args.get("global_log_level", "") validate_log_level("global log level", global_log_level) - gas_token_enabled = args.get("gas_token_enabled", false) + gas_token_enabled = args.get("gas_token_enabled", False) gas_token_address = args.get("gas_token_address", "") if not gas_token_enabled and gas_token_address != "": fail( From 26c817c502762133519f2bd465079cfe0bdb6ffd Mon Sep 17 00:00:00 2001 From: leovct Date: Mon, 25 Nov 2024 17:27:12 +0100 Subject: [PATCH 12/12] ci: disable cdk workflow for now until kurtosis-cdk version is bumped in the cdk node repo --- .github/workflows/cdk-e2e.yml | 174 +++++++++++++++++----------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/.github/workflows/cdk-e2e.yml b/.github/workflows/cdk-e2e.yml index 5a6b81ff5..cecb0ca94 100644 --- a/.github/workflows/cdk-e2e.yml +++ b/.github/workflows/cdk-e2e.yml @@ -1,101 +1,101 @@ -name: Test e2e -on: - pull_request: - push: - branches: [main] - workflow_dispatch: {} +# name: Test e2e +# on: +# pull_request: +# push: +# branches: [main] +# workflow_dispatch: {} -jobs: - test-e2e: - strategy: - fail-fast: false - matrix: - go-version: [ 1.22.x ] - goarch: [ "amd64" ] - e2e-group: - - "fork9-validium" - - "fork11-rollup" - - "fork12-validium" - - "fork12-rollup" - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 +# jobs: +# test-e2e: +# strategy: +# fail-fast: false +# matrix: +# go-version: [ 1.22.x ] +# goarch: [ "amd64" ] +# e2e-group: +# - "fork9-validium" +# - "fork11-rollup" +# - "fork12-validium" +# - "fork12-rollup" +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - env: - GOARCH: ${{ matrix.goarch }} +# - name: Install Go +# uses: actions/setup-go@v5 +# with: +# go-version: ${{ matrix.go-version }} +# env: +# GOARCH: ${{ matrix.goarch }} - - name: Install kurtosis - shell: bash - run: | - echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list - sudo apt update - sudo apt install kurtosis-cli=1.4.1 - kurtosis version +# - name: Install kurtosis +# shell: bash +# run: | +# echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list +# sudo apt update +# sudo apt install kurtosis-cli=1.4.1 +# kurtosis version - - name: Disable kurtosis analytics - shell: bash - run: kurtosis analytics disable +# - name: Disable kurtosis analytics +# shell: bash +# run: kurtosis analytics disable - - name: Install yq - shell: bash - run: | - pip3 install yq - yq --version +# - name: Install yq +# shell: bash +# run: | +# pip3 install yq +# yq --version - - name: Install polycli - run: | - POLYCLI_VERSION="v0.1.63" - tmp_dir=$(mktemp -d) - curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir" - mv "$tmp_dir"/* /usr/local/bin/polycli - rm -rf "$tmp_dir" - sudo chmod +x /usr/local/bin/polycli - /usr/local/bin/polycli version +# - name: Install polycli +# run: | +# POLYCLI_VERSION="v0.1.63" +# tmp_dir=$(mktemp -d) +# curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir" +# mv "$tmp_dir"/* /usr/local/bin/polycli +# rm -rf "$tmp_dir" +# sudo chmod +x /usr/local/bin/polycli +# /usr/local/bin/polycli version - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 +# - name: Install foundry +# uses: foundry-rs/foundry-toolchain@v1 - - name: checkout polygon-cdk - uses: actions/checkout@v4 - with: - repository: 0xPolygon/cdk - path: "cdk" - ref: "v0.4.0-beta10" +# - name: checkout polygon-cdk +# uses: actions/checkout@v4 +# with: +# repository: 0xPolygon/cdk +# path: "cdk" +# ref: "v0.4.0-beta10" - - name: Build Docker - run: make build-docker - working-directory: ${{ github.workspace }}/cdk +# - name: Build Docker +# run: make build-docker +# working-directory: ${{ github.workspace }}/cdk - - name: Setup Bats and bats libs - uses: bats-core/bats-action@2.0.0 +# - name: Setup Bats and bats libs +# uses: bats-core/bats-action@2.0.0 - - name: Test - run: make test-e2e-${{ matrix.e2e-group }} - working-directory: ./cdk/test - env: - KURTOSIS_FOLDER: ${{ github.workspace }} - BATS_LIB_PATH: /usr/lib/ +# - name: Test +# run: make test-e2e-${{ matrix.e2e-group }} +# working-directory: ./cdk/test +# env: +# KURTOSIS_FOLDER: ${{ github.workspace }} +# BATS_LIB_PATH: /usr/lib/ - - name: Dump enclave logs - if: failure() - run: kurtosis dump ./dump +# - name: Dump enclave logs +# if: failure() +# run: kurtosis dump ./dump - - name: Generate archive name - if: failure() - run: | - archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}" - echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV" - echo "Generated archive name: ${archive_name}" - kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml +# - name: Generate archive name +# if: failure() +# run: | +# archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}" +# echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV" +# echo "Generated archive name: ${archive_name}" +# kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: ${{ env.ARCHIVE_NAME }} - path: ./dump +# - name: Upload logs +# if: failure() +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ env.ARCHIVE_NAME }} +# path: ./dump