diff --git a/crates/stages/src/stages/hashing_account.rs b/crates/stages/src/stages/hashing_account.rs index cc49527bb8..757609461b 100644 --- a/crates/stages/src/stages/hashing_account.rs +++ b/crates/stages/src/stages/hashing_account.rs @@ -2,7 +2,7 @@ use crate::{ db::Transaction, ExecInput, ExecOutput, Stage, StageError, StageId, UnwindInput, UnwindOutput, }; use reth_db::{ - cursor::{DbCursorRO, DbCursorRW}, + cursor::DbCursorRO, database::Database, tables, transaction::{DbTx, DbTxMut}, @@ -76,9 +76,10 @@ impl Stage for AccountHashingStage { // next key of iterator let next_key = accounts.next()?; - let mut hashes = tx.cursor_write::()?; - // iterate and append presorted hashed accounts - hashed_batch.into_iter().try_for_each(|(k, v)| hashes.append(k, v))?; + // iterate and put presorted hashed accounts + hashed_batch + .into_iter() + .try_for_each(|(k, v)| tx.put::(k, v))?; next_key }; tx.commit()?; diff --git a/crates/stages/src/stages/hashing_storage.rs b/crates/stages/src/stages/hashing_storage.rs index 9665d62945..e984fe937d 100644 --- a/crates/stages/src/stages/hashing_storage.rs +++ b/crates/stages/src/stages/hashing_storage.rs @@ -80,9 +80,10 @@ impl Stage for StorageHashingStage { // next key of iterator let next_key = storage.next()?; - let mut hashes = tx.cursor_write::()?; - // iterate and append presorted hashed slots - hashed_batch.into_iter().try_for_each(|(k, v)| hashes.append(k, v))?; + // iterate and put presorted hashed slots + hashed_batch + .into_iter() + .try_for_each(|(k, v)| tx.put::(k, v))?; next_key }; tx.commit()?; diff --git a/crates/stages/src/stages/index_account_history.rs b/crates/stages/src/stages/index_account_history.rs index 109a25c5a4..18634276e4 100644 --- a/crates/stages/src/stages/index_account_history.rs +++ b/crates/stages/src/stages/index_account_history.rs @@ -16,8 +16,8 @@ use tracing::*; const INDEX_ACCOUNT_HISTORY: StageId = StageId("IndexAccountHistoryStage"); -/// Account hashing stage hashes plain account. -/// This is preparation before generating intermediate hashes and calculating Merkle tree root. +/// Stage is indexing history the account changesets generated in [`ExecutionStage`] +/// For more information on index sharding please look at [`tables::AccountHistory`] #[derive(Debug)] pub struct IndexAccountHistoryStage { /// Number of blocks after which the control diff --git a/crates/stages/src/stages/index_storage_history.rs b/crates/stages/src/stages/index_storage_history.rs index 092de34b6d..c3bc6fd4e5 100644 --- a/crates/stages/src/stages/index_storage_history.rs +++ b/crates/stages/src/stages/index_storage_history.rs @@ -16,8 +16,8 @@ use tracing::*; const INDEX_STORAGE_HISTORY: StageId = StageId("IndexStorageHistoryStage"); -/// Account hashing stage hashes plain account. -/// This is preparation before generating intermediate hashes and calculating Merkle tree root. +/// Stage is indexing history the account changesets generated in [`ExecutionStage`] +/// For more information on index sharding please look at [`tables::StorageHistory`] #[derive(Debug)] pub struct IndexStorageHistoryStage { /// Number of blocks after which the control