Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Enrich debug log with block tracing events #3903

Open
kid-alan opened this issue May 9, 2023 · 1 comment
Open

Feature: Enrich debug log with block tracing events #3903

kid-alan opened this issue May 9, 2023 · 1 comment
Assignees
Labels
feature request New functionality added to Iron Fish verified Verified by Iron Fish core team

Comments

@kid-alan
Copy link

kid-alan commented May 9, 2023

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:

  • Node discovers a new block (new height);
  • Node begins generating a new block template;
  • Node completes generating new block template;
    - Pool receives block template;
    - Pool broadcasts block template as miner's work;
    - Pool receives block PoW solution;
  • Node receives block PoW solution;
  • Node broadcasts block solution to other nodes;
    (Back to one: "Node discovers a new block")

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.

@kid-alan kid-alan added the feature request New functionality added to Iron Fish label May 9, 2023
@dguenther
Copy link
Member

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)

@dguenther dguenther added the verified Verified by Iron Fish core team label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New functionality added to Iron Fish verified Verified by Iron Fish core team
Projects
None yet
Development

No branches or pull requests

2 participants