feat: add edge feature flag to reth (#20841)

This commit is contained in:
joshieDo
2026-01-09 15:33:21 +00:00
committed by GitHub
parent 08c0d30ea7
commit 425a021e3b
14 changed files with 85 additions and 42 deletions

View File

@@ -28,10 +28,14 @@ jobs:
build:
- name: 'Build and push the nightly reth image'
command: 'make PROFILE=maxperf docker-build-push-nightly'
- name: 'Build and push the nightly edge profiling reth image'
command: 'make PROFILE=profiling docker-build-push-nightly-edge-profiling'
- name: 'Build and push the nightly profiling reth image'
command: 'make PROFILE=profiling docker-build-push-nightly-profiling'
- name: 'Build and push the nightly op-reth image'
command: 'make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=maxperf op-docker-build-push-nightly'
- name: 'Build and push the nightly edge profiling op-reth image'
command: 'make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=profiling op-docker-build-push-nightly-edge-profiling'
- name: 'Build and push the nightly profiling op-reth image'
command: 'make IMAGE_NAME=$OP_IMAGE_NAME DOCKER_IMAGE_NAME=$OP_DOCKER_IMAGE_NAME PROFILE=profiling op-docker-build-push-nightly-profiling'
steps:

View File

@@ -15,11 +15,21 @@ concurrency:
cancel-in-progress: true
jobs:
prepare-reth:
prepare-reth-stable:
uses: ./.github/workflows/prepare-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/reth:latest
binary_name: reth
cargo_features: "asm-keccak"
artifact_name: "reth-stable"
prepare-reth-edge:
uses: ./.github/workflows/prepare-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/reth:latest
binary_name: reth
cargo_features: "asm-keccak edge"
artifact_name: "reth-edge"
prepare-hive:
if: github.repository == 'paradigmxyz/reth'
@@ -77,6 +87,7 @@ jobs:
strategy:
fail-fast: false
matrix:
storage: [stable, edge]
# ethereum/rpc to be deprecated:
# https://github.com/ethereum/hive/pull/1117
scenario:
@@ -176,9 +187,10 @@ jobs:
- sim: ethereum/eels/consume-rlp
limit: .*tests/paris.*
needs:
- prepare-reth
- prepare-reth-stable
- prepare-reth-edge
- prepare-hive
name: run ${{ matrix.scenario.sim }}${{ matrix.scenario.limit && format(' - {0}', matrix.scenario.limit) }}
name: ${{ matrix.storage }} / ${{ matrix.scenario.sim }}${{ matrix.scenario.limit && format(' - {0}', matrix.scenario.limit) }}
runs-on:
group: Reth
permissions:
@@ -197,7 +209,7 @@ jobs:
- name: Download reth image
uses: actions/download-artifact@v7
with:
name: artifacts
name: reth-${{ matrix.storage }}
path: /tmp
- name: Load Docker images

View File

@@ -21,6 +21,11 @@ on:
required: false
type: string
description: "Optional cargo package path"
artifact_name:
required: false
type: string
default: "artifacts"
description: "Name for the uploaded artifact"
jobs:
prepare-reth:
@@ -52,5 +57,5 @@ jobs:
id: upload
uses: actions/upload-artifact@v6
with:
name: artifacts
name: ${{ inputs.artifact_name }}
path: ./artifacts

View File

@@ -19,29 +19,22 @@ concurrency:
jobs:
test:
name: test / ${{ matrix.type }} (${{ matrix.partition }}/${{ matrix.total_partitions }})
name: test / ${{ matrix.type }} / ${{ matrix.storage }}
runs-on: depot-ubuntu-latest-4
env:
RUST_BACKTRACE: 1
EDGE_FEATURES: ${{ matrix.storage == 'edge' && 'edge' || '' }}
strategy:
matrix:
type: [ethereum, optimism]
storage: [stable, edge]
include:
- type: ethereum
args: --features "asm-keccak ethereum" --locked
partition: 1
total_partitions: 2
- type: ethereum
args: --features "asm-keccak ethereum" --locked
partition: 2
total_partitions: 2
features: asm-keccak ethereum
exclude_args: ""
- type: optimism
args: --features "asm-keccak" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum"
partition: 1
total_partitions: 2
- type: optimism
args: --features "asm-keccak" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum"
partition: 2
total_partitions: 2
features: asm-keccak
exclude_args: --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum"
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
@@ -59,9 +52,9 @@ jobs:
- name: Run tests
run: |
cargo nextest run \
${{ matrix.args }} --workspace \
--features "${{ matrix.features }} $EDGE_FEATURES" --locked \
${{ matrix.exclude_args }} --workspace \
--exclude ef-tests --no-tests=warn \
--partition hash:${{ matrix.partition }}/2 \
-E "!kind(test) and not binary(e2e_testsuite)"
state:
@@ -99,24 +92,6 @@ jobs:
cache-on-failure: true
- run: cargo nextest run --release -p ef-tests --features "asm-keccak ef-tests"
rocksdb:
name: rocksdb tests
runs-on: depot-ubuntu-latest-4
env:
RUST_BACKTRACE: 1
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- name: Run RocksDB tests
run: cargo nextest run -p reth-provider -p reth-stages --features "rocksdb" --locked
doc:
name: doc tests
runs-on: depot-ubuntu-latest
@@ -138,7 +113,7 @@ jobs:
name: unit success
runs-on: ubuntu-latest
if: always()
needs: [test, state, rocksdb, doc]
needs: [test, state, doc]
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed

View File

@@ -276,6 +276,11 @@ docker-build-push-latest: ## Build and push a cross-arch Docker image tagged wit
docker-build-push-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`.
$(call docker_build_push,nightly,nightly)
.PHONY: docker-build-push-nightly-edge-profiling
docker-build-push-nightly-edge-profiling: FEATURES := $(FEATURES) edge
docker-build-push-nightly-edge-profiling: ## Build and push cross-arch Docker image with edge features tagged with `nightly-edge-profiling`.
$(call docker_build_push,nightly-edge-profiling,nightly-edge-profiling)
# Create a cross-arch Docker image with the given tags and push it
define docker_build_push
$(MAKE) build-x86_64-unknown-linux-gnu
@@ -328,6 +333,11 @@ op-docker-build-push-latest: ## Build and push a cross-arch Docker image tagged
op-docker-build-push-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`.
$(call op_docker_build_push,nightly,nightly)
.PHONY: op-docker-build-push-nightly-edge-profiling
op-docker-build-push-nightly-edge-profiling: FEATURES := $(FEATURES) edge
op-docker-build-push-nightly-edge-profiling: ## Build and push cross-arch Docker image with edge features tagged with `nightly-edge-profiling`.
$(call op_docker_build_push,nightly-edge-profiling,nightly-edge-profiling)
# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`

View File

@@ -171,6 +171,8 @@ min-trace-logs = [
"reth-node-core/min-trace-logs",
]
edge = ["reth-ethereum-cli/edge"]
[[bin]]
name = "reth"
path = "src/main.rs"

View File

@@ -129,3 +129,5 @@ arbitrary = [
"reth-primitives-traits/arbitrary",
"reth-ethereum-primitives/arbitrary",
]
edge = ["reth-db-common/edge", "reth-stages/rocksdb"]

View File

@@ -86,3 +86,5 @@ min-trace-logs = [
"tracing/release_max_level_trace",
"reth-node-core/min-trace-logs",
]
edge = ["reth-cli-commands/edge"]

View File

@@ -55,6 +55,8 @@ min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]
edge = ["reth-optimism-cli/edge"]
[[bin]]
name = "op-reth"
path = "src/main.rs"

