mixing: Create new sessions over incrementing runs #3343
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This simplifies the code significantly while simultaneously making mixpool acceptance checks stricter in ruruns after blame due to the session validation and PR inclusion rules that were only being performed during run 0.
This avoids an issue where peers who have been excluded in a later rerun continue to submit messages in the rerun. These messages were not being correctly rejected by mixpool, and could be improperly received by clients. Rejecting these messages would have required wallets to provide additional hints to the mixpool about which peers are still in the rerun, and this information would be unavailable to dcrd mixpools entirely.
Instead, a new run-0 session is formed with a subset of the original peers, and all of the existing run-0 validation would continue to be executed for the rerun. mixpools no longer understand the difference between reformed sessions and reruns, and will refuse to accept any non-run-0 message.
In the future, this may also be useful to observe new rerun sessions that other peers have tried to create that differ from our own, which will be useful first step in debugging why these sets differ.
This is technically a breaking change that will stop rerun mixes for older wallets who do not also create the same new sessions, but this only affects reruns after blame assignment and original run-0 sessions will continue to operate properly if all peers are honest and behaving.