fix: Disable transaction invariants#7409
Open
Tapanito wants to merge 3 commits into
Open
Conversation
hasInvalidAmount runs on the per-transaction invariant-checking path (ValidAmounts::finalize) and at preflight, walking every field of every modified entry. The previous implementation tried a dynamic_cast chain (STAmount, STObject, STArray) on each field, so every scalar non-amount field paid three failed RTTI casts. Dispatch on the serialized type tag via getSType() and a switch instead. The object-like tags all denote STObject subclasses (STLedgerEntry, STTx), so the downcast is sound; safeDowncast keeps a dynamic_cast validity assert in debug builds while compiling to static_cast in release.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7409 +/- ##
=========================================
- Coverage 82.3% 82.1% -0.3%
=========================================
Files 1011 1011
Lines 76913 76910 -3
Branches 8965 8967 +2
=========================================
- Hits 63335 63114 -221
- Misses 13569 13787 +218
Partials 9 9
🚀 New features to boost your workflow:
|
ximinez
approved these changes
Jun 5, 2026
Collaborator
ximinez
left a comment
There was a problem hiding this comment.
Good, clear explanation.
65c620a to
1105878
Compare
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.
This PR disables transaction invariants due to introduced performance regression.
The logic is commented out instead of reverting the invariant PR due to the fact that the invariant PR touches every single transaction.
A pull-request addressing the said regression can be found here: #7404
High Level Overview of Change
Context of Change
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)