Skip to content
Draft
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: 2 additions & 2 deletions crates/node/builder/src/components/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ where
V::Transaction:
PoolTransaction<Consensus = TxTy<Node::Types>> + reth_transaction_pool::EthPoolTransaction,
{
/// Consume the ype and build the [`reth_transaction_pool::Pool`] with the given config and blob
/// store.
/// Consume the type and build the [`reth_transaction_pool::Pool`] with the given config and
/// blob store.
pub fn build<BS>(
self,
blob_store: BS,
Expand Down
25 changes: 22 additions & 3 deletions crates/storage/provider/src/providers/state/historical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ impl<
}
HistoryInfo::InPlainState | HistoryInfo::MaybeInPlainState => {
if let Some((exec_tip, hist_tip)) =
self.pipeline_consistency.account_inconsistency()
self.pipeline_consistency.account_inconsistency() &&
self.block_number > hist_tip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more typical case is when the queried block is below hist_tip. In that scenario, if the key happens to have been modified within the (hist_tip, exec_tip] window, this returns wrong data from a future block — silently, with no error raised.

{
return Err(ProviderError::HistoryStateInconsistent {
block: self.block_number,
Expand Down Expand Up @@ -469,7 +470,8 @@ impl<
)),
HistoryInfo::InPlainState | HistoryInfo::MaybeInPlainState => {
if let Some((exec_tip, hist_tip)) =
self.pipeline_consistency.storage_inconsistency()
self.pipeline_consistency.storage_inconsistency() &&
self.block_number > hist_tip
{
return Err(ProviderError::HistoryStateInconsistent {
block: self.block_number,
Expand Down Expand Up @@ -1175,7 +1177,24 @@ mod tests {
let result = provider.basic_account(&no_history_addr);
assert!(matches!(result, Ok(None)), "Never-written account should return None: {result:?}");

// Test 4: Same queries with consistent pipeline → all succeed
// Test 4: ADDRESS at block 16, hist_tip=200 → block_number <= hist_tip → InPlainState is
// safe even though exec_tip=300 > hist_tip (mirrors issue #338 where historical RPC calls
// were incorrectly rejected during pipeline sync)
let safe_inconsistent = PipelineConsistency {
execution_tip: Some(300),
account_history_tip: Some(200),
storage_history_tip: Some(200),
};
let provider =
HistoricalStateProviderRef::new(&db, 16).with_pipeline_consistency(safe_inconsistent);
let result = provider.basic_account(&ADDRESS);
assert!(
result.is_ok(),
"InPlainState below hist_tip should succeed during inconsistency: {result:?}"
);
assert_eq!(result.unwrap().unwrap().nonce, acc_plain.nonce);

// Test 5: Same queries with consistent pipeline → all succeed
let consistent = PipelineConsistency {
execution_tip: Some(200),
account_history_tip: Some(200),
Expand Down
6 changes: 6 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ ignore = [
"RUSTSEC-2026-0097",
# https://rustsec.org/advisories/RUSTSEC-2026-0105 core2 unmaintained, all versions yanked (no replacement)
"RUSTSEC-2026-0105",
# https://rustsec.org/advisories/RUSTSEC-2026-0118 hickory-proto NSEC3 unbounded loop, fixed in 0.26
# TODO: upgrade hickory-resolver to 0.26 when upstream deps support it
"RUSTSEC-2026-0118",
# https://rustsec.org/advisories/RUSTSEC-2026-0119 hickory-proto O(n²) name compression, fixed in 0.26
# TODO: upgrade hickory-resolver to 0.26 when upstream deps support it
"RUSTSEC-2026-0119",
]

# This section is considered when running `cargo deny check bans`.
Expand Down
Loading