Skip to content

Commit

Permalink
[4844] Fix some Devnet9 Hive tests (hyperledger#5929)
Browse files Browse the repository at this point in the history
* Return latest valid hash for blob validation
* Fix invalid hash
* Fix null hash
* Change HISTORY_BUFFER_LENGTH
---------

Signed-off-by: Gabriel-Trintinalia <[email protected]>
  • Loading branch information
Gabriel-Trintinalia authored and NickSneo committed Nov 12, 2023
1 parent 4fe9e6b commit 50034e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
try {
maybeVersionedHashes = extractVersionedHashes(maybeVersionedHashParam);
} catch (RuntimeException ex) {
return respondWithInvalid(reqId, blockParam, null, INVALID, "Invalid versionedHash");
return respondWithInvalid(
reqId,
blockParam,
mergeCoordinator.getLatestValidAncestor(blockParam.getParentHash()).orElse(null),
INVALID,
"Invalid versionedHash");
}

final Optional<BlockHeader> maybeParentHeader =
Expand Down Expand Up @@ -240,7 +245,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
return respondWithInvalid(
reqId,
blockParam,
null,
mergeCoordinator.getLatestValidAncestor(blockParam.getParentHash()).orElse(null),
getInvalidBlockHashStatus(),
blobValidationResult.getErrorMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public interface ParentBeaconBlockRootHelper {

// Modulus to use for the timestamp to store the root
public static final long HISTORICAL_ROOTS_MODULUS = 8191;
public static final long HISTORICAL_ROOTS_MODULUS = 98304;
public static final Address BEACON_ROOTS_ADDRESS =
Address.fromHexString("0xbEAC020008aFF7331c0A389CB2AAb67597567d7a");

Expand Down

0 comments on commit 50034e5

Please sign in to comment.