refactor(l1): improve snap sync logging with table format#5977
Merged
pablodeymo merged 18 commits intomainfrom Jan 22, 2026
Merged
refactor(l1): improve snap sync logging with table format#5977pablodeymo merged 18 commits intomainfrom
pablodeymo merged 18 commits intomainfrom
Conversation
Replace verbose multi-line logging with a clean, scannable table format featuring visual progress bars, aligned columns, and simplified time display (HH:MM:SS). Removes redundant timing details per component while keeping essential metrics: downloaded/inserted counts and progress percentage.
Lines of code reportTotal lines added: Detailed view |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the snap sync logging to use a cleaner table format with visual progress bars, replacing the previous verbose multi-line format with aligned columns and simplified time display.
Changes:
- Replaced verbose log format with table-based display using Unicode box-drawing characters
- Added visual progress bars using block characters (█) for instant progress recognition
- Simplified time format from
HH:MM:SS:MStoHH:MM:SSand removed per-component timing metrics
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Change the snap sync progress table from 4 rows with 2 columns (Downloaded/Inserted) to 8 rows with a single data column. Remove progress bars, keeping only the percentage for Headers Downloaded. This makes the output easier to read and parse.
Reduce console noise by lowering log level for frequent engine API messages: - Received new engine request (Blobs V1/V2/V3) - Received new payload - New fork choice update
…er retrieved", "All downloaded headers are unique", "Received unexpected message from peer" and "Timeout while waiting for sync head from peer" moved to DEBUG
ilitteri
approved these changes
Jan 22, 2026
tomip01
approved these changes
Jan 22, 2026
Comment on lines
+277
to
+284
| 1. Headers Downloaded {headers_downloaded:>13} {headers_percentage:>5.1}% {headers_per_second} headers/s | ||
| 2. Accounts Downloaded {account_leaves_downloaded:>13} {accounts_per_second} accounts/s | ||
| 3. Accounts Inserted {account_leaves_inserted:>13} | ||
| 4. Storage Downloaded {storage_leaves_downloaded:>13} {storage_per_second} storage slots/s | ||
| 5. Storage Inserted {storage_leaves_inserted:>13} | ||
| 6. Healing: {healed_accounts} accounts | ||
| 7. Healing: {healed_storages} storages | ||
| 8. Bytecodes Downloaded {bytecodes_downloaded:>13} {bytecodes_per_second} bytecodes/s |
Contributor
There was a problem hiding this comment.
Just a nit, but with this formatting we get:
1. Headers Downloaded 1791878 85.9% 9685 headers/s
2. Accounts Downloaded 0 0 accounts/s
...
Could we make it look like this (aligning the unit names)?
1. Headers Downloaded 1791878 85.9% 9685 headers/s
2. Accounts Downloaded 0 0 accounts/s
...
jrchatruc
approved these changes
Jan 22, 2026
rodrigo-o
approved these changes
Jan 22, 2026
Comment on lines
+5
to
+7
| ### 2026-01-21 | ||
|
|
||
| - Improve snap sync logging with table format and visual progress bars [#5977](https://github.com/lambdaclass/ethrex/pull/5977) |
Contributor
There was a problem hiding this comment.
Does this actually affect performance?
Contributor
Author
There was a problem hiding this comment.
No, it's just visual modification (that is displayed every 30 secs).
ElFantasma
approved these changes
Jan 22, 2026
Oppen
pushed a commit
that referenced
this pull request
Jan 27, 2026
## Motivation The current snap sync logs are verbose and hard to scan at a glance: ``` P2P Snap Sync | elapsed 01h 10m 53s 04ms | peers 13 | step Requesting Storage Ranges | head 2f966c... headers : 2072429/2072429 (100.00%), remaining 0 accounts: downloaded 19140475 @ 00h 02m 29s 00ms | inserted 19140475 (100.0%) in 00h 00m 23s 00ms | pending 0 storage : downloaded 143517386 @ 00h 43m 30s 02ms | inserted 0 (0.0%) in 00h 00m 00s 00ms healing : accounts 2106, storages 0, elapsed 00h 00m 00s 00ms, throttle Peers bytecodes: downloaded 0 in 00h 00m 00s 00ms ``` Additionally, frequent engine API logs pollute the console during sync. ## Description Replace with a clean table format that's easier to read: ``` ─────────────────────────────────────────────────────────────────────── SNAP SYNC │ 01:10:53 │ 13 peers │ Requesting Storage Ranges │ 2f966c ─────────────────────────────────────────────────────────────────────── Headers Downloaded 2072429 100.0% Headers Inserted - Accounts Downloaded 19140475 Accounts Inserted 19140475 Storage Downloaded 143517386 Storage Inserted 0 Bytecodes Downloaded 0 Bytecodes Inserted - ─────────────────────────────────────────────────────────────────────── Healing: 2106 accounts │ 0 storages ─────────────────────────────────────────────────────────────────────── ``` **Changes:** - Single-column layout with 8 rows (one per metric) instead of 4 rows with 2 columns - Progress percentage shown only for Headers Downloaded - Simplified time format (`01:10:53` vs `01h 10m 53s 04ms`) - Removed per-component timing clutter (download/insert times) - Removed redundant metrics (pending counts, remaining headers) - Increased refresh interval from 10s to 30s to reduce log noise - Changed engine API logs from INFO to DEBUG level: - "Received new engine request" (Blobs V1/V2/V3) - "Received new payload" - "New fork choice update" **Result:** Cleaner, more scannable output with less console noise. ## How to Test 1. Run a node with snap sync enabled 2. Observe the new table format in logs every 30 seconds 3. Verify engine API messages only appear at DEBUG level --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pablodeymo
added a commit
that referenced
this pull request
Jan 27, 2026
Resolve conflicts from #5977 and #6018 merge to main: - Keep modular sync structure (sync.rs delegates to full.rs and snap_sync.rs) - Keep snap client code in snap/client.rs (removed from peer_handler.rs) - Add InsertingAccountRanges metric from #6018 to snap_sync.rs - Remove unused info import from peer_handler.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The current snap sync logs are verbose and hard to scan at a glance:
Additionally, frequent engine API logs pollute the console during sync.
Description
Replace with a clean table format that's easier to read:
Changes:
01:10:53vs01h 10m 53s 04ms)Result: Cleaner, more scannable output with less console noise.
How to Test