Skip to content

fix: don't build flashblocks with more gas than block gas limit #567

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

Merged
merged 3 commits into from
Apr 25, 2025

Conversation

danyalprout
Copy link
Collaborator

📝 Summary

Currently it's possible for the builder to make more Flashblocks than intended during a block (likely due to delays). If more flashblocks are made than desired (e.g. 11 flashblocks for a 2s block w/ 200ms Flashblocks), the 11th flashblock will have a gas limit that is over the blocks gas limit and will cause invalid blocks on the sequencer.

💡 Motivation and Context

If the builder produces a full block that uses more gas than the gas limit, the local EL client will treat it as invalid.


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@@ -512,7 +526,7 @@ where
&mut info,
&mut db,
best_txs,
total_gas_per_batch,
total_gas_per_batch.min(ctx.block_gas_limit()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This technically isn't necessary given we skip building the flashblock if it's out of the expected bounds. However this seems like a sensible check to keep IMO

@danyalprout
Copy link
Collaborator Author

@avalonche would it be possible to run the CI please 🙏

@ferranbt ferranbt merged commit 6bcd1c9 into flashbots:develop Apr 25, 2025
4 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.

3 participants