RPC - return null result if requested block not found#9303
RPC - return null result if requested block not found#9303macfarla merged 12 commits intobesu-eth:mainfrom
Conversation
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
|
draft bc this has unfortunately broken these hive tests: |
|
In Besu we have an abstract class AbstractBlockParameterOrBlockHashMethod that is used by several RPCs - so any RPC that gets a block by block number or hash will have the same error handling behavior. Including: The spec, and the hive tests, are inconsistent with error handling expectations. return null if block not found |
...dger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterOrBlockHashMethod.java
Show resolved
Hide resolved
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
…su into getblockreceipts-return-null
* null result if block not found * changelog Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> --------- Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Co-authored-by: Justin Florentine <justin+github@florentine.us> Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane macfarla.github@gmail.com
PR description
If block not found, return a Success response with null result, NOT an Error response.
This affects all RPC methods that use
AbstractBlockParameterOrBlockHashMethodincluding
debug_accountAt,debug_setHead,eth_call,eth_getBlockReceipts,eth_getProof,eth_simulateV1,eth_getBalance,eth_getCode,eth_getStorageAt,eth_getTransactionCountI've included this as a breaking change in the changelog since it is a change in behavior. However this is what the hive tests expect and it's moving towards being more consistent with other clients.
Fixed Issue(s)
Fixes #9197
Fixes hive tests:
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests