Skip to content

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.

Small changes to BAL retrieval from storage will be needed after rebase on #9629 (basing on main branch simplifies review).

Closes: #9615

…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>
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Open PRs

Development

Successfully merging this pull request may close these issues.

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

3 participants