L2 Node: Observer assembles IC blocks
What
With instant confirmations enabled, Observer nodes now use their accumulated transactions to assemble the block instead of performing a full application of the incoming blueprint.
For a bit of context, current flow for observer incremental execution is the following:
- Receive next timestamp
- Update EVM context informations for future execution => Single transaction request is no longer a Noop
- Receive inclusion preconfirmation
- Execute transaction, write in durable storage, share result
- Receive blueprint
- Wipe accumulated state
- Apply blueprint
What it should become with this MR:
- Receive next timestamp
- Update EVM context informations for future execution => Single transaction request is no longer a Noop
- EVM context checks for potential sequencer upgrades
- Receive inclusion preconfirmation
- Execute transaction and share result
- Receive blueprint
-
Wipe accumulated stateKeep state -
Apply blueprintAssemble with accumulated state - If diverge then perform Apply blueprint
Why
We're currently hindered by 2 major bottleneck w.r.t. block production and application:
- Sequencer emits inclusion preconfirmations, but does not execute them incrementally => Large worker lock at the time of producing the block
- Observer executes all the inclusion preconfirmations incrementally, but re-executes them when receiving blueprint => Duplicates lock number 1
Here we want to get rid of number 2.
How
-
724cb91e => Layer interacting with
assemble_blockkernel entrypoint. -
4418ed73 => Factorize sequencer upgrade logic and run it inside the
Next_block_inforequest. -
1b72e2d2 => Reuse the existing logic of
apply_blueprint, AFAIU it already contains everything that needs to be done after callingassemble_block. Important : This statement needs to be reviewed (happy to peer-review this). -
f3586706 =>
future_block_stateno longer holds its own version of the state, we use the global session for this as we're now consuming it - 17dfafc3 => Broadcast Sequencer application resulting block hash
- ecb74c70 => Share block hash through blueprint follower
-
2be95e62 => Divergence logic inside
apply_blueprint_store_unsafe
⚠️ Disclaimer
This MR requires:
- !20138 (merged) to fix divergence issues between applied blocks and assembled blocks
- !20157 (merged) to allow applied blocks after assembled blocks
assemble_block was not tested e2e before this, and we discovered a few semantic issues in the kernel entrypoint.
Edited by plissi