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

sweepbatcher: set max batch size to 1000 sweeps #813

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

starius
Copy link
Collaborator

@starius starius commented Aug 26, 2024

This is needed to avoid non-standard batch transactions (larger than 400k wu). A non-cooperative input is 393 wu, so 1000 inputs are still under 400k wu.

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

// Wait for the batcher to be initialized.
<-batcher.initDone

const swapsNum = 2500
Copy link
Member

Choose a reason for hiding this comment

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

To reduce test runtime, would just 1001 work? Also the test seems to be logging excessively, so perhaps we could reduce that too. wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great idea! I changed the number of swaps to 1001. Disabling logging has negligible effect.

Copy link
Member

Choose a reason for hiding this comment

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

Disabling logging is helpful when running make unit locally, as it's easier to follow test logs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Disabled logging in the test.

@starius starius marked this pull request as ready for review August 26, 2024 16:37
This is needed to avoid non-standard batch transactions (larger than 400k wu).
A non-cooperative input is 393 wu, so 1000 inputs are still under 400k wu.
Copy link
Collaborator

@hieblmi hieblmi left a comment

Choose a reason for hiding this comment

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

LGTM 💾

// the batch, do not add another sweep to prevent the tx from becoming
// non-standard.
if len(b.sweeps) >= MaxSweepsPerBatch {
return false, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

does it make sense to log such an occurence?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added Info log message in cases when addSweep returns accept=false and err=nil in a separate commit "sweepbatcher: log the reason of acceptance failure".

Add Info log message in cases when addSweep returns accept=false and err=nil.
Copy link
Member

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

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

LGTM!

@starius starius merged commit 876ed40 into lightninglabs:master Aug 27, 2024
4 checks passed
@starius starius deleted the sweepbatcher-max-inputs branch August 27, 2024 13:03
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

Successfully merging this pull request may close these issues.

4 participants