Skip to content

Conversation

iovoid
Copy link
Contributor

@iovoid iovoid commented Oct 15, 2025

Motivation

Description

Closes #issue_number

Copy link

Benchmark for 02a5733

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.3±1.50ms 37.7±1.75ms +6.80%
Trie/cita-trie insert 1k 3.6±0.08ms 3.6±0.10ms 0.00%
Trie/ethrex-trie insert 10k 71.7±2.17ms 68.7±1.12ms -4.18%
Trie/ethrex-trie insert 1k 8.4±0.05ms 8.5±0.15ms +1.19%

Copy link

Benchmark for 781ab2f

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.2±0.66ms 35.6±0.75ms +1.14%
Trie/cita-trie insert 1k 3.5±0.01ms 3.6±0.20ms +2.86%
Trie/ethrex-trie insert 10k 67.7±1.20ms 67.6±1.68ms -0.15%
Trie/ethrex-trie insert 1k 8.4±0.11ms 8.3±0.02ms -1.19%

Copy link

Benchmark for 8c91fc8

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.2±0.90ms 35.4±1.28ms +0.57%
Trie/cita-trie insert 1k 3.6±0.01ms 3.6±0.23ms 0.00%
Trie/ethrex-trie insert 10k 67.1±1.18ms 66.8±0.98ms -0.45%
Trie/ethrex-trie insert 1k 8.4±0.09ms 8.4±0.23ms 0.00%

Copy link

Benchmark for bb899da

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.8±1.74ms 36.4±1.84ms +1.68%
Trie/cita-trie insert 1k 3.6±0.01ms 3.6±0.17ms 0.00%
Trie/ethrex-trie insert 10k 66.8±0.86ms 68.4±2.21ms +2.40%
Trie/ethrex-trie insert 1k 8.4±0.02ms 8.3±0.03ms -1.19%

Copy link

Benchmark for f78d0a8

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.9±1.01ms 40.0±3.88ms +11.42%
Trie/cita-trie insert 1k 3.5±0.01ms 3.6±0.22ms +2.86%
Trie/ethrex-trie insert 10k 66.7±0.90ms 71.3±2.78ms +6.90%
Trie/ethrex-trie insert 1k 8.2±0.06ms 8.4±0.06ms +2.44%

Copy link

Benchmark for d88bcb2

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.8±1.65ms 36.7±1.50ms -0.27%
Trie/cita-trie insert 1k 3.6±0.01ms 3.6±0.22ms 0.00%
Trie/ethrex-trie insert 10k 67.2±0.69ms 67.3±0.91ms +0.15%
Trie/ethrex-trie insert 1k 8.3±0.08ms 8.3±0.02ms 0.00%

}

fn generate_snapshot(&self) -> Result<(), StoreError> {
todo!()
Copy link
Contributor

Choose a reason for hiding this comment

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

relace this todo! for a Ok(()).

const CF_INVALID_ANCESTORS: &str = "invalid_ancestors";

#[derive(Debug)]
const CF_SNAPSHOTS: &str = "snapshots";
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use a better name for this CF. For example: flatkeyvalue

let store_clone = store.clone();
std::thread::spawn(move || {
let mut rx = rx;
while rx.recv() != Ok(SnapshotControlMessage::Continue) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should take in account Err results of this call.

Comment on lines 478 to 479
self.db
.delete_range_cf(&cf_snapshot, vec![], vec![0xff; 131])?;
Copy link
Contributor

Choose a reason for hiding this comment

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

this delete should be done after snap sync, not before

.map(|v| Nibbles::from_hex(v.to_vec()))
.unwrap_or_default();

println!("Starting snapshooting loop pivot={last_written:?} SR={state_root:x}");
Copy link
Contributor

Choose a reason for hiding this comment

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

change to debug!

@iovoid iovoid changed the base branch from pathbased_regen_leafs to main October 16, 2025 19:52
Copy link

Benchmark for 741e9ba

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 37.1±2.03ms 36.2±1.47ms -2.43%
Trie/cita-trie insert 1k 3.6±0.07ms 3.5±0.15ms -2.78%
Trie/ethrex-trie insert 10k 67.2±0.98ms 66.1±0.57ms -1.64%
Trie/ethrex-trie insert 1k 8.5±0.11ms 8.2±0.11ms -3.53%

Copy link

Benchmark for 1ada7d2

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.6±1.50ms 37.6±2.00ms +8.67%
Trie/cita-trie insert 1k 3.5±0.10ms 3.5±0.02ms 0.00%
Trie/ethrex-trie insert 10k 67.4±0.98ms 69.6±0.82ms +3.26%
Trie/ethrex-trie insert 1k 8.0±0.04ms 8.4±0.14ms +5.00%

Copy link

Benchmark for 18ae5ff

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.3±2.77ms 38.1±2.50ms +11.08%
Trie/cita-trie insert 1k 3.5±0.03ms 3.5±0.02ms 0.00%
Trie/ethrex-trie insert 10k 63.2±1.06ms 68.1±3.04ms +7.75%
Trie/ethrex-trie insert 1k 8.0±0.04ms 8.2±0.10ms +2.50%

batch.put_cf(&cf_misc, "last_written", path.as_ref());
batch.put_cf(&cf_snapshot, path.as_ref(), node.value);
ctr += 1;
if ctr > 10_000 {
Copy link
Contributor

Choose a reason for hiding this comment

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

i think its possible to miss a db.write if the last loop doesnt land on a > 10_000, i.e ctr < 10_000 and we dont loop anymore, isnt the batch lost?, i dont see any other db.write outsdie a if ctr > 10_000 to handle that case

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

Labels

L1 Ethereum client

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants