Skip to content

feat(proofs): add bounded historical proof history#142

Open
panos-xyz wants to merge 7 commits into
mainfrom
codex/reth-main-history-proof
Open

feat(proofs): add bounded historical proof history#142
panos-xyz wants to merge 7 commits into
mainfrom
codex/reth-main-history-proof

Conversation

@panos-xyz

@panos-xyz panos-xyz commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in, forward-only historical MPT proof index backed by a separate MDBX database
  • serve bounded historical eth_getProof requests on both normal and authenticated RPC
  • add explicit proofs init, proofs prune, and proofs unwind operator commands
  • keep proof history independent from the always-on reference-index runtime

The versioned-trie implementation is adapted from Base commit
b2673bbd927cb34d7cfad4d448bfbd5bd30eae88 under MIT; Morph owns the integration,
MDBX backend, lifecycle, RPC policy, and tests.

Behavior

  • proof history is disabled by default and enabled with --proofs-history
  • the default retention window is 604,800 blocks (7 days at 1 second per block); the Reth historical-state overlay remains disabled
  • proofs init anchors the proof database at the current canonical tip; there is no backward backfill, schema migration, or automatic data deletion
  • chain ID, genesis hash, and schema metadata are validated fail-closed; incomplete metadata or proof data without identity requires manual deletion
  • the proof ExEx consumes precomputed trie updates on the fast path, supports canonical commit/reorg/revert notifications, and fails the node on unrecoverable proof-history errors
  • startup refuses automatic pruning gaps above 1,000 blocks; operators must run proofs prune explicitly
  • eth_getProof accepts only the inclusive durable window, checks the latest stored canonical hash, and limits each request to 1,024 storage keys
  • window validation and proof cursors share one request-scoped MDBX read transaction so concurrent pruning cannot change the state generation mid-request
  • debug_proofsSyncStatus reports earliest/latest bounds from one MDBX snapshot
  • the derived database defaults to <chain-datadir>/historical-proofs; cold snapshots remain whole-data-directory copies

CLI

morph-reth proofs init --chain <chain> --datadir <path>
morph-reth node --chain <chain> --datadir <path> --proofs-history
morph-reth proofs prune --chain <chain> --datadir <path>
morph-reth proofs unwind --chain <chain> --datadir <path> --target <block>

Optional node settings:

  • --proofs-history.storage-path <PATH>
  • --proofs-history.window <BLOCKS>
  • --proofs-history.verification-interval <BLOCKS>

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace --no-fail-fast
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • strict missing-docs build for morph-proofs and morph-proofs-exex
  • proof storage: 139 unit tests plus identity integration and doctest
  • proof ExEx: 38 tests, including reorg/revert/error propagation
  • request-snapshot and concurrent-prune regression tests
  • real-node coexistence E2E: proof ExEx and canonical reference-index runtime advance together; normal/auth historical eth_getProof match
  • existing reference-index node/RPC E2E: 4/4

Scope

This PR does not add a reference-index disable flag, reference-index status RPC,
snapshot format, compatibility migration, or benchmark harness. Live long-running
network sync, Hive/geth datasets, and performance benchmarks remain separate validation work.

Summary by CodeRabbit

  • New Features
    • Added bounded historical proof support for eth_getProof.
    • Added proof-history initialization, pruning, unwinding, verification, and synchronization.
    • Added CLI commands and configuration options for managing historical proofs.
    • Added proof synchronization status through the debug RPC API.
  • Documentation
    • Updated architecture, feature, CLI, and setup documentation with historical proof workflows and retention details.
  • Bug Fixes
    • Local reset tooling now removes historical proof data to ensure clean synchronization.

panos-xyz and others added 5 commits July 13, 2026 21:48
validate_payload already registered an expectation in convert_payload_to_block;
clearing it on the early L1-index reject path matches the inner-failure cleanup
and avoids a stale cache entry until LRU eviction.
Format the L1-index cleanup path, upgrade crossbeam-epoch to 0.9.20, and
drop advisory ignores that no longer match after the reth main bump.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds bounded historical EIP-1186 proof storage using MDBX, an EXEX synchronization and pruning pipeline, proof-history RPC endpoints, CLI management commands, node startup wiring, metrics, tests, and documentation.

Changes

Historical proof storage

