[go: up one dir, main page]

Miscellaneous shell logs prettification

Context

This MR refactor some logs in order to make it less coarse for users.

This first commit refactors bootstrap logs in order to not log every head increment like:

Apr 20 14:55:37.710: head is now BL5rMcuzBAVCagcKAYkh9oPuA3Sp76ZSJ1WzVKQU45BWcsvrcxH (3387685)
Apr 20 14:55:37.818: head is now BM8ssvnqJ6mh7HA86Q1GYAmHv7Z5ESTJsNb5Eb4auQiWZckYLTp (3387686)
Apr 20 14:55:37.915: head is now BMXvZ2u4kh7wC2q9TMBLhgHffSspg9GynM262ru1mi4WRqw8C53 (3387687)
Apr 20 14:55:38.061: head is now BMRHKbFMFbT31LQ8z3eYGostVa7juTV9QGSaKDMjywmqnN6xHrE (3387688)
(ad lib)

and will instead display every 50 applied blocks a log indicating at which level the bootstrap currently is and how old the latest head is giving the user an approximation on how long it will take to reach a synchronized state which was something that could be extrapolated from looking at the block's timestamp in previous versions logs but was lost when switching to the new log system:

Apr 20 17:00:27.596: synchronizing: current head is 3h39min old (level: 3392300)
Apr 20 17:00:33.987: synchronizing: current head is 3h26min old (level: 3392350)
Apr 20 17:00:40.683: synchronizing: current head is 3h14min old (level: 3392400)

The second commit handles unexpected peer disconnections by displaying a non-dramatic message:

Apr 20 16:25:18.182: peer idtLbMz42y4ne7wJpjfjPJG4QvVStG disconnected

instead of

Apr 20 14:54:38.019: request
Apr 20 14:54:38.019:   New branch BLNwEjNyb5qSn4yZPnLbkdh5mHPKM3Zmb9mxeyP3ejQCeVpLDnw, locator length 3616480
Apr 20 14:54:38.019:   failed
Apr 20 14:54:38.019:   (Request pushed on 2023-04-20T12:44:11.979-00:00, treated in 154us, completed in 10min26s):
Apr 20 14:54:38.019:   Error:
Apr 20 14:54:38.019:     The promise was unexpectedly canceled
Apr 20 14:54:38.019:
Apr 20 14:54:38.019: worker crashed [validator-peer]: Error:
Apr 20 14:54:38.019:                                    The promise was unexpectedly canceled
Apr 20 14:54:38.019:

The third commit makes locator fetching messages fit on a single line

The fourth commit filters out block validator's worker error message when the validation request was canceled (e.g. when a peer validating a block disconnected).

The fifth commit adds information to notify branch/head debug events making them more useful.

The sixth commit replaces the unknown locator error which typically occurs when a node tries to bootstrap from a rolling node that's too far behind.

Apr 25 12:51:05.877: request
Apr 25 12:51:05.877:   New branch BMD6NKDar3qigqRChFvf9NPeH7RyU5qea71kMX8uJr51X8VtYCA, locator length 25904
Apr 25 12:51:05.877:   failed
Apr 25 12:51:05.877:   (Request pushed on 2023-04-25T10:51:05.875-00:00, treated in 44.109us, completed in 1.31ms):
Apr 25 12:51:05.877:   Error:
Apr 25 12:51:05.877:     Unknown ancestor
Apr 25 12:51:05.877: 

by

Apr 25 13:07:57.037: disconnected from peer idsrLVBc1AgAFQpsF2zAXssPquUndT: insufficient history

Checklist

  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by vbot

Merge request reports

Loading