Skip to content

Commit 194d77b

Browse files
committed
feat: backpressure, stable load
1 parent 6eb3f92 commit 194d77b

12 files changed

Lines changed: 596 additions & 37 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010

1111
env:
1212
CARGO_TERM_COLOR: always
13+
CARGO_SORT_VERSION: "2.0.1"
14+
CARGO_DENY_VERSION: "0.19.0"
15+
CARGO_AUDIT_VERSION: "0.22.1"
1316

1417
permissions:
1518
contents: read
@@ -62,10 +65,10 @@ jobs:
6265
- name: Install cargo-sort
6366
uses: taiki-e/install-action@v2
6467
with:
65-
tool: cargo-sort
68+
tool: cargo-sort@${{ env.CARGO_SORT_VERSION }}
6669

6770
- name: sort-check
68-
run: cargo sort --workspace --check
71+
run: make sort-check
6972

7073
# ----------------------------------------------------------------------------
7174
# Clippy
@@ -151,12 +154,12 @@ jobs:
151154
- name: Install cargo-deny
152155
uses: taiki-e/install-action@v2
153156
with:
154-
tool: cargo-deny
157+
tool: cargo-deny@${{ env.CARGO_DENY_VERSION }}
155158

156159
- uses: Swatinem/rust-cache@v2
157160

158161
- name: cargo deny
159-
run: cargo deny check
162+
run: make deny
160163

161164
# ----------------------------------------------------------------------------
162165
# Security: cargo-audit
@@ -174,9 +177,9 @@ jobs:
174177
- name: Install cargo-audit
175178
uses: taiki-e/install-action@v2
176179
with:
177-
tool: cargo-audit
180+
tool: cargo-audit@${{ env.CARGO_AUDIT_VERSION }}
178181

179182
- uses: Swatinem/rust-cache@v2
180183

181184
- name: cargo audit
182-
run: cargo audit --deny warnings --ignore RUSTSEC-2025-0055 --ignore RUSTSEC-2024-0388 --ignore RUSTSEC-2024-0436
185+
run: make audit

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ serde = { version = "1.0", features = ["derive"], default-features = false }
9191
serde_json = "1.0"
9292
thiserror = "2.0"
9393
tokio = { version = "1.46.0", features = ["macros", "rt-multi-thread", "time"] }
94+
tower = "0.5"
9495
tracing = "0.1.41"
9596

9697
[features]
@@ -156,6 +157,7 @@ serde = { workspace = true }
156157
serde_json = { workspace = true }
157158
thiserror = { workspace = true }
158159
tokio = { workspace = true }
160+
tower = { workspace = true }
159161
tracing = { workspace = true }
160162

161163
[dev-dependencies]

‎Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ DOCKER_BUILDX_OUTPUT ?= type=oci,dest=dist/load-reth-multiarch.tar
1717
# Git metadata
1818
GIT_TAG := $(shell (git describe --exact-match --tags 2>/dev/null) || echo sha-$$(git rev-parse --short=12 HEAD))
1919
GIT_SHA := $(shell git rev-parse --short=12 HEAD 2>/dev/null || echo "unknown")
20-
AUDIT_IGNORES ?= RUSTSEC-2025-0055 RUSTSEC-2024-0388 RUSTSEC-2024-0436
20+
AUDIT_IGNORES ?= RUSTSEC-2025-0055 RUSTSEC-2024-0388 RUSTSEC-2024-0436 RUSTSEC-2025-0137 RUSTSEC-2025-0141 RUSTSEC-2026-0002 RUSTSEC-2026-0007 RUSTSEC-2026-0008 RUSTSEC-2026-0009
21+
CARGO_SORT_CMD ?= cargo sort --workspace
2122

2223
AUDIT_FLAGS := --deny warnings
2324
ifneq ($(strip $(AUDIT_IGNORES)),)
@@ -166,11 +167,11 @@ clippy: ## Run clippy lints
166167

167168
.PHONY: sort
168169
sort: ## Sort dependencies in Cargo.toml
169-
cargo sort --workspace
170+
$(CARGO_SORT_CMD)
170171

171172
.PHONY: sort-check
172173
sort-check: ## Check if dependencies are sorted
173-
cargo sort --workspace --check
174+
$(CARGO_SORT_CMD) --check
174175

175176
.PHONY: docs
176177
docs: ## Build documentation with warnings as errors

