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

Untangle CoinJoinManager #12615

Open
molnard opened this issue Mar 5, 2024 · 0 comments
Open

Untangle CoinJoinManager #12615

molnard opened this issue Mar 5, 2024 · 0 comments
Assignees
Milestone

Comments

@molnard
Copy link
Collaborator

molnard commented Mar 5, 2024

Preamble

Untangle CoinJoinManager and CoinJoinClient plus their relation to the so called Music Box.

TL;DR

This refactor aims to make CoinJoinManager (CJM) and CoinJoinClient (CJC) more readable especially clarifying the code path that describes the steps of wasabi-client going through to achieve a successful CJ. Starting from the complex decision if the wallet should even start coinjoining, coinselection, which round to register, until the end when the client made a successful CJ.

Details on Specification, Scope, and Features

Motivation

  • The code got very complex since 2.0 release, thus became error-prone to touch it.
  • Code parts and logic became fragmented. Hard to read the code.
  • Maintenance is hard but it is required because we have many minor/major issues with: coinselection, start/stop cj, when to stop mixing, when to start mixing, how to select coins, and how to select rounds.

Rationale

I start with organization, files and code parts are scattered everywhere. Then separate the logic of

  • Decision to mix or not.
  • Which coins to mix?
  • Which round to go?
  • Maybe more if I find logically separatable things during the organization.

This will also include the clarification of how the switches like stopwhenallmix or plebstop, etc will work.
Add tests for the separated parts. If I have more time then sort out notifications those are controlling the music box messages.

Backward Compatibility

It should not be affected.

Subtasks

  • Files and folders
    • Move the related files into a specific folder.
    • Move subclasses and records to separate files, and organize the existing code.
  • Separate logic into modules
    • Mix or not?
    • Coin selection.
    • Round selection.
  • Add tests for the modules.
  • Sort out the notifications used by the music box.

Related

@molnard molnard changed the title [WIP] Untangle CoinJoinManager Untangle CoinJoinManager Mar 6, 2024
@MaxHillebrand MaxHillebrand added this to the v2.0.7 milestone Mar 6, 2024
@molnard molnard self-assigned this Mar 13, 2024
@MaxHillebrand MaxHillebrand modified the milestones: v2.0.7, v2.0.8 Apr 1, 2024
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

No branches or pull requests

3 participants