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
IsWasabiCoinJoinLookingTx need to account for delta #12640
Conversation
@@ -160,7 +160,7 @@ public void BanDoubleSpenders(object? sender, Transaction tx) | |||
|
|||
private bool IsWasabiCoinJoinLookingTx(Transaction tx) => | |||
tx.RBF == false | |||
&& tx.Inputs.Count >= Config.MinInputCountByRound |
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.
Should maybe some check be added somewhere in code that MinInputCountByBlameRound
is not bigger than MinInputCountByRound
? It can be if human error is made in ~/.walletwasabi/backend/WabiSabiConfig.json
.
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.
I thought about it as well, we can do like this:
WabiSabiConfig:
- public int MinInputCountByBlameRound => Math.Max(1, (int)(MaxInputCountByRound * MinInputCountByBlameRoundMultiplier));
+ public int MinInputCountByBlameRound => Math.Min(MinInputCountByRound, Math.Max(1, (int)(MaxInputCountByRound * MinInputCountByBlameRoundMultiplier)));
Lucas if you are ok with this I will push this change as well 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.
That change doesn't solve the problem but hide it instead, and that's always wrong. The thing is that no software can do anything with wrong inputs, that's why we have to validate everything that comes from the user (external sources in general) as soon as possible, preferably in the border of the system. So, if the user makes a mistake and sets the multiplier to 80 instead of 0.8 the software has to fail immediately with an error "Multiplier out of range blh blah blah".
Update: we have never validated anything so, feel free to ignore and merge.
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.
I think backend should brutally fail at start if MinInputCountByBlameRoundMultiplier
is greater (or not smaller) than MinInputCountByRoundMultiplier
. But that's out of the scope of this PR.
We might have banned some inputs without any reason since the delta PR.