TODOs part 2#7884
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
… not triggered if async enabled but there are still some checks in the old flow
…nder is exceeded, no tx is removed because the specific nonce is tracked.
…-chain-go into todos2 # Conflicts: # process/track/shardBlockTrack.go
BeniaminDrasovean
approved these changes
Jun 23, 2026
AdoAdoAdo
approved these changes
Jun 26, 2026
Contributor
There was a problem hiding this comment.
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()inTxsForBlockHandlerand uses it after waiting for missing data, to prevent lateReceivedTransactioncalls 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 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasoning behind the pull request
Proposed changes
// 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 mbsTesting procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?