Skip to content

feat: calldata gas benchmark - how many resources fit per block#515

Open
jonaprieto wants to merge 1 commit into
mainfrom
feature/calldata-gas-benchmark
Open

feat: calldata gas benchmark - how many resources fit per block#515
jonaprieto wants to merge 1 commit into
mainfrom
feature/calldata-gas-benchmark

Conversation

@jonaprieto
Copy link
Copy Markdown
Contributor

@jonaprieto jonaprieto commented Apr 13, 2026

Adds test_print_calldata_gas_analysis to measure how many compliance units (CUs) and resources can fit in a block under current and proposed calldata gas pricing schemes.

Key results (aggregated proof mode, current EIP-2028 pricing):

  • 36M block: 162 CUs / 324 resources
  • 60M block (Fusaka): 271 CUs / 542 resources
  • Single tx under EIP-7825 cap: 74 CUs / 148 resources

Under worst-case Glamsterdam flat rate (64 gas/byte), capacity drops ~46% but still allows 147 CUs / 294 resources per 60M block. Pectra floor never binds for ARM txns (execution gas dominates by 6-20x).

Gas limits are file-level constants (BLOCK_GAS_LIMIT_CURRENT, BLOCK_GAS_LIMIT_FUSAKA, TX_GAS_CAP_EIP7825) for easy tweaking. The linear model (R^2 = 0.9954 agg, 1.0 reg) is validated with out-of-sample predictions.

Full results: https://gist.github.com/jonaprieto/cb1f13d487144a91c7c5244debb21cd7

Refs #459

@jonaprieto jonaprieto self-assigned this Apr 13, 2026
@jonaprieto jonaprieto added the enhancement New feature or request label Apr 13, 2026
@jonaprieto jonaprieto force-pushed the feature/calldata-gas-benchmark branch from 439a89d to 65daa5f Compare April 13, 2026 16:21
…labels

Restore test_print_calldata_gas_analysis from 7bea56e with improvements:

- Add resource counts to Table 3 (1 CU = 2 resources, using
  Compliance._RESOURCES_PER_COMPLIANCE_UNIT)
- Parametrize gas limits in _logMaxCUsTable (dynamic array instead
  of hardcoded 36M/60M)
- Replace cryptic scheme labels (4/16, 10/40, etc.) with descriptive
  names: Current(EIP-2028), PectraFloor(EIP-7623),
  Glamsterdam(EIP-7976), FlatRate(EIP-7976-alt)
- Add plain-English captions to all tables explaining what each
  measures
- Add pricing scheme reference and Fusaka context (EIP-7935 60M
  block limit, EIP-7825 per-tx gas cap) to notes

Refs #459
@jonaprieto jonaprieto force-pushed the feature/calldata-gas-benchmark branch from 65daa5f to 3578d0d Compare April 14, 2026 02:49
@jonaprieto jonaprieto changed the title feat: restore calldata gas benchmark with resource counts feat: calldata gas benchmark - how many resources fit per block Apr 14, 2026
@jonaprieto jonaprieto added the documentation Improvements or additions to documentation label Apr 14, 2026
@jonaprieto jonaprieto requested a review from heueristik April 14, 2026 02:59
@jonaprieto jonaprieto marked this pull request as ready for review April 14, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant