-
Notifications
You must be signed in to change notification settings - Fork 132
[group key addrs 5/6]: Add Pedersen unique script key type #1621
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
5687720
to
46d9159
Compare
Pull Request Test Coverage Report for Build 16141989592Details
💛 - Coveralls |
46d9159
to
e5fdf7e
Compare
Going to look into the test failures (I think the mock just needs some mutexes). |
555c711
to
6a85168
Compare
authmailbox/multi_subscription.go
Outdated
// Subscribe adds a new subscription for the specified client URL and receiver | ||
// key. It starts a new mailbox client if one does not already exist for the | ||
// given URL. The subscription will receive messages that match the provided | ||
// filter and will send them to the shared message queue. | ||
func (m *MultiSubscription) Subscribe(serverURL url.URL, | ||
receiverKey keychain.KeyDescriptor, filter MessageFilter) error { |
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.
Maybe this should be thread safe? I'm not sure how this might be used. But if it's going to be called from an RPC endpoint then it probably needs to be thread safe.
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.
Currently we only access this from a single Goroutine in the asset custodian. But doesn't hurt to make it thread safe, so I did that.
proof/send.go
Outdated
const ( | ||
// SendFragmentV0 is the first version of the send fragment. | ||
SendFragmentV0 SendFragmentVersion = 0 | ||
) |
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.
Might be useful to reserve 0
for "unspecified version". Useful for returning errors on version parsing.
Might also be useful to have a "latest version" var here.
d050a45
to
770baa6
Compare
I addressed all comments, should be ready for another round of review. |
770baa6
to
d029ca6
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.
LGTM 💃🏾
Because we'll use the address' script key as the bare/raw public key that will be tweaked for each individual output of an address v2 send, we'll need to be able to find addresses by that script key. We'll also make the script key unique for v2 addresses to avoid multiple records being returned here.
This introduces a workaround that gets us WHERE xxx IN (...) queries working with a little trick. See the comment in scripts/gen_sqlc_docker.sh for more information on how this works and why the workaround is needed.
This MultiSubscription helper struct allows us to subscribe to receive messages for multiple keys held by a receiving wallet but all consolidated into a single message channel.
We need to place these types in the proof package because the proof courier will need access to them. And because we already use the proof package from the address package, we can't place the new types there, as that would create a circular package dependency.
d029ca6
to
7436356
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.
Nice!
SendFragmentVersionUnknown SendFragmentVersion = 0 | ||
|
||
// SendFragmentV0 is the first version of the send fragment. | ||
SendFragmentV0 SendFragmentVersion = 1 |
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.
might be nice to call this SendFragmentV1
so that the enum value corresponds to the version in code, might be confusing otherwise
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.
Yeah, makes sense. I'll rename it in the follow-up PR.
More commits extracted from #1587 that contain the last (mostly) non-functional changes that can be merged independently before we're starting to change the address behavior.