-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
updates to book_changes RPC command #5096
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5096 +/- ##
=========================================
+ Coverage 76.1% 76.2% +0.1%
=========================================
Files 760 760
Lines 61548 61550 +2
Branches 8160 8124 -36
=========================================
+ Hits 46834 46884 +50
+ Misses 14714 14666 -48
|
…commit removes the includes for protocol, json_reader and json_writer files
@godexsoft you might want to test this branch with clio. |
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.
I love that it gets rid of getLedgerByContext
call in a USER context, also the newly added unit tests seem to bump test coverage overall. Nice work !
@Bronek thanks for the quick review! What do you mean by USER context? I feel the The |
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.
I don't see anything that could impact Clio.
My only concern is whether the new code still does the same error handling as the old did.
|
||
if (std::holds_alternative<Json::Value>(res)) | ||
return std::get<Json::Value>(res); | ||
Json::Value result = RPC::lookupLedger(ledger, context); |
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.
- Does this change still yield the same error from checking ledger_index etc.?
- Can we do the same in
LedgerRequest.cpp
and eliminate getLedgerByContext() entirely?
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.
- @godexsoft the
ledger_index
handling (and errors) will be the same as in almost every other command, since the vast majority of commands uselookupLedger
. However, since with this change, the ledger won't be requested from other nodes, if a ledger which is not in the local cache is requested, this method will fail withledgerNotFound
error (just like other methods do in such situation) - No; the ADMIN method
ledger_request
which, with this PR, will be the only method usinggetLedgerByContext()
, and it needs to rely on this function in order to download the ledger from other nodes.
USER methods are accessible to users, ADMIN methods are accessible to admins only (i.e. they require a password and are bound to specific ip/port). The purpose of
Nope, it should not be removed. There is a reason why we need to be able to download ledgers from other nodes, and why we need to have an ADMIN method for this action. |
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.
@ckeshava please also update API-CHANGELOG.md for release 2.3 . You need to add section for release 2.3 and list the changes in behaviour of book_changes
(basically making it like all other methods, but also will now return ledgerNotFound
if the ledger is very old). I suggest asking @mDuo13 for help.
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.
Suggested a rewording to the changelog for consistency. I also think it's ok to merge as-is and improve the docs later on (which is easy to do).
Co-authored-by: Elliot Lee <github.public@intelliot.com>
High Level Overview of Change
Updates to the
book_changes
RPC command.Pending clarification, I believe this PR also fixes #5033 and #5036 (improves the latency of the command)
Context of Change
current, closed, validated
) as inputs toledger_index
parameter in the RPC command.validated: true/false
in the RPC outputType of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)