ws proxy: brotli compress each message from upstream before sending downstream#309
Merged
avalonche merged 4 commits intoflashbots:mainfrom Jun 9, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Contributor
|
What do you think about adding a feature flag for the compression? I find it useful for debugging to see the raw data in JSON format. |
Contributor
Author
done |
danyalprout
reviewed
Jun 9, 2025
Contributor
|
Do you see a need to do this on Rollup-boost <> builder side? |
ferranbt
approved these changes
Jun 9, 2025
Contributor
Author
We can discuss it. Our main goal right now was to try to reduce egress size/costs and this is the main thing that contributes to it. It isn't an immediate concern to do this for the internal communication. |
Contributor
Author
|
Can we rerun the test? Seems like it got unlucky with its port selection? |
avalonche
approved these changes
Jun 9, 2025
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Feb 11, 2026
…compression-on-proxy ws proxy: brotli compress each message from upstream before sending downstream
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Feb 13, 2026
…compression-on-proxy ws proxy: brotli compress each message from upstream before sending downstream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Websocket Proxy serves many downstream clients, and the raw JSON payload of the Flashblock stream adds up pretty quickly. Estimated monthly egress is quite high.
This PR introduces Brotli compression on the proxy level, giving us an average improvement of ~5.5-6x on the payload size tested against Base Sepolia. On Base Mainnet where blocks are larger, the difference is likely going to be even larger.
Downstream clients (like Flashblocks aware preconf nodes) and direct WS consumers will need to implement decompression of the message before parsing it as JSON.