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

Improve MainnetBlockBodyValidator logging #4984

Merged
merged 4 commits into from
Jan 23, 2023

Conversation

siladu
Copy link
Contributor

@siladu siladu commented Jan 23, 2023

  • Associate block number and hash with the various invalid block warnings, in the format:
    Invalid block {blockNumber} ({blockHash}): ... mismatch (expected=..., actual=...)

Instead of

WARN  | MainnetBlockBodyValidator | Invalid block: receipts root mismatch (expected=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, actual=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421) 

we now have

WARN  | MainnetBlockBodyValidator | Invalid block 1 (0xd2ce6fb30db1ab80b0a5c137f3c8a83d12052e5a40366eba4c15b229c6a863e6): receipts root mismatch (expected=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, actual=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421) 

  • Print a less obscure message when there's no error message:

Instead of

INFO  | MainnetBlockValidator | Optional.empty. Block 11 (0x8edd340dd4718e884ffe327bab2d3e3874bac2799cde83a085e5cae66d53c3b5)

we now have

INFO  | MainnetBlockValidator | Invalid block 11 (0x8edd340dd4718e884ffe327bab2d3e3874bac2799cde83a085e5cae66d53c3b5)

Print a less obscure message when there's no error message.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Copy link
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

just waiting on your next push

Use toLogString
Fix bugs to put the logs back inside the guard.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Copy link
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

lgtm

@siladu siladu enabled auto-merge (squash) January 23, 2023 18:09
@siladu siladu disabled auto-merge January 23, 2023 18:10
…d by MainnetBlockBodyValidator)

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu enabled auto-merge (squash) January 23, 2023 18:16
@siladu siladu merged commit 844db62 into hyperledger:main Jan 23, 2023
@siladu siladu deleted the improve-block-validation-logging branch January 23, 2023 21:45
fab-10 pushed a commit to fab-10/besu that referenced this pull request Feb 1, 2023
Associate block number and hash with the various invalid block warnings

Print a less obscure message when there's no error message.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
ensi321 pushed a commit to ensi321/besu that referenced this pull request Feb 19, 2023
Associate block number and hash with the various invalid block warnings

Print a less obscure message when there's no error message.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu added the mainnet label Mar 6, 2023
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
Associate block number and hash with the various invalid block warnings

Print a less obscure message when there's no error message.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
Associate block number and hash with the various invalid block warnings

Print a less obscure message when there's no error message.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants