chore: move proof types and root functions from primitives/proofs into reth-trie-common (#8724)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
joshieDo
2024-06-13 18:36:18 +02:00
committed by GitHub
parent 763317d356
commit 76c8f4842c
47 changed files with 401 additions and 394 deletions

View File

@ -3,7 +3,7 @@ use alloy_rlp::{BufMut, Encodable};
use itertools::Itertools;
use reth_db_api::database::Database;
use reth_execution_errors::StorageRootError;
use reth_primitives::{proofs::IntoTrieAccount, B256};
use reth_primitives::B256;
use reth_provider::{providers::ConsistentDbView, DatabaseProviderFactory, ProviderError};
use reth_tasks::pool::BlockingTaskPool;
use reth_trie::{
@ -12,7 +12,7 @@ use reth_trie::{
trie_cursor::TrieCursorFactory,
updates::TrieUpdates,
walker::TrieWalker,
HashBuilder, HashedPostState, Nibbles, StorageRoot,
HashBuilder, HashedPostState, Nibbles, StorageRoot, TrieAccount,
};
use std::{collections::HashMap, sync::Arc};
use thiserror::Error;
@ -170,7 +170,7 @@ where
}
account_rlp.clear();
let account = IntoTrieAccount::to_trie_account((account, storage_root));
let account = TrieAccount::from((account, storage_root));
account.encode(&mut account_rlp as &mut dyn BufMut);
hash_builder.add_leaf(Nibbles::unpack(hashed_address), &account_rlp);
}

View File

@ -3,7 +3,7 @@ use alloy_rlp::{BufMut, Encodable};
use rayon::prelude::*;
use reth_db_api::database::Database;
use reth_execution_errors::StorageRootError;
use reth_primitives::{proofs::IntoTrieAccount, B256};
use reth_primitives::B256;
use reth_provider::{providers::ConsistentDbView, DatabaseProviderFactory, ProviderError};
use reth_trie::{
hashed_cursor::{HashedCursorFactory, HashedPostStateCursorFactory},
@ -11,7 +11,7 @@ use reth_trie::{
trie_cursor::TrieCursorFactory,
updates::TrieUpdates,
walker::TrieWalker,
HashBuilder, HashedPostState, Nibbles, StorageRoot,
HashBuilder, HashedPostState, Nibbles, StorageRoot, TrieAccount,
};
use std::collections::HashMap;
use thiserror::Error;
@ -152,7 +152,7 @@ where
}
account_rlp.clear();
let account = IntoTrieAccount::to_trie_account((account, storage_root));
let account = TrieAccount::from((account, storage_root));
account.encode(&mut account_rlp as &mut dyn BufMut);
hash_builder.add_leaf(Nibbles::unpack(hashed_address), &account_rlp);
}