refactor metablock reference checks to ensure budget not exceeded - #7957
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/recon-by-meta #7957 +/- ##
===================================================
Coverage 77.70% 77.71%
===================================================
Files 892 892
Lines 128984 129025 +41
===================================================
+ Hits 100232 100267 +35
- Misses 22204 22209 +5
- Partials 6548 6549 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors shard-block metablock reference handling to enforce the maximum referenced metaheaders budget, correctly revert gas for dropped pending incoming miniblocks, and ensure V3 metablock processing returns a contiguous “fully processed” prefix (trimming fully-processed metablocks that appear above a partial one).
Changes:
- Refined pending incoming miniblock appending to stop at reference budget / partial-header boundaries and revert gas for any dropped miniblocks.
- Adjusted V3 ordered-processed metablock gating to trim fully-processed metablocks above the first partially processed metablock.
- Improved V3-specific validation/consumption logic and added/updated targeted tests for the new behaviors.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| process/block/shardblockProposal.go | Enforces referenced metablock budget while appending pending miniblocks; trims fully-processed V3 metablocks above partial ones. |
| process/block/shardblockProposal_test.go | Updates existing V3 ordered-processing test and adds new tests for pending miniblock appending/budget behavior. |
| process/block/shardblock.go | Adjusts referenced metablock consumption rules for V3 headers (treat proposed miniblocks as consumed) and clarifies comments. |
| process/block/shardblock_test.go | Adds V3 tests for canonical metablock hash ordering and referenced metablock consumption behavior. |
| process/block/gasConsumption.go | Fixes pending incoming miniblock consumption to not drop the first non-fitting pending miniblock. |
| process/block/gasConsumption_test.go | Adds regression test ensuring the first non-fitting pending miniblock remains pending. |
| process/block/export_test.go | Exposes small helpers/wrappers for tests (header accessor + pending miniblock helpers). |
| node/node_test.go | Minor local refactor in test helper variable initialization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Reasoning behind the pull request
Proposed changes
Testing 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?