-
Notifications
You must be signed in to change notification settings - Fork 133
price oracle: add intent, optional peer_id and metadata to QueryAssetRates
RPC
#1677
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
Pull Request Test Coverage Report for Build 17107029065Details
💛 - Coveralls |
cacf233
to
babbbfa
Compare
I think change log changes for this PR have been merged already: #1679 (comment) |
@guggero the combination of the |
babbbfa
to
da60f26
Compare
Added an end-to-end test that verifies all calls, taking out of draft. |
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 🙌
@ffranr: review reminder |
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.
Went through this in detail, LGTM. 👍
To align the interface method names more with the actual RPC calls, we replace the terms ask and bid with sale, purchase respectively.
This commit adds three new fields to the price oracle's QueryAssetRates RPC call: The intent behind the call, the peer at the opposite side of the transaction and user-defined metadata. To understand the role of those fields and how they can help the price oracle to decide what price rate to return, we also add a sequence diagram with the full price oracle interaction to the RFQ document.
This commit adds the price oracle metadata field to the buy and sell request messages that are sent over the p2p network between participants. We'll actually hook up things to populate the value in a later commit.
This informs the price oracle about the intent and other context behind a call to its QueryAssetRate RPC method.
To improve privacy when using a public or untrusted third-party price oracle, we no longer send a price hint by default. We also make sharing the peer's identity public key with the price oracle opt-in.
da60f26
to
3294fc1
Compare
Rebased. |
Fixes #1159 (replaces #1161).
cc @lukegao209 and @bitcoin-coder-bob, does this look like what you had in mind?
The metadata field can be used to send any JSON or other custom data (e.g. user information or authentication data) to the price oracle for any payment or invoice creation request.
The two new diagrams now show how the price oracle is called and with what parameters:
https://github.com/lightninglabs/taproot-assets/blob/cacf2339ff448bd04b7fdde4dcb713d196a75d4a/docs/rfq-and-decimal-display.md#price-oracle-interaction
See this to get an explanation for the intent values:
taproot-assets/taprpc/priceoraclerpc/price_oracle.proto
Line 31 in cacf233