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

feat(spartan): run ethereum with beacon node in cluster w/ kurtosis #10275

Closed
wants to merge 19 commits into from
Closed
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
30 changes: 30 additions & 0 deletions .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,36 @@ jobs:
run: |
earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ env.GIT_COMMIT }} --ARCH=arm64

build-blob-sink-x86:
needs: [configure, build-aztec-x86]
runs-on: ${{ needs.configure.outputs.username }}-x86
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-aztec-blob-sink-x86_64
dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}"
- name: Build & push aztec blob sink image x86-64
run: |
earthly-ci --no-output --push ./yarn-project+export-blob-sink --DIST_TAG=${{ env.GIT_COMMIT }} --ARCH=x86_64

build-blob-sink-arm:
needs: [configure, build-aztec-arm]
runs-on: ${{ needs.configure.outputs.username }}-arm
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-aztec-blob-sink-arm64
dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}"
- name: Build & push aztec blob sink image arm
run: |
earthly-ci --no-output --push ./yarn-project+export-blob-sink --DIST_TAG=${{ env.GIT_COMMIT }} --ARCH=arm64

publish-manifests:
needs:
- configure
Expand Down
1 change: 1 addition & 0 deletions aztec-up/bin/aztec-install
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ if [ -z "${SKIP_PULL:-}" ]; then
pull_container aztec-nargo
pull_container aztec
pull_container cli-wallet
pull_container blob-sink
fi

# Download the Docker Compose file. Used by aztec.
Expand Down
9 changes: 9 additions & 0 deletions aztec-up/bin/docker-compose.sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ services:
FORK_BLOCK_NUMBER:
ANVIL_PORT: ${ANVIL_PORT:-8545}

# TODO: add a readiness probe to this
# TODO: delete all of these extra images and just have one, then symlink them???
blob-sink:
image: aztecprotocol/blob-sink
ports:
- "${BLOB_SINK_PORT:-5052}:${BLOB_SINK_PORT:-5052}"

aztec:
image: "aztecprotocol/aztec"
ports:
Expand All @@ -29,11 +36,13 @@ services:
SEQ_TX_POLLING_INTERVAL_MS: 50
WS_BLOCK_CHECK_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
SEQ_BLOB_SINK_URL: http://blob-sink:${BLOB_SINK_PORT:-5052}
PXE_PORT: ${PXE_PORT:-8080}
PORT: ${AZTEC_NODE_PORT:-8080}
TEST_ACCOUNTS: ${TEST_ACCOUNTS:-true}
volumes:
- ./log:/usr/src/yarn-project/aztec/log:rw
depends_on:
- ethereum
- blob-sink
command: "start --sandbox"
8 changes: 8 additions & 0 deletions boxes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ services:
SEQ_TX_POLLING_INTERVAL_MS: 50
WS_BLOCK_CHECK_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
SEQ_BLOB_SINK_URL: http://blob-sink:5052
depends_on:
- ethereum

blob-sink:
image: aztecprotocol/blob-sink:${AZTEC_DOCKER_TAG:-latest}
environment:
PORT: 5052
DEBUG: "aztec:*"
DEBUG_COLORS: "true"

boxes:
image: aztecprotocol/boxes:${AZTEC_DOCKER_TAG:-latest}
entrypoint: >
Expand Down
7 changes: 7 additions & 0 deletions build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ cli-wallet:
- yarn-project
multiarch: buildx

blob-sink:
buildDir: yarn-project
projectDir: yarn-project/blob-sink
dependencies:
- yarn-project
multiarch: buildx

# Builds all the boxes. They are then independently tested in the container.
boxes:
buildDir: boxes
Expand Down
3 changes: 2 additions & 1 deletion scripts/run_native_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ BASE_CMD="INTERLEAVED=$INTERLEAVED ./yarn-project/end-to-end/scripts/native_netw
\"./validators.sh $NUM_VALIDATORS\" \
$PROVER_SCRIPT \
./pxe.sh \
./transaction-bot.sh"
./transaction-bot.sh \
./blob-sink.sh"

# Execute the command
eval $BASE_CMD
2 changes: 2 additions & 0 deletions spartan/aztec-network/files/config/setup-service-addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ if [ "${ETHEREUM_EXTERNAL_HOST}" != "" ]; then
ETHEREUM_ADDR="${ETHEREUM_EXTERNAL_HOST}"
elif [ "${NETWORK_PUBLIC}" = "true" ]; then
ETHEREUM_ADDR=$(get_service_address "ethereum" "${ETHEREUM_PORT}")
elif [ "${ETHEREUM__NAMESPACE}" != "" ]; then
ETHEREUM_ADDR="http://${ETHEREUM_EL_SERVICE_NAME}.${ETHEREUM__NAMESPACE}:${ETHEREUM_PORT}"
else
ETHEREUM_ADDR="http://${SERVICE_NAME}-ethereum.${NAMESPACE}:${ETHEREUM_PORT}"
fi
Expand Down
8 changes: 7 additions & 1 deletion spartan/aztec-network/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,14 @@ Service Address Setup Container
value: "{{ .Values.telemetry.otelCollectorEndpoint }}"
- name: EXTERNAL_ETHEREUM_HOST
value: "{{ .Values.ethereum.externalHost }}"
- name: ETHEREUM__NAMESPACE
value: "{{ .Values.ethereum.namespace }}"
- name: ETHEREUM_EL_SERVICE_NAME
value: "{{ .Values.ethereum.elServiceName }}"
- name: ETHEREUM_CL_SERVICE_NAME
value: "{{ .Values.ethereum.clServiceName }}"
- name: ETHEREUM_PORT
value: "{{ .Values.ethereum.service.port }}"
value: "{{ .Values.ethereum.elPort }}"
- name: EXTERNAL_BOOT_NODE_HOST
value: "{{ .Values.bootNode.externalHost }}"
- name: BOOT_NODE_PORT
Expand Down
147 changes: 0 additions & 147 deletions spartan/aztec-network/templates/reth.yaml

This file was deleted.

9 changes: 8 additions & 1 deletion spartan/aztec-network/templates/setup-l2-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ spec:
value: "{{ .Values.network.public }}"
- name: NAMESPACE
value: {{ .Release.Namespace }}
# TODO: clean up these variables
- name: ETHEREUM_HOST
value: "http://${ETHEREUM_EL_SERVICE_NAME}.${ETHEREUM__NAMESPACE}:${ETHEREUM_PORT}"
- name: EXTERNAL_ETHEREUM_HOST
value: "{{ .Values.ethereum.externalHost }}"
- name: ETHEREUM_EL_SERVICE_NAME
value: "{{ .Values.ethereum.elServiceName }}"
- name: ETHEREUM_CL_SERVICE_NAME
value: "{{ .Values.ethereum.clServiceName }}"
- name: ETHEREUM_PORT
value: "{{ .Values.ethereum.service.port }}"
value: "{{ .Values.ethereum.elPort }}"
- name: EXTERNAL_BOOT_NODE_HOST
value: "{{ .Values.bootNode.externalHost }}"
- name: BOOT_NODE_PORT
Expand Down
24 changes: 4 additions & 20 deletions spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,14 @@ bot:
cpu: "200m"

ethereum:
externalHost: ""
replicas: 1
chainId: 1337
blockTime: 12sec
# 1 billion gas limit
# helps ensure we can deploy public contracts
gasLimit: "1000000000"
args: ""
service:
type: ClusterIP
port: 8545
targetPort: 8545
nodePort: ""
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
resources:
requests:
memory: "2Gi"
cpu: "200m"
storage: "80Gi"
namespace: "kt-ethereum-testnet"
elServiceName: el-1-reth-lighthouse
clServiceName: cl-1-lighthouse-reth
elPort: 8545

proverAgent:
service:
Expand Down
20 changes: 20 additions & 0 deletions spartan/ethereum-testnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Ethereum Testnet

This directory contains scripts to install a local Ethereum testnet using Kurtosis.

To install:
```bash
./install_kurtosis.sh
```

To deploy the testnet:
```bash
export ENCLAVE_NAME=ethereum-testnet # defaults to this
./deploy.sh
```
This will deploy a testnet with into the namespace `kt-{ENCLAVE_NAME}`. Defaults to `kt-ethereum-testnet`.

To destroy the testnet:
```bash
./teardown.sh
```
11 changes: 11 additions & 0 deletions spartan/ethereum-testnet/config/kurtosis-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
config-version: 2
should-send-metrics: false
kurtosis-clusters:
docker:
type: "docker"
kind:
type: "kubernetes"
config:
kubernetes-cluster-name: "kind-kind"
storage-class: "standard"
enclave-size-in-megabytes: 10
Loading
Loading