refactor: move config flags from FlashblocksState to OpPayloadBuilderCtx#478
Open
refactor: move config flags from FlashblocksState to OpPayloadBuilderCtx#478
Conversation
akundaz
approved these changes
Apr 24, 2026
…lderCtx `disable_state_root` and `enable_incremental_state_root` are read from `flashblocks_config` once per block and never mutated, yet they lived in `FlashblocksState` — which is cloned/forwarded on every flashblock. Move them into `OpPayloadBuilderCtx` alongside the other per-block config so they're set once and read directly at the call sites.
f735d32 to
eb5c661
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
disable_state_rootandenable_incremental_state_rootare read fromflashblocks_configonce per block and never mutated, yet they lived inFlashblocksStatewhich is cloned/forwarded vianext()on every flashblock.The remaining static fields on
FlashblocksState(target_flashblock_count,gas_per_batch,da_per_batch,da_footprint_per_batch) would need a slightly bigger change because their values aren't known until after the fallback block builds (derived from computed flashblock schedule). But a similar refactor could be possible.