-
Notifications
You must be signed in to change notification settings - Fork 1k
Add BAL RPC methods #9643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add BAL RPC methods #9643
Conversation
…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>
| .<JsonRpcResponse>map( | ||
| bal -> | ||
| new JsonRpcSuccessResponse( | ||
| requestId, BlockAccessListResult.fromBlockAccessList(bal))) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Implements BAL-related JSON-RPC methods as defined by the API specs:
eth_getBlockAccessListByBlockHash- returns BAL by block hasheth_getBlockAccessListByBlockNumber- returns BAL by block numberAt 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
balHashfield and returning only flattenedblockAccessList.Small changes to BAL retrieval from storage will be needed after rebase on #9629 (basing on main branch simplifies review).
Closes: #9615