Skip to content

Commit 931188a

Browse files
committed
fix: remove excessive persistence logging
Signed-off-by: William Hankins <william@sundae.fi>
1 parent eabd1fa commit 931188a

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

modules/historical_accounts_state/src/historical_accounts_state.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,10 @@ impl HistoricalAccountsState {
212212
(state.immutable.clone(), state.config.clone())
213213
};
214214

215-
info!("sending persist for epoch {}", current_block.epoch);
216215
if let Err(e) = persist_tx.send((current_block.epoch as u32, store, cfg)).await
217216
{
218217
panic!("persistence worker crashed: {e}");
219218
}
220-
221-
info!("persist send completed");
222219
}
223220
}
224221

modules/historical_accounts_state/src/immutable_historical_account_store.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use fjall::{Keyspace, Partition, PartitionCreateOptions};
99
use minicbor::{decode, to_vec};
1010
use rayon::iter::{IntoParallelIterator, ParallelIterator};
1111
use tokio::sync::Mutex;
12-
use tracing::{debug, error, info};
12+
use tracing::{debug, error};
1313

1414
use crate::state::{AccountEntry, ActiveStakeHistory, HistoricalAccountsConfig, RewardHistory};
1515

@@ -61,10 +61,14 @@ impl ImmutableHistoricalAccountStore {
6161
/// and addresses into their respective Fjall partitions for an entire epoch.
6262
/// Skips any partitions that have already stored the given epoch.
6363
/// All writes are batched and committed atomically, preventing on-disk corruption in case of failure.
64-
pub async fn persist_epoch(&self, epoch: u32, config: &HistoricalAccountsConfig) -> Result<()> {
64+
pub async fn persist_epoch(
65+
&self,
66+
epoch: u32,
67+
config: &HistoricalAccountsConfig,
68+
) -> Result<u64> {
6569
if !config.any_enabled() {
6670
debug!("no persistence needed for epoch {epoch} (disabled)",);
67-
return Ok(());
71+
return Ok(0);
6872
}
6973

7074
let drained_blocks = {
@@ -135,10 +139,7 @@ impl ImmutableHistoricalAccountStore {
135139
}
136140

137141
match batch.commit() {
138-
Ok(_) => {
139-
info!("committed {change_count} account changes for epoch {epoch}");
140-
Ok(())
141-
}
142+
Ok(_) => Ok(change_count),
142143
Err(e) => {
143144
error!("batch commit failed for epoch {epoch}: {e}");
144145
Err(e.into())

0 commit comments

Comments
 (0)