-
Notifications
You must be signed in to change notification settings - Fork 598
feat: node upgrade infra #12127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: node upgrade infra #12127
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,6 +1,17 @@ | ||
| #!/bin/bash | ||
| set -exu | ||
|
|
||
| # If REGISTRY_CONTRACT_ADDRESS is already set, skip deployment and just write the file | ||
| if [ -n "${REGISTRY_CONTRACT_ADDRESS:-}" ]; then | ||
| echo "Registry address already set. Skipping deployment." | ||
| # Write the addresses to a file in the shared volume | ||
| cat <<EOF >/shared/contracts/contracts.env | ||
| export REGISTRY_CONTRACT_ADDRESS=$REGISTRY_CONTRACT_ADDRESS | ||
| EOF | ||
| cat /shared/contracts/contracts.env | ||
| exit 0 | ||
| fi | ||
|
|
||
| SALT=${1:-$RANDOM} | ||
| CHAIN_ID=$2 | ||
| VALIDATOR_ADDRESSES=$3 | ||
|
|
@@ -9,10 +20,15 @@ VALIDATOR_ADDRESSES=$3 | |
| output="" | ||
| MAX_RETRIES=5 | ||
| RETRY_DELAY=15 | ||
| TEST_ACCOUNTS=${TEST_ACCOUNTS:-false} | ||
| TEST_ACCOUNTS_ARG="" | ||
| if [ "$TEST_ACCOUNTS" = "true" ]; then | ||
| TEST_ACCOUNTS_ARG="--test-accounts" | ||
| fi | ||
|
|
||
| for attempt in $(seq 1 $MAX_RETRIES); do | ||
| # Construct base command | ||
| base_cmd="LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --test-accounts" | ||
| base_cmd="LOG_LEVEL=debug node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts $TEST_ACCOUNTS_ARG" | ||
|
|
||
| # Add account - use private key if set, otherwise use mnemonic | ||
| if [ -n "${L1_DEPLOYMENT_PRIVATE_KEY:-}" ]; then | ||
|
|
@@ -38,32 +54,12 @@ done || { | |
| echo "$output" | ||
|
|
||
| # Extract contract addresses using grep and regex | ||
| rollup_address=$(echo "$output" | grep -oP 'Rollup Address: \K0x[a-fA-F0-9]{40}') | ||
| registry_address=$(echo "$output" | grep -oP 'Registry Address: \K0x[a-fA-F0-9]{40}') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
| inbox_address=$(echo "$output" | grep -oP 'L1 -> L2 Inbox Address: \K0x[a-fA-F0-9]{40}') | ||
| outbox_address=$(echo "$output" | grep -oP 'L2 -> L1 Outbox Address: \K0x[a-fA-F0-9]{40}') | ||
| fee_juice_address=$(echo "$output" | grep -oP 'Fee Juice Address: \K0x[a-fA-F0-9]{40}') | ||
| staking_asset_address=$(echo "$output" | grep -oP 'Staking Asset Address: \K0x[a-fA-F0-9]{40}') | ||
| fee_juice_portal_address=$(echo "$output" | grep -oP 'Fee Juice Portal Address: \K0x[a-fA-F0-9]{40}') | ||
| coin_issuer_address=$(echo "$output" | grep -oP 'CoinIssuer Address: \K0x[a-fA-F0-9]{40}') | ||
| reward_distributor_address=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}') | ||
| governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}') | ||
| governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') | ||
| slash_factory_address=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}') | ||
|
|
||
| # Write the addresses to a file in the shared volume | ||
| cat <<EOF >/shared/contracts/contracts.env | ||
| export ROLLUP_CONTRACT_ADDRESS=$rollup_address | ||
| export REGISTRY_CONTRACT_ADDRESS=$registry_address | ||
| export INBOX_CONTRACT_ADDRESS=$inbox_address | ||
| export OUTBOX_CONTRACT_ADDRESS=$outbox_address | ||
| export FEE_JUICE_CONTRACT_ADDRESS=$fee_juice_address | ||
| export STAKING_ASSET_CONTRACT_ADDRESS=$staking_asset_address | ||
| export FEE_JUICE_PORTAL_CONTRACT_ADDRESS=$fee_juice_portal_address | ||
| export COIN_ISSUER_CONTRACT_ADDRESS=$coin_issuer_address | ||
| export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$reward_distributor_address | ||
| export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$governance_proposer_address | ||
| export GOVERNANCE_CONTRACT_ADDRESS=$governance_address | ||
| export SLASH_FACTORY_CONTRACT_ADDRESS=$slash_factory_address | ||
| EOF | ||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ telemetry: | |
|
|
||
| validator: | ||
| replicas: 1 | ||
| sequencer: | ||
| minTxsPerBlock: 0 | ||
| validator: | ||
| disabled: false | ||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue for picking real values for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was 60 picked to make the test work? I would prefer they default high but we adjust the slot in a test to a lower value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, the
60was picked just to make the test fast, and acknowledging that for the first few upgrades on testnet, aztec labs likely be using proposeWithLock and voting, so shorter times are preferable.Ideally these are configurable in a constructor, similar to the governanceproposer.