Skip to content

Commit

Permalink
Testnet deployments: use different accs for sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Sep 19, 2023
1 parent abfbd60 commit 4796e58
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 23 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ jobs:
L1_WS_URL_0: ${{ steps.outputVars.outputs.L1_WS_URL_0 }}
L1_WS_URL_1: ${{ steps.outputVars.outputs.L1_WS_URL_1 }}
L1_HTTP_URL: ${{ steps.outputVars.outputs.L1_HTTP_URL }}

# these variables will just contain the lookup key for the Github secret
SEQ_PK_LOOKUP_KEY: ${{ steps.outputVars.outputs.SEQ_PK_LOOKUP_KEY }}
VAL_PK_LOOKUP_KEY: ${{ steps.outputVars.outputs.VAL_PK_LOOKUP_KEY }}
WORKER_PK_LOOKUP_KEY: ${{ steps.outputVars.outputs.WORKER_PK_LOOKUP_KEY }}
SEQ_ADDRESS_LOOKUP_KEY: ${{ steps.outputVars.outputs.SEQ_ADDRESS_LOOKUP_KEY }}
VAL_ADDRESS_LOOKUP_KEY: ${{ steps.outputVars.outputs.VAL_ADDRESS_LOOKUP_KEY }}

BATCH_INTERVAL: ${{ steps.deployL2Contracts.outputs.BATCH_INTERVAL }}
ROLLUP_INTERVAL: ${{ steps.deployL2Contracts.outputs.ROLLUP_INTERVAL }}

Expand Down Expand Up @@ -71,6 +79,11 @@ jobs:
echo "L1_WS_URL_0=ws://testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_WS_URL_1=ws://testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_HTTP_URL=http://testnet-eth2network.uksouth.cloudapp.azure.com:8025" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_0" >> $GITHUB_ENV
echo "VAL_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_1" >> $GITHUB_ENV
echo "WORKER_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_WORKER" >> $GITHUB_ENV
echo "SEQ_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_0" >> $GITHUB_ENV
echo "VAL_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_1" >> $GITHUB_ENV
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=10s" >> $GITHUB_ENV
Expand All @@ -86,6 +99,11 @@ jobs:
echo "L1_WS_URL_0=ws://dev-testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_WS_URL_1=ws://dev-testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_HTTP_URL=http://dev-testnet-eth2network.uksouth.cloudapp.azure.com:8025" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_0" >> $GITHUB_ENV
echo "VAL_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_1" >> $GITHUB_ENV
echo "WORKER_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_WORKER" >> $GITHUB_ENV
echo "SEQ_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_0" >> $GITHUB_ENV
echo "VAL_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_1" >> $GITHUB_ENV
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=10s" >> $GITHUB_ENV
Expand All @@ -101,6 +119,11 @@ jobs:
echo "L1_WS_URL_0=wss://sepolia.infura.io/ws/v3/${{secret.infura_apikey_0}}" >> $GITHUB_ENV
echo "L1_WS_URL_1=wss://sepolia.infura.io/ws/v3/${{secret.infura_apikey_1}}" >> $GITHUB_ENV
echo "L1_HTTP_URL=https://sepolia.infura.io/v3/${{secret.infura_apikey_0}}" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=SEPOLIA_FUNDED_ACC_PKSTR_0" >> $GITHUB_ENV
echo "VAL_PK_LOOKUP_KEY=SEPOLIA_FUNDED_ACC_PKSTR_1" >> $GITHUB_ENV
echo "WORKER_PK_LOOKUP_KEY=SEPOLIA_FUNDED_ACC_0" >> $GITHUB_ENV
echo "SEQ_ADDRESS_LOOKUP_KEY=SEPOLIA_FUNDED_ADDR_0" >> $GITHUB_ENV
echo "VAL_ADDRESS_LOOKUP_KEY=SEPOLIA_FUNDED_ADDR_1" >> $GITHUB_ENV
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=3m" >> $GITHUB_ENV
Expand All @@ -116,6 +139,11 @@ jobs:
echo "L1_WS_URL_0=${{env.L1_WS_URL_0}}" >> $GITHUB_OUTPUT
echo "L1_WS_URL_1=${{env.L1_WS_URL_1}}" >> $GITHUB_OUTPUT
echo "L1_HTTP_URL=${{env.L1_HTTP_URL}}" >> $GITHUB_OUTPUT
echo "SEQ_PK_LOOKUP_KEY=${{env.SEQ_PK_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "VAL_PK_LOOKUP_KEY=${{env.VAL_PK_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "WORKER_PK_LOOKUP_KEY=${{env.WORKER_PK_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "SEQ_ADDRESS_LOOKUP_KEY=${{env.SEQ_ADDRESS_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "VAL_ADDRESS_LOOKUP_KEY=${{env.VAL_ADDRESS_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "BATCH_INTERVAL=${{env.BATCH_INTERVAL}}" >> $GITHUB_OUTPUT
echo "ROLLUP_INTERVAL=${{env.ROLLUP_INTERVAL}}" >> $GITHUB_OUTPUT
Expand All @@ -141,7 +169,7 @@ jobs:
run: |
go run ./testnet/launcher/l1contractdeployer/cmd \
-l1_http_url=${{ env.L1_HTTP_URL }} \
-private_key=${{ secrets.GETHNETWORK_PREFUNDED_PKSTR_WORKER }} \
-private_key=${{ secrets[env.WORKER_PK_LOOKUP_KEY] }} \
-docker_image=${{env.L2_HARDHATDEPLOYER_DOCKER_BUILD_TAG}} \
-contracts_env_file=./testnet/.env
source ./testnet/.env
Expand Down Expand Up @@ -191,19 +219,14 @@ jobs:
matrix:
host_id: [ 0,1 ]
include:
# Hardcoded host addresses
- host_addr: 0x0000000000000000000000000000000000000000
host_id: 0
- host_addr: 0x0000000000000000000000000000000000000001
host_id: 1
# Hardcoded host prefunded keys
- node_pk_str: GETHNETWORK_PREFUNDED_PKSTR_0
- node_pk_str: ${{ needs.build.outputs.SEQ_PK_LOOKUP_KEY }}
host_id: 0
- node_pk_str: GETHNETWORK_PREFUNDED_PKSTR_1
- node_pk_str: ${{ needs.build.outputs.VAL_PK_LOOKUP_KEY }}
host_id: 1
- node_pk_addr: GETHNETWORK_PREFUNDED_ADDR_0
- node_pk_addr: ${{ needs.build.outputs.SEQ_ADDRESS_LOOKUP_KEY }}
host_id: 0
- node_pk_addr: GETHNETWORK_PREFUNDED_ADDR_1
- node_pk_addr: ${{ needs.build.outputs.VAL_ADDRESS_LOOKUP_KEY }}
host_id: 1
# Ensure there is a single genesis node
- is_genesis: true
Expand Down Expand Up @@ -295,7 +318,7 @@ jobs:
-message_bus_contract_addr=${{needs.build.outputs.MSG_BUS_CONTRACT_ADDR}} \
-l1_start=${{needs.build.outputs.L1_START_HASH}} \
-private_key=${{ secrets[matrix.node_pk_str] }} \
-sequencer_id=${{ secrets.GETHNETWORK_PREFUNDED_ADDR_0 }} \
-sequencer_id=${{ secrets[needs.build.outputs.SEQ_ADDRESS_LOOKUP_KEY] }} \
-host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \
-host_p2p_port=10000 \
-enclave_docker_image=${{needs.build.outputs.L2_ENCLAVE_DOCKER_BUILD_TAG}} \
Expand Down Expand Up @@ -364,7 +387,7 @@ jobs:
-l2_host=obscuronode-0-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com \
-l1_http_url=${{ needs.build.outputs.L1_HTTP_URL }} \
-l2_ws_port=81 \
-private_key=${{ secrets.GETHNETWORK_PREFUNDED_PKSTR_WORKER }} \
-private_key=${{ secrets[needs.build.outputs.WORKER_PK_LOOKUP_KEY] }} \
-l2_private_key=8dfb8083da6275ae3e4f41e3e8a8c19d028d32c9247e24530933782f2a05035b \
-l2_hoc_private_key=6e384a07a01263518a09a5424c7b6bbfc3604ba7d93f47e3a455cbdd7f9f0682 \
-l2_poc_private_key=4bfe14725e685901c062ccd4e220c61cf9c189897b6c78bd18d7f51291b2b8f8 \
Expand Down
42 changes: 31 additions & 11 deletions .github/workflows/manual-upgrade-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ jobs:
RESOURCE_TAG_NAME: ${{ steps.outputVars.outputs.RESOURCE_TAG_NAME }}
RESOURCE_STARTING_NAME: ${{ steps.outputVars.outputs.RESOURCE_STARTING_NAME }}
RESOURCE_TESTNET_NAME: ${{ steps.outputVars.outputs.RESOURCE_TESTNET_NAME }}

# there are two websocket URLs because our sepolia RPC provider requires separate API keys for the connections
L1_WS_URL_0: ${{ steps.outputVars.outputs.L1_WS_URL_0 }}
L1_WS_URL_1: ${{ steps.outputVars.outputs.L1_WS_URL_1 }}

# these variables will just contain the lookup key for the Github secret
SEQ_PK_LOOKUP_KEY: ${{ steps.outputVars.outputs.SEQ_PK_LOOKUP_KEY }}
VAL_PK_LOOKUP_KEY: ${{ steps.outputVars.outputs.VAL_PK_LOOKUP_KEY }}
SEQ_ADDRESS_LOOKUP_KEY: ${{ steps.outputVars.outputs.SEQ_ADDRESS_LOOKUP_KEY }}
VAL_ADDRESS_LOOKUP_KEY: ${{ steps.outputVars.outputs.VAL_ADDRESS_LOOKUP_KEY }}

VM_BUILD_NUMBER: ${{ steps.outputVars.outputs.VM_BUILD_NUMBER }}
BATCH_INTERVAL: ${{ steps.deployL2Contracts.outputs.BATCH_INTERVAL }}
ROLLUP_INTERVAL: ${{ steps.deployL2Contracts.outputs.ROLLUP_INTERVAL }}
Expand All @@ -69,6 +77,10 @@ jobs:
echo "RESOURCE_TESTNET_NAME=testnet" >> $GITHUB_ENV
echo "L1_WS_URL_0=ws://testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_WS_URL_1=ws://testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_0" >> $GITHUB_ENV
echo "VAL_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_1" >> $GITHUB_ENV
echo "SEQ_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_0" >> $GITHUB_ENV
echo "VAL_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_1" >> $GITHUB_ENV
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=10s" >> $GITHUB_ENV
Expand All @@ -82,6 +94,10 @@ jobs:
echo "RESOURCE_TESTNET_NAME=devtestnet" >> $GITHUB_ENV
echo "L1_WS_URL_0=ws://dev-testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "L1_WS_URL_1=ws://dev-testnet-eth2network.uksouth.cloudapp.azure.com:9000" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_0" >> $GITHUB_ENV
echo "VAL_PK_LOOKUP_KEY=GETHNETWORK_PREFUNDED_PKSTR_1" >> $GITHUB_ENV
echo "SEQ_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_0" >> $GITHUB_ENV
echo "VAL_ADDRESS_LOOKUP_KEY=GETHNETWORK_PREFUNDED_ADDR_1" >> $GITHUB_ENV
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=10s" >> $GITHUB_ENV
Expand All @@ -95,6 +111,10 @@ jobs:
echo "RESOURCE_TESTNET_NAME=sepoliatestnet" >> $GITHUB_ENV
echo "L1_WS_URL_0=wss://sepolia.infura.io/ws/v3/${{secret.infura_apikey_0}}" >> $GITHUB_ENV
echo "L1_WS_URL_1=wss://sepolia.infura.io/ws/v3/${{secret.infura_apikey_1}}" >> $GITHUB_ENV
echo "SEQ_PK_LOOKUP_KEY=${{env.SEQ_PK_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "VAL_PK_LOOKUP_KEY=${{env.VAL_PK_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "SEQ_ADDRESS_LOOKUP_KEY=${{env.SEQ_ADDRESS_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "VAL_ADDRESS_LOOKUP_KEY=${{env.VAL_ADDRESS_LOOKUP_KEY}}" >> $GITHUB_OUTPUT
echo "BATCH_INTERVAL=1s" >> $GITHUB_ENV
echo "ROLLUP_INTERVAL=3m" >> $GITHUB_ENV
Expand Down Expand Up @@ -147,19 +167,14 @@ jobs:
matrix:
host_id: [ 0,1 ]
include:
# Hardcoded host addresses
- host_addr: 0x0000000000000000000000000000000000000000
host_id: 0
- host_addr: 0x0000000000000000000000000000000000000001
host_id: 1
# Hardcoded host prefunded keys
- node_pk_str: GETHNETWORK_PREFUNDED_PKSTR_0
- node_pk_str: ${{ needs.build.outputs.SEQ_PK_LOOKUP_KEY }}
host_id: 0
- node_pk_str: GETHNETWORK_PREFUNDED_PKSTR_1
- node_pk_str: ${{ needs.build.outputs.VAL_PK_LOOKUP_KEY }}
host_id: 1
- node_pk_addr: GETHNETWORK_PREFUNDED_ADDR_0
- node_pk_addr: ${{ needs.build.outputs.SEQ_ADDRESS_LOOKUP_KEY }}
host_id: 0
- node_pk_addr: GETHNETWORK_PREFUNDED_ADDR_1
- node_pk_addr: ${{ needs.build.outputs.VAL_ADDRESS_LOOKUP_KEY }}
host_id: 1
# Ensure there is a single genesis node
- is_genesis: true
Expand All @@ -171,6 +186,11 @@ jobs:
host_id: 0
- node_type: validator
host_id: 1
# Prepare L1 RPC URLs
- l1_ws_addr: ${{ needs.build.outputs.L1_WS_URL_0 }}
host_id: 0
- l1_ws_addr: ${{ needs.build.outputs.L1_WS_URL_1 }}
host_id: 1

steps:
- name: 'Extract branch name'
Expand Down Expand Up @@ -201,9 +221,9 @@ jobs:
-node_type=${{ matrix.node_type }} \
-is_sgx_enabled=true \
-host_id=${{ secrets[matrix.node_pk_addr] }} \
-l1_ws_url=${{needs.build.outputs.L1_WS_URL}} \
-l1_ws_url=${{matrix.l1_ws_addr}} \
-private_key=${{ secrets[matrix.node_pk_str] }} \
-sequencer_id=${{ secrets.GETHNETWORK_PREFUNDED_ADDR_0 }} \
-sequencer_id=${{ secrets[needs.build.outputs.SEQ_ADDRESS_LOOKUP_KEY] }} \
-host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-${{needs.build.outputs.VM_BUILD_NUMBER}}.uksouth.cloudapp.azure.com:10000 \
-host_p2p_port=10000 \
-enclave_docker_image=${{needs.build.outputs.L2_ENCLAVE_DOCKER_BUILD_TAG}} \
Expand Down

0 comments on commit 4796e58

Please sign in to comment.