Skip to content

Conversation

SozinM
Copy link
Collaborator

@SozinM SozinM commented Jun 20, 2025

📝 Summary

Now control loop is issuing flashblock level cancel tokens that we use to cancel execute_best_transaction when it's time to create new flashblock

This is critical fix
It fixes the bug with first flashblocks sending timing (if there no txs in the network it would be fired almost immediately)

  • Default mode for flashblock production called dynamic. In short we use system time to determine how much time we have left to build a block and adjusting number of flashblocks based on this, to make sure we send them at steady rate.
  • If you want to fallback to previous behavior (when we don't account for time) you could use --flashblock.fixed
  • We have added new flag flashblocks.leeway-time :
    1. In default mode (dynamic flashblocks) this time would be deducted from total calculated time, to account for some timings that are outside of calculation (state root calculation time, time to create base flashblock, system time skew). To put it shorty whole process would end early by leeway-time .
    2. In fixed mode this time would be deducated from first flashblock send timer, so if we set it to 100 -> first flashblocks would be sent after 100ms instead of 200ms (anything more than flashblock time will result in first flashblock being sent instantly).

Because we fixed bug with first flashblock time flow in generally became a little bit more brittle (because previously we were running equivalent to fixed mode with 200ms leeway-time )

💡 Motivation and Context


✅ I have completed the following steps:

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

@SozinM SozinM force-pushed the msozin/fix-flashblocks-cutoff-time branch from 42a6122 to 0b1aa83 Compare June 25, 2025 10:37
Add control flow with child cancel tokens, that control flashblock duration
@SozinM SozinM force-pushed the msozin/fix-flashblocks-cutoff-time branch from 5d5c9be to 349fce4 Compare June 26, 2025 09:50
static_files_path: None,
};

let db = DatabaseArgs {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not love that we are doing this, still not sure whether we know why this is working with Reth and not with op-rbuilder. Whether this is something we do different or they do different and we want to do it as well.

@SozinM SozinM merged commit 2ecd976 into main Jun 27, 2025
2 checks passed
@SozinM SozinM deleted the msozin/fix-flashblocks-cutoff-time branch June 27, 2025 12:02
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