Skip to content

Conversation

@mradian1
Copy link

@mradian1 mradian1 commented Nov 11, 2025

Reasoning behind the pull request

Using the prettify block logging, improve the logs analysis tool to validate that cross shard miniblocks are executed (and proposed) in strict order, without gaps or duplications.

Proposed changes

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@mradian1 mradian1 self-assigned this Nov 11, 2025
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 38.70968% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.59%. Comparing base (18aaf4c) to head (4cfddb1).
⚠️ Report is 1 commits behind head on feat/supernova-async-exec.

Files with missing lines Patch % Lines
consensus/spos/bls/v1/subroundBlock.go 40.00% 2 Missing and 4 partials ⚠️
consensus/spos/bls/v1/subroundEndRound.go 40.00% 2 Missing and 4 partials ⚠️
consensus/spos/bls/v2/subroundBlock.go 33.33% 1 Missing and 3 partials ⚠️
consensus/spos/bls/v2/subroundEndRound.go 40.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/supernova-async-exec    #7419      +/-   ##
=============================================================
- Coverage                      77.60%   77.59%   -0.02%     
=============================================================
  Files                            874      874              
  Lines                         119875   119904      +29     
=============================================================
+ Hits                           93031    93039       +8     
- Misses                         20749    20756       +7     
- Partials                        6095     6109      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mradian1 mradian1 changed the title MX-17306 Added header logs on commit MX-17306 Tooling for incorrect cross shard execution Nov 11, 2025
Copy link
Contributor

Copilot AI left a 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 enhanced logging capabilities for debugging cross-shard miniblock execution by logging header details at key consensus stages using the PrettifyStruct utility.

Key changes:

  • Added debug logging for headers when they are proposed, received, and committed across BLS consensus versions (v1 and v2)
  • Added comprehensive test coverage for PrettifyStruct with HeaderV3 and MetaBlockV3 types
  • Created mock helper functions to support the new tests

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
consensus/spos/bls/v2/subroundEndRound.go Logs header details when a block is finalized and committed
consensus/spos/bls/v1/subroundEndRound.go Logs header details when blocks are committed by both leader and participant nodes
consensus/spos/bls/v1/subroundBlock.go Logs header details when blocks are sent and received during consensus
common/common_test.go Adds test cases for HeaderV3/MetaBlockV3 and helper functions to create mock headers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

NotarizedInRound: hdrRound - 1,
},
ExecutionResults: []*block.ExecutionResult{
&block.ExecutionResult{
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The code uses the unidiomatic composite literal syntax &block.ExecutionResult{...} instead of {...}. When the slice element type is already a pointer ([]*block.ExecutionResult), you should omit the & operator. This applies to all three entries in the slice (lines 848, 857, 866).

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

done


meta := createMockMetaHeaderV3()
hdr = meta
prettified, err = common.PrettifyStruct(meta)
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

Inconsistency in the variable passed to PrettifyStruct. Line 510 assigns meta to hdr, but line 511 passes meta directly instead of using hdr. For consistency with the pattern used for the shard header (lines 504-505), this should be common.PrettifyStruct(hdr).

Suggested change
prettified, err = common.PrettifyStruct(meta)
prettified, err = common.PrettifyStruct(hdr)

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@axenteoctavian axenteoctavian left a comment

Choose a reason for hiding this comment

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

  • Copilot suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants