iron-fish / ironfish

A novel cryptocurrency focused on privacy and accessibility.
https://ironfish.network
Mozilla Public License 2.0
964 stars 574 forks source link

Feature: Enrich debug log with block tracing events #3903

Open kid-alan opened 1 year ago

kid-alan commented 1 year ago

Description

@danield9tqh As we work to debug the orphan issue, our goal is to create a chronological log of key blockchain events with accurate timestamps. This will help us identify and fix the bottleneck precisely instead of resorting to guesswork.

Here is a list of the events:

Italicized Pool events are on our end, while the remaining events are those for which we want to insert debug log entries in the node's codebase. This comprehensive chronology will help us pinpoint the issue or confirm that there isn't a problem.

dguenther commented 1 year ago

This makes sense to me.

I'm not sure where the "discovers a new block" log would be best placed, but I'd expect most of the time to be consumed starting in this.chain.addBlock, which gets called in syncer.ts's addBlock function, and anything before that in peerNetwork should be a trivial amount of time.

Feel free to experiment with it though! We'd prefer debug logs, and if you're able to use the timestamps in logs for measurement, that'll probably make it easier than passing timestamps through the code (set the logPrefix config value to [%time%], see the docs for the config value: https://ironfish.network/use/get-started/node-configuration)