-
Notifications
You must be signed in to change notification settings - Fork 1.6k
remove the type filter from "ledger" RPC command #4934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ximinez @HowardHinnant please review this PR at your convenience |
@ckeshava can you update your branch and resolve the conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i understand correctly, this is the type
that has been deprecated in Clio about a year ago. If that's correct then there should be no issue with Clio compatibility from this change.
EDIT: I should probably say that Clio will report a "deprecated" error when type
is passed while rippled
probably will not. But since it's now removed, this may be expected. If we want to have no discrepancy at all in the output IF type
is used then perhaps it should be adjusted in this PR. @mounikakun do we check for this in integration?
@godexsoft We do have integration tests for Also Clio do not return Clio request: {
"method": "ledger",
"params": [
{
"type": "ticket"
}
]
} Response: {
"result": {
"ledger_hash": "B93129538E2C211567FAC16702575CC278F288B9BEAB2FA8819E8142935256B4",
"ledger_index": 3007200,
"validated": True,
"ledger": {
"account_hash": "BD5DBDC8FAF4A66F8DD00FCC3311D6B7273690C58E219322E9E7482C25EA8AD1",
"close_flags": 0,
"close_time": 801266581,
"close_time_human": "2025-May-22 22:03:01.000000000 UTC",
"close_time_resolution": 10,
"close_time_iso": "2025-05-22T22:03:01Z",
"ledger_hash": "B93129538E2C211567FAC16702575CC278F288B9BEAB2FA8819E8142935256B4",
"parent_close_time": 801266580,
"parent_hash": "FE727AF6B6890F0D6BD62E95BB5786EE4BD6B90B641BC66B25A117C4E60F316D",
"total_coins": "99999926515219548",
"transaction_hash": "698B0C5B6CDB666D5B0FA2E480303AA8F53EC129D0D1963DA12EEB940D12CE6F",
"ledger_index": "3007200",
"closed": True
},
"status": "success"
},
"warnings": [
{
"id": 2004,
"message": "Some fields from your request are deprecated. Please check the documentation at https://xrpl.org/docs/references/http-websocket-apis/ and update your request. Field "type" is deprecated."
},
{
"id": 2001,
"message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include "ledger_index":"current" in your request"
},
{
"id": 2002,
"message": "This server may be out of date"
}
]
}
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4934 +/- ##
=======================================
Coverage 78.4% 78.4%
=======================================
Files 816 816
Lines 71709 71711 +2
Branches 8595 8576 -19
=======================================
+ Hits 56221 56249 +28
+ Misses 15488 15462 -26
🚀 New features to boost your workflow:
|
Hi @ckeshava , it would be great if you could:
Also , a warning is preferred over error for reasons of backwards compatibility with older |
8b472e1
to
e18f27f
Compare
Hello, I'm working on rebasing my branch. This PR is quite old, so I'll need some time to wrangle out the old commits. The Furthermore, I do not agree with the current behavior of the Clio server. Since Clio ignores the However, I'm happy to make the necessary changes to provide a warning in this PR. |
Re-opening the PR after rebasing with the latest. The existing tests have been modified to validate the warnings thrown in the response. |
@Bronek @mvadari @godexsoft please re-review this PR. I have made minor changes after the recent review. |
Hello! Gentle reminder: Is this PR acceptable? @Bronek |
…refactoring-1 * upstream/develop: (56 commits) Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) test: switch some unit tests to doctest (#5383) ...
…actoring-2 * ximinez/lending-refactoring-1: (57 commits) Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) ...
…actoring-3 * ximinez/lending-refactoring-2: (57 commits) Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) chore: Fix compilation error with clang-20 and cleanup (#5543) test: Remove circular jtx.h dependencies (#5544) Decouple CredentialHelpers from xrpld/app/tx (#5487) fix: crash when trace-logging in tests (#5529) ...
…actoring-4 * ximinez/lending-refactoring-3: (61 commits) fixup! Rename Transactor preflight functions Rename Transactor preflight functions fixup! Make preflight1 and preflight2 private static Transactor functions Make preflight1 and preflight2 private static Transactor functions Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) ...
…actoring-4 * ximinez/lending-refactoring-3: (61 commits) fixup! Rename Transactor preflight functions Rename Transactor preflight functions fixup! Make preflight1 and preflight2 private static Transactor functions Make preflight1 and preflight2 private static Transactor functions Fix formatting Remove `include(default)` from libxrpl profile (#5587) refactor: Change boost::shared_mutex to std::shared_mutex (#5576) Fix macos runner (#5585) Remove the type filter from "ledger" RPC command (#4934) refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567) test: Run unit tests regardless of 'Supported' amendment status (#5537) Retire Flow Cross amendment (#5562) chore: Update CI to use Conan 2 (#5556) fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513) chore: Add gcc-12 workaround (#5554) Add MPT related txns into issuer's account history (#5530) chore: Remove unused headers (#5526) fix: add allowTrustLineLocking flag for account_info (#5525) Downgrade required CMake version for Antithesis SDK (#5548) fix: Link with boost libraries explicitly (#5546) ... Co-authored-by: Bronek Kozicki <[email protected]>
High Level Overview of Change
This issue was reported on the Javascript client library: XRPLF/xrpl.js#2611
The
type
filter (Note: as of the latest version of rippled,type
parameter is deprecated) does not work as expected. This PR removes thetype
filter from theledger
command.Context of the bug
I have not investigated the full extent of this issue. I have reproduced the issue on this branch: https://github.com/XRPLF/rippled/compare/develop...ckeshava:rippled:failingTestCasesTypeFilter?expand=1
Note: The above branch has annotations about which portions of the codebase are responsible for the wrong behavior.
Both
ledger_data
andledger
commands must behave identically with respect to thetype
filter, but that is not the case. While the above branch demonstrates failing tests, I'd like to highlight two tests that work correctly:rippled/src/test/rpc/LedgerRPC_test.cpp
Line 2241 in 8a2f6be
This behavior occurs because of a specific combination of
expand
,accounts
andfull
parameters in theledger
command.Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
Public API: New feature (new methods and/or new fields)
Public API: Breaking change (in general, breaking changes should only impact the next api_version)
type
parameter can no longer be used with theledger
RPC commandlibxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)Peer protocol change (must be backward compatible or bump the peer protocol version)
No impact on performance of rippled