Add eth_getBlockAccessListBy* methods#9643
Conversation
| .<JsonRpcResponse>map( | ||
| bal -> | ||
| new JsonRpcSuccessResponse( | ||
| requestId, BlockAccessListResult.fromBlockAccessList(bal))) |
There was a problem hiding this comment.
this is a bit clunky to read
There was a problem hiding this comment.
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.
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.
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.
…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>
8f2a485 to
06294a4
Compare
...hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockAccessListByBlockHash.java
Show resolved
Hide resolved
...perledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockAccessListByBlockNumber.java
Outdated
Show resolved
Hide resolved
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>
01453c6 to
40b79a4
Compare
|
are you ok @macfarla to merge this one ? |
eth_getBlockAccessListBy* methods
Signed-off-by: Miroslav Kovar <miroslavkovar@protonmail.com> Co-authored-by: Karim Taam <karim.t2am@gmail.com>
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.The implementation currently requires
BALs retained <= blocks retained.Closes: #9615