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

fix(builder): only reset sleep future when it has elapsed #63

Merged

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Oct 28, 2024

Right now, when spawning the block builder task, we're spawning the sleep future inside the loop. This means that any of the two select! branches will re-set the sleep timer. This is particularly bad on the branch that receives txs: It means that if we constantly received txs in between the incoming transactions buffer, the first branch would never trigger, as it requires the sleep future to elapse, therefore never building a block. This would effectively DDoS the builder.

Fixes ENG-609

Right now, when spawning the block builder task, we're spawning the sleep future inside the loop. This means that any of the two `select!` branches will re-set the sleep timer. This is particularly bad on the branch that receives txs: It means that if we constantly received txs in between the incoming transactions buffer, the first branch would never trigger, as it requires the sleep future to elapse, therefore never building a block. This would effectively DDoS the builder.

Fixes ENG-609
Copy link
Member Author

Evalir commented Oct 28, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Evalir and the rest of your teammates on Graphite Graphite

@Evalir Evalir marked this pull request as draft October 28, 2024 12:26
@Evalir Evalir self-assigned this Oct 28, 2024
@Evalir Evalir marked this pull request as ready for review October 28, 2024 12:45
@Evalir Evalir requested review from prestwich and dylanlott and removed request for prestwich October 28, 2024 12:45
@Evalir Evalir merged commit c2d83b5 into main Oct 28, 2024
5 checks passed
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.

2 participants