lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

Use `truncateBytes` to log `blockRoot`

Open nazarhussain opened this issue 4 months ago • 2 comments

I'd like blockRoot to be fully printed consistently so that it's easier to debug you search for it through explorer then copy it to our loki explorer. If it's not consistent then it make it harder to debug. Does anybody agree?

this is different to peerId where we print it fully 1 time and pretty print in all other times

Originally posted by @twoeths in https://github.com/ChainSafe/lodestar/pull/8390#pullrequestreview-3222743320

nazarhussain avatar Sep 15 '25 09:09 nazarhussain

it would also be nice to log get consensus on root blockRoot vs blockRootHex vs rootHex log

twoeths avatar Sep 16 '25 02:09 twoeths

it would also be nice to log get consensus on root blockRoot vs blockRootHex vs rootHex log

Either root or blockRoot, adding Hex suffix in the log context doens't make sense, although it's useful for variable names, but that's different.

When it comes to root vs. blockRoot I feel like it depens on the context of the log, if it's clearly talking about a block, then just root might be fine.

If we wanna keep it simple, just use blockRoot all the time.

nflaig avatar Sep 16 '25 09:09 nflaig