Skip to content

Commit ecda0cd

Browse files
authored
change invalid block param error message (#8328)
* change invalid block param error message Signed-off-by: Sally MacFarlane <[email protected]> --------- Signed-off-by: Sally MacFarlane <[email protected]>
1 parent 679e0de commit ecda0cd

21 files changed

+22
-20
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
### Breaking Changes
55
- k8s (KUBERNETES) Nat method is removed. Use docker or none instead. [#8289](https://github.com/hyperledger/besu/pull/8289)
6+
- Change "Invalid block, unable to parse RLP" RPC error message to "Invalid block param (block not found)" [#8328](https://github.com/hyperledger/besu/pull/8328)
67

78
### Upcoming Breaking Changes
89
- `MetricSystem::createLabelledGauge` is deprecated and will be removed in a future release, replace it with `MetricSystem::createLabelledSuppliedGauge`
@@ -23,6 +24,7 @@
2324
- Allow plugins to propose transactions during block creation [#8268](https://github.com/hyperledger/besu/pull/8268)
2425
- 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)
2526
- Improve Conflict Detection in Parallelization by Considering Slots to Reduce False Positives. [#7923](https://github.com/hyperledger/besu/pull/7923)
27+
- Change "Invalid block, unable to parse RLP" RPC error message to "Invalid block param (block not found)" [#8328](https://github.com/hyperledger/besu/pull/8328)
2628
### Bug fixes
2729
- Upgrade Netty to version 4.1.118 to fix CVE-2025-24970 [#8275](https://github.com/hyperledger/besu/pull/8275)
2830
- Add missing RPC method `debug_accountRange` to `RpcMethod.java` and implemented its handler. [#8153](https://github.com/hyperledger/besu/issues/8153)

Diff for: ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public enum RpcErrorType implements RpcMethodError {
3636
"Invalid blob count (blob transactions must have at least one blob)"),
3737
INVALID_BLOB_GAS_USED_PARAMS(
3838
INVALID_PARAMS_ERROR_CODE, "Invalid blob gas used param (missing or invalid)"),
39-
INVALID_BLOCK_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid block, unable to parse RLP"),
39+
INVALID_BLOCK_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid block param (block not found)"),
4040
INVALID_BLOCK_COUNT_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid block count params"),
4141
INVALID_BLOCK_HASH_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid block hash params"),
4242
INVALID_BLOCK_INDEX_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid block index params"),

Diff for: ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,6 @@ public void shouldHandleInvalidParametersGracefully() {
208208
assertThat(jsonRpcResponse).isInstanceOf(JsonRpcErrorResponse.class);
209209
final JsonRpcErrorResponse response = (JsonRpcErrorResponse) debugTraceBlock.response(request);
210210

211-
assertThat(response.getError().getMessage()).contains("Invalid block, unable to parse RLP");
211+
assertThat(response.getError().getMessage()).contains("Invalid block param (block not found)");
212212
}
213213
}

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_callParamsMissing_block_8.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"id": 4,
1313
"error":{
1414
"code":-32602,
15-
"message":"Invalid block, unable to parse RLP"
15+
"message":"Invalid block param (block not found)"
1616
}
1717
},
1818
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_call_invalidBlockhash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"id": 3,
1818
"error" : {
1919
"code" : -32602,
20-
"message" : "Invalid block, unable to parse RLP"
20+
"message" : "Invalid block param (block not found)"
2121
}
2222
},
2323
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_invalidBlockHash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 28,
1414
"error" : {
1515
"code" : -32602,
16-
"message" : "Invalid block, unable to parse RLP"
16+
"message" : "Invalid block param (block not found)"
1717
}
1818
},
1919
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBalance_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 32,
1111
"error" : {
1212
"code" : -32602,
13-
"message" : "Invalid block, unable to parse RLP"
13+
"message" : "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockReceipts_invalidParams_blockNumber.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"id": 300,
1313
"error" : {
1414
"code" : -32602,
15-
"message" : "Invalid block, unable to parse RLP"
15+
"message" : "Invalid block param (block not found)"
1616
}
1717
},
1818
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockReceipts_invalidParams_tag.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"id": 301,
1313
"error" : {
1414
"code" : -32602,
15-
"message" : "Invalid block, unable to parse RLP"
15+
"message" : "Invalid block param (block not found)"
1616
}
1717
},
1818
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getBlockTransactionCountByNumber_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 248,
1111
"error": {
1212
"code" : -32602,
13-
"message" : "Invalid block, unable to parse RLP"
13+
"message" : "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_invalidBlockHash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 0,
1414
"error" : {
1515
"code" : -32602,
16-
"message" : "Invalid block, unable to parse RLP"
16+
"message" : "Invalid block param (block not found)"
1717
}
1818
},
1919
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getCode_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 255,
1111
"error": {
1212
"code": -32602,
13-
"message": "Invalid block, unable to parse RLP"
13+
"message": "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_invalidBlockHash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"id": 28,
1515
"error" : {
1616
"code" : -32602,
17-
"message" : "Invalid block, unable to parse RLP"
17+
"message" : "Invalid block param (block not found)"
1818
}
1919
},
2020
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getProof_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 28,
1111
"error" : {
1212
"code" : -32602,
13-
"message" : "Invalid block, unable to parse RLP"
13+
"message" : "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_invalidBlockHash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"id": 341,
1515
"error" : {
1616
"code" : -32602,
17-
"message" : "Invalid block, unable to parse RLP"
17+
"message" : "Invalid block param (block not found)"
1818
}
1919
},
2020
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getStorageAt_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 342,
1111
"error" : {
1212
"code" : -32602,
13-
"message" : "Invalid block, unable to parse RLP"
13+
"message" : "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionByBlockNumberAndIndex_invalidParams.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 486,
1111
"error": {
1212
"code" : -32602,
13-
"message" : "Invalid block, unable to parse RLP"
13+
"message" : "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_invalidBlockHash.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 487,
1414
"error" : {
1515
"code" : -32602,
16-
"message" : "Invalid block, unable to parse RLP"
16+
"message" : "Invalid block param (block not found)"
1717
}
1818
},
1919
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_invalidBlockNumber.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 487,
1414
"error" : {
1515
"code" : -32602,
16-
"message" : "Invalid block, unable to parse RLP"
16+
"message" : "Invalid block param (block not found)"
1717
}
1818
},
1919
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/eth/eth_getTransactionCount_missingArgument.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"id": 489,
1111
"error": {
1212
"code": -32602,
13-
"message": "Invalid block, unable to parse RLP"
13+
"message": "Invalid block param (block not found)"
1414
}
1515
},
1616
"statusCode": 200

Diff for: ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/replay-trace-transaction/flat/trace_replayBlockTransactions_invalidBlockParam.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 415,
1414
"error": {
1515
"code": -32602,
16-
"message": "Invalid block, unable to parse RLP"
16+
"message": "Invalid block param (block not found)"
1717
}
1818
},
1919
"statusCode": 200

0 commit comments

Comments
 (0)