Skip to content

wip: fast-forward buffered streaming + async task cancellation safety + lock free state#468

Draft
0xOsiris wants to merge 3 commits into
mainfrom
fix/flashblocks-coordinator
Draft

wip: fast-forward buffered streaming + async task cancellation safety + lock free state#468
0xOsiris wants to merge 3 commits into
mainfrom
fix/flashblocks-coordinator

Conversation

@0xOsiris

@0xOsiris 0xOsiris commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Reworks the flashblock execution pipeline to use per-epoch async processors and broadcast-driven notifications, which can change ordering/cancellation semantics and impact pending-block/payload propagation under load.

Overview
Refactors flashblock execution from a single, coordinator-owned state machine into an epoch-scoped processing model: run_flashblock_processor now detects payload_id boundaries, spawns a PendingPayloadProcessor per epoch, and cancels the previous epoch by dropping its broadcast sender.

Adds a new processor module that centralizes pending-block mutations and payload event broadcasting via PendingBlockNotification, and updates the coordinator’s local-payload publish path to notify this processor after P2P broadcast.

Updates the builder APIs (BlockBuilderExt) and executors to support new plumbing (new trait hooks, committed-state construction helper), and adjusts benchmarks/dependencies (adds tokio-stream and op-alloy-rpc-types-engine) to drive the new stream-based processor path.

Written by Cursor Bugbot for commit dad6f1f. Configure here.

@0xOsiris 0xOsiris changed the title chore: wip wip: skip-ahead buffered streaming + async task cancellation safety Mar 24, 2026
@0xOsiris 0xOsiris marked this pull request as ready for review March 24, 2026 19:46
@0xOsiris 0xOsiris changed the title wip: skip-ahead buffered streaming + async task cancellation safety wip: fast-forward buffered streaming + async task cancellation safety + lock free state Mar 24, 2026
@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Compared on the same runner in the same workflow run.

group                                                                        base
-----                                                                        ----
launch_flashblock_sequence_eth_transfers/stream/4fb_x_125tx                  1.00     30.6±0.42ms        ? ?/sec
launch_flashblock_sequence_eth_transfers/stream/4fb_x_250tx                  1.00     58.1±0.32ms        ? ?/sec
launch_flashblock_sequence_eth_transfers/stream/4fb_x_50tx                   1.00     12.9±0.65ms        ? ?/sec
launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_125tx         1.00     37.3±0.68ms        ? ?/sec
launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_250tx         1.00     72.1±0.94ms        ? ?/sec
launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_50tx          1.00     16.3±0.49ms        ? ?/sec
launch_flashblock_sequence_fib/stream/4fb_x_125tx                            1.00     28.2±0.24ms        ? ?/sec
launch_flashblock_sequence_fib/stream/4fb_x_250tx                            1.00     53.9±0.73ms        ? ?/sec
launch_flashblock_sequence_fib/stream/4fb_x_50tx                             1.00     12.5±0.35ms        ? ?/sec
launch_flashblock_sequence_fib_with_bal/stream/4fb_x_125tx                   1.00     34.9±0.24ms        ? ?/sec
launch_flashblock_sequence_fib_with_bal/stream/4fb_x_250tx                   1.00     67.0±0.96ms        ? ?/sec
launch_flashblock_sequence_fib_with_bal/stream/4fb_x_50tx                    1.00     15.4±0.19ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_10tx             1.00    137.3±0.34ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_12tx             1.00    164.3±0.47ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_5tx              1.00     69.0±0.17ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_10tx    1.00    141.1±1.86ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_12tx    1.00    167.9±0.85ms        ? ?/sec
launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_5tx     1.00     72.1±0.87ms        ? ?/sec
process_flashblock_eth_transfers/txs/1000                                    1.00     48.1±0.31ms        ? ?/sec
process_flashblock_eth_transfers/txs/50                                      1.00      3.0±0.04ms        ? ?/sec
process_flashblock_eth_transfers/txs/500                                     1.00     25.3±2.79ms        ? ?/sec
process_flashblock_eth_transfers_with_bal/txs/1000                           1.00     78.9±1.47ms        ? ?/sec
process_flashblock_eth_transfers_with_bal/txs/50                             1.00      3.7±0.06ms        ? ?/sec
process_flashblock_eth_transfers_with_bal/txs/500                            1.00     33.0±1.02ms        ? ?/sec
process_flashblock_fib/txs/1000                                              1.00     47.0±0.17ms        ? ?/sec
process_flashblock_fib/txs/50                                                1.00      2.5±0.02ms        ? ?/sec
process_flashblock_fib/txs/500                                               1.00     23.6±0.11ms        ? ?/sec
process_flashblock_fib_with_bal/txs/1000                                     1.00     66.4±1.09ms        ? ?/sec
process_flashblock_fib_with_bal/txs/50                                       1.00      3.6±0.06ms        ? ?/sec
process_flashblock_fib_with_bal/txs/500                                      1.00     31.8±1.52ms        ? ?/sec
process_flashblock_world_id_like_bn254/txs/10                                1.00     34.3±0.55ms        ? ?/sec
process_flashblock_world_id_like_bn254/txs/25                                1.00     84.9±0.31ms        ? ?/sec
process_flashblock_world_id_like_bn254/txs/50                                1.00    169.4±0.31ms        ? ?/sec
process_flashblock_world_id_like_bn254_with_bal/txs/10                       1.00     35.1±0.39ms        ? ?/sec
process_flashblock_world_id_like_bn254_with_bal/txs/25                       1.00     86.4±0.23ms        ? ?/sec
process_flashblock_world_id_like_bn254_with_bal/txs/50                       1.00    172.1±0.83ms        ? ?/sec

Threshold: 10% regression triggers failure

@0xOsiris 0xOsiris marked this pull request as draft March 24, 2026 20:44
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.

1 participant