Commit cc6893b
authored
fix(l1): force final progress print on snap sync phase completion (#6142)
## Motivation
The snap sync progress logs are printed every 10s. When a phase finishes
between prints, its progress bar is never shown at its final state — the
next print detects the transition and jumps straight to the completion
message, leaving the bar looking incomplete (e.g. stuck at 75%).
## Description
Force a final `log_phase_progress()` call for the finishing phase right
before `log_phase_completion()`, so the bar always reaches its end state
before the completion line is printed.
**Before:**
```
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░ 75.0% ← stale, from 10s ago
✓ BLOCK HEADERS complete: 1,234 headers in 15s 200ms
── PHASE 2/8: ACCOUNT RANGES ──────────────
```
**After:**
```
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% ← forced final print
✓ BLOCK HEADERS complete: 1,234 headers in 15s 200ms
── PHASE 2/8: ACCOUNT RANGES ──────────────
```
## How to test
Run a snap sync and observe that each phase's progress bar is printed at
its final state before the completion message appears.1 parent 13f553d commit cc6893b
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
323 | 325 | | |
324 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
325 | 337 | | |
326 | 338 | | |
327 | 339 | | |
| |||
0 commit comments