Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Nov 21, 2024
1 parent 7819576 commit 45da068
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/tests/gas-token/pre-deployed.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
args:
gas_token_enabled: true
gas_token_address: ""
gas_token_address: "0xCHANGEME"
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,76 @@ 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
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)
l1_preallocated_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"
gas_token_address=$(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" \
| jq --raw-output '.deployedTo')
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 }} ./.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_deploy_to_external_l1_${{ github.run_id }}
path: ./dump

additional-services:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down

0 comments on commit 45da068

Please sign in to comment.