‎deny.toml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ ignore = [
99
# https://rustsec.org/advisories/RUSTSEC-2024-0436
1010
# paste crate unmaintained, comes from reth dependencies - no fix available yet
1111
"RUSTSEC-2024-0436",
12+
# https://rustsec.org/advisories/RUSTSEC-2025-0137
13+
# ruint unsoundness comes via upstream reth/alloy dependency graph; awaiting upstream bump
14+
"RUSTSEC-2025-0137",
15+
# https://rustsec.org/advisories/RUSTSEC-2025-0141
16+
# bincode marked unmaintained; transitive via upstream reth stack, no direct safe replacement here yet
17+
"RUSTSEC-2025-0141",
18+
# https://rustsec.org/advisories/RUSTSEC-2026-0009
19+
# time RFC2822 parser DoS; transitive in upstream deps; awaiting patched transitive upgrade
20+
"RUSTSEC-2026-0009",
21+
# https://rustsec.org/advisories/RUSTSEC-2026-0007
22+
# bytes integer overflow; transitive via upstream reth networking deps, awaiting upstream bump
23+
"RUSTSEC-2026-0007",
1224
]
1325

1426
[bans]

‎src/engine/rpc.rs‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! - keep a hook surface for future fork/attribute guards.
77
88
use std::{
9+
fmt,
910
sync::Arc,
1011
time::{Instant, SystemTime, UNIX_EPOCH},
1112
};
@@ -35,7 +36,6 @@ use reth_rpc_api::EngineApiServer;
3536
use reth_rpc_engine_api::{EngineApi, EngineApiError, EngineCapabilities};
3637
use reth_transaction_pool::TransactionPool;
3738
use tracing::trace;
38-
use std::fmt;
3939

4040
use crate::{
4141
chainspec::{LoadChainSpec, LOAD_MAX_BLOB_COUNT},
@@ -115,12 +115,7 @@ where
115115
let is_syncing = Arc::new(move || network.is_syncing());
116116

117117
// Wrap with Load-specific behaviour.
118-
Ok(LoadEngineApi::new(
119-
inner,
120-
ctx.node.pool().clone(),
121-
engine_metrics,
122-
is_syncing,
123-
))
118+
Ok(LoadEngineApi::new(inner, ctx.node.pool().clone(), engine_metrics, is_syncing))
124119
}
125120
}
126121

‎src/engine/validator.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ where
116116
&self,
117117
payload: LoadExecutionData,
118118
) -> Result<SealedBlock<Self::Block>, NewPayloadError> {
119-
self.ensure_load_payload_invariants(&payload)
120-
.map_err(NewPayloadError::other)?;
119+
self.ensure_load_payload_invariants(&payload).map_err(NewPayloadError::other)?;
121120
self.inner.ensure_well_formed_payload(payload.into()).map_err(Into::into)
122121
}
123122
}

‎src/node/mod.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use reth_node_api::{FullNodeComponents, PrimitivesTy};
2222
use reth_node_builder::{
2323
components::{BasicPayloadServiceBuilder, ComponentsBuilder, NetworkBuilder, NodeComponents},
2424
node::FullNodeTypes as FullNodeTypesAlias,
25-
rpc::{BasicEngineValidatorBuilder, Identity as RpcIdentity, RpcAddOns},
25+
rpc::{BasicEngineValidatorBuilder, RpcAddOns},
2626
BuilderContext, Node, NodeAdapter, NodeComponentsBuilder,
2727
};
2828
use reth_node_ethereum::node::EthereumEthApiBuilder;
@@ -42,6 +42,7 @@ use crate::{
4242
evm::{LoadEvmConfig, LoadExecutorBuilder},
4343
pool::LoadPoolBuilder,
4444
primitives::LoadPrimitives,
45+
rpc::backpressure::LoadRpcBackpressureLayer,
4546
version::load_client_version_string,
4647
};
4748

@@ -159,7 +160,7 @@ where
159160
LoadEngineValidatorBuilder,
160161
LoadEngineApiBuilder<LoadEngineValidatorBuilder>,
161162
BasicEngineValidatorBuilder<LoadEngineValidatorBuilder>,
162-
RpcIdentity,
163+
LoadRpcBackpressureLayer,
163164
>;
164165

165166
fn components_builder(&self) -> Self::ComponentsBuilder {
@@ -184,7 +185,7 @@ where
184185
LoadEngineValidatorBuilder::default(),
185186
LoadEngineApiBuilder::<LoadEngineValidatorBuilder>::default(),
186187
BasicEngineValidatorBuilder::new(LoadEngineValidatorBuilder::default()),
187-
RpcIdentity::default(),
188+
LoadRpcBackpressureLayer::from_env(),
188189
)
189190
}
190191
}

0 commit comments

Comments
 (0)