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

Add sanity check for round destroyer threshold #12585

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion WalletWasabi/WabiSabi/Backend/Rounds/Arena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ private async Task CreateRoundsAsync(CancellationToken cancellationToken)
x.Phase == Phase.InputRegistration
&& x is not BlameRound
&& !x.IsInputRegistrationEnded(x.Parameters.MaxInputCountByRound)
&& x.InputCount >= roundDestroyerInputCount).ToArray())
&& x.InputCount >= Math.Min(0.9 * x.Parameters.MaxInputCountByRound, roundDestroyerInputCount)).ToArray())
Copy link
Collaborator

@adamPetho adamPetho Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roundDestroyerInputCount has no use after this change and at LOC540 we will log false data.

How about this?

var roundDestroyerInputCount = 0.9 * Config.MaxInputCountByRound

Then, we don't complicate further this Where predicate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the x come from? :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, Config.MaxInputCountByRound is better.

Edited my prev message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the logging, we could create a function instead, I was tired, didn't see we where using it again for logging purposes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, Config.MaxInputCountByRound is better.

No, it has to be tested against the Round Parameter, not the Config.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to fix this while respecting that we want use the Round Parameter and not the Config
#12591

{
feeRate = (await Rpc.EstimateConservativeSmartFeeAsync((int)Config.ConfirmationTarget, cancellationToken).ConfigureAwait(false)).FeeRate;

Expand Down