[eth-rpc]: add resumable block sync and improve CLI arguments#11153
Merged
marian-radu merged 74 commits intomasterfrom Mar 20, 2026
Merged
Conversation
…h-argument-improvements
…h-argument-improvements
0xRVE
approved these changes
Mar 17, 2026
- Out-of-gas failures(480 cases) after gas overrides were removed in anticipation of the eth-rpc binary search gas estimation (not yet merged) - New tests added to the differential test suite - 4 new optimization modes added to the test matrix (6 total)
…h-argument-improvements
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-11153-to-stable2603
git worktree add --checkout .worktree/backport-11153-to-stable2603 backport-11153-to-stable2603
cd .worktree/backport-11153-to-stable2603
git reset --hard HEAD^
git cherry-pick -x 8c6f7606348edee72a7a1abf14807e38bec5ca17
git push --force-with-lease |
marian-radu
added a commit
that referenced
this pull request
Mar 25, 2026
- New `block_sync` module syncs backward from the latest finalized block to the first EVM block, with restart-safe checkpoint tracking via a `sync_state` SQLite table. - On restart, fills only the top gap (new blocks) and bottom gap (remaining backfill) without re-syncing completed ranges. - Auto-discovers and persists `first_evm_block` — the lowest block with EVM support on the chain. - Chain identity verification: stores genesis hash in `sync_state` and validates on startup; detects stale boundaries after reorgs. New `--eth-pruning` flag replaces `--database-url`, `--cache-size`, `--index-last-n-blocks`, and `--earliest-receipt-block`: - `--eth-pruning archive` (default): persistent on-disk DB with backward historical sync. - `--eth-pruning <N>`: in-memory DB keeping the latest N blocks. | Previous flag | Replacement | Notes | |---|---|---| | `--cache-size N` | `--eth-pruning N` | In-memory DB, keeps latest N blocks | | `--database-url sqlite::memory:` | `--eth-pruning N` | --eth-pruning N always uses in-memory DB | | `--database-url /path/to/db.sqlite` | `--base-path /path/to/dir` | Persistent DB stored as `eth-rpc.db` inside the directory | | `--index-last-n-blocks N` | `--eth-pruning archive` | Syncs all finalized blocks down to the first EVM block | | `--earliest-receipt-block N` | _(removed)_ | Replaced by auto-discovered `first_evm_block` | > **Note:** `--dev` automatically uses a temporary directory with an on-disk DB, which is deleted on exit. > **Note:** When `--base-path` is omitted, the DB is stored in the default OS data directory: > - macOS: `~/Library/Application Support/eth-rpc/` > - Linux: `~/.local/share/eth-rpc/` > - Windows: `%APPDATA%\eth-rpc\` ```bash eth-rpc --dev eth-rpc --node-rpc-url wss://example.com:443 --eth-pruning 512 eth-rpc --node-rpc-url wss://example.com:443 eth-rpc --node-rpc-url wss://example.com:443 --base-path /data/eth-rpc eth-rpc --node-rpc-url wss://example.com:443 --eth-pruning archive paritytech/contract-issues#271 --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> (cherry picked from commit 8c6f760)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumable block sync
block_syncmodule syncs backward from the latest finalized block to the first EVM block, with restart-safe checkpoint tracking via async_stateSQLite table.first_evm_block— the lowest block with EVM support on the chain.sync_stateand validates on startup; detects stale boundaries after reorgs.CLI rework
New
--eth-pruningflag replaces--database-url,--cache-size,--index-last-n-blocks, and--earliest-receipt-block:--eth-pruning archive(default): persistent on-disk DB with backward historical sync.--eth-pruning <N>: in-memory DB keeping the latest N blocks.CLI migration guide
--cache-size N--eth-pruning N--database-url sqlite::memory:--eth-pruning N--database-url /path/to/db.sqlite--base-path /path/to/direth-rpc.dbinside the directory--index-last-n-blocks N--eth-pruning archive--earliest-receipt-block Nfirst_evm_blockExamples