-
Notifications
You must be signed in to change notification settings - Fork 293
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
multi: Integrate mixpool and propagate p2p mixing messages #3208
Conversation
14218d5
to
a379d96
Compare
02673d2
to
fea21bd
Compare
4fda613
to
1fe24e6
Compare
internal/rpcserver/rpcwebsocket.go
Outdated
wsc.blake256HaserMu.Unlock() | ||
//hash := msg.Hash() | ||
|
||
err = wsc.rpcServer.cfg.SyncMgr.SubmitMixMessage(msg) |
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.
Shouldn't this be returning all of the accepted messages (because orphans can be added) and then relaying them all?
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.
Probably.. but the ordering issues aren't so relevant to rpc clients who can/will send them in the proper order. I don't think I've ever seen dcrd reject a KE from a rpc-mode wallet because the PR was unknown. I intentionally also increased the time it takes to expire PRs out of dcrd's mixpool, so they would not be removed from underneath the wallet.
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.
Leaving unresolved for now. It's not a big issue for now and we can add it later.
internal/rpcserver/rpcwebsocket.go
Outdated
|
||
wsc.rpcServer.cfg.ConnMgr.RelayMixMessages([]mixing.Message{msg}) | ||
|
||
wsc.rpcServer.ntfnMgr.NotifyMixMessage(msg) |
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.
Similarly, this should be notifying of all accepted mix messages in the order they were accepted (which is what is returned from mixpool.AcceptMessage
).
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.
Leaving unresolved for now. It's not a big issue for now and we can add it later.
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 to go. I did some light simnet testing of the RPC server after the updates:
$ ./ctl -l | grep -E 'sendrawmix|mixpair'
getmixpairrequests
sendrawmixmessage "command" "message"
$ ./ctl sendrawmixmessage
sendrawmixmessage command: wrong number of params (expected 2, received 1) (ErrNumParams)
Usage:
sendrawmixmessage "command" "message"
$ ./ctl sendrawmixmessage foo 0a
-8: Unrecognized mixing message wire command string "foo"
$ ./ctl getmixpairrequests
[]
Feel free to squash it down and we can get it merged. 🎉
This commit adds the mixing message pool to the server and listens for all peer-to-peer mixing messages broadcast on the network. If these messages are able to be accepted to the mixpool, they are relayed to other peers through the inventory system, and notified to RPC clients. This commit also also adds support for publishing and receiving mix messages over JSON-RPC for non-SPV wallet clients.
This commit adds the mixing message pool to the server and listens for all
peer-to-peer mixing messages broadcast on the network. If these messages are
able to be accepted to the mixpool, they are relayed to other peers through
the inventory system, and notified to RPC clients.
This commit also also adds support for publishing and receiving mix messages
over JSON-RPC for non-SPV wallet clients.
Requires #3207.
Requires #3082.