Skip to content

refactor: extract post-seal side-effects into PostSealHook trait#518

Open
julio4 wants to merge 1 commit into
mainfrom
refactor/extract-post-seal-hooks
Open

refactor: extract post-seal side-effects into PostSealHook trait#518
julio4 wants to merge 1 commit into
mainfrom
refactor/extract-post-seal-hooks

Conversation

@julio4
Copy link
Copy Markdown
Member

@julio4 julio4 commented May 15, 2026

Move ws publication, p2p forwarding, engine propagation, and per-flashblock metrics out of the building loop behind a PostSealHook trait. Hooks are constructed once and dispatched after each sealed candidate (fallback + every flashblock).

build_next_flashblock no longer performs side-effects: it returns FlashblockBuildResult struct and the async loop handles dispatch.

Move WS publication, p2p forwarding, engine propagation, and per-flashblock
metrics out of the building loop and behind a PostSealHook trait. Hooks
are constructed once in OpPayloadBuilder::new() and dispatched after each
sealed candidate (fallback + every flashblock).

build_next_flashblock no longer performs side-effects: it returns a
FlashblockBuildResult struct and the async loop handles dispatch. The
side-effect call sites in the fallback path and the FB iteration are
collapsed to a single dispatch_post_seal call each.

p2p and engine forwarders are unified as ChannelHook(name, sender) since
they only differ in the failure log label.
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