diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d336fa77e..b7e8ce0eed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: target/release/permissionless-builder target/release/nasty-client target/release/pub-key - target/release/bridge + target/release/espresso-bridge build-arm: runs-on: buildjet-4vcpu-ubuntu-2204-arm @@ -118,7 +118,7 @@ jobs: target/release/permissionless-builder target/release/nasty-client target/release/pub-key - target/release/bridge + target/release/espresso-bridge build-dockers: runs-on: ubuntu-latest @@ -421,4 +421,4 @@ jobs: - name: Test docker demo run: | just demo & - timeout 600 scripts/smoke-test-demo + timeout -v 600 scripts/smoke-test-demo | sed -e 's/^/smoke-test: /;' diff --git a/.github/workflows/build_static.yml b/.github/workflows/build_static.yml index b8fc1b0f96..40dc079927 100644 --- a/.github/workflows/build_static.yml +++ b/.github/workflows/build_static.yml @@ -89,7 +89,7 @@ jobs: ${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/deploy ${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/keygen ${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/pub-key - ${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/bridge + ${{ env.CARGO_TARGET_DIR }}/${{ env.TARGET_TRIPLET }}/release/espresso-bridge static-dockers: runs-on: ubuntu-latest diff --git a/.github/workflows/test-demo-native.yml b/.github/workflows/test-demo-native.yml index 7d6bb7e4ac..ab85b1a756 100644 --- a/.github/workflows/test-demo-native.yml +++ b/.github/workflows/test-demo-native.yml @@ -50,4 +50,4 @@ jobs: run: | export PATH="$PWD/target/release:$PATH" scripts/demo-native --tui=false & - timeout -v 600 scripts/smoke-test-demo + timeout -v 600 scripts/smoke-test-demo | sed -e 's/^/smoke-test: /;' diff --git a/docker/bridge.Dockerfile b/docker/bridge.Dockerfile index d50d321c58..7a77b6056f 100644 --- a/docker/bridge.Dockerfile +++ b/docker/bridge.Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* ENTRYPOINT ["tini", "--"] -COPY target/$TARGETARCH/release/bridge /bin/bridge +COPY target/$TARGETARCH/release/espresso-bridge /bin/bridge RUN chmod +x /bin/bridge CMD [ "/bin/bridge"] diff --git a/scripts/build-docker-images b/scripts/build-docker-images index e3e9a71321..14742079ea 100755 --- a/scripts/build-docker-images +++ b/scripts/build-docker-images @@ -19,7 +19,8 @@ cleanup(){ } # Copy data files to Docker context. -cp -r data/genesis ${WORKDIR}/genesis +mkdir -p ${WORKDIR}/data +cp -rv data/genesis ${WORKDIR}/data/ for ARCH in "amd64" "arm64"; do case "$ARCH" in @@ -35,7 +36,7 @@ for ARCH in "amd64" "arm64"; do ;; esac mkdir -p ${WORKDIR}/target/$ARCH/release - for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "bridge"; do + for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge"; do cp -v "${CARGO_TARGET_DIR}/${TARGET}/release/$binary" ${WORKDIR}/target/$ARCH/release done done diff --git a/scripts/build-docker-images-native b/scripts/build-docker-images-native index 63e829b267..3749b12be5 100755 --- a/scripts/build-docker-images-native +++ b/scripts/build-docker-images-native @@ -83,10 +83,11 @@ cleanup(){ } # Copy data files to Docker context. -cp -r data/genesis ${WORKDIR}/genesis +mkdir -p ${WORKDIR}/data +cp -rv data/genesis ${WORKDIR}/data/ mkdir -p "${WORKDIR}/target/$ARCH/release" -for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "bridge"; do +for binary in "orchestrator" "cdn-broker" "cdn-marshal" "cdn-whitelist" "sequencer" "commitment-task" "submit-transactions" "reset-storage" "state-relay-server" "state-prover" "deploy" "keygen" "permissionless-builder" "nasty-client" "pub-key" "espresso-bridge"; 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 diff --git a/scripts/smoke-test-demo b/scripts/smoke-test-demo index 7099808d5d..725e0e891a 100755 --- a/scripts/smoke-test-demo +++ b/scripts/smoke-test-demo @@ -1,6 +1,13 @@ #!/usr/bin/env bash - -set -e +set -eE + +# Duplicate some debugging information to stdout in case the process exits +trap 'error_handler "${LINENO}" "$BASH_COMMAND"' ERR INT +error_handler() { + local lineno=$1 + local msg=$2 + echo "Failed at line $lineno: msg: $msg" +} # load env vars in .env set -a; source .env; set +a; @@ -32,15 +39,15 @@ function wait_for() { # usage: get_balance
function get_balance() { - if which bridge > /dev/null ; then - # If the bridge program is built locally, use it. + if which espresso-bridge > /dev/null 2>&1 ; then + # If the espresso-bridge program is built locally, use it. ( unset MNEMONIC - RUST_LOG=off bridge balance -e $SEQUENCER_API -a $1 -b $2 + RUST_LOG=off espresso-bridge balance -e $SEQUENCER_API -a $1 -b $2 ) else # Otherwise, use Docker. - docker run -e RUST_LOG=off ghcr.io/espressosystems/espresso-sequencer/bridge:main \ + docker run --network="host" -e RUST_LOG=off ghcr.io/espressosystems/espresso-sequencer/bridge:main \ bridge balance -e $SEQUENCER_API -a $1 -b $2 fi } @@ -66,14 +73,14 @@ wait_for 300 "demo load generator" "$LOAD_GENERATOR/healthcheck" # Get the block height and number of transactions, wait some time, and check that these numbers have # both increased. -block_height=`curl -sL $SEQUENCER_API/node/block-height` -num_tx=`curl -sL $SEQUENCER_API/node/transactions/count` +block_height=$(curl -sL $SEQUENCER_API/node/block-height) +num_tx=$(curl -sL $SEQUENCER_API/node/transactions/count) # Get the balance of the builder and fee recipient accounts. The former should decrease over time # while the latter should increase. -builder_balance=`get_balance 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f $block_height` -recipient_balance=`get_balance 0x0000000000000000000000000000000000000000 $block_height` +builder_balance=$(get_balance 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f $block_height) +recipient_balance=$(get_balance 0x0000000000000000000000000000000000000000 $block_height) # Get the last L1 block where the light client was updated. This should increase over time. -light_client_updated=`last_light_client_update` +light_client_updated=$(last_light_client_update) echo "Initial state:" echo " block_height: $block_height" diff --git a/sequencer/src/bin/bridge.rs b/sequencer/src/bin/espresso-bridge.rs similarity index 100% rename from sequencer/src/bin/bridge.rs rename to sequencer/src/bin/espresso-bridge.rs