View File

@@ -114,3 +114,5 @@ serde = [
"reth-primitives-traits/serde",
"reth-optimism-chainspec/serde",
]
edge = ["reth-cli-commands/edge"]

View File

@@ -93,3 +93,4 @@ op = [
"reth-primitives-traits/op",
]
bench = []
edge = []

View File

@@ -34,6 +34,22 @@ pub struct StorageSettings {
}
impl StorageSettings {
/// Creates `StorageSettings` for edge nodes with all storage features enabled:
/// - Receipts and transaction senders in static files
/// - History indices in `RocksDB` (storages, accounts, transaction hashes)
/// - Account changesets in static files
#[cfg(feature = "edge")]
pub const fn edge() -> Self {
Self {
receipts_in_static_files: true,
transaction_senders_in_static_files: true,
account_changesets_in_static_files: true,
storages_history_in_rocksdb: false,
transaction_hash_numbers_in_rocksdb: false,
account_history_in_rocksdb: false,
}
}
/// Creates `StorageSettings` for legacy nodes.
///
/// This explicitly sets `receipts_in_static_files` and `transaction_senders_in_static_files` to

View File

@@ -45,5 +45,8 @@ tracing.workspace = true
reth-db = { workspace = true, features = ["mdbx"] }
reth-provider = { workspace = true, features = ["test-utils"] }
[features]
edge = ["reth-db-api/edge", "reth-provider/rocksdb"]
[lints]
workspace = true

View File

@@ -104,7 +104,14 @@ where
+ AsRef<PF::ProviderRW>,
PF::ChainSpec: EthChainSpec<Header = <PF::Primitives as NodePrimitives>::BlockHeader>,
{
init_genesis_with_settings(factory, StorageSettings::legacy())
#[cfg(feature = "edge")]
{
init_genesis_with_settings(factory, StorageSettings::edge())
}
#[cfg(not(feature = "edge"))]
{
init_genesis_with_settings(factory, StorageSettings::legacy())
}
}
/// Write the genesis block if it has not already been written with [`StorageSettings`].