Calldata Compression for Rollups: Gas Savings and Trade-offs
Calldata compression can cut L1 gas costs for rollups, but it adds CPU load and compatibility risks. Benchmark before enabling it on your sequencer.
24 Apr 2026, 20:20 UTC

The problem: L1 calldata dominates rollup gas costs
In a rollup, the sequencer batches transactions and posts the raw data to layer 1 as calldata. Calldata is the transaction data field sent to an L1 contract, and L1 gas pricing charges per byte of that data. When network demand is high, calldata can become the largest operating cost for a rollup, often exceeding the cost of proving the batch itself.
The practical takeaway is that calldata compression can reduce L1 gas consumption, but it is not a free optimization. Enabling it changes sequencer behavior and should be treated as a state-changing feature that requires benchmarking, compatibility checks, and a rollback path before mainnet use.
What compression actually changes
Calldata compression encodes one or more calldata blobs into a smaller byte array before the sequencer submits it to L1. The goal is to post fewer bytes while preserving enough structure for the L1 contract or verifier to reconstruct the original batch. This is distinct from zero-knowledge proof compression, though the two techniques are sometimes used together in the same rollup stack.
Compression does not change the security model of the rollup by itself. Security still depends on the L1 verifier accepting the posted data and the proof that attests to it. If the compressed payload is malformed, the verifier can reject the batch regardless of how small it is.
Worked example: configuration and what to measure
Rollup SDKs expose compression settings in different formats. The following is an illustrative configuration block, not a tested template:
# Example only; actual keys depend on your rollup SDK
calldata:
compression:
enabled: false
algorithm: "placeholder"
maxCompressionRatio: 8
Before enabling this on mainnet, measure the variables that matter for your batches. Use a table like this to record your own results:
| Metric | Uncompressed | Compressed (your measurement) |
|---|---|---|
| Calldata bytes per batch | <uncompressed-bytes> | <compressed-bytes> |
| Estimated L1 gas per batch | <gas-uncompressed> | <gas-compressed> |
| Sequencer CPU usage | baseline | <cpu-compressed> |
Replace every placeholder with values from a testnet deployment. Do not treat illustrative figures as proven savings.
Read-only calldata size check
You can inspect an existing L1 transaction to see how much calldata a batch currently uses. Run this from a terminal or CI job with read-only access to an Ethereum RPC endpoint:
curl -X POST <RPC_URL> \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["<L1_TX_HASH>"],"id":1}'
Where to run: any machine with network access to the RPC. Required permissions: read-only RPC access; no private keys or signer privileges are needed. Placeholders: replace <RPC_URL> with your endpoint and <L1_TX_HASH> with a confirmed L1 batch transaction hash. Expected checks: inspect the input field in the response; its hex length corresponds to calldata size. Compare this across batches to establish your baseline. Risks: this is a read-only call, so it does not change state, though public RPC endpoints may rate-limit repeated requests.
Trade-offs and limitations
- Sequencer CPU overhead. Compression runs before every batch is posted. On resource-constrained nodes, this can slow block production and increase operator costs.
- Legacy client incompatibility. Older rollup nodes or indexers may not recognize a compressed calldata format, which can cause desynchronization or failed syncs.
- Verifier rejection. If compression corrupts the payload or the L1 contract does not expect the encoding, the batch can be rejected and transactions fail.
- Proof generation time. Some compression schemes add a small amount of time to proving, which should be weighed against gas savings.
Verify before you enable it
- Review your rollup SDK release notes for calldata compression support, version assumptions, and the L1 contract version that expects the format.
- Run a local benchmark on a testnet: post batches with compression disabled, then enabled, and compare L1 gas receipts for each.
- Check block explorer data for L1 transaction cost before and after enabling the feature on a canonical batch to confirm real-world savings.
Rollback
Because enabling compression changes how the sequencer constructs L1 transactions, keep a rollback path ready: set enabled: false in the sequencer configuration, restart the sequencer, and confirm that new batches post uncompressed calldata. Monitor the block explorer to verify the format change has propagated.
Bottom line
Calldata compression is a lever for reducing L1 gas costs, not a default setting. Enable it only after your own benchmarks show net savings that outweigh CPU and compatibility costs, and only after every node in the validator set can process the compressed format.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.