Skip to content

Conversation

cody-wang-cb
Copy link
Contributor

@cody-wang-cb cody-wang-cb commented Aug 18, 2025

📝 Summary

On Base Mainnet we don't calculate state root per flashblock, we control this with a flag. It only calculates state root when doing historical sync as it's necessary.

For calculate state root, it does via rollup-boost and op-geth. flashbots/rollup-boost#381

💡 Motivation and Context


✅ I have completed the following steps:

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

ctx.metrics
.flashblock_byte_size_histogram
.record(flashblock_byte_size as f64);
if !is_doing_historical_sync {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

solves the issue that it'd stream out flashblocks while historical syncing

Copy link
Collaborator

Choose a reason for hiding this comment

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

How exactly does it happen? As i understand if we are doing historical syncing we will answer SYNCING to FCU with attributes and don't start block building job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC that's when you are doing EL sync, for us we are still doing CL sync so this happens somehow

Copy link
Contributor

Choose a reason for hiding this comment

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

does CL sync need to trigger a block building job? Can't you short circuit the block building much earlier during CL sync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why it triggers but payload builder does get used during CL historical sync
What do you mean by short circuit the block building?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Only FCU w/ attr will initiate job creating
Are you replaying ALL cl historical calls (including FCU w/ attr and getPayload's)?
I think you should filter them out when you perform CL sync

Copy link
Contributor

Choose a reason for hiding this comment

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

are there no websocket tests to check the block didn't compute state root when flashblocks_calculate_state_root = false? Also I don't think you need to specify this config here since it has a default

@@ -214,6 +219,12 @@ where

let chain_spec = self.client.chain_spec();
let timestamp = config.attributes.timestamp();
let is_doing_historical_sync = timestamp < current_timestamp;
let calculate_state_root = if is_doing_historical_sync {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to build blocks and calculate the state root during historical sync?

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