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

First pass focusing on warn and info level logging. Couple debugs #4923

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

jferrant
Copy link
Collaborator

@jferrant jferrant commented Jun 27, 2024

I have been tearing my hair out trying to compare across log lines without knowing what is a burn header hash vs stacks block hash vs consensus hash etc. This is a quick first pass to just print all the info as available in all warn and info level logs. I also did a few debug logs that were specifically standing out to me. I think we could cleanup a lot of log lines to only ever print these hashes annotated instead of inline as they are just a nebulous blob of bytes otherwise, but will leave that for a sep PR.

I might actually implement on top of this a trait for printing internal hashes for each object that holds them, but for now this seemed the quickest way to get it done and that might be overkill especially if the object contains parent hashes.

Note I didn't bother changing really much of the pre nakamoto lines. There are a few, but I avoided touching neon_node for example.

Closes #4922

@jferrant jferrant requested review from kantai and obycode June 27, 2024 20:30
@jferrant jferrant requested a review from a team as a code owner June 27, 2024 20:30
@wileyj
Copy link
Collaborator

wileyj commented Jun 28, 2024

@ldiego08 - pinging you since i know we discussed this as a possible PR, perhaps you can help jacinta here?

@ldiego08
Copy link

@wileyj, sure! @jferrant, please feel free to let me know how I can help (or if I'm needed). I'll be looking at logging in general to see how it can be improved or messages made more helpful. This PR provides a good insight into where some pain points are.

@jferrant
Copy link
Collaborator Author

@wileyj, sure! @jferrant, please feel free to let me know how I can help (or if I'm needed). I'll be looking at logging in general to see how it can be improved or messages made more helpful. This PR provides a good insight into where some pain points are.

I think for me the biggest pain point has been the inconsistency throughout the code base concerning what block heights (is it the anchor bkock height? the stacks block height? the burn block height?) and what hashes get printed (is it a consensus hash? a txid? a burn block hash? or a stacks block hash?). They are often not annotated so I have to look at the code closely to see what I am actually printing rather than just the log itself. I think this was my first pass effort that prob could be cleaner in general. I think maybe adding some traits for printing this info might be good? such as a trait with a function
"print_block_info" which would print all internal object data regarding block heights and hashes. I just don't know if it should include things like "parent_block_hash" or only print those if manually specified? Of couse this will not account for the instances of printing this data that is individually passed into a function rather than an object, but it might help all the same.

Otherwise, I think there are instances where some log messages should includ more data than they do, but its not available because its been abstracted into a sep function. This would be harder to determine without looking at very specific messages and updating them on a case by case basis so I prob would not worry about these cases for now.

@kantai what do you think?

kantai
kantai previously approved these changes Jul 2, 2024
@kantai
Copy link
Member

kantai commented Jul 2, 2024

@kantai what do you think?

Yeah, I agree with all of that. I think there's a bunch of pain points when it comes to our logs, but one thing that's hard for people is just as Jacinta said, there's often kind of multiple relevant chain references at a log location: burn header hash, consensus hash, stacks block hash, block heights, etc., and not all logs do a great job conveying all of them. A related-ish pain point is that often relevant information will be scattered across multiple log locations when they could be combined into a single log invocation.

… into feature/print-all-hashes-as-possible-in-logs
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an improvement to me. 👍

@jferrant jferrant added this pull request to the merge queue Jul 9, 2024
Merged via the queue into develop with commit 3c0bb38 Jul 9, 2024
1 check passed
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants