Skip to content

Commit e5998a8

Browse files
authored
fix: code messages in shared cache and trie logic (#363)
## 📝 Summary <!--- A general summary of your changes --> ## 💡 Motivation and Context <!--- (Optional) Why is this change required? What problem does it solve? Remove this section if not applicable. --> --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent cf49d29 commit e5998a8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

crates/eth-sparse-mpt/benches/trie_insert_bench.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn gather_nodes(c: &mut Criterion) {
6666
b.iter(|| {
6767
let out = shared_cache
6868
.gather_tries_for_changes(&changes)
69-
.expect("gather must succed");
69+
.expect("gather must succeed");
7070
black_box(out);
7171
})
7272
});
@@ -165,7 +165,7 @@ fn root_hash_all(c: &mut Criterion) {
165165

166166
let tries = shared_cache
167167
.gather_tries_for_changes(&changes)
168-
.expect("gather must succed");
168+
.expect("gather must succeed");
169169

170170
c.bench_function("root_hash_all_par_all", |b| {
171171
b.iter_batched(
@@ -228,10 +228,10 @@ fn root_hash_main_trie(c: &mut Criterion) {
228228

229229
let mut trie = shared_cache
230230
.gather_tries_for_changes(&changes)
231-
.expect("gather must succed")
231+
.expect("gather must succeed")
232232
.account_trie;
233233
for key in changes.account_trie_updates {
234-
trie.insert(key.clone(), key.clone()).expect("must instert");
234+
trie.insert(key.clone(), key.clone()).expect("must insert");
235235
}
236236
for key in changes.account_trie_deletes {
237237
trie.delete(key).expect("must update");
@@ -267,7 +267,7 @@ fn root_hash_storage(c: &mut Criterion) {
267267

268268
let tries = shared_cache
269269
.gather_tries_for_changes(&changes)
270-
.expect("gather must succed");
270+
.expect("gather must succeed");
271271

272272
c.bench_function("root_hash_storage_insert", |b| {
273273
b.iter_batched(

crates/eth-sparse-mpt/src/reth_sparse_trie/change_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn prepare_change_set<'a>(
9393
if value.is_zero() {
9494
storage_deleted_keys.push(hashed_key);
9595
} else {
96-
// @efficienty, alloy_fixed encoding
96+
// @efficiently, alloy_fixed encoding
9797
let value = Bytes::from(alloy_rlp::encode(value));
9898
storage_updates_keys.push(hashed_key);
9999
storage_updates_values.push(value);

crates/eth-sparse-mpt/src/reth_sparse_trie/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub enum SparseTrieError {
3838
#[error("Error while updated shared cache: {0:?}")]
3939
FailedToUpdateSharedCache(#[from] AddNodeError),
4040
/// This might indicate bug in the library
41-
/// or incorrect underlying storage (e.g. when deletes can't be applyed to the trie because it does not have that keys)
41+
/// or incorrect underlying storage (e.g. when deletes can't be applied to the trie because it does not have that keys)
4242
#[error("Failed to fetch data")]
4343
FailedToFetchData,
4444
}
@@ -89,7 +89,7 @@ where
8989
}
9090

9191
/// Calculate root hash for the given outcome on top of the block defined by consistent_db_view.
92-
/// * shared_cache should be created once for each parent block and it stores fethed parts of the trie
92+
/// * shared_cache should be created once for each parent block and it stores fetched parts of the trie
9393
/// * It uses rayon for parallelism and the thread pool should be configured from outside.
9494
pub fn calculate_root_hash_with_sparse_trie<Provider>(
9595
consistent_db_view: ConsistentDbView<Provider>,

crates/eth-sparse-mpt/src/reth_sparse_trie/shared_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ impl RethSparseTrieShareCacheInternal {
8888
Ok(account_trie) => {
8989
tries.account_trie = account_trie;
9090
}
91-
Err(missing_acccount_trie_nodes) => {
92-
missing_nodes.account_trie_nodes = missing_acccount_trie_nodes;
91+
Err(missing_account_trie_nodes) => {
92+
missing_nodes.account_trie_nodes = missing_account_trie_nodes;
9393
}
9494
}
9595

0 commit comments

Comments
 (0)