-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters