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

IsWasabiCoinJoinLookingTx need to account for delta #12640

Merged
merged 1 commit into from Mar 9, 2024

Conversation

turbolay
Copy link
Collaborator

@turbolay turbolay commented Mar 8, 2024

We might have banned some inputs without any reason since the delta PR.

@@ -160,7 +160,7 @@ public void BanDoubleSpenders(object? sender, Transaction tx)

private bool IsWasabiCoinJoinLookingTx(Transaction tx) =>
tx.RBF == false
&& tx.Inputs.Count >= Config.MinInputCountByRound
Copy link
Collaborator

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.

Copy link
Collaborator Author

@turbolay turbolay Mar 8, 2024

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

Copy link
Collaborator

@lontivero lontivero Mar 8, 2024

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.

Copy link
Collaborator

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.

@lontivero lontivero merged commit ac8dce7 into zkSNACKs:master Mar 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants