diff --git a/crates/stages/src/stages/hashing_account.rs b/crates/stages/src/stages/hashing_account.rs index db0e3ca6258..6ae7fc5221b 100644 --- a/crates/stages/src/stages/hashing_account.rs +++ b/crates/stages/src/stages/hashing_account.rs @@ -53,37 +53,6 @@ impl AccountHashingStage { } } -impl Default for AccountHashingStage { - fn default() -> Self { - Self { - clean_threshold: 500_000, - commit_threshold: 100_000, - etl_config: EtlConfig::default(), - } - } -} - -// TODO: Rewrite this -/// `SeedOpts` provides configuration parameters for calling `AccountHashingStage::seed` -/// in unit tests or benchmarks to generate an initial database state for running the -/// stage. -/// -/// In order to check the "full hashing" mode of the stage you want to generate more -/// transitions than `AccountHashingStage.clean_threshold`. This requires: -/// 1. Creating enough blocks so there's enough transactions to generate the required transition -/// keys in the `BlockTransitionIndex` (which depends on the `TxTransitionIndex` internally) -/// 2. Setting `blocks.len() > clean_threshold` so that there's enough diffs to actually take the -/// 2nd codepath -#[derive(Clone, Debug)] -pub struct SeedOpts { - /// The range of blocks to be generated - pub blocks: RangeInclusive, - /// The number of accounts to be generated - pub accounts: usize, - /// The range of transactions to be generated per block. - pub txs: Range, -} - #[cfg(any(test, feature = "test-utils"))] impl AccountHashingStage { /// Initializes the `PlainAccountState` table with `num_accounts` having some random state @@ -144,6 +113,16 @@ impl AccountHashingStage { } } +impl Default for AccountHashingStage { + fn default() -> Self { + Self { + clean_threshold: 500_000, + commit_threshold: 100_000, + etl_config: EtlConfig::default(), + } + } +} + impl Stage for AccountHashingStage { /// Return the id of the stage fn id(&self) -> StageId { @@ -280,6 +259,27 @@ fn collect( Ok(()) } +// TODO: Rewrite this +/// `SeedOpts` provides configuration parameters for calling `AccountHashingStage::seed` +/// in unit tests or benchmarks to generate an initial database state for running the +/// stage. +/// +/// In order to check the "full hashing" mode of the stage you want to generate more +/// transitions than `AccountHashingStage.clean_threshold`. This requires: +/// 1. Creating enough blocks so there's enough transactions to generate the required transition +/// keys in the `BlockTransitionIndex` (which depends on the `TxTransitionIndex` internally) +/// 2. Setting `blocks.len() > clean_threshold` so that there's enough diffs to actually take the +/// 2nd codepath +#[derive(Clone, Debug)] +pub struct SeedOpts { + /// The range of blocks to be generated + pub blocks: RangeInclusive, + /// The number of accounts to be generated + pub accounts: usize, + /// The range of transactions to be generated per block. + pub txs: Range, +} + fn stage_checkpoint_progress( provider: &DatabaseProviderRW, ) -> ProviderResult {