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
14 changes: 7 additions & 7 deletions .github/workflows/_build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ name: Build Binaries
on:
workflow_call:
inputs:
reth_version:
description: "Reth version to build"
optimism_version:
description: "Optimism version to build"
required: false
type: string
default: "27a8c0f5a6dfb27dea84c5751776ecabdd069646"
default: "3019251e80aa248e91743addd3e833190acb26f1"
geth_version:
description: "Geth version to build"
required: false
Expand Down Expand Up @@ -85,25 +85,25 @@ jobs:

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

- name: Build reth
if: steps.cache-reth.outputs.cache-hit != 'true'
run: |
unset CI
mkdir -p ~/bin
cd clients
RETH_VERSION=${{ inputs.reth_version }} OUTPUT_DIR=~/bin ./build-reth.sh
OPTIMISM_VERSION=${{ inputs.optimism_version }} OUTPUT_DIR=~/bin ./build-reth.sh
# Rename op-reth to reth for consistency
[ -f ~/bin/op-reth ] && mv ~/bin/op-reth ~/bin/reth || true

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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
actions: write # Required for reusable workflow to upload artifacts
uses: ./.github/workflows/_build-binaries.yaml
with:
reth_version: 27a8c0f5a6dfb27dea84c5751776ecabdd069646
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Download reth binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: reth
name: optimism
path: ${{ runner.temp }}/bin/

- name: Download geth binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write # Required for reusable workflow to upload artifacts
uses: ./.github/workflows/_build-binaries.yaml
with:
reth_version: 27a8c0f5a6dfb27dea84c5751776ecabdd069646
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601
base_reth_node_version: main
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Download reth binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: reth
name: optimism
path: ${{ runner.temp }}/bin/

- name: Download geth binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/public-benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write # Required for reusable workflow to upload artifacts
uses: ./.github/workflows/_build-binaries.yaml
with:
reth_version: 27a8c0f5a6dfb27dea84c5751776ecabdd069646
optimism_version: 3019251e80aa248e91743addd3e833190acb26f1
geth_version: 6cbfcd5161083bcd4052edc3022d9f99c6fe40e0
builder_version: 23f42c8e78ba3abb45a8840df7037a27e196e601

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Download reth binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: reth
name: optimism
path: ${{ runner.temp }}/bin/

- name: Download geth binary
Expand Down
8 changes: 4 additions & 4 deletions clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Modify the `versions.env` file to change defaults for all builds:

```bash
# Edit versions.env to update default versions
RETH_VERSION="v0.2.0-beta.5"
OPTIMISM_VERSION="v0.2.0-beta.5"
GETH_VERSION="v1.13.0"
BUILDER_VERSION="your-commit-hash"
```
Expand All @@ -83,7 +83,7 @@ Override specific builds with environment variables:

```bash
# Build reth from a specific commit
RETH_REPO="https://github.com/paradigmxyz/reth/" RETH_VERSION="v0.1.0" ./build-reth.sh
OPTIMISM_REPO="https://github.com/ethereum-optimism/optimism/" OPTIMISM_VERSION="v0.1.0" ./build-reth.sh

# Build geth from a fork
GETH_REPO="https://github.com/your-fork/op-geth/" GETH_VERSION="your-branch" ./build-geth.sh
Expand All @@ -95,8 +95,8 @@ BUILDER_VERSION="main" ./build-builder.sh
### Available Environment Variables

#### For reth (build-reth.sh):
- `RETH_REPO`: Git repository URL (default: https://github.com/paradigmxyz/reth/)
- `RETH_VERSION`: Git branch, tag, or commit hash (default: main)
- `OPTIMISM_REPO`: Git repository URL (default: https://github.com/ethereum-optimism/optimism/)
- `OPTIMISM_VERSION`: Git branch, tag, or commit hash (default: develop)
- `BUILD_DIR`: Directory for source code (default: ./build)
- `OUTPUT_DIR`: Directory for built binaries (default: ../bin)

Expand Down
40 changes: 22 additions & 18 deletions clients/build-reth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ if [ -f "versions.env" ]; then
fi

# Default values
RETH_REPO="${RETH_REPO:-https://github.com/paradigmxyz/reth/}"
RETH_VERSION="${RETH_VERSION:-main}"
OPTIMISM_REPO="${OPTIMISM_REPO:-https://github.com/ethereum-optimism/optimism/}"
OPTIMISM_VERSION="${OPTIMISM_VERSION:-develop}"
BUILD_DIR="${BUILD_DIR:-./build}"
OUTPUT_DIR="${OUTPUT_DIR:-../bin}"

echo "Building reth binary..."
echo "Repository: $RETH_REPO"
echo "Version/Commit: $RETH_VERSION"
echo "Building op-reth binary..."
echo "Repository: $OPTIMISM_REPO"
echo "Version/Commit: $OPTIMISM_VERSION"
echo "Build directory: $BUILD_DIR"
echo "Output directory: $OUTPUT_DIR"

Expand All @@ -24,28 +24,32 @@ mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"

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

# ensure remote matches the repository
git remote set-url origin "$RETH_REPO"
git remote set-url origin "$OPTIMISM_REPO"
git fetch origin
else
echo "Cloning reth repository..."
git clone "$RETH_REPO" reth
cd reth
echo "Cloning optimism repository..."
git clone "$OPTIMISM_REPO" optimism
cd optimism
fi

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

pushd rust

# Build the binary using cargo
echo "Building reth with cargo..."
echo "Building op-reth with cargo..."
# Build with performance features matching CI workflow
cargo build --features asm-keccak,jemalloc --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml
cargo build --features asm-keccak,jemalloc --bin op-reth --profile maxperf --manifest-path op-reth/bin/Cargo.toml

popd

# Copy binary to output directory
echo "Copying binary to output directory..."
Expand All @@ -58,6 +62,6 @@ else
FINAL_OUTPUT_DIR="../../$OUTPUT_DIR"
fi
mkdir -p "$FINAL_OUTPUT_DIR"
cp target/maxperf/op-reth "$FINAL_OUTPUT_DIR/"
cp rust/target/maxperf/op-reth "$FINAL_OUTPUT_DIR/"

echo "reth binary built successfully and placed in $FINAL_OUTPUT_DIR/op-reth"
echo "op-reth binary built successfully and placed in $FINAL_OUTPUT_DIR/op-reth"
4 changes: 2 additions & 2 deletions clients/versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Source this file in scripts to use these variables

# Reth Configuration
RETH_REPO="https://github.com/paradigmxyz/reth/"
RETH_VERSION="v1.9.3"
OPTIMISM_REPO="https://github.com/ethereum-optimism/optimism/"
OPTIMISM_VERSION="3019251e80aa248e91743addd3e833190acb26f1"

# Op-Geth Configuration
GETH_REPO="https://github.com/ethereum-optimism/op-geth/"
Expand Down
1 change: 1 addition & 0 deletions runner/clients/reth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (r *RethClient) Run(ctx context.Context, cfg *types.RuntimeConfig) error {
// increase mempool size
args = append(args, "--txpool.pending-max-count", "100000000")
args = append(args, "--txpool.queued-max-count", "100000000")
args = append(args, "--txpool.max-account-slots", "100000000")
args = append(args, "--txpool.pending-max-size", "100")
args = append(args, "--txpool.queued-max-size", "100")

Expand Down