Skip to content

Minor updates to fee tracking logic in tx sets. - #5170

Merged
dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:fee_tracking
Mar 12, 2026
Merged

dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:fee_tracking

Conversation

@dmkozh

@dmkozh dmkozh commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Description

Minor updates to fee tracking logic in tx sets.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

@dmkozh
dmkozh marked this pull request as ready for review March 10, 2026 23:28
Copilot AI review requested due to automatic review settings March 10, 2026 23:28

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 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 through TxSetUtils::getInvalidTxListWithErrors() and trimInvalid().
  • 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.

Comment thread src/herder/TxSetFrame.cpp Resolved
Comment thread src/herder/HerderImpl.cpp Resolved

@marta-lokhova marta-lokhova 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.

small nit, LGTM otherwise!

Comment thread src/herder/TxSetFrame.cpp Resolved
@dmkozh
dmkozh added this pull request to the merge queue Mar 11, 2026
Merged via the queue into stellar:master with commit 39c3ec5 Mar 12, 2026
53 of 56 checks passed
@dmkozh
dmkozh deleted the fee_tracking branch March 12, 2026 00:28
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.

3 participants