Fetch fees based on last chain exec header#7838
Conversation
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
There was a problem hiding this comment.
Pull request overview
This PR changes the source of accumulated epoch fees for V3 meta headers in getCurrentlyAccumulatedFees: instead of extracting them from the proposed header's embedded LastExecutionResult, they are now read from blockChain.GetLastExecutionResult() (the chain-level last execution result maintained by the async executor). Tests are updated to reflect the new source and to populate MetaExecutionResult.ExecutionResult where required by other paths.
Changes:
- In
getCurrentlyAccumulatedFees, switch the V3 path to read fees frommp.blockChain.GetLastExecutionResult(); on nil chain result, return(0, 0, nil)instead of an error. - Update
Test_getCurrentlyAccumulatedFeesto cover the new nil/zero-return behavior and the new fee source semantics; remove the obsolete "nil base execution result" test case. - Update
metablockProposal_test.gotest setups to seedBlockChainwith aMetaExecutionResultcontaining a populatedBaseMetaExecutionResult(with fee fields where expectations changed).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| process/block/metablock.go | Reads V3 last execution fees from the blockchain's last execution result instead of the proposed header; nil result yields zero fees. |
| process/block/metablock_test.go | Renames/rewrites V3 fee tests to drive BlockChain.GetLastExecutionResult; drops the now-unreachable "nil base execution result" case. |
| process/block/metablockProposal_test.go | Updates proposal/process tests to seed the chain's last execution result with nested BaseMetaExecutionResult and adjusts fee expectations to come from the chain rather than the header. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/testnet-fixes #7838 +/- ##
======================================================
- Coverage 77.57% 77.57% -0.01%
======================================================
Files 884 884
Lines 125210 125210
======================================================
- Hits 97135 97134 -1
- Misses 21622 21625 +3
+ Partials 6453 6451 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?