Skip to content
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
53 changes: 41 additions & 12 deletions .github/workflows/fund-sepolia-accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ on:
required: true
type: string
default: sepolia-accounts-mnemonic
ref:
description: The branch or tag to checkout
required: false
type: string
default: master
secrets:
GCP_SA_KEY:
required: true
SEPOLIA_FUNDING_PRIVATE_KEY:
required: true
GCP_SEPOLIA_URL:
required: true
GCP_SEPOLIA_API_KEY:
required: true

workflow_dispatch:
inputs:
values_file:
description: The values file to use, e.g. 1-validators.yaml
required: true
type: string
sepolia_accounts_mnemonic_secret_name:
description: The name of the secret which holds the sepolia accounts mnemonic. Will create a new one if it doesn't exist.
required: true
type: string
default: sepolia-accounts-mnemonic
ref:
description: The branch or tag to checkout
required: false
type: string
default: master

jobs:
fund-sepolia-accounts:
Expand All @@ -20,7 +51,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ref: ${{ inputs.ref || github.ref || 'master' }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
Expand All @@ -30,14 +61,6 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Install cast
run: |
if ! command -v cast &>/dev/null; then
echo "Installing cast..."
curl -L https://foundry.paradigm.xyz | bash
$HOME/.foundry/bin/foundryup
fi

- name: Get mnemonic
id: get-mnemonic
run: |
Expand Down Expand Up @@ -66,7 +89,7 @@ jobs:
export ETHEREUM_HOST="https://json-rpc.${{ secrets.GCP_SEPOLIA_URL }}?key=${{ secrets.GCP_SEPOLIA_API_KEY }}"

echo "Funding accounts..."
$REPO/spartan/scripts/fund_sepolia_accounts.sh ${{ inputs.values_file }} "$MNEMONIC_FILE"
$REPO/spartan/scripts/prepare_sepolia_accounts.sh ${{ inputs.values_file }} 30 "$MNEMONIC_FILE"
mnemonic=$(cat "$MNEMONIC_FILE")
rm "$MNEMONIC_FILE"
echo "::add-mask::$mnemonic"
Expand All @@ -76,5 +99,11 @@ jobs:
if: ${{ steps.get-mnemonic.outputs.new_mnemonic == 'true' }}
run: |
echo "Saving mnemonic to GCP"
echo "::add-mask::${{ steps.get-mnemonic.outputs.mnemonic }}"
gcloud secrets versions add latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$MNEMONIC_FILE"
echo "::add-mask::${{ steps.fund-accounts.outputs.mnemonic }}"
echo "Creating new secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
gcloud secrets create ${{ inputs.sepolia_accounts_mnemonic_secret_name }}
TMP_FILE=$(mktemp)
echo "${{ steps.fund-accounts.outputs.mnemonic }}" > "$TMP_FILE"
gcloud secrets versions add ${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$TMP_FILE"
rm "$TMP_FILE"
echo "Saved mnemonic to GCP secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
58 changes: 33 additions & 25 deletions .github/workflows/network-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,26 @@ on:
type: string
default: "false"
sepolia_accounts_mnemonic_secret_name:
description: The name of the secret which holds the sepolia accounts mnemonic
description: The name of the secret which holds the sepolia accounts mnemonic (if not provided, will use '{namespace}-accounts-mnemonic').
required: false
type: string
default: sepolia-accounts-mnemonic

jobs:
fund_sepolia_accounts:
if: ${{ inputs.sepolia_deployment == 'true' }}
uses: ./.github/workflows/fund-sepolia-accounts.yml
with:
values_file: ${{ inputs.values_file }}
sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name || format('{0}-accounts-mnemonic', inputs.namespace) }}
ref: ${{ inputs.ref || github.ref || 'master' }}
secrets:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
SEPOLIA_FUNDING_PRIVATE_KEY: ${{ secrets.SEPOLIA_FUNDING_PRIVATE_KEY }}
GCP_SEPOLIA_URL: ${{ secrets.GCP_SEPOLIA_URL }}
GCP_SEPOLIA_API_KEY: ${{ secrets.GCP_SEPOLIA_API_KEY }}

network_deployment:
needs: fund_sepolia_accounts
# This job will run on Ubuntu
runs-on: ubuntu-latest
concurrency:
Expand Down Expand Up @@ -129,6 +142,13 @@ jobs:
with:
ref: ${{ inputs.ref || github.ref }}

- name: Check values
run: |
echo "inputs.ref: ${{ inputs.ref }}"
echo "github.ref: ${{ github.ref }}"
ls -la .github/workflows/
ls -la .github/workflows/fund-sepolia-accounts.yml

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
Expand Down Expand Up @@ -172,28 +192,6 @@ jobs:

$REPO/spartan/scripts/generate_devnet_config.sh ${{ env.VALUES_FILE }}

- name: Fund sepolia accounts
uses: ./.github/workflows/fund-sepolia-accounts.yml
if: ${{ inputs.sepolia_deployment == 'true' }}
with:
values_file: ${{ env.VALUES_FILE }}
sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name }}

