Skip to content
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: network deployments #11463

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion spartan/aztec-network/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
out/
out/
tmp/
33 changes: 20 additions & 13 deletions spartan/aztec-network/eth-devnet/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,46 @@ create_beacon_genesis() {
echo " Execution genesis path: $execution_genesis_path"

# update the templates block time if it is provided
cp "$DIR_PATH/$beacon_config_path" "$DIR_PATH/out/config.yaml"
cp "$DIR_PATH/$beacon_config_path" "$DIR_PATH/tmp/config.yaml"
if [[ -n "${BLOCK_TIME:-}" ]]; then
yq eval ".SECONDS_PER_SLOT = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml"
yq eval ".SECONDS_PER_ETH1_BLOCK = ${BLOCK_TIME}" -i "$DIR_PATH/out/config.yaml"
yq eval ".SECONDS_PER_SLOT = ${BLOCK_TIME}" -i "$DIR_PATH/tmp/config.yaml"
yq eval ".SECONDS_PER_ETH1_BLOCK = ${BLOCK_TIME}" -i "$DIR_PATH/tmp/config.yaml"
fi

# Update the chain id if it is provided
if [[ -n "${CHAIN_ID:-}" ]]; then
yq eval ".DEPOSIT_CHAIN_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml"
yq eval ".DEPOSIT_NETWORK_ID = ${CHAIN_ID}" -i "$DIR_PATH/out/config.yaml"
yq eval ".DEPOSIT_CHAIN_ID = ${CHAIN_ID}" -i "$DIR_PATH/tmp/config.yaml"
yq eval ".DEPOSIT_NETWORK_ID = ${CHAIN_ID}" -i "$DIR_PATH/tmp/config.yaml"
fi

# Copy mnemonics file to tmp and update it with provided mnemonic
cp "$DIR_PATH/config/mnemonics.yaml" "$DIR_PATH/tmp/mnemonics.yaml"
yq eval '.0.mnemonic = "'"$MNEMONIC"'"' -i "$DIR_PATH/tmp/mnemonics.yaml"

# Run the protolamba's eth2 testnet genesis container
echo "$DIR_PATH/config:/app/config"
echo "$DIR_PATH/out:/app/out"

docker run --rm \
-v "$DIR_PATH/config:/app/config" \
-v "$DIR_PATH/tmp:/app/tmp" \
-v "$DIR_PATH/out:/app/out" \
maddiaa/eth2-testnet-genesis deneb \
--config="./out/config.yaml" \
--config="./tmp/config.yaml" \
--eth1-config="./tmp/genesis.json" \
--preset-phase0=minimal \
--preset-altair=minimal \
--preset-bellatrix=minimal \
--preset-capella=minimal \
--preset-deneb=minimal \
--eth1-config="./out/genesis.json" \
--state-output="${beacon_genesis_path}/genesis.ssz" \
--tranches-dir="$beacon_genesis_path" \
--mnemonics="$beacon_mnemonics_path" \
--mnemonics="./tmp/mnemonics.yaml" \
--eth1-withdrawal-address="0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
--eth1-match-genesis-time


cp "$DIR_PATH/tmp/genesis.json" "$DIR_PATH/out/genesis.json"
cp "$DIR_PATH/tmp/config.yaml" "$DIR_PATH/out/config.yaml"

if [[ $? -ne 0 ]]; then
echo "Error: eth2-testnet-genesis failed."
exit 1
Expand All @@ -162,12 +169,12 @@ beacon_config_path="$DIR_PATH/config/config.yaml"
genesis_json_path="$DIR_PATH/config/genesis.json"

mkdir -p "$DIR_PATH/out"
mkdir -p "$DIR_PATH/tmp"

create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/out/genesis.json"
create_beacon_genesis "$DIR_PATH/out/genesis.json"
create_execution_genesis "$DIR_PATH/config/genesis.json" "$DIR_PATH/tmp/genesis.json"
create_beacon_genesis "$DIR_PATH/tmp/genesis.json"
create_deposit_contract_block
write_ssz_file_base64

cp "$beacon_config_path" "$DIR_PATH/out/config.yaml"
cp "$DIR_PATH/config/jwt-secret.hex" "$DIR_PATH/out/jwt-secret.hex"
echo "Genesis files copied to ./out"
Loading