Skip to content

Commit 1931a50

Browse files
committed
Fix linting errors
1 parent c9226b7 commit 1931a50

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

benches/crud_benchmarks.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use alloy_primitives::{StorageKey, StorageValue, U256};
2020
use alloy_trie::{EMPTY_ROOT_HASH, KECCAK_EMPTY};
2121
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
2222
use rand::prelude::*;
23-
use std::{fs, hint::black_box, io, path::Path, sync::Arc, thread, time::Duration};
23+
use std::{fs, io, path::Path, sync::Arc, thread, time::Duration};
2424
use tempdir::TempDir;
2525
use triedb::{
2626
account::Account,
@@ -631,30 +631,6 @@ fn bench_state_root_with_overlay(c: &mut Criterion) {
631631
);
632632
});
633633

634-
// group.bench_function(BenchmarkId::new("state_root_with_storage_overlay", BATCH_SIZE), |b| {
635-
// b.iter_with_setup(
636-
// || {
637-
// let dir = TempDir::new("triedb_bench_state_root_with_storage_overlay").unwrap();
638-
// copy_files(&base_dir, dir.path()).unwrap();
639-
// let db_path = dir.path().join(&file_name);
640-
// Database::open(db_path).unwrap()
641-
// },
642-
// |db| {
643-
// black_box({
644-
// for _ in 0..100 {
645-
// let tx = db.begin_ro().unwrap();
646-
647-
// // Compute the root hash with the overlay
648-
// let _root_result =
649-
// tx.compute_root_with_overlay(&storage_overlay).unwrap();
650-
651-
// tx.commit().unwrap();
652-
// }
653-
// })
654-
// },
655-
// );
656-
// });
657-
658634
group.finish();
659635
}
660636

src/storage/overlay_root.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a> TraversalStack<'a> {
5454
self.push(TriePosition::Pointer(path, page, pointer, can_add_by_hash), overlay);
5555
}
5656

57-
fn push_none(&mut self, overlay: OverlayState) {
57+
fn push_overlay(&mut self, overlay: OverlayState) {
5858
self.push(TriePosition::None, overlay);
5959
}
6060

@@ -187,7 +187,7 @@ impl StorageEngine {
187187
storage_branch_updates,
188188
);
189189
// Defer the post_overlay to be processed after the node is traversed
190-
stack.push_none(post_overlay);
190+
stack.push_overlay(post_overlay);
191191

192192
if pre_overlay.contains_prefix_of(&path) {
193193
// A prefix of the node has already been processed, so we can skip the rest
@@ -308,7 +308,7 @@ impl StorageEngine {
308308
// nothing here to add
309309
} else {
310310
// we have a nonconflicting overlay, add all of it to the hash builder
311-
stack.push_none(child_overlay);
311+
stack.push_overlay(child_overlay);
312312
}
313313
}
314314
}
@@ -637,8 +637,8 @@ mod tests {
637637
(output.root, output.updated_branch_nodes, output.storage_branch_updates);
638638
assert_ne!(overlay_root, initial_root, "Overlay should not match initial root");
639639

640-
println!("Account branch updates: {:?}", account_branch_updates);
641-
println!("Storage branch updates: {:?}", storage_branch_updates);
640+
// println!("Account branch updates: {:?}", account_branch_updates);
641+
// println!("Storage branch updates: {:?}", storage_branch_updates);
642642

643643
let mut overlay_mut_with_branches = OverlayStateMut::new();
644644

0 commit comments

Comments
 (0)