-
Notifications
You must be signed in to change notification settings - Fork 671
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
Feat: added use_latest_tip query parameter to the relevant v2 endpoints #2778
Conversation
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.
Hello. Seems like a good change but I just had a few nits about the comments, including for the tests to add some info about the logic of the test for people new to the file.
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.
Looks good.. can you just add comments for all tests you are adding?
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.
Thanks for all the new test comments.. I feel like I can understand it a lot better and hopefully will be the same for other readers as well!
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.
Thanks for the change! One small nit on the comments but LGTM.
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.
Overall this looks good to me @pavitthrap! I just had a couple of small but must-have testing asks. After that, I'll approve.
Review is blocked on #2774 |
…ying MARF for the unconfirmed state when executing rpc calls against the unconfirmed tip
This PR is looking a lot better. Thanks for adding all the thorough test coverage! Just a few minor nits to address, and then I'll approve. |
Codecov Report
@@ Coverage Diff @@
## develop #2778 +/- ##
===========================================
- Coverage 82.91% 82.79% -0.12%
===========================================
Files 235 235
Lines 189778 190437 +659
===========================================
+ Hits 157351 157672 +321
- Misses 32427 32765 +338
Continue to review full report at Codecov.
|
…tp response if the chain tip can't be loaded for an rpc request
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.
LGTM. I think the one thing that still stands out to me on this PR is that there's a race condition whereby the unconfirmed tip obtained from handle_load_stacks_chain_tip()
can get invalidated before getting passed into maybe_read_only_clarity_tx()
. However, the result of this race occurring isn't too bad -- the caller would simply receive a 404 response. I don't think this is a show-stopping problem; if it becomes a problem, the fix would be to simply load the unconfirmed chain tip hash again at the call for maybe_read_only_clarity_tx()
if it got invalidated. Can you add a TODO comment describing this on handle_load_stacks_chain_tip()
before merging (and open an issue for it)?
Description
Updated
tip
query parameter to the v2 RPC endpoints to accept the value of "latest".When set to "latest", the latest tip is used - this includes the unconfirmed state, if there is any unconfirmed state.
Type of Change
Are documentation updates required?
Added changes to the openapi yaml file
Testing information
Added tests mostly in
rpc.rs
.Added test in
integrations.rs
.