fix: better logging message when ledger is reset#873
fix: better logging message when ledger is reset#873Jovian-Dsouza wants to merge 1 commit intomagicblock-labs:masterfrom
Conversation
📝 WalkthroughWalkthroughThe PR introduces a new public enum Assessment against linked issues
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
please review @thlorenz |
Summary
Replaces confusing
u64::MAXslot logging with semanticLedgerInitStateenum to clearly indicate whether the ledger is freshly initialized or resuming from existing data.Solution
Introduced
LedgerInitStateenum with two variants:Fresh: Ledger was reset/is a fresh start with no existing blocksResuming { last_slot: Slot }: Resuming from an existing slotThe enum provides:
Displaytrait implementationCompatibility
Testing
LedgerInitStateDisplay and slot_for_accountsdb methodstest_ledger_init_state_fresh_displayandtest_ledger_init_state_resuming_displayExpected output
Fresh start (with --reset):
INFO ... Ledger initialized ledger_state="fresh start (no existing blocks)"
Resuming from existing data:
INFO ... Ledger initialized ledger_state="resuming from slot 12345"
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.