Skip to content
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

mixing: Add mixpool package. #3082

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

mixing: Add mixpool package. #3082

wants to merge 3 commits into from

Conversation

jrick
Copy link
Member

@jrick jrick commented Apr 5, 2023

The mixpool package implements a memory pool of recently observed mix messages. Similar to the transaction mempool, the mixpool allows these messages to be temporarily stored in memory to be relayed through the P2P network. It handles message acceptance, expiry, UTXO ownership proof checks, and that previously referenced messages have also been accepted to the mixpool.

The mixpool is designed with both full-node and wallet usage in mind, providing all of these same acceptance rules to mixing wallets with the exception of UTXO proof checks. For wallets, it also implements query functions for messages matching compatible pairings and messages belong to ongoing sessions.

Requires #3207.

@jrick jrick force-pushed the mixpool branch 4 times, most recently from 2d0d3c6 to 36b835e Compare April 5, 2023 15:48
@davecgh davecgh added this to the 1.9.0 milestone May 23, 2023
@jrick jrick changed the title mixing: introduce module mixing: add mixpool package Nov 7, 2023
@davecgh davecgh changed the title mixing: add mixpool package mixing: Add mixpool package. Nov 20, 2023
@jrick jrick force-pushed the mixpool branch 3 times, most recently from 5c698ec to 18f2b89 Compare March 20, 2024 13:50
@jrick jrick force-pushed the mixpool branch 4 times, most recently from cfa0c3d to c19fc08 Compare May 11, 2024 04:06
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think almost all of this should be an internal package, just like mempool. Since mixing is a development module for the time being, it's fine, but ultimately I really don't want to go back to having a huge surface of exposed code that really is specifically for the server itself.

I expect that some of it the code should be shared, akin to how blockchain/standalone does it, but pretty much everything in mixpool.go, mixpool_test.go, and log.go, at least, should be internal.

@jrick
Copy link
Member Author

jrick commented May 13, 2024

I think almost all of this should be an internal package, just like mempool. Since mixing is a development module for the time being, it's fine, but ultimately I really don't want to go back to having a huge surface of exposed code that really is specifically for the server itself.

I expect that some of it the code should be shared, akin to how blockchain/standalone does it, but pretty much everything in mixpool.go, mixpool_test.go, and log.go, at least, should be internal.

Not possible with current design.

$ pwd                  
/home/jrick/src/dcrwallet
$ find . -name '*.go' | xargs grep mixpool.Pool
./wallet/mixing.go:func (w *mixingWallet) Mixpool() *mixpool.Pool {
./wallet/wallet.go:	mixpool   *mixpool.Pool

This is because the mixclient package expects the wallet interface to provide an accessor function for the mixpool.

@jrick jrick force-pushed the mixpool branch 2 times, most recently from 8120f7b to 65c2a80 Compare May 13, 2024 18:37
The mixpool package implements a memory pool of recently observed mix
messages.  Similar to the transaction mempool, the mixpool allows these
messages to be temporarily stored in memory to be relayed through the P2P
network.  It handles message acceptance, expiry, UTXO ownership proof checks,
and that previously referenced messages have also been accepted to the
mixpool.

The mixpool is designed with both full-node and wallet usage in mind,
providing all of these same acceptance rules to mixing wallets with the
exception of UTXO proof checks.  For wallets, it also implements query
functions for messages matching compatible pairings and messages belong to
ongoing sessions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants