feat: Add delegate filter param for account_tx RPC#6126
feat: Add delegate filter param for account_tx RPC#6126PeterChen13579 wants to merge 24 commits intoXRPLF:developfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6126 +/- ##
=========================================
- Coverage 82.0% 82.0% -0.0%
=========================================
Files 1010 1010
Lines 76304 76359 +55
Branches 7486 7479 -7
=========================================
+ Hits 62535 62579 +44
- Misses 13769 13780 +11
🚀 New features to boost your workflow:
|
|
A few suggestions to the new API:
|
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
There was a problem hiding this comment.
Pull request overview
Adds a new delegate request parameter to the account_tx RPC to filter results based on delegated transaction signing (delegator vs delegatee scenarios).
Changes:
- Introduces
DelegateFilter/DelegateTypeand parses the newdelegateJSON node inaccount_tx. - Propagates the filter into relational DB paging options and applies filtering while iterating transaction rows.
- Adds RPC unit tests validating correct filtering and malformed-parameter handling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/xrpld/rpc/handlers/account/AccountTx.cpp | Parses the new delegate param and forwards it into DB paging options. |
| src/xrpld/app/rdb/backend/detail/Node.cpp | Applies delegate-based filtering during accountTxPage iteration by comparing tx owner vs signer. |
| src/xrpld/app/misc/NetworkOPs.cpp | Updates AccountTxPageOptions aggregate init to include the new delegate field. |
| src/test/rpc/AccountTx_test.cpp | Adds delegation filtering tests and malformed-input coverage. |
| src/test/rpc/AccountObjects_test.cpp | Minor test adjustment (const + designated initializer) unrelated to account_tx filtering. |
| include/xrpl/rdb/RelationalDatabase.h | Adds delegate filter types and threads delegate through relevant option/result structs. |
| include/xrpl/protocol/jss.h | Adds new JSON keys used by the feature (delegate_filter, counterparty, etc.). |
| .github/scripts/levelization/results/ordering.txt | Updates module dependency ordering for the new xrpl.rdb > xrpl.json relationship. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
kuznetsss
left a comment
There was a problem hiding this comment.
LGTM, one minor comment
High Level Overview of Change
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).
Context of Change
New Request Parameter:
"delegate": {
"delegate_filter": "actor" or "authorizer",
"counter_party": "account_address"
}
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 where A acted on behalf of B).
User A (The signer) can query with delegate_filter: "authorizer" to find transactions they signed for others (like User B, since B authorized A to act on their behalf).
The counter_party field can be used in either case to filter by a specific valid address
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)