-
Notifications
You must be signed in to change notification settings - Fork 132
[group key addrs 6/7]: bug fixes and refactors #1658
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
base: main
Are you sure you want to change the base?
Conversation
To allow a sender to re-try sending a message easily, we return the same response for a message that uses the same proof and receiver key as if we saw that message for the first time. We can't actually check the content of the message, since it's encrypted, and might differ each time it is re-encrypted, even if the cleartext remains the same. Since with the address v2 scheme each outpoint can only have a single recipient, we can make the assumption that a message that claims the same outpoint and is for the same recipient also is the same message.
We'll want to use the same error being returned in all asset group related database interactions.
For V2 addresses we need to know certain information from the address when creating the final send fragment. Because we might be transporting a vPSBT over RPC boundaries between funding and finalizing, we need to also transport the address between those steps. The easiest way to do that is to encode the address into the virtual output directly.
We'll need to know the last block height we processed for any event based on the address version.
This was always a bit confusing and also unnecessarily complicated. We'll need to manually re-create the tapscript root given a sibling in the next commit, where we'll use similar code. This refactor shows that the root with no sibling can easily be transformed into the root with a sibling.
fbf18b2
to
d40b977
Compare
Pull Request Test Coverage Report for Build 16373392934Details
💛 - Coveralls |
// It's a different recipient, so someone is | ||
// attempting to re-use a proof for a different | ||
// recipient. | ||
return nil, proof.ErrTxMerkleProofExists |
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.
returned error type here doesn't make sense to me. I would expect an error type along the lines of: attempting to reuse outpoint for a different receiver.
@@ -174,3 +174,12 @@ WHERE addr_events.status >= @status_from | |||
AND COALESCE(@addr_taproot_key, addrs.taproot_output_key) = addrs.taproot_output_key | |||
AND addr_events.creation_time >= @created_after | |||
ORDER by addr_events.creation_time; | |||
|
|||
-- name: QueryLastEventHeightByAddrVersion :one |
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 think we should just call this QueryLastEventHeight
and the addr version could be thought of as an optional argument. But not a big deal.
// The exclusive start message ID, meaning messages with this ID or higher | ||
// will be included in the response. This allows the client to resume | ||
// receiving messages from a specific point without missing any. One of | ||
// start_message_id_exclusive, start_block_height_inclusive or |
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.
Would be good to add doc comment for bytes receiver_id = 1;
above also
Extracted some commits from #1587 as suggested.
Addressed comments on existing review in #1587 that were meant for these commits.