status-im / nimbus-eth2

Nim implementation of the Ethereum Beacon Chain
https://nimbus.guide
Other
508 stars 214 forks source link

Nimbus guide: Understanding the logs page #2498

Open unixpi opened 3 years ago

unixpi commented 3 years ago

A page that provides answers to questions like the following:

Is there a good reference that i can use to understand the meanings of the output logs from eth2 nimbus. In particular I'm trying to understand what delay=-2s529ms655us583ns means in an "Attestation sent" entry. Sometimes I see a negative time other times I see a positive one e.g. delay=40ms390us998ns?

This should also help us improve the logs. h/t @mratsim :)

unixpi commented 3 years ago

Copy and pasting Jacek's answer here fmr

This log line in particular is a bit special due to a quirk in eth2: normally, attestations (votes) are sent out 4s after the start of the slot giving the block producer 4s to create and disseminate the block - however, if the block is produced earlier, the spec allows the attestations to be sent out earlier as well - a negative delay is then printed (relative to the 4s mark), and one can deduce that the network is generally healthy - in the same way, it may happen that no block is produced by the 4s mark - the client will then vote anyway (for the previous block) as close as possible to the 4s mark - if the delay is consistently large, it means your node is not keeping up with the network for some reason (slow cpu, slow hard drive, poor connectivity etc) and usually warrants investigation - if it's "close" to 0, specially on the testnets, it usually means there was no block produced because the proposer before you was offfline