Layer / File(s) Summary
Proof storage contracts and persistence
crates/proofs/src/**, Cargo.toml
Adds proof-storage traits, versioned MDBX tables, cursors, initialization, in-memory testing, proof generation, state providers, and lifecycle operations.
Live collection and pruning
crates/proofs/src/live.rs, crates/proofs/src/prune/**, crates/proofs/src/metrics.rs
Adds block execution, batch writes, reorg replacement, bounded pruning, periodic pruning tasks, and metrics.
EXEX synchronization state machine
crates/proofs-exex/src/**
Adds notification-driven proof synchronization, cached trie data, reorg/revert handling, verification intervals, and asynchronous background processing.
RPC and node integration
bin/morph-reth/**, crates/node/**, crates/rpc/**
Adds proof-history CLI flags and commands, startup wiring, historical eth_getProof, proof sync status, state-provider validation, and integration tests.
Documentation and local tooling
README.md, local-test/*
Documents historical proof operation and updates local reset/start scripts for the proof database.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: chengwenxi

Sequence Diagram(s)

sequenceDiagram
  participant Node
  participant ProofsExEx
  participant MdbxProofsStorage
  participant ProofRpc
  Node->>ProofsExEx: start proof-history EXEX
  ProofsExEx->>MdbxProofsStorage: initialize and sync block updates
  ProofsExEx->>MdbxProofsStorage: prune retained history
  ProofRpc->>MdbxProofsStorage: read proof window snapshot
  MdbxProofsStorage-->>ProofRpc: historical proof data
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.61% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: adding bounded historical proof history support.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/reth-main-history-proof

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from codex/reth-main-reference-index to main July 22, 2026 00:39

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
crates/proofs/src/live.rs (1)

92-92: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Redundant full-block clone on the execution hot path. Executor::execute takes a &RecoveredBlock, so &(*block).clone() clones the entire block (including all transactions) only to borrow it immediately. This runs on the batch/cold catch-up path where many blocks are re-executed, so the extra allocation and copy is pure waste. Pass the existing reference instead.

  • crates/proofs/src/live.rs#L92-L92: replace block_executor.execute(&(*block).clone())? with block_executor.execute(block)? (here block: &RecoveredBlock<...>).
  • crates/proofs/src/live.rs#L408-L408: same change; block is already &RecoveredBlock<...>.

Please confirm the execute signature in your reth version accepts &RecoveredBlock directly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/proofs/src/live.rs` at line 92, Remove the redundant full-block clones
before execution: in crates/proofs/src/live.rs at lines 92-92 and 408-408,
update both calls in the relevant execution flows to pass the existing block
reference directly to Executor::execute. Confirm the reth version’s execute
signature accepts &RecoveredBlock, preserving the existing error propagation.
crates/proofs/src/prune/error.rs (1)

64-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

strum::Display discards the underlying error and field context. This compiles (thiserror's Error derive only requires a Display impl to exist and doesn't emit one without #[error]), but strum::Display renders just the variant name — Storage, Provider, BlockNotFound, TimedOut — dropping the wrapped error message and the u64/Duration payloads.

MorphProofStoragePruner::run logs failures via err=%e (crates/proofs/src/prune/pruner.rs Line 216), so the actual cause (e.g. which block was missing, or the inner storage/provider error) is lost in production logs. Consider replacing strum::Display with thiserror #[error("...")] messages:

♻️ Proposed change
-use strum::Display;
 use thiserror::Error;
@@
-/// Error returned by the pruner.
-#[derive(Debug, Error, Display)]
+/// Error returned by the pruner.
+#[derive(Debug, Error)]
 pub enum PrunerError {
     /// Wrapped error from the underlying `MorphProofStorage` layer.
-    Storage(#[from] MorphProofsStorageError),
+    #[error(transparent)]
+    Storage(#[from] MorphProofsStorageError),
 
     /// Wrapped error from the reth db provider.
-    Provider(#[from] ProviderError),
+    #[error(transparent)]
+    Provider(#[from] ProviderError),
 
     /// Block not found in the underlying reth storage provider.
-    BlockNotFound(u64),
+    #[error("block {0} not found in the underlying reth storage provider")]
+    BlockNotFound(u64),
 
     /// The pruner timed out before finishing the prune
-    TimedOut(Duration),
+    #[error("pruner timed out after {0:?}")]
+    TimedOut(Duration),
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/proofs/src/prune/error.rs` around lines 64 - 78, Replace the
strum::Display derive on PrunerError with explicit thiserror #[error(...)]
annotations for every variant. Ensure Storage and Provider include their wrapped
source errors, while BlockNotFound and TimedOut include their u64 and Duration
payloads, so MorphProofStoragePruner::run preserves complete failure context in
err=%e logs.
crates/proofs/src/db/store.rs (1)

693-713: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid cloning the whole HistoryDeleteBatch per table.

Each history.clone() copies all four vectors and discards three, so this performs 4× full-batch allocations on the prune/unwind hot path. Compute the counts first, then move each field into delete_dup_sorted by value.

♻️ Proposed change
-        // Delete using the simplified API: iterator of (key, subkey)
-        self.delete_dup_sorted::<AccountTrieHistory, _, _>(tx, history.clone().account_trie)?;
-        self.delete_dup_sorted::<StorageTrieHistory, _, _>(tx, history.clone().storage_trie)?;
-        self.delete_dup_sorted::<HashedAccountHistory, _, _>(tx, history.clone().hashed_account)?;
-        self.delete_dup_sorted::<HashedStorageHistory, _, _>(tx, history.clone().hashed_storage)?;
-
-        Ok(WriteCounts {
-            account_trie_updates_written_total: history.account_trie.len() as u64,
-            storage_trie_updates_written_total: history.storage_trie.len() as u64,
-            hashed_accounts_written_total: history.hashed_account.len() as u64,
-            hashed_storages_written_total: history.hashed_storage.len() as u64,
-        })
+        let counts = WriteCounts {
+            account_trie_updates_written_total: history.account_trie.len() as u64,
+            storage_trie_updates_written_total: history.storage_trie.len() as u64,
+            hashed_accounts_written_total: history.hashed_account.len() as u64,
+            hashed_storages_written_total: history.hashed_storage.len() as u64,
+        };
+
+        // Delete using the simplified API: iterator of (key, subkey)
+        self.delete_dup_sorted::<AccountTrieHistory, _, _>(tx, history.account_trie)?;
+        self.delete_dup_sorted::<StorageTrieHistory, _, _>(tx, history.storage_trie)?;
+        self.delete_dup_sorted::<HashedAccountHistory, _, _>(tx, history.hashed_account)?;
+        self.delete_dup_sorted::<HashedStorageHistory, _, _>(tx, history.hashed_storage)?;
+
+        Ok(counts)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/proofs/src/db/store.rs` around lines 693 - 713, Update the history
deletion flow around delete_dup_sorted to avoid cloning the entire
HistoryDeleteBatch for each table. Compute the four vector lengths before
consuming history, then move account_trie, storage_trie, hashed_account, and
hashed_storage by value into their respective delete_dup_sorted calls,
preserving the existing WriteCounts values.
bin/morph-reth/src/proofs.rs (1)

68-76: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract shared storage-path/env args to remove 3x duplication.

InitCommand, PruneCommand, and UnwindCommand all repeat the identical env + storage_path fields and the identical env.init(...) → resolve path → open_storage(...) sequence.

♻️ Proposed refactor: shared flattened args + helper
#[derive(Debug, Parser)]
struct ProofStorageArgs {
    #[command(flatten)]
    env: EnvironmentArgs<MorphChainSpecParser>,
    /// Proof-history MDBX directory (defaults to `<chain-datadir>/historical-proofs`).
    #[arg(long = "proofs-history.storage-path", value_name = "PATH")]
    storage_path: Option<PathBuf>,
}

impl ProofStorageArgs {
    fn open(&self, runtime: reth_tasks::Runtime) -> eyre::Result<(Environment, MorphProofsStorage<Arc<MdbxProofsStorage>>)> {
        let env = self.env.init::<MorphNode>(AccessRights::RO, runtime)?;
        let path = self
            .storage_path
            .clone()
            .unwrap_or_else(|| env.data_dir.data_dir().join("historical-proofs"));
        let storage = open_storage(&path, &self.env.chain)?;
        Ok((env, storage))
    }
}

Then each command flattens #[command(flatten)] shared: ProofStorageArgs and calls let (Environment { provider_factory, .. }, storage) = self.shared.open(runtime)?;.

Also applies to: 78-88, 115-123, 144-153, 163-171, 178-187

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bin/morph-reth/src/proofs.rs` around lines 68 - 76, Extract the duplicated
env and storage_path fields from InitCommand, PruneCommand, and UnwindCommand
into a shared ProofStorageArgs type. Add a ProofStorageArgs::open helper
containing the common env.init, default historical-proofs path resolution, and
open_storage logic, then flatten this shared type into each command and use its
returned environment and storage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/proofs/src/in_memory.rs`:
- Around line 820-822: Update InMemoryStorage::unwind_history when computing
unwind_upto_block_number to use saturating subtraction, matching the MDBX
backend and preventing underflow for block number 0.

In `@crates/proofs/src/lib.rs`:
- Around line 19-20: Update the DEFAULT_PROOFS_HISTORY_WINDOW constant to
1,296,000 blocks and revise its documentation to describe the PR-defined
retention window without claiming seven days at one-second block time. Preserve
any downstream startup or CLI wiring that consumes this constant.

In `@README.md`:
- Line 126: Update the README table entry for --proofs-history.window to
document the actual default of 1,296,000 blocks and revise the retention
description from 7 days to 15 days at 1-second blocks.

---

Nitpick comments:
In `@bin/morph-reth/src/proofs.rs`:
- Around line 68-76: Extract the duplicated env and storage_path fields from
InitCommand, PruneCommand, and UnwindCommand into a shared ProofStorageArgs
type. Add a ProofStorageArgs::open helper containing the common env.init,
default historical-proofs path resolution, and open_storage logic, then flatten
this shared type into each command and use its returned environment and storage.

In `@crates/proofs/src/db/store.rs`:
- Around line 693-713: Update the history deletion flow around delete_dup_sorted
to avoid cloning the entire HistoryDeleteBatch for each table. Compute the four
vector lengths before consuming history, then move account_trie, storage_trie,
hashed_account, and hashed_storage by value into their respective
delete_dup_sorted calls, preserving the existing WriteCounts values.

In `@crates/proofs/src/live.rs`:
- Line 92: Remove the redundant full-block clones before execution: in
crates/proofs/src/live.rs at lines 92-92 and 408-408, update both calls in the
relevant execution flows to pass the existing block reference directly to
Executor::execute. Confirm the reth version’s execute signature accepts
&RecoveredBlock, preserving the existing error propagation.

In `@crates/proofs/src/prune/error.rs`:
- Around line 64-78: Replace the strum::Display derive on PrunerError with
explicit thiserror #[error(...)] annotations for every variant. Ensure Storage
and Provider include their wrapped source errors, while BlockNotFound and
TimedOut include their u64 and Duration payloads, so
MorphProofStoragePruner::run preserves complete failure context in err=%e logs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89868985-c564-4c54-9d4a-51fe61b82a45

📥 Commits

Reviewing files that changed from the base of the PR and between 50b361c and 5f878b5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (55)
  • Cargo.toml
  • README.md
  • bin/morph-reth/Cargo.toml
  • bin/morph-reth/src/main.rs
  • bin/morph-reth/src/proofs.rs
  • crates/node/Cargo.toml
  • crates/node/src/add_ons.rs
  • crates/node/src/args.rs
  • crates/node/src/node.rs
  • crates/node/tests/it/main.rs
  • crates/node/tests/it/proof_history.rs
  • crates/proofs-exex/Cargo.toml
  • crates/proofs-exex/NOTICE.md
  • crates/proofs-exex/src/lib.rs
  • crates/proofs-exex/src/sync_target.rs
  • crates/proofs/Cargo.toml
  • crates/proofs/NOTICE.md
  • crates/proofs/src/api.rs
  • crates/proofs/src/batch_provider.rs
  • crates/proofs/src/cursor.rs
  • crates/proofs/src/cursor_factory.rs
  • crates/proofs/src/db/batch.rs
  • crates/proofs/src/db/cursor.rs
  • crates/proofs/src/db/mod.rs
  • crates/proofs/src/db/models/block.rs
  • crates/proofs/src/db/models/change_set.rs
  • crates/proofs/src/db/models/kv.rs
  • crates/proofs/src/db/models/metadata.rs
  • crates/proofs/src/db/models/mod.rs
  • crates/proofs/src/db/models/storage.rs
  • crates/proofs/src/db/models/version.rs
  • crates/proofs/src/db/store.rs
  • crates/proofs/src/error.rs
  • crates/proofs/src/in_memory.rs
  • crates/proofs/src/initialize.rs
  • crates/proofs/src/lib.rs
  • crates/proofs/src/live.rs
  • crates/proofs/src/metrics.rs
  • crates/proofs/src/proof.rs
  • crates/proofs/src/provider.rs
  • crates/proofs/src/prune/error.rs
  • crates/proofs/src/prune/metrics.rs
  • crates/proofs/src/prune/mod.rs
  • crates/proofs/src/prune/pruner.rs
  • crates/proofs/src/prune/task.rs
  • crates/proofs/tests/identity.rs
  • crates/rpc/Cargo.toml
  • crates/rpc/src/eth/mod.rs
  • crates/rpc/src/eth/proofs.rs
  • crates/rpc/src/lib.rs
  • crates/rpc/src/proof_status.rs
  • crates/rpc/src/state.rs
  • local-test/README.md
  • local-test/reset.sh
  • local-test/reth-start.sh
💤 Files with no reviewable changes (1)
  • local-test/reth-start.sh

Comment on lines +820 to +822
fn unwind_history(&self, unwind_upto_block: BlockWithParent) -> MorphProofsStorageResult<()> {
let mut inner = self.inner.write();
let unwind_upto_block_number = unwind_upto_block.block.number - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Potential subtraction underflow on block 0.

unwind_upto_block.block.number - 1 panics when the target block number is 0. The MDBX backend uses saturating_sub(1) here; mirror that to keep the test double from diverging and panicking.

🛡️ Proposed fix
-        let unwind_upto_block_number = unwind_upto_block.block.number - 1;
+        let unwind_upto_block_number = unwind_upto_block.block.number.saturating_sub(1);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fn unwind_history(&self, unwind_upto_block: BlockWithParent) -> MorphProofsStorageResult<()> {
let mut inner = self.inner.write();
let unwind_upto_block_number = unwind_upto_block.block.number - 1;
fn unwind_history(&self, unwind_upto_block: BlockWithParent) -> MorphProofsStorageResult<()> {
let mut inner = self.inner.write();
let unwind_upto_block_number = unwind_upto_block.block.number.saturating_sub(1);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/proofs/src/in_memory.rs` around lines 820 - 822, Update
InMemoryStorage::unwind_history when computing unwind_upto_block_number to use
saturating subtraction, matching the MDBX backend and preventing underflow for
block number 0.

Comment thread crates/proofs/src/lib.rs
Comment on lines +19 to +20
/// Default proof-history retention window: 7 days at a one-second block time.
pub const DEFAULT_PROOFS_HISTORY_WINDOW: u64 = 604_800;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align the default retention window with the PR contract.

This exports 604_800 and documents a seven-day, one-second-based window, while the PR objective requires a default of 1_296_000 blocks. If downstream startup/CLI wiring uses this constant, nodes will prune history earlier than promised.

Proposed fix
-/// Default proof-history retention window: 7 days at a one-second block time.
-pub const DEFAULT_PROOFS_HISTORY_WINDOW: u64 = 604_800;
+/// Default proof-history retention window in blocks.
+pub const DEFAULT_PROOFS_HISTORY_WINDOW: u64 = 1_296_000;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// Default proof-history retention window: 7 days at a one-second block time.
pub const DEFAULT_PROOFS_HISTORY_WINDOW: u64 = 604_800;
/// Default proof-history retention window in blocks.
pub const DEFAULT_PROOFS_HISTORY_WINDOW: u64 = 1_296_000;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/proofs/src/lib.rs` around lines 19 - 20, Update the
DEFAULT_PROOFS_HISTORY_WINDOW constant to 1,296,000 blocks and revise its
documentation to describe the PR-defined retention window without claiming seven
days at one-second block time. Preserve any downstream startup or CLI wiring
that consumes this constant.

Comment thread README.md
| `--rpc.eth-proof-window` | 0 (disabled) | Max historical blocks for `eth_getProof` (up to 1209600) |
| `--proofs-history` | false | Enable historical `eth_getProof` and proof-history accumulation |
| `--proofs-history.storage-path` | `<chain-datadir>/historical-proofs` | Override the proof MDBX directory |
| `--proofs-history.window` | 604800 | Number of canonical blocks retained (7 days at 1s/block) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the documented retention default.

Line 126 says the default is 604800, but the proof-history default is 1,296,000 blocks (15 days at 1-second blocks). Update the README so operators do not configure or size storage for the wrong retention window.

Proposed documentation fix
-| `--proofs-history.window` | 604800 | Number of canonical blocks retained (7 days at 1s/block) |
+| `--proofs-history.window` | 1296000 | Number of canonical blocks retained (15 days at 1s/block) |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `--proofs-history.window` | 604800 | Number of canonical blocks retained (7 days at 1s/block) |
| `--proofs-history.window` | 1296000 | Number of canonical blocks retained (15 days at 1s/block) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 126, Update the README table entry for
--proofs-history.window to document the actual default of 1,296,000 blocks and
revise the retention description from 7 days to 15 days at 1-second blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant