Skip to content

TODOs part 2#7884

Merged
AdoAdoAdo merged 14 commits into
feat/testnet-fixesfrom
todos2
Jun 29, 2026
Merged

TODOs part 2#7884
AdoAdoAdo merged 14 commits into
feat/testnet-fixesfrom
todos2

Conversation

@sstanculeanu

@sstanculeanu sstanculeanu commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Reasoning behind the pull request

  • TODOs

Proposed changes

  • TODOs:
    • // TODO: previously the number of missing reward txs was cleared in rewardTxsForBlock - check if this is still needed -> fixed, some late call to ReceivedTransaction could have put the channel in an invalid state
    • // TODO: previously the number of missing txs was cleared in scrForBlock - check if this is still needed -> fixed
    • // TODO: previously the number of missing txs was cleared in txsForCurrentBlock - check if this is still needed -> fixed
    • // TODO: evaluate disabling this entirely (for old flows) - the check is not triggered if async enabled but there are still some checks in the old flow -> fixed, guarded the only call with header v3 check
    • // TODO: analyze the requested headers in this func, after andromeda committed blocks are final -> fixed, no need to request the headers
    • // TODO: consider if tx count per metablock header is still needed -> fixed, not needed anymore, only used for metrics
    • // TODO: remove log if no longer needed for validation -> fixed, removed the log
    • // TODO: check again before saving the last executed result -> removed todo, already handled
    • // TODO check for overflow? -> removed, will happen in 500 years
    • // TODO: check if we need to pack also miniblock into smaller chunks -> removed, already throttled
    • // TODO analyze if this behaviour is ok. Even if the limit of txs per sender is exceeded, no tx is removed because the specific nonce is tracked. -> remvoed, enforcement is based on executed transactions, not tracked
    • // TODO modify when the function is updated -> fixed, updated ComputeCrossInfo to properly fetch num pending mbs
    • // todo: maybe sanitize, removing empty miniBlocks -> added a new method to remove the empty mbs

Testing procedure

  • with feat branch

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?

@sstanculeanu sstanculeanu self-assigned this Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.68%. Comparing base (143c2f4) to head (77dcf3a).

Files with missing lines Patch % Lines
process/block/metrics.go 66.66% 2 Missing and 1 partial ⚠️
process/coordinator/process.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feat/testnet-fixes    #7884      +/-   ##
======================================================
+ Coverage               77.67%   77.68%   +0.01%     
======================================================
  Files                     885      885              
  Lines                  125579   125605      +26     
======================================================
+ Hits                    97543    97579      +36     
+ Misses                  21567    21560       -7     
+ Partials                 6469     6466       -3     

☔ View full report in Codecov by Harness.
📢 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.

@sstanculeanu sstanculeanu marked this pull request as ready for review June 19, 2026 14:24
…-chain-go into todos2

# Conflicts:
#	process/track/shardBlockTrack.go
@AdoAdoAdo AdoAdoAdo requested a review from Copilot June 26, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses a batch of previously tracked TODO items across block preprocessing, proposal creation, metrics, and scheduled epoch-start syncing, with several changes gated for HeaderV3 (async execution) flow.

Changes:

  • Introduces ClearMissingTxsCount() in TxsForBlockHandler and uses it after waiting for missing data, to prevent late ReceivedTransaction calls from affecting subsequent waits.
  • Adds miniblock sanitization via RemoveEmptyMiniBlocks() in the miniblock selection session and wires it into shard proposal miniblock creation.
  • Adjusts meta header tx-count metrics for HeaderV3 (deriving the value from shard info + execution results) and short-circuits scheduled header syncing for HeaderV3.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
txcache/txCache_test.go Removes an outdated TODO comment from tx cache tests.
testscommon/preprocMocks/txsForBlockStub.go Extends stub to support the new ClearMissingTxsCount() interface method.
testscommon/mbSelection/mbSelectionSessionStub.go Extends stub to support the new RemoveEmptyMiniBlocks() interface method.
process/track/shardBlockTrack_test.go Adds coverage for ComputeCrossInfo() behavior for legacy vs V3 meta headers.
process/estimator/executionResultInclusionEstimator.go Removes outdated overflow TODO/comment in ms→ns conversion helper.
process/coordinator/process.go Skips max-block-size checks in a HeaderV3 path to match async flow behavior.
process/block/shardinfo_test.go Updates/extends tests to cover V3/non-V3 cross-shard info updates.
process/block/shardblockProposal.go Calls RemoveEmptyMiniBlocks() after assembling proposal miniblocks.
process/block/preprocess/txsForBlock.go Adds ClearMissingTxsCount() implementation to reset missing counter safely.
process/block/preprocess/txsForBlock_test.go Adds tests for ClearMissingTxsCount() semantics (including late transaction behavior).
process/block/preprocess/transactions.go Clears missing-tx counters after wait and removes a debug log in bad-tx removal path.
process/block/preprocess/smartContractResults.go Clears missing-SCR counters after waiting for requested data.
process/block/preprocess/rewardTxPreProcessor.go Clears missing-reward-tx counters after waiting for requested data.
process/block/preprocess/interfaces.go Adds ClearMissingTxsCount() to TxsForBlockHandler.
process/block/metrics.go Computes meta-header tx count differently for HeaderV3 (from shard info + execution results).
process/block/metablockProposal.go Removes setting meta header tx count during proposal creation (no longer needed).
process/block/mbsSelectionSession.go Adds RemoveEmptyMiniBlocks() to keep session slices consistent and drop empty miniblocks.
process/block/mbsSelectionSession_test.go Adds unit test for RemoveEmptyMiniBlocks() behavior and internal consistency.
process/block/interface.go Adds RemoveEmptyMiniBlocks() to MiniBlocksSelectionSession interface.
go.sum Updates checksums for bumped mx-chain-core-go version.
go.mod Bumps github.com/multiversx/mx-chain-core-go dependency version.
factory/processing/blockProcessorCreator.go Removes an outdated TODO comment related to old-flow checks.
epochStart/bootstrap/startInEpochScheduled.go Short-circuits getRequiredHeaderByHash() for HeaderV3 to avoid unnecessary prev-header sync.
epochStart/bootstrap/startInEpochScheduled_test.go Adds test asserting the HeaderV3 short-circuit behavior.
consensus/broadcast/commonMessenger.go Removes an outdated TODO comment about packing miniblocks.

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

Comment thread process/block/metrics.go
Comment on lines +51 to +63
func getMetaHeaderTxCount(header data.MetaHeaderHandler) uint32 {
if !header.IsHeaderV3() {
return header.GetTxCount()
}

txsInExecutionResults, err := getTxCountExecutionResults(header)
if err != nil {
log.Debug("getMetaHeaderTxCount: failed to compute tx count from execution results", "error", err)
return 0
}

return getTxCount(header.GetShardInfoHandlers()) + txsInExecutionResults
}
@AdoAdoAdo AdoAdoAdo merged commit 4486bce into feat/testnet-fixes Jun 29, 2026
12 checks passed
@AdoAdoAdo AdoAdoAdo deleted the todos2 branch June 29, 2026 07:24
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