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
4 changes: 3 additions & 1 deletion .github/scripts/run-example-benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BENCHMARK_CONFIGS=(
configs/examples/simulator.yml
configs/examples/sload.yml
configs/examples/rbuilder.yml
configs/examples/base-reth-node.yml
configs/examples/sstore.yml
# configs/examples/snapshot.yml
# configs/examples/tx-fuzz-geth.yml
Expand All @@ -28,5 +29,6 @@ for config in "${BENCHMARK_CONFIGS[@]}"; do
--output-dir $TEMP_DIR/output \
--reth-bin $TEMP_DIR/bin/reth \
--geth-bin $TEMP_DIR/bin/geth \
--rbuilder-bin $TEMP_DIR/bin/rbuilder
--rbuilder-bin $TEMP_DIR/bin/rbuilder \
--base-reth-node-bin $TEMP_DIR/bin/base-reth-node
done
43 changes: 43 additions & 0 deletions .github/workflows/_build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ on:
required: false
type: string
default: "23f42c8e78ba3abb45a8840df7037a27e196e601"
base_reth_node_version:
description: "Base Reth Node version to build"
required: false
type: string
default: "main"

# Set minimal permissions for all jobs by default
permissions:
Expand Down Expand Up @@ -180,6 +185,44 @@ jobs:
path: ~/bin/rbuilder
retention-days: 1

build-base-reth-node:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # Required for artifact upload
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0

- name: Cache base-reth-node binary
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3
id: cache-base-reth-node
with:
path: ~/bin/base-reth-node
key: ${{ runner.os }}-base-reth-node-${{ inputs.base_reth_node_version }}

- name: Build base-reth-node
if: steps.cache-base-reth-node.outputs.cache-hit != 'true'
run: |
unset CI
mkdir -p ~/bin
cd clients
BASE_RETH_NODE_VERSION=${{ inputs.base_reth_node_version }} OUTPUT_DIR=~/bin ./build-base-reth-node.sh

- name: Upload base-reth-node artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: base-reth-node
path: ~/bin/base-reth-node
retention-days: 1

build-op-program:
runs-on: ubuntu-latest
permissions:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
reth_version: 27a8c0f5a6dfb27dea84c5751776ecabdd069646
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
rbuilder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main

basic-benchmarks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -118,6 +119,12 @@ jobs:
name: rbuilder
path: ${{ runner.temp }}/bin/

- name: Download base-reth-node binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: base-reth-node
path: ${{ runner.temp }}/bin/

- name: Download op-program binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
reth_version: 27a8c0f5a6dfb27dea84c5751776ecabdd069646
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
rbuilder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main

example-benchmarks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,6 +68,12 @@ jobs:
name: rbuilder
path: ${{ runner.temp }}/bin/

- name: Download base-reth-node binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: base-reth-node
path: ${{ runner.temp }}/bin/

- name: Make binaries executable
run: |
chmod +x ${{ runner.temp }}/bin/*
Expand Down
70 changes: 70 additions & 0 deletions clients/build-base-reth-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

set -e

# Source versions if available, otherwise use defaults
if [ -f "versions.env" ]; then
source versions.env
fi

# Default values
BASE_RETH_NODE_REPO="${BASE_RETH_NODE_REPO:-https://github.com/base/base}"
BASE_RETH_NODE_VERSION="${BASE_RETH_NODE_VERSION:-main}"
BUILD_DIR="${BUILD_DIR:-./build}"
OUTPUT_DIR="${OUTPUT_DIR:-../bin}"

echo "Building base-reth-node binary..."
echo "Repository: $BASE_RETH_NODE_REPO"
echo "Version/Commit: $BASE_RETH_NODE_VERSION"
echo "Build directory: $BUILD_DIR"
echo "Output directory: $OUTPUT_DIR"

# Create build directory if it doesn't exist
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"

# Clone or update repository
if [ -d "base" ]; then
echo "Updating existing base repository..."
cd base
git fetch origin

# ensure remote matches the repository
git remote set-url origin "$BASE_RETH_NODE_REPO"
git fetch origin
else
echo "Cloning base repository..."
git clone "$BASE_RETH_NODE_REPO" base
cd base
fi

# Checkout specified version/commit
echo "Checking out version: $BASE_RETH_NODE_VERSION"
git checkout -f "$BASE_RETH_NODE_VERSION"

# Build the binary using cargo
echo "Building base-reth-node with cargo..."
# Build with maxperf profile
cargo build --bin base-reth-node --profile maxperf

# Copy binary to output directory
echo "Copying binary to output directory..."
# Handle absolute paths correctly
if [[ "$OUTPUT_DIR" == /* ]]; then
# Absolute path - use directly
FINAL_OUTPUT_DIR="$OUTPUT_DIR"
else
# Relative path - resolve from current location (clients/build/base)
FINAL_OUTPUT_DIR="../../$OUTPUT_DIR"
fi
mkdir -p "$FINAL_OUTPUT_DIR"

# Find the built binary and copy it
if [ -f "target/maxperf/base-reth-node" ]; then
cp target/maxperf/base-reth-node "$FINAL_OUTPUT_DIR/"
else
echo "No base-reth-node binary found"
exit 1
fi

echo "base-reth-node binary built successfully and placed in $FINAL_OUTPUT_DIR/base-reth-node"
4 changes: 4 additions & 0 deletions clients/versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ GETH_VERSION="v1.101604.0"
RBUILDER_REPO="https://github.com/base/op-rbuilder"
RBUILDER_VERSION="main"

# Base Reth Node Configuration
BASE_RETH_NODE_REPO="https://github.com/base/base"
BASE_RETH_NODE_VERSION="main"

# Build Configuration
# BUILD_DIR="./build"
# OUTPUT_DIR="../bin"
23 changes: 23 additions & 0 deletions configs/examples/base-reth-node-flashblocks-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Base Reth Node flashblocks metrics test
description: Test base-reth-node flashblock metrics collection with rbuilder as sequencer and base-reth-node as validator
payloads:
- name: Transfer Only
type: transfer-only
id: transfer-only

benchmarks:
- variables:
- type: payload
values:
- transfer-only
- type: node_type
values:
- rbuilder
- type: validator_node_type
values:
- base-reth-node
- type: num_blocks
value: 5
- type: gas_limit
values:
- 1000000000
23 changes: 23 additions & 0 deletions configs/examples/base-reth-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Base Reth Node transfer throughput test
description: Test base-reth-node transfer throughput using flashblocks
payloads:
- name: Transfer Only
type: transfer-only
id: transfer-only

benchmarks:
- variables:
- type: payload
values:
- transfer-only
- type: node_type
values:
- base-reth-node
- type: validator_node_type
values:
- reth
- type: num_blocks
value: 10
- type: gas_limit
values:
- 1000000000
Loading