-
Notifications
You must be signed in to change notification settings - Fork 498
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
Add SuggestedMaxAmount #7748
Add SuggestedMaxAmount #7748
Conversation
Backend logic ACK. |
var txParams = new MultipartyTransactionParameters( | ||
roundParameters.FeeRate, | ||
roundParameters.CoordinationFeeRate, | ||
allowedAmounts, |
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.
Is allowedAmounts
supposed to be twice here?
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.
Yes we allow the same value on input and on output side as well.
|
||
// Check if after taking the suggestion into account, the situation worsen? | ||
filteredCoins = missingCoinsWithOriginal < missingCoinsWithSuggested | ||
? throw new InvalidOperationException("Skipping the round for more optimal mixing, waiting for one with bigger suggested amount.") |
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.
? throw new InvalidOperationException("Skipping the round for more optimal mixing, waiting for one with bigger suggested amount.") | |
? throw new InvalidOperationException("Skipping the round for more optimal mixing, waiting for one with bigger suggested input value.") |
Round r = new(roundParams); | ||
Rounds.Add(r); | ||
} | ||
} | ||
|
||
internal static Money GetMaxSuggestedAmount(int roundCounter) | ||
{ | ||
Money baseAmount = Money.Coins(0.1m); |
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.
Maybe smaller? Not sure.
Money baseAmount = Money.Coins(0.1m); | |
Money baseAmount = Money.Coins(0.01m); |
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.
Added to WabiSabiConfig as a parameter. the current default is 0.1 still
Before I continue with this, I need to know if it is necessary to add MaxSuggestedAmount while we already have a MaxInput amount in roundparameters. Here is the concept: If we never gonna register bigger coin that the suggested then this is much simpler. @nopara73 @lontivero |
We will. It's just a "suggestion". |
@nopara73 @lontivero @MaxHillebrand this is ready, pls take a final look. I had to change a couple of things because of tests but the logic is still the same. |
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.
NACK until we go through the client logic carefully together. Good job btw.
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.
ACK
Backend
(1) If the round goes to conn confirmation, Arena will open another round to have at least one round in input reg. That round will be created with the upcoming MaxSuggestedAmount value. This will make sure that we keep changing the counter. THIS is what I do now.
(2) The other option can be that we increase the counter after a round was successful. In this case, it is possible to have more rounds created with the same counter.
Client
How should the client handle the value here?
https://github.com/molnard/WalletWasabi/blob/master/WalletWasabi/WabiSabi/Client/CoinJoinClient.cs#L119
Current solution: apply the filtering by using the maxSuggestedAmount and if the number of coins drops below the target number of coins - so we will have a worse solution than before, then do not take part in the round and wait for a bigger maxSuggestedAmount.