besu icon indicating copy to clipboard operation
besu copied to clipboard

Besu logs could better help non-developers understand how a sync is going

Open ColinCampbell opened this issue 3 years ago • 0 comments

Description

As a non-developer syncing Besu, it would be helpful if Besu's log messages included summaries of what Besu is currently doing and its progress in a non-developer friendly way.

Just to set some context, you'll see in the Discord messages in the Besu channels on the hyperledger server as well as on the ethstaker server that many solo stakers are using logs to determine how their sync is going. Most of the messages are coming from people who aren't fully aware of how Besu works internally (its syncing mechanisms, its codebase, etc). Grafana dashboards provide some of this functionality but in an overly summarized way for people who want to know "minute by minute" if things are healthy and functioning properly. There are a couple things that could catch people out currently:

  1. It would be nice to better delineate the different block import stages. For example, during the longer initial sync phase, it seems you aren't able to restart the Besu process without at least some risk of it needing to resync entirely over again, but there is nothing in the logs to warn you against doing that as far as I could see.
  2. The world state syncing and healing process is communicated as a percent, but block importing is not. When I synced Besu the first time, I had a naive view of what "world state" meant and assumed the percent represented the sync percent.

Steps to Reproduce (Bug)

  1. Start a fresh Besu sync
  2. Open the log output

Expected behavior:

Include the current sync stage (initial sync, final sync) in the progress messages as well as a percent: Current:

Completed importing chain segment 435601 to 449600 (14000 blocks in 10089ms), Peers: 25

Maybe something like:

Initial sync 2.9% complete after importing chain segment 435601 to 449600 (14000 blocks in 10089ms), Peers: 25.

Include a warning at the state of the initial sync stage to keep Besu running. Current:

main | INFO  | DefaultSynchronizer | Starting synchronizer
main | INFO  | SnapSyncDownloader | Starting sync.

Changing to something like:

main | INFO  | DefaultSynchronizer | Starting synchronizer
main | INFO  | SnapSyncDownloader | Starting initial sync
main | WARN | SnapSyncDownloader | Do not restart Besu during the initial sync phase. That could lead to Besu needing to restart its sync

Include a message that more clearly delineates the initial sync from the final sync: Current:

PipelineChain download complete
Sync completed successfully with pivot block 15426018
Initial sync done, unsubscribe finalized block hash supplier

Adding something like:

Initial sync completed, switching to final sync to catch up to the head of the chain. It is now safe to restart the Besu process.

Actual behavior: The logs require some level of knowledge of how Besu works

Frequency: 100%

Versions

  • Software version: 22.7.1

ColinCampbell avatar Aug 31 '22 17:08 ColinCampbell