Skip to content

feat(feynman): compute compression ratio on tx data #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 30, 2025

Conversation

Thegaram
Copy link

@Thegaram Thegaram commented Jun 27, 2025

Update rollup fee formula:

rollup_fee(tx) = penalty(tx) * size(encode_eip2718(tx)) * (
	exec_scalar * l1_base_fee + 
	blob_scalar * l1_blob_base_fee
)

penalty(tx) = compression_ratio(tx) < penalty_threshold ? penalty_value : 1

compression_ratio(tx) = size(tx.data) > 0 ? max(size(tx.data) / size(zstd(tx.data)), 1) : U256MAX   // !!

Note:

  1. Rollup fee is still multiplied by the full encoded transaction (EIP-2718, or RLP for legacy txs).
  2. The compression ratio is computed on tx.data (payload) only, ignoring other tx fields (signature, etc.)
  3. Transactions with no payload (i.e. simple ETH transfers) will not be penalized.

Copy link

codspeed-hq bot commented Jun 27, 2025

CodSpeed Performance Report

Merging #261 will not alter performance

Comparing feat-compute-compression-ratio-on-tx-data (d75bbba) with scroll (77da60f)

Summary

✅ 77 untouched benchmarks

@Thegaram Thegaram marked this pull request as ready for review June 29, 2025 16:41
Copy link
Collaborator

@greged93 greged93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@lispc lispc merged commit b2377df into scroll Jun 30, 2025
46 checks passed
@lispc lispc deleted the feat-compute-compression-ratio-on-tx-data branch June 30, 2025 07:34
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge review - all looks good.

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.

6 participants