Refactors logging for startup accounts verification#7327
Refactors logging for startup accounts verification#7327brooksprumo merged 2 commits intoanza-xyz:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7327 +/- ##
=========================================
- Coverage 83.0% 83.0% -0.1%
=========================================
Files 800 800
Lines 362384 362384
=========================================
- Hits 300861 300820 -41
- Misses 61523 61564 +41 🚀 New features to boost your workflow:
|
2d6a119 to
2641992
Compare
| verified | ||
| ) | ||
| } else { | ||
| info!("Verifying accounts... Skipped."); |
There was a problem hiding this comment.
Is this comment redundant or incorrect? Seems useful to know that it was skipped.
There was a problem hiding this comment.
Before we had it because we always logged:
info!("Verifying accounts...");a few lines up, so it was needed to be clear. Now, we only log what we're actually doing. So the absence of any "verifying accounts" logs indicates it was skipped. Wdyt?
There was a problem hiding this comment.
I find it can still be useful to know it was skipped. For example when searching through logs of multiple startup cycles trying to figure out why one was failing and another passed.
| }; | ||
| let is_ok = check_lt_hash(&expected_accounts_lt_hash, &calculated_accounts_lt_hash); | ||
| self.set_initial_accounts_hash_verification_completed(); | ||
| info!( |
There was a problem hiding this comment.
Just for consistency what about let total_time = start.elapsed();
I would guess logging the timing is not useful in this case?
There was a problem hiding this comment.
I could add a variable, but it seemed unnecessary. We do log the timing here.
There was a problem hiding this comment.
Verifying accounts in the foreground will always be for testing/debugging usages, so I don't think we need to submit metrics in this case.
Problem
Startup accounts verification does logging in multiple places, and is also incomplete and inconsistent.
verify_snapshot_bank(), we log that verification is happening in the background, even if it actually runs in the foreground.Summary of Changes
Unifies all the startup verification logging into
verify_accounts_hash().