feat: Add delegate filter param's to account_tx RPC - #2827
Open
PeterChen13579 wants to merge 19 commits into
Open
feat: Add delegate filter param's to account_tx RPC#2827PeterChen13579 wants to merge 19 commits into
PeterChen13579 wants to merge 19 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
godexsoft
reviewed
Dec 2, 2025
godexsoft
reviewed
Dec 2, 2025
godexsoft
reviewed
Dec 2, 2025
Collaborator
Author
|
Will wait for Rippled PR to be merged first before merging this one 🫡 |
There was a problem hiding this comment.
Pull request overview
Adds delegation-aware filtering to the account_tx RPC so callers can request only transactions where the queried account participated via sfDelegate (either as the authorizer/owner or as the actor/signer), optionally constrained to a specific counterparty.
Changes:
- Introduces
delegaterequest parameter validation/parsing (delegate_filter+ optionalcounter_party) and threads it intoAccountTxHandler. - Implements
DelegateTransactionFilterto include/exclude transactions based onsfDelegatesemantics and annotates results withauthorizer/actorfor matched delegated txns. - Adds unit test coverage for parsing, validation, filtering behavior, and handler integration.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/rpc/RPCHelpersTests.cpp | Adds unit tests for parseDelegateType / parseDelegateFilter. |
| tests/unit/rpc/handlers/AccountTxTests.cpp | Adds parameter-validation and handler behavior tests for delegate filtering. |
| tests/unit/rpc/filters/impl/DelegateTransactionsFilterTests.cpp | New unit tests for the delegate transaction filter logic. |
| tests/unit/CMakeLists.txt | Registers the new filter test file in the unit test build. |
| tests/common/util/TestObject.hpp | Declares createDelegateBlob test helper. |
| tests/common/util/TestObject.cpp | Implements createDelegateBlob helper to produce delegated tx blobs. |
| tests/common/util/MockBackendTestFixture.hpp | Removes an unused include. |
| src/rpc/RPCHelpers.hpp | Declares delegate parsing helpers. |
| src/rpc/RPCHelpers.cpp | Implements delegate parsing helpers. |
| src/rpc/handlers/AccountTx.hpp | Extends handler input/spec to accept delegate and adds validator. |
| src/rpc/handlers/AccountTx.cpp | Applies delegate filtering in the account_tx loop and adds authorizer/actor output fields (non-binary path). |
| src/rpc/filters/TransactionFilter.hpp | Introduces a filter interface and FilterResult struct. |
| src/rpc/filters/impl/DelegateTransactionsFilter.hpp | Declares DelegateTransactionFilter. |
| src/rpc/filters/impl/DelegateTransactionsFilter.cpp | Implements delegation-based transaction matching. |
| src/rpc/common/Validators.hpp | Declares delegateValidator. |
| src/rpc/common/Validators.cpp | Implements delegate parameter validation (required delegate_filter, optional valid-account counter_party). |
| src/rpc/common/Types.hpp | Adds DelegateFilter request type. |
| src/rpc/CMakeLists.txt | Adds the new filter implementation to the rpc target sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 adds the ability to filter account_tx results based on transaction delegation. This is useful for scenarios where one account (the delegatee) signs and submits a transaction on behalf of another account (the delegator).
New Request Parameter:
Example: If User A submits a transaction to C on behalf of B:
User B (The account holder) can query with delegate_filter: "actor" to find transactions signed by others (like User A).
User A (The signer) can query with delegate_filter: "authorizer" to find transactions they signed for others (like User B).
The counter_party field can be used in either case to filter by a specific valid address