-
Notifications
You must be signed in to change notification settings - Fork 324
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
fix: sepolia deployments #12329
Merged
+55
−34
Merged
fix: sepolia deployments #12329
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3286cb9
fix: run prepare_sepolia_accounts from inside dir
spypsy 3c89540
one-liner
spypsy dce9f5b
use ci3/source
spypsy 5b21c9e
revert working-directory
spypsy 9a9ec1e
remove bash cmd
spypsy 792b288
rm set -eu
spypsy 18b08c0
copy create.sh
spypsy ed47234
multi-hosts update
spypsy d3c4320
single host for cast
spypsy fc36a7e
no need for dispatch ref input
spypsy 3187c49
use input if given tho
spypsy 37a6200
export mnemonic to file
spypsy 738e4f8
ensure externalHosts is treated as single string
spypsy 9925c82
Merge branch 'master' into spy/fix-sepolia-network-deploy
spypsy c967a8f
send more ETH
spypsy 54283f3
Merge branch 'master' into spy/fix-sepolia-network-deploy
spypsy 7fe456a
trap cleanup
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
set -euo pipefail | ||
|
||
source $(git rev-parse --show-toplevel)/ci3/source | ||
|
||
values_file=$1 | ||
eth_amount=${2:-"1"} | ||
output_file=${3:-"mnemonic.tmp"} | ||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} | ||
|
||
value_yamls="../aztec-network/values/$values_file ../aztec-network/values.yaml" | ||
|
@@ -14,31 +18,36 @@ num_accounts=$((num_validators + num_provers + num_bots)) | |
|
||
# Install bc if needed | ||
if ! command -v bc &>/dev/null; then | ||
echo "Installing bc..." | ||
apt-get update && apt-get install -y bc | ||
fi | ||
|
||
# Install cast if needed | ||
if ! command -v cast &>/dev/null; then | ||
echo "Installing cast..." | ||
curl -L https://foundry.paradigm.xyz | bash | ||
$HOME/.foundry/bin/foundryup && export PATH="$PATH:$HOME/.foundry/bin" || | ||
$XDG_CONFIG_HOME/.foundry/bin/foundryup && export PATH="$PATH:$XDG_CONFIG_HOME/.foundry/bin" | ||
$HOME/.foundry/bin/foundryup && export PATH="$PATH:$HOME/.foundry/bin" || $XDG_CONFIG_HOME/.foundry/bin/foundryup && export PATH="$PATH:$XDG_CONFIG_HOME/.foundry/bin" | ||
fi | ||
|
||
# Install yq if needed | ||
if ! command -v yq &>/dev/null; then | ||
echo "Installing yq..." | ||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq | ||
chmod +x /usr/local/bin/yq | ||
fi | ||
|
||
# Create a new mnemonic with the required number of accounts | ||
echo "Creating mnemonic..." | ||
cast wallet new-mnemonic --accounts "$num_accounts" --json >output.json | ||
MNEMONIC=$(jq -r '.mnemonic' output.json) | ||
ADDRESSES=$(jq -r '.accounts[].address' output.json) | ||
rm output.json | ||
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. security nit: it's probably safer to put cleanup like this in a traped cleanup function. |
||
|
||
# Convert ETH to wei | ||
wei_amount=$(cast to-wei "$eth_amount" ether) | ||
|
||
# Get current gas price and add 25% buffer | ||
echo "Getting gas price..." | ||
gas_price=$(cast gas-price --rpc-url "$ETHEREUM_HOST") | ||
gas_price=$((gas_price * 125 / 100)) # Add 25% to gas price | ||
|
||
|
@@ -56,6 +65,7 @@ total_value=$(echo "$wei_amount * $num_accounts" | bc) | |
|
||
multicall_address="0xcA11bde05977b3631167028862bE2a173976CA11" # Sepolia Multicall3 contract | ||
|
||
echo "Sending transaction..." | ||
tx_hash=$(cast send "$multicall_address" \ | ||
"aggregate3Value((address,bool,uint256,bytes)[])" \ | ||
"$calls" \ | ||
|
@@ -64,9 +74,7 @@ tx_hash=$(cast send "$multicall_address" \ | |
--rpc-url "$ETHEREUM_HOST" \ | ||
--json --gas-price "$gas_price") | ||
|
||
echo >&2 "Sent ${wei_amount} wei to ${num_accounts} addresses in tx $tx_hash" | ||
|
||
# Remove temp file | ||
rm output.json | ||
echo "Sent ${wei_amount} wei to ${num_accounts} addresses in tx $tx_hash" | ||
|
||
echo "$MNEMONIC" | ||
# Write mnemonic to output file | ||
echo "$MNEMONIC" >"$output_file" |
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
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.
I would like to keep this please, otherwise the values file needs to be in master in order to test a deployment.
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.
unless the github.ref below does the same thing in that case all gucci
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.
yesss workflow dispatch actions have this by default, we don't need an extra input of our own
