-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support queryLatestState
in ViewService#auctions
#1035
Support queryLatestState
in ViewService#auctions
#1035
Conversation
5decab2
to
4a3ec0d
Compare
83fd279
to
6aa6869
Compare
6aa6869
to
b82e4c4
Compare
queryLatestState
in ViewService#auctions
queryLatestState
in ViewService#auctions
d86d87a
to
7585700
Compare
7585700
to
590f69c
Compare
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 think we should be making an additional RPC request here. The point of query_latest_state
was to make it easier for clients to get the latest state without making additional RPC calls. If include_inactive
in AuctionsRequest
is set to true, then AuctionsResponse
will include the latest auction state. cc @erwanor
@TalDerei That's right but afaict that's what this PR does? no? why not? it setup a view service implementation that offer an option for clients to request the latest auction state, which is what we want. This makes it easy to improve later on because every query service call is mediated by the user's view server from the get go |
This LGTM as far as the existing work done feel free to ping again for more review, @TalDerei re: The view service implementation contract is like this:
It's completely valid to ask for |
oops typo here, meant If |
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.
@erwanor thanks for the clarification, this makes sense! I re-reviewed the PR and the logic seems to be all there
eca90c4
into
jessepinho/auctions-rpc-include-inactive-web-980
* Store auction state in the database * Rename state -> seqNum * Add test re: upserting seqNum to be safe * Store the sequence number in the block processor * Support includeInactive * Refactor * Handle Dutch auction withdrawals in the block processor * Bump IDB version * Support `queryLatestState` in `ViewService#auctions` (#1035) * Support queryLatestState * Simplify * Remove unused method * Change method signature * Rework a bit * Remove unused import * Account for the fullnode returning a DutchAuction, not a DutchAuctionState * Fix type name check * UI for ending auctions (#1060) * Build UI to end an auction * Fix layout issue * Tweak symbols * Reload auctions after scheduling or ending an auction * Save auction metadata when ending an auction * Rename helper
🚨 Note that my local devnet does not actually respond when I call the auction's
QueryService#auction_state_by_id
RPC method. Not sure why, but it's still probably OK to merge this, since none of our code usesqueryLatestState
yet.AuctionsRequest
has an optionalqueryLatestState
boolean property that, when passed withtrue
, indicates that we should call out to a fullnode to get the auction's latest state. This PR adds support for that.In this PR
AuctionQuerier
class and add it to theRootQuerier
.queryLatestState
is passed, call out to theAuctionQuerier
. Take the returned state and add it to theViewService#auctions
response.Closes #980