Skip to content

Add eth_getBlockAccessListBy* methods#9643

Merged
matkt merged 9 commits intohyperledger:mainfrom
mirgee:bal-rpc-methods
Jan 23, 2026
Merged

Add eth_getBlockAccessListBy* methods#9643
matkt merged 9 commits intohyperledger:mainfrom
mirgee:bal-rpc-methods

Conversation

@mirgee
Copy link
Contributor

@mirgee mirgee commented Jan 16, 2026

Implements BAL-related JSON-RPC methods as defined by the API specs:

  • eth_getBlockAccessListByBlockHash - returns BAL by block hash
  • eth_getBlockAccessListByBlockNumber - returns BAL by block number

At this point it is not fully clear whether the response should contain BALs in RLP or JSON format, but likely it is to remain JSON. The change required to the current response format is removing the balHash field and returning only flattened blockAccessList.

The implementation currently requires BALs retained <= blocks retained.

Closes: #9615

@mirgee mirgee marked this pull request as ready for review January 18, 2026 16:37
.<JsonRpcResponse>map(
bal ->
new JsonRpcSuccessResponse(
requestId, BlockAccessListResult.fromBlockAccessList(bal)))
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a bit clunky to read

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean this particular line? Because of naming or indentation, or...? For performance it is slightly better to create BlockAccessListResult inside the lambda here.

.orElseGet(
() ->
new JsonRpcErrorResponse(
requestContext.getRequest().getId(), RpcErrorType.PRUNED_HISTORY_UNAVAILABLE));
Copy link
Contributor

Choose a reason for hiding this comment

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

what would be the condition that would result in this being called? should it be a different error? PRUNED_HISTORY_UNAVAILABLE was returned on line 70 if body is empty

Copy link
Contributor Author

@mirgee mirgee Jan 20, 2026

Choose a reason for hiding this comment

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

This would be called if the BAL was pruned but the block body wasn't, i.e. currently never :) With #9629, block body will not be read and PRUNED_HISTORY_UNAVAILABLE will be returned only if the BAL itself is not available, so this issue will go away.

@macfarla macfarla moved this to Open PRs in 26.1.0 Release Jan 22, 2026
@mirgee mirgee changed the title Add BAL RPC methods Add eth_getBlockAccessListBy* methods Jan 22, 2026
…yNumber to eth_getBlockAccessListByBlockNumber

Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
mirgee and others added 3 commits January 22, 2026 12:48
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
@matkt
Copy link
Contributor

matkt commented Jan 22, 2026

are you ok @macfarla to merge this one ?

@mirgee mirgee changed the title Add eth_getBlockAccessListBy* methods Add eth_getBlockAccessListBy* methods Jan 23, 2026
@matkt matkt enabled auto-merge (squash) January 23, 2026 06:45
@matkt matkt merged commit 3ffe31d into hyperledger:main Jan 23, 2026
72 of 84 checks passed
@github-project-automation github-project-automation bot moved this from Open PRs to Done in 26.1.0 Release Jan 23, 2026
macfarla pushed a commit to CPerezz/besu that referenced this pull request Feb 6, 2026
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com>
Co-authored-by: Karim Taam <karim.t2am@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

EIP-7928 - Block level Access Lists : implement eth_getBlockAccessList BAL RPC APIs

3 participants