Skip to content

Comments

feat: implement initial sync backfill job#196

Merged
dhyaniarun1993 merged 37 commits intounstablefrom
meyer9/166-backfill-script
Oct 13, 2025
Merged

feat: implement initial sync backfill job#196
dhyaniarun1993 merged 37 commits intounstablefrom
meyer9/166-backfill-script

Conversation

@meyer9
Copy link
Collaborator

@meyer9 meyer9 commented Oct 8, 2025

Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the current state to the database. The transaction ensures we see a consistent view of the database at the current block, even if the node is syncing. This requires --db.read-transaction-timeout 0.

This currently doesn't handle interrupting the job because the state may update while syncing and may read a different version of the database upon restart.

@wiz-b4c72f16a4
Copy link

wiz-b4c72f16a4 bot commented Oct 8, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Comment on lines 3 to 13
use std::sync::Arc;

use futures_util::TryStreamExt;
use reth_chainspec::ChainInfo;
use reth_node_api::{FullNodeComponents, NodePrimitives};
use reth_node_types::NodeTypes;
use reth_provider::StateReader;
use reth_provider::{BlockNumReader, DBProvider, DatabaseProviderFactory};

use reth_exex::{ExExContext, ExExEvent};

pub mod storage;
use crate::{backfill::BackfillJob, in_memory::InMemoryExternalStorage};
Copy link

Choose a reason for hiding this comment

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

let's be consistent with module import prelude formatting. i think reth prefers if we omit white space between std/core/alloc imports, other library imports and crate imports, as you have done in base branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed for all files in this PR

@meyer9 meyer9 force-pushed the meyer9/166-backfill-script branch from c686e1d to 21589ca Compare October 9, 2025 16:03
Base automatically changed from meyer9/176-in-memory-storage-backend to unstable October 12, 2025 08:27
@dhyaniarun1993
Copy link
Collaborator

Ignoring the clippy issues since it needs to be fixed upstream.

@dhyaniarun1993 dhyaniarun1993 merged commit 183da84 into unstable Oct 13, 2025
36 of 40 checks passed
@dhyaniarun1993 dhyaniarun1993 deleted the meyer9/166-backfill-script branch October 13, 2025 06:24
emhane added a commit that referenced this pull request Oct 20, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
meyer9 added a commit that referenced this pull request Oct 31, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Nov 11, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
meyer9 added a commit that referenced this pull request Nov 13, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Nov 18, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Nov 25, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Dec 8, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Dec 10, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Dec 18, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Dec 18, 2025
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 5, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 13, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 15, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 20, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 26, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
emhane added a commit that referenced this pull request Jan 29, 2026
Based on #183

This PR adds a backfill job that accepts a DB transaction and copies the
current state to the database. The transaction ensures we see a
consistent view of the database at the current block, even if the node
is syncing. This requires `--db.read-transaction-timeout 0`.

This currently doesn't handle interrupting the job because the state may
update while syncing and may read a different version of the database
upon restart.

---------

Co-authored-by: Arun Dhyani <dhyaniarun7@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: CLI crate A-db Area: database K-feature Kind: feature W-historical-proofs Workstream: historical-proofs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add backfill script that copies account/storage trie data

3 participants