diff --git a/.env b/.env index 46bf1251f..eee98b246 100644 --- a/.env +++ b/.env @@ -83,6 +83,10 @@ ESPRESSO_STATE_SIGNATURE_WEIGHT_THRESHOLD=3 ESPRESSO_PROVER_SERVICE_PORT=60001 ESPRESSO_STATE_PROVER_UPDATE_INTERVAL=10m +# Builder service +ESPRESSO_BUILDER_SERVER_PORT=60003 +BUILDER_CHANNEL_CAPACITY=1024 + # Load generator ESPRESSO_SUBMIT_TRANSACTIONS_DELAY=1s ESPRESSO_SUBMIT_TRANSACTIONS_PORT=44010 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e892affe0..1e77ae3fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,7 @@ jobs: target/release/reset-storage target/release/deploy target/release/keygen + target/release/permissionless-builder target/release/nasty-client build-arm: @@ -115,6 +116,7 @@ jobs: target/release/reset-storage target/release/deploy target/release/keygen + target/release/permissionless-builder target/release/nasty-client build-dockers: @@ -129,6 +131,7 @@ jobs: commitment-task-tag: ${{ steps.commitment-task.outputs.tags }} submit-transactions-tag: ${{ steps.submit-transactions.outputs.tags }} deploy-tag: ${{ steps.deploy.outputs.tags }} + builder-tag: ${{ steps.builder.outputs.tags }} nasty-client-tag: ${{ steps.nasty-client.outputs.tags }} steps: - name: Checkout Repository @@ -293,6 +296,16 @@ jobs: tags: ${{ steps.deploy.outputs.tags }} labels: ${{ steps.deploy.outputs.labels }} + - name: Build and push builder docker + uses: docker/build-push-action@v5 + with: + context: ./ + file: ./docker/permissionless-builder.Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.builder.outputs.tags }} + labels: ${{ steps.builder.outputs.labels }} + - name: Build and push nasty-client docker uses: docker/build-push-action@v5 with: @@ -326,6 +339,7 @@ jobs: docker pull ${{ needs.build-dockers.outputs.commitment-task-tag }} docker pull ${{ needs.build-dockers.outputs.submit-transactions-tag }} docker pull ${{ needs.build-dockers.outputs.deploy-tag }} + docker pull ${{ needs.build-dockers.outputs.builder-tag }} docker pull ${{ needs.build-dockers.outputs.nasty-client-tag }} - name: Tag new docker images run: | diff --git a/docker-compose.yaml b/docker-compose.yaml index 53bca6b22..e8c31e6f6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -301,6 +301,27 @@ services: sequencer0: condition: service_healthy + permissionless-builder: + image: ghcr.io/espressosystems/espresso-sequencer/permissionless-builder:main + ports: + - "$ESPRESSO_BUILDER_SERVER_PORT:$ESPRESSO_BUILDER_SERVER_PORT" + environment: + - ESPRESSO_SEQUENCER_URL + - ESPRESSO_SEQUENCER_DA_SERVER_URL + - ESPRESSO_BUILDER_KEY_FILE + - ESPRESSO_BUILDER_ETH_MNEMONIC + - ESPRESSO_BUILDER_ETH_ACCOUNT_INDEX + - ESPRESSO_BUILDER_L1_PROVIDER + - BUILDER_SERVER_PORT=$ESPRESSO_BUILDER_SERVER_PORT + - BUILDER_ADDRESS + - BUILDER_CHANNEL_CAPACITY=$BUILDER_CHANNEL_CAPACITY + - RUST_LOG + - RUST_LOG_FORMAT + - ASYNC_STD_THREAD_COUNT + depends_on: + sequencer0: + condition: service_healthy + nasty-client: image: ghcr.io/espressosystems/espresso-sequencer/nasty-client:main ports: diff --git a/docker/permissionless-builder.Dockerfile b/docker/permissionless-builder.Dockerfile new file mode 100644 index 000000000..10f919232 --- /dev/null +++ b/docker/permissionless-builder.Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:jammy + +ARG TARGETARCH + +RUN apt-get update \ + && apt-get install -y curl libcurl4 wait-for-it tini \ + && rm -rf /var/lib/apt/lists/* +ENTRYPOINT ["tini", "--"] + +COPY target/$TARGETARCH/release/permissionless-builder /bin/permissionless-builder +RUN chmod +x /bin/permissionless-builder + +ENV BUILDER_SERVER_PORT=60003 + +CMD [ "/bin/permisisonless-builder"] diff --git a/process-compose.yaml b/process-compose.yaml index ec9f9ff7c..dab19535a 100644 --- a/process-compose.yaml +++ b/process-compose.yaml @@ -251,6 +251,13 @@ processes: path: /healthcheck failure_threshold: 100 + permissionless-builder: + command: permissionless-builder + depends_on: + sequencer0: + condition: process_healthy + da_server: + nasty-client: command: nasty-client depends_on: diff --git a/scripts/build-docker-images b/scripts/build-docker-images index 7fc1f8750..5427639c3 100755 --- a/scripts/build-docker-images +++ b/scripts/build-docker-images @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -nix develop .#crossShell --command cargo build --release -nix develop .#armCrossShell --command cargo build --release +nix develop .#crossShell --ignore-environment --command cargo build --release +nix develop .#armCrossShell --ignore-environment --command cargo build --release # The rest of the script doesn't run in a nix shell but we need to know where # the binaries are. @@ -32,7 +32,7 @@ for ARCH in "amd64" "arm64"; do ;; esac mkdir -p ${WORKDIR}/target/$ARCH/release - for binary in "orchestrator" "web-server" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "nasty-client"; do + for binary in "orchestrator" "web-server" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client"; do cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release done done @@ -46,4 +46,5 @@ docker build -t ghcr.io/espressosystems/espresso-sequencer/sequencer:main -f doc docker build -t ghcr.io/espressosystems/espresso-sequencer/commitment-task:main -f docker/commitment-task.Dockerfile ${WORKDIR} docker build -t ghcr.io/espressosystems/espresso-sequencer/submit-transactions:main -f docker/submit-transactions.Dockerfile ${WORKDIR} docker build -t ghcr.io/espressosystems/espresso-sequencer/deploy:main -f docker/deploy.Dockerfile ${WORKDIR} +docker build -t ghcr.io/espressosystems/espresso-sequencer/permissionless-builder:main -f docker/permissionless-builder.Dockerfile ${WORKDIR} docker build -t ghcr.io/espressosystems/espresso-sequencer/nasty-client:main -f docker/nasty-client.Dockerfile ${WORKDIR} diff --git a/scripts/build-docker-images-native b/scripts/build-docker-images-native index 6663d3404..f9b62e6e5 100755 --- a/scripts/build-docker-images-native +++ b/scripts/build-docker-images-native @@ -72,7 +72,7 @@ cleanup(){ } mkdir -p ${WORKDIR}/target/$ARCH/release -for binary in "orchestrator" "web-server" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "nasty-client"; do +for binary in "orchestrator" "web-server" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client"; do cp -v "${CARGO_TARGET_DIR}/release/$binary" ${WORKDIR}/target/$ARCH/release # Patch the interpreter for running without nix inside the ubuntu based docker image. if [ $KERNEL == "linux" ]; then @@ -89,4 +89,5 @@ docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/ docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/commitment-task:main -f docker/commitment-task.Dockerfile ${WORKDIR} docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/submit-transactions:main -f docker/submit-transactions.Dockerfile ${WORKDIR} docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/deploy:main -f docker/deploy.Dockerfile ${WORKDIR} +docker build -t ghcr.io/espressosystems/espresso-sequencer/permissionless-builder:main -f docker/permissionless-builder.Dockerfile ${WORKDIR} docker build --platform $PLATFORM -t ghcr.io/espressosystems/espresso-sequencer/nasty-client:main -f docker/nasty-client.Dockerfile ${WORKDIR}