Skip to content

execution: implement EIP-7981 - Access List Data Gas#20631

Open
Sahil-4555 wants to merge 8 commits intoerigontech:mainfrom
Sahil-4555:eip-7981-access-list-data-gas
Open

execution: implement EIP-7981 - Access List Data Gas#20631
Sahil-4555 wants to merge 8 commits intoerigontech:mainfrom
Sahil-4555:eip-7981-access-list-data-gas

Conversation

@Sahil-4555
Copy link
Copy Markdown
Contributor

@Sahil-4555 Sahil-4555 commented Apr 17, 2026

Implements EIP-7981 which prices access lists for their data footprint, preventing circumvention of the EIP-7623/7976 floor pricing. Activated with the Amsterdam fork. Builds on top of the EIP 7976 PR and refactors its floor gas logic to incorporate access list tokens.

EIP-7976 changes (refactor)

  • Moved the EIP-7976 floor gas calculation outside if dataLen > 0 so that access list tokens (EIP-7981) apply even when calldata is empty
  • Split the combined EIP-7623/7976 floor block into:
    • if IsEIP7623 && !IsEIP7976 — pre-Amsterdam floor (unchanged formula)
    • if IsEIP7976 — Amsterdam floor with access list tokens (new block)

Access list cost (intrinsic gas)

Per the spec, access_list_cost now includes a data component:

  • Per address: 20 × 64 = 1280 gas (on top of base 2400)
  • Per storage key: 32 × 64 = 2048 gas (on top of base 1900)

Floor gas (access list tokens)

Access list entries contribute floor_tokens_in_access_list to the EIP-7976 floor calculation:

  • Per address: 20 × 4 = 80 tokens
  • Per storage key: 32 × 4 = 128 tokens
  • data_floor_gas_cost = 21000 + 16 × total_floor_data_tokens

Changes

  • params/protocol.go: Add TxTokenPerNonZeroByte = 4 constant
  • mdgas/intrinsic_gas.go: Refactor EIP-7976 floor, add EIP-7981 logic
  • mdgas/intrinsic_gas_test.go: Add tests for intrinsic gas, floor gas, and pre-Amsterdam no-effect behavior

Dependent: #20613
Closes: #20544

taratorio and others added 8 commits April 16, 2026 12:37
Raise the calldata floor cost from 10/40 (EIP-7623) to a uniform 64 gas
per byte, activated with the Amsterdam (Glamsterdam) fork. This reduces
the maximum possible block size by ~37% with minimal user impact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move to gitignored agentspecs/ directory instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Avoid calling p.isAmsterdam() twice per iteration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Avoid calling p.isAmsterdam() three times; use a single local variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yperbasis yperbasis added the Glamsterdam https://eips.ethereum.org/EIPS/eip-7773 label Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Glamsterdam https://eips.ethereum.org/EIPS/eip-7773

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bal-devnet-4] Implement EIP-7981: Increase Access List Cost

3 participants