You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RPC] add SAFE and FINALIZED options for block param (hyperledger#4902)
* new test file with a block number param that is too long to be a block number
* check for block hash parameter length
* added unit test for safe & finalized
Signed-off-by: Sally MacFarlane <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
10
10
- Improve SLOAD and SSTORE performance by caching empty slots [#4874](https://github.com/hyperledger/besu/pull/4874)
11
11
- RPC methods that lookup block by hash will now return an error response if no block found [#4582](https://github.com/hyperledger/besu/pull/4582)
12
+
- Added support for `safe` and `finalized` strings for the RPC methods using defaultBlock parameter [#4902](https://github.com/hyperledger/besu/pull/4902)
Copy file name to clipboardExpand all lines: ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterOrBlockHashMethod.java
Copy file name to clipboardExpand all lines: ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/BlockParameterOrBlockHash.java
+25-3
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,8 @@
27
27
importcom.fasterxml.jackson.databind.JsonNode;
28
28
29
29
/**
30
-
* Represents a block parameter that can be a special value ("pending", "earliest", "latest") or a
31
-
* number formatted as a hex string or a block hash.
30
+
* Represents a block parameter (or block hash) that can be a special value ("pending", "earliest",
31
+
* "latest", "finalized", "safe") or a number formatted as a hex string, or a block hash.
32
32
*
33
33
* <p>When distinguishing between a hash and a number it is presumed that a hash won't have three
34
34
* quarters of the leading bytes as zero. This is fine for block hashes but not for precompiled
@@ -61,11 +61,23 @@ public BlockParameterOrBlockHash(final Object value) throws JsonProcessingExcept
0 commit comments