Skip to content

mixing: Allow more than mixing.MaxPeers in KE messages - #3824

Merged
davecgh merged 1 commit into
decred:masterfrom
jrick:max_mix_peers_peer_agreement
Oct 7, 2026
Merged

davecgh merged 1 commit into
decred:masterfrom
jrick:max_mix_peers_peer_agreement

Conversation

@jrick

@jrick jrick commented Oct 6, 2026

Copy link
Copy Markdown
Member

The 64 MaxPeers limit was introduced to reduce severe memory consumption, but it's later messages in the session (CT, SR, and DC especially) which use the most memory.

When more than 64 peers are chosen by mixclient in a compatible pairing, it would error during publishing of KE messages for exceeding the lower limit. This prevents the intended mixing.MaxPeers limiting from occurring later in Client.run() after peer agreement is reached.

This commit removes the limit check for KE messages from mixpool, and additionally adds a mixclient check that the initial KE messages before peer agreement all have no more than the larger wire.MaxMixPeers limit.

@davecgh davecgh added this to the 2.2.0 milestone Oct 7, 2026

@davecgh davecgh left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe the comment on MaxPeers needs to be updated now because it says and the maximum number of previous messages that may be referenced by mix messages which is no longer true given a KE can now reference up to 512, right?

The 64 MaxPeers limit was introduced to reduce severe memory consumption, but
it's later messages in the session (CT, SR, and DC especially) which use the
most memory.

When more than 64 peers are chosen by mixclient in a compatible pairing, it
would error during publishing of KE messages for exceeding the lower limit.
This prevents the intended mixing.MaxPeers limiting from occurring later in
Client.run() after peer agreement is reached.

This commit removes the limit check for KE messages from mixpool, and
additionally adds a mixclient check that the initial KE messages before peer
agreement all have no more than the larger wire.MaxMixPeers limit.
@jrick
jrick force-pushed the max_mix_peers_peer_agreement branch from e0207bd to cdcd4a9 Compare October 7, 2026 19:00

@davecgh davecgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving since this is necessary. Although I will note that we're ultimately going to want some additional limits put in place as discussed elsewhere.

@davecgh
davecgh merged commit 6b65e0d into decred:master Oct 7, 2026
32 checks passed
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.

2 participants