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

Log string header_hash on long validation warnings #17304

Merged
merged 5 commits into from Jan 12, 2024

Conversation

hoffmang9
Copy link
Member

Purpose:

We are logging the binary form of the header hash in the "WARNING Block validation time" is slow log entry. Instead log the human readable header hash.

Current Behavior:

Slow look up warning log looks like this:

2024-01-11T14:44:13.647 full_node chia.full_node.full_node: WARNING  Block validation time: 11.09 seconds, pre_validation time: 1.68 seconds, post-process time: 6.97 seconds, cost: 5462045750, percent full: 49.655% header_hash: b'\xd5\x96\xc8\x10\xb4\x93Y\x82\xf8\x99H:G\x99\xe7E\x86\x02\xaa\x97q\x868\x1fO\x97Pe\xfd27\x95' height: 4787397

New Behavior:

Now these will be human readable and searchable:

2024-01-11T14:44:13.647 full_node chia.full_node.full_node: WARNING  Block validation time: 11.09 seconds, pre_validation time: 1.68 seconds, post-process time: 6.97 seconds, cost: 5462045750, percent full: 49.655% header_hash: d596c810b4935982f899483a4799e7458602aa977186381f4f975065fd323795 height: 4787397

Testing Notes:

We are logging the binary form of the header hash in the "WARNING Block validation time" is slow log entry. Instead log the human readable header hash.
@hoffmang9 hoffmang9 added Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog Logging Change output to .chia/NETWORK/log/debug.log labels Jan 11, 2024
@hoffmang9 hoffmang9 requested a review from a team as a code owner January 11, 2024 23:32
@hoffmang9 hoffmang9 marked this pull request as draft January 12, 2024 01:17
@hoffmang9
Copy link
Member Author

Testing found the object still contained a bytes string so now using header_hash.hex() to get the correct human readable method.

Please squash when merging.

@hoffmang9 hoffmang9 marked this pull request as ready for review January 12, 2024 01:58
Copy link
Contributor

@arvidn arvidn left a comment

Choose a reason for hiding this comment

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

that was my mistake

@cmmarslender cmmarslender merged commit fb2e892 into main Jan 12, 2024
264 checks passed
@cmmarslender cmmarslender deleted the hoffmang9-slow-header-hash branch January 12, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog Logging Change output to .chia/NETWORK/log/debug.log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants