Skip to content

op-conductor: fixes flashblocks handler leaks#18506

Merged
zhwrd merged 1 commit intodevelopfrom
zhwrd/fix-op-conductor-leaks
Dec 10, 2025
Merged

op-conductor: fixes flashblocks handler leaks#18506
zhwrd merged 1 commit intodevelopfrom
zhwrd/fix-op-conductor-leaks

Conversation

@zhwrd
Copy link
Copy Markdown
Contributor

@zhwrd zhwrd commented Dec 4, 2025

Fixes a memory leak in op-conductor flashblocks websocket handler:

  • Broadcasts now drop and close slow clients when their send queue is full, preventing large buffered flashblock payloads from piling up.

Implemented some additional flashblock memory pressure and shutdown leakage (not an issue in production generally since the container will get killed, but included for completeness)

  • Hub is now protected with a mutex, waits for a stopped signal on shutdown, and the stop path drains clients safely without leaving goroutines blocked on unregister. The read pump now unregisters directly when the hub is already stopping, so stopping won’t strand clients or buffers.
  • Flashblocks handler Stop now waits for the hub to finish and guards the done-channel close. Also, the rollup-boost read loop idles when not leader to avoid needless allocations while a follower.

https://github.com/ethereum-optimism/k8s/issues/8053

@zhwrd zhwrd requested review from a team and mslipper December 4, 2025 21:53
@zhwrd zhwrd marked this pull request as draft December 4, 2025 21:53
Comment thread op-conductor/rpc/ws/flashblocks_handler.go
Comment thread op-conductor/rpc/ws/flashblocks_handler.go
@zhwrd zhwrd force-pushed the zhwrd/fix-op-conductor-leaks branch from a1e0126 to 0bdf87c Compare December 10, 2025 16:53
@zhwrd zhwrd force-pushed the zhwrd/fix-op-conductor-leaks branch from 0bdf87c to 6cb6d0f Compare December 10, 2025 18:23
@zhwrd zhwrd marked this pull request as ready for review December 10, 2025 19:52
Comment thread op-conductor/rpc/ws/flashblocks_handler.go
@zhwrd zhwrd added this pull request to the merge queue Dec 10, 2025
Merged via the queue into develop with commit cafdfb7 Dec 10, 2025
88 checks passed
@zhwrd zhwrd deleted the zhwrd/fix-op-conductor-leaks branch December 10, 2025 21: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.

2 participants