From fe5f423da34977d7a6aed504db49bdf2698e4a65 Mon Sep 17 00:00:00 2001 From: twoeths <10568965+twoeths@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:05:20 +0700 Subject: [PATCH] chore: more logs for maybeArchiveState() (#8541) **Motivation** - this task runs once per epoch so there should be no issue being more verbose on the log Co-authored-by: Tuyen Nguyen --- .../strategies/frequencyStateArchiveStrategy.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/beacon-node/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts b/packages/beacon-node/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts index 668ae4e327..3e3d207a40 100644 --- a/packages/beacon-node/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +++ b/packages/beacon-node/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts @@ -63,7 +63,9 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy { const lastStoredEpoch = computeEpochAtSlot(lastStoredSlot ?? 0); const {archiveStateEpochFrequency} = this.opts; + const logCtx = {finalizedEpoch: finalized.epoch, lastStoredEpoch, archiveStateEpochFrequency}; if (finalized.epoch - lastStoredEpoch >= Math.min(PERSIST_TEMP_STATE_EVERY_EPOCHS, archiveStateEpochFrequency)) { + this.logger.verbose("Start archiving state", logCtx); await this.archiveState(finalized, metrics); // Only check the current and previous intervals @@ -88,11 +90,13 @@ export class FrequencyStateArchiveStrategy implements StateArchiveStrategy { // More logs to investigate the rss spike issue https://github.com/ChainSafe/lodestar/issues/5591 this.logger.verbose("Archived state completed", { - finalizedEpoch: finalized.epoch, + ...logCtx, minEpoch, storedStateSlots: storedStateSlots.join(","), statesSlotsToDelete: statesSlotsToDelete.join(","), }); + } else { + this.logger.verbose("Skip archiving state", logCtx); } }