Repository navigation
Minor updates to fee tracking logic in tx sets. - #5170
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates fee-tracking during tx-set validation/trimming by sharing an accountFeeMap across calls, enabling cross-phase fee accumulation (classic + Soroban) for fee-source solvency checks.
Changes:
- Thread an
UnorderedMap<AccountID, int64_t>fee accumulator throughTxSetUtils::getInvalidTxListWithErrors()andtrimInvalid(). - Extend tx-set/phase validation to optionally reuse the fee accumulator across phases (protocol-gated in
ApplicableTxSetFrame). - Add a herder test covering cross-phase fee-bump interactions and update call sites to the new API.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/herder/test/HerderTests.cpp | Adds/adjusts tests for cross-phase fee bump behavior and updates callers for the new fee-map parameter. |
| src/herder/TxSetUtils.h | Updates helper signatures to accept an externally-managed accountFeeMap. |
| src/herder/TxSetUtils.cpp | Uses caller-provided accountFeeMap instead of a function-local map. |
| src/herder/TxSetFrame.h | Adds UnorderedMap include and extends phase validation API to accept a fee map. |
| src/herder/TxSetFrame.cpp | Reuses a fee map across phases in validation and tx-set construction/roundtrip validation. |
| src/herder/HerderImpl.cpp | Shares a fee map while pruning/banning invalid transactions from queues. |
marta-lokhova
approved these changes
Mar 11, 2026
marta-lokhova
left a comment
Contributor
There was a problem hiding this comment.
small nit, LGTM otherwise!
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.
Description
Minor updates to fee tracking logic in tx sets.
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)