Skip to content

ws proxy: brotli compress each message from upstream before sending downstream#309

Merged
avalonche merged 4 commits intoflashbots:mainfrom
haardikk21:brotli-compression-on-proxy
Jun 9, 2025
Merged

ws proxy: brotli compress each message from upstream before sending downstream#309
avalonche merged 4 commits intoflashbots:mainfrom
haardikk21:brotli-compression-on-proxy

Conversation

@haardikk21
Copy link
Copy Markdown
Contributor

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.

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rollup-boost ⬜️ Ignored (Inspect) Visit Preview Jun 9, 2025 2:56pm

@ferranbt
Copy link
Copy Markdown
Contributor

ferranbt commented Jun 9, 2025

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.

@haardikk21
Copy link
Copy Markdown
Contributor Author

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.

done

@ferranbt
Copy link
Copy Markdown
Contributor

ferranbt commented Jun 9, 2025

Do you see a need to do this on Rollup-boost <> builder side?

@ferranbt ferranbt self-requested a review June 9, 2025 14:58
@haardikk21
Copy link
Copy Markdown
Contributor Author

Do you see a need to do this on Rollup-boost <> builder side?

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.

@haardikk21
Copy link
Copy Markdown
Contributor Author

Can we rerun the test? Seems like it got unlucky with its port selection?

@avalonche avalonche merged commit 68f9028 into flashbots:main Jun 9, 2025
7 checks passed
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
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.

4 participants