- name: Generate sepolia accounts
id: generate-sepolia-accounts
if: ${{ inputs.sepolia_deployment == 'true' }}
run: |
REPO=$(git rev-parse --show-toplevel)
export FUNDING_PRIVATE_KEY=${{ secrets.SEPOLIA_FUNDING_PRIVATE_KEY }}
export ETHEREUM_HOST="https://json-rpc.${{ secrets.GCP_SEPOLIA_URL }}?key=${{ secrets.GCP_SEPOLIA_API_KEY }}"
echo "Preparing sepolia accounts..."
MNEMONIC_FILE=$(mktemp)
$REPO/spartan/scripts/prepare_sepolia_accounts.sh ${{ env.VALUES_FILE }} 30 "$MNEMONIC_FILE"
mnemonic=$(cat "$MNEMONIC_FILE")
rm "$MNEMONIC_FILE"
echo "::add-mask::$mnemonic"
echo "mnemonic=$mnemonic" >> "$GITHUB_OUTPUT"

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
Expand All @@ -213,6 +211,11 @@ jobs:
continue-on-error: true
run: |
if ${{ inputs.sepolia_deployment == 'true' }}; then
if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then
SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic"
else
SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
fi
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }})
terraform destroy -auto-approve \
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
Expand Down Expand Up @@ -244,7 +247,12 @@ jobs:
working-directory: ./spartan/terraform/deploy-release
run: |
if ${{ inputs.sepolia_deployment == 'true' }}; then
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }})
if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then
SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic"
else
SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
fi
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=$SECRET_NAME)
terraform plan \
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
-var="VALUES_FILE=${{ env.VALUES_FILE }}" \
Expand Down
91 changes: 91 additions & 0 deletions spartan/aztec-network/values/alpha-testnet-provers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
telemetry:
enabled: true

snapshots:
uploadLocation: "gs://aztec-testnet/snapshots/"
syncUrl: "https://storage.googleapis.com/aztec-testnet/snapshots/"
frequency: "0 0 * * *" # daily uploads at midnight

aztec:
realProofs: true
numberOfDefaultAccounts: 0
testAccounts: false
sponsoredFPC: true
bootstrapENRs: "enr:-LO4QLbJddVpePYjaiCftOBY-L7O6Mfj_43TAn5Q1Y-5qQ_OWmSFc7bTKWHzw5xmdVIqXUiizum_kIRniXdPnWHHcwEEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEI8nh9YlzZWNwMjU2azGhA-_dX6aFcXP1DLk91negbXL2a0mNYGXH4hrMvb2i92I0g3VkcIKd0A,enr:-LO4QN4WF8kFyV3sQVX0C_y_03Eepxk5Wac70l9QJcIDRYwKS6aRst1YcfbTDdvovXdRfKf-WSXNVWViGLhDA-dUz2MEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIicTHolzZWNwMjU2azGhAsz7aFFYRnP5xjTux5UW-HyEQcW_EJrZMT1CNm79N4g-g3VkcIKd0A,enr:-LO4QFrGfkRaCk_iFTeUjR5ESwo45Eov9hx_T1-BLdoT-iHzFgCiHMT4V1KBtdFp8D0ajLSe5HcNYrhalmdJXgv6NTUEhWF6dGVjqDAwLTExMTU1MTExLTAwMDAwMDAwLTAtMTgwNmEwMjgtMWE1MzBmM2KCaWSCdjSCaXCEIlICt4lzZWNwMjU2azGhAlC6nKB3iDtRFqWKWqxf_t-P9hc-SZ6VFBJV4y3bTZBQg3VkcIKd0A"
contracts:
registryAddress: "0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e"
rollupAddress: "0xee6d4e937f0493fb461f28a75cf591f1dba8704e"
slashFactoryAddress: "0x3c9ccf55a8ac3c2eeedf2ee2aa1722188fd676be"
feeAssetHandlerContractAddress: "0x80d848dc9f52df56789e2d62ce66f19555ff1019"

network:
public: true
p2pBootstrapNodesAsFullPeers: false

blobSink:
enabled: false
archiveApiUrl: "https://api.sepolia.blobscan.com"
dataStoreConfig:
dataDir: "/data"
storageSize: "128Gi"
dataStoreMapSize: "134217728" # 128 GB

bot:
enabled: false

pxe:
enabled: false

faucet:
enabled: false

bootNode:
enabled: false
replicas: 0
# unused.
externalHost: "http://localhost:8080"

fullNode:
enabled: false
replicas: 0
# unused
externalHost: "http://localhost:8080"

proverNode:
replicas: 1
l1FixedPriorityFeePerGas: 3
l1GasLimitBufferPercentage: 15
l1GasPriceMax: 1000
failedEpochStore: "gs://aztec-testnet/failed-epochs/"
maxOldSpaceSize: "8192"
storageSize: "512Gi"
resources:
requests:
cpu: "3"
memory: "10Gi"

validator:
replicas: 0

proverBroker:
storageSize: "10Gi"

proverAgent:
replicas: 15
bb:
hardwareConcurrency: 31
gke:
spotEnabled: true
resources:
requests:
memory: "116Gi"
cpu: "31"

ethereum:
chainId: "11155111"
l1GasPriceMax: 1000
l1FixedPriorityFeePerGas: 3

jobs:
deployL1Verifier:
enable: false
6 changes: 5 additions & 1 deletion spartan/scripts/prepare_sepolia_accounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ if ! command -v yq &>/dev/null; then
fi

# Convert ETH to wei
if [[ ! "$eth_amount" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
echo "Error: Invalid ETH amount: $eth_amount"
exit 1
fi
wei_amount=$(cast to-wei "$eth_amount" ether)

value_yamls="../aztec-network/values/$values_file ../aztec-network/values.yaml"
Expand Down Expand Up @@ -91,7 +95,7 @@ max_index=$((max_index > bot_max_index ? max_index : bot_max_index))
total_accounts=$((num_validators + num_provers + num_bots))

# Check if mnemonic is provided
if [ -z "$MNEMONIC" ]; then
if [ "${MNEMONIC:-}" = "" ]; then
# Create a new mnemonic
echo "Creating mnemonic..."
cast wallet new-mnemonic --json >"$tmp_filename"
Expand Down