You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is sequence diagram for flashblock building flow, rollup-boost, op-node and fallback sequencer interaction.
1
+
# Flashblock flow details
2
+
FCU w/ attr - engine_forkchoiceUpdated with payloadAttributes. This starts block building.
3
+
FCU w/o attr - engine_forkchoiceUpdated without payloadAttributes. This progresses the unsafe/safe/finalized head.
4
+
newPayload - engine_newPayload. This provides the execution client with new canonical block.
5
+
getPayload - engine_getPayload. Collects block building results. In flashblocks, this is only used to terminate block building
6
+
as flashblocks are assembled on rollup-boost side.
3
7
4
-
There is 2 separate cases, for regular block and for block with no-txpool flag. When building no-txpool block we are using only fallback EL to construct the block.
5
-
This is done to rely on canonical implementation for such block as they are not compute intensive.
6
-
## Regular block building flow
7
-
```mermaid
8
+
## build_payload Function Overview
9
+
This is the function that produces the block and contains all logic responsible for building the block and producing flashblocks
10
+
```pseudocode
11
+
function build_payload(build_arguments, best_payload_cell):
12
+
// 1. Set up the state for block building
13
+
apply_pre_execution_changes()
14
+
// === FALLBACK BLOCK CREATION ===
15
+
// Produces deposits only block
16
+
execute_sequencer_transactions()
17
+
// 2. Add builder transaction if we build block with txpool enabled (specified in FCU)
break // If the main cancel token is cancelled we must start a new block building job and all previous
98
+
// results are obsolete.
99
+
100
+
// 16. Publish flashblock and update state
101
+
publish_flashblock(flashblock_payload)
102
+
best_payload_cell.set(new_payload)
103
+
send_payload_to_engine(new_payload)
104
+
105
+
// 17. Update limits for next flashblock
106
+
increment_flashblock_index()
107
+
increase_gas_and_da_limits_for_next_flashblock()
108
+
mark_committed_transactions()
109
+
110
+
// === CLEANUP PHASE ===
111
+
112
+
// 18. Record final metrics and cleanup
113
+
record_flashblocks_metrics()
114
+
return success
115
+
```
116
+
117
+
### Timing Coordination
118
+
-**Timer Task**: Spawned async task that sends timing signals at regular intervals
119
+
-**First Offset**: Timeout after which we must send the flashblock. We calculate it so we send flashblocks at `current time % flashblock_time == 0`
120
+
-**Cancellation Tokens**: When we cancel the flashblock token we stop this flashblock building process and publish it.
121
+
122
+
### Caveats
123
+
If the system clock drifts too much we will print an error message and fallback to producing flashblocks with regular flashblock_time intervals, without adjusting anything.
124
+
125
+
## Block building flow
126
+
These are sequence diagrams for flashblock building flow, rollup-boost, op-node and fallback sequencer interaction.
127
+
128
+
There are 2 separate cases: for regular blocks and for blocks with the no-txpool flag. When building no-txpool blocks we are using only the fallback EL to construct the block.
129
+
This is done to rely on the canonical implementation for such blocks as they are not compute intensive.
8
130
131
+
### Regular block building flow
132
+

133
+
### No txpool block building flow
134
+

0 commit comments