-
Notifications
You must be signed in to change notification settings - Fork 27
visualize forkchoice tree #196
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a configurable tree visualization feature to the fork choice logging system to help visualize the blockchain's fork structure. The visualization displays nodes with their block roots and slots, showing parent-child relationships using ASCII tree characters.
- Adds a new
tree_visualizer.zigmodule with functions to build ASCII tree representations of the fork choice tree - Updates the
printSlotfunction to include an optional tree depth parameter and display the fork choice tree visualization - Integrates the tree visualization into the existing chain status logging output
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| pkgs/node/src/tree_visualizer.zig | New module implementing tree visualization logic with depth limiting and ASCII tree formatting |
| pkgs/node/src/chain.zig | Updates printSlot function signature and integrates tree visualization into logging output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
looks cool! some changes to make it look small and easy for eyes:
|
|
@ScottyPoi can you resolve the conflicts |
7b650c0 to
a8906ec
Compare
|
@ScottyPoi can we truncate in opposite direction because most of the time relevance is to see the leaf forking, and if there are too many leaves include 3 by heaviest weight, and include 3 by most recent, so total 6 but keep this 3 number as a param also relevant to know is justified is a parent in which of these branches |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
a8906ec to
7451031
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
adds a visualization for the fork choice tree to the printSlot logging function as described in issue: #191.
The visualization is configurable with tree_depth limit. A tree_depth limit of
nullequals no depth limit.A visualization with tree_depth = 2 should look something like: