Skip to content

rpc: implement eth_capabilities method#20951

Draft
lupin012 wants to merge 6 commits into
mainfrom
lupin012/impl_eth_capabilities
Draft

rpc: implement eth_capabilities method#20951
lupin012 wants to merge 6 commits into
mainfrom
lupin012/impl_eth_capabilities

Conversation

@lupin012
Copy link
Copy Markdown
Contributor

@lupin012 lupin012 commented May 2, 2026

Implements eth_capabilities per ethereum/execution-apis#755.

Returns per-category data availability (state, tx, logs, receipts, blocks, stateproofs) with oldestBlock computed from the node's prune mode:

  • archive: all fields from block 0
  • full: state/logs/receipts from head-pruneDistance, tx/blocks from 0
  • minimal: all fields from head-pruneDistance
  • stateproofs: disabled unless --prune.include-commitment-history is set

Also caches the commitment-history-enabled flag (written once at startup) in BaseAPI and Generator to avoid a DB read per call, and migrates eth_receipts.go and eth_simulation.go to use the new cached helper.

Closes #19762

lupin012 and others added 6 commits May 2, 2026 10:07
Implements eth_capabilities per ethereum/execution-apis#755.

Returns per-category data availability (state, tx, logs, receipts, blocks,
stateproofs) with oldestBlock computed from the node's prune mode:
- archive: all fields from block 0
- full: state/logs/receipts from head-pruneDistance, tx/blocks from 0
- minimal: all fields from head-pruneDistance
- stateproofs: disabled unless --prune.include-commitment-history is set

Also caches the commitment-history-enabled flag (written once at startup)
in BaseAPI and Generator to avoid a DB read per call, and migrates
eth_receipts.go and eth_simulation.go to use the new cached helper.

Closes #19762

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the cached atomic.Pointer[bool] field from Generator and the
internal rawdb.ReadDBCommitmentHistoryEnabled call inside GetReceipts.
Callers with BaseAPI access use the existing atomic cache via
api.commitmentHistoryEnabled(tx); other callers read from the DB directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

eth: add eth_capabilities RPC method

1 participant