mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-08 21:38:15 -05:00
RPC - eth_getLogs: Return block not found instead of empty logs (#8290)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
This commit is contained in:
committed by
GitHub
parent
90015fca42
commit
6342f5d678
@@ -17,6 +17,7 @@
|
||||
### Additions and Improvements
|
||||
- Add TLS/mTLS options and configure the GraphQL HTTP service[#7910](https://github.com/hyperledger/besu/pull/7910)
|
||||
- Allow plugins to propose transactions during block creation [#8268](https://github.com/hyperledger/besu/pull/8268)
|
||||
- Update `eth_getLogs` to return a `Block not found` error when the requested block is not found. [#8290](https://github.com/hyperledger/besu/pull/8290)
|
||||
### Bug fixes
|
||||
- Upgrade Netty to version 4.1.118 to fix CVE-2025-24970 [#8275](https://github.com/hyperledger/besu/pull/8275)
|
||||
- Add missing RPC method `debug_accountRange` to `RpcMethod.java` and implemented its handler. [#8153](https://github.com/hyperledger/besu/issues/8153)
|
||||
|
||||
@@ -73,8 +73,18 @@ public class EthGetLogs implements JsonRpcMethod {
|
||||
.getBlockHash()
|
||||
.map(
|
||||
blockHash ->
|
||||
blockchain.matchingLogs(
|
||||
blockHash, filter.getLogsQuery(), requestContext::isAlive))
|
||||
blockchain
|
||||
.getBlockHeaderByHash(blockHash)
|
||||
.map(
|
||||
blockHeader ->
|
||||
blockchain.matchingLogs(
|
||||
blockHeader.getBlockHash(),
|
||||
filter.getLogsQuery(),
|
||||
requestContext::isAlive))
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new InvalidJsonRpcParameters(
|
||||
"Block not found", RpcErrorType.BLOCK_NOT_FOUND)))
|
||||
.orElseGet(
|
||||
() -> {
|
||||
final long fromBlockNumber;
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"response": {
|
||||
"jsonrpc": "2.0",
|
||||
"id": 406,
|
||||
"result" : [ ]
|
||||
"error" : {
|
||||
"code": -32000,
|
||||
"message": "Block not found"
|
||||
}
|
||||
},
|
||||
"statusCode": 200
|
||||
}
|
||||
Reference in New Issue
Block a user