-
Notifications
You must be signed in to change notification settings - Fork 307
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
feat: devnet #3473
Merged
Merged
feat: devnet #3473
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6d65ba0
feat: deploy terraforms
spypsy ae3c337
# of nodes variable
spypsy a2c95b1
faucet updates
spypsy 92955d5
run deploy-devnet job
spypsy 90d5ab8
missing variable
spypsy 7b27613
Fixes
spypsy 6a92e0f
Node index fixes from PR
spypsy d86e9b6
formatting
spypsy 4d020dd
Added missing files
PhilWindle c2f7f33
check should_deploy before l1 contracts deployments
spypsy e50e4c0
update bootstrap node to use count + uncomment listeners
spypsy 1e32f6e
env var fixes
spypsy 2219a1f
l1-contracts to dockerhub
spypsy b480aba
dockerhub uses deploy_tag
spypsy 3e8dac7
don't redeploy devnet on releases
spypsy 9d4c503
mainnet fork requires dockerhub
spypsy 21a58d9
Fix deploy-contracts
spypsy a20d577
more PR fixes
spypsy 5dfab7b
remove invalid var declarations
spypsy 9ec36f6
remove invalid var declarations
spypsy 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 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 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 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 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 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 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,7 +1,11 @@ | ||
#!/bin/bash | ||
# Retuns success if we are expected to do a deploy. | ||
# At present this is only if we have a commit tag. | ||
# Once we are doing master deployments to devnet, we'll want to check if BRANCH is master. | ||
# Returns success if we are expected to do a deployment. | ||
# This is if we have a commit tag (release) or if we're on `master` branch (devnet deployment). | ||
|
||
set -eu | ||
|
||
[ -n "$COMMIT_TAG" ] | ||
if [ -n "$COMMIT_TAG" ] || [ "$BRANCH" = "master" ]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
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
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
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 |
---|---|---|
|
@@ -16,4 +16,7 @@ lcov.info | |
.foundry | ||
|
||
# Yarn lockfile | ||
yarn.lock | ||
yarn.lock | ||
|
||
# 'deploy_contracts' script output | ||
serve/ |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
FORCE_DEPLOY=${2:-"false"} | ||
|
||
export ETHEREUM_HOST=$DEPLOY_TAG-mainnet-fork.aztec.network:8545/$FORK_API_KEY | ||
|
||
# If we have previously successful commit, we can early out if nothing relevant has changed since. | ||
if [[ $FORCE_DEPLOY == 'false' ]] && check_rebuild cache-"$CONTENT_HASH" $REPOSITORY; then | ||
echo "No contract deploy necessary." | ||
exit 0 | ||
fi | ||
|
||
mkdir -p serve | ||
# Contract addresses will be mounted in the serve directory | ||
docker run \ | ||
-v $(pwd)/serve:/usr/src/contracts/serve \ | ||
-e ETHEREUM_HOST=$ETHEREUM_HOST -e PRIVATE_KEY=$CONTRACT_PUBLISHER_PRIVATE_KEY \ | ||
278380418400.dkr.ecr.eu-west-2.amazonaws.com/l1-contracts:$COMMIT_HASH \ | ||
./scripts/deploy_contracts.sh | ||
|
||
# Write the contract addresses as terraform variables | ||
for KEY in ROLLUP_CONTRACT_ADDRESS REGISTRY_CONTRACT_ADDRESS INBOX_CONTRACT_ADDRESS OUTBOX_CONTRACT_ADDRESS; do | ||
VALUE=$(jq -r .$KEY ./serve/contract_addresses.json) | ||
export TF_VAR_$KEY=$VALUE | ||
done | ||
|
||
# Write TF state variables | ||
deploy_terraform l1-contracts ./terraform |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Sets up defaults then runs the E2E Setup script to perform contract deployments | ||
# | ||
# Expected enviornment variables | ||
# -ROLLUP_CONTRACT_ADDRESS | ||
# -CONTRACT_DEPLOYMENT_EMITTER_ADDRESS | ||
# -INBOX_CONTRACT_ADDRESS | ||
# -OUTBOX_CONTRACT_ADDRESS | ||
# -REGISTRY_CONTRACT_ADDRESS | ||
|
||
# Create serve directory in which we save contract_addresses.json. | ||
mkdir -p serve/ | ||
echo "Created output directory" | ||
|
||
extract_deployed_to() { | ||
grep 'Deployed to:' | awk '{print $3}' | ||
} | ||
|
||
deploy_contract() { | ||
CONTRACT="$1" | ||
CONSTRUCTOR_ARGS=(${2-}) | ||
if [ ${#CONSTRUCTOR_ARGS[@]} -gt 0 ]; then | ||
forge create --rpc-url $ETHEREUM_HOST --private-key $PRIVATE_KEY $CONTRACT --constructor-args $CONSTRUCTOR_ARGS | ||
else | ||
forge create --rpc-url $ETHEREUM_HOST --private-key $PRIVATE_KEY $CONTRACT | ||
fi | ||
} | ||
|
||
export REGISTRY_CONTRACT_ADDRESS=$(deploy_contract ./src/core/messagebridge/Registry.sol:Registry | extract_deployed_to) | ||
export INBOX_CONTRACT_ADDRESS=$(deploy_contract ./src/core/messagebridge/Inbox.sol:Inbox "$REGISTRY_CONTRACT_ADDRESS" | extract_deployed_to) | ||
export OUTBOX_CONTRACT_ADDRESS=$(deploy_contract ./src/core/messagebridge/Outbox.sol:Outbox "$REGISTRY_CONTRACT_ADDRESS" | extract_deployed_to) | ||
export ROLLUP_CONTRACT_ADDRESS=$(deploy_contract ./src/core/Rollup.sol:Rollup "$REGISTRY_CONTRACT_ADDRESS" | extract_deployed_to) | ||
export CONTRACT_DEPLOYMENT_EMITTER_ADDRESS=$(deploy_contract ./src/core/periphery/ContractDeploymentEmitter.sol:ContractDeploymentEmitter | extract_deployed_to) | ||
|
||
# Store contract addresses in a JSON file | ||
jq -n \ | ||
--arg registryAddress "$REGISTRY_CONTRACT_ADDRESS" \ | ||
--arg inboxAddress "$INBOX_CONTRACT_ADDRESS" \ | ||
--arg outboxAddress "$OUTBOX_CONTRACT_ADDRESS" \ | ||
--arg rollupAddress "$ROLLUP_CONTRACT_ADDRESS" \ | ||
--arg emitterAddress "$CONTRACT_DEPLOYMENT_EMITTER_ADDRESS" \ | ||
'{ | ||
REGISTRY_CONTRACT_ADDRESS: $registryAddress, | ||
INBOX_CONTRACT_ADDRESS: $inboxAddress, | ||
OUTBOX_CONTRACT_ADDRESS: $outboxAddress, | ||
ROLLUP_CONTRACT_ADDRESS: $rollupAddress, | ||
CONTRACT_DEPLOYMENT_EMITTER_ADDRESS: $emitterAddress | ||
}' >serve/contract_addresses.json | ||
|
||
cat serve/contract_addresses.json | ||
|
||
echo "Contract addresses have been written to serve/contract_addresses.json" |
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.
Can we use dockerhub for this container instead of ecr?