Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
advaita-saha committed Jan 24, 2025
1 parent d4385bf commit 1b58d95
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions nimbus/beacon/api_handler/api_forkchoice.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ template validateHeaderTimestamp(header, com, apiVersion) =
" doesn't support head block with timestamp >= Cancun")
# See fCUV2 specification No.2 bullet 1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/shanghai.md#specification-1
# elif com.isShanghaiOrLater(header.timestamp):
# if apiVersion != Version.V2:
# raise invalidAttr("forkChoiceUpdated" & $apiVersion &
# " doesn't support head block with Shanghai timestamp")
# else:
# if apiVersion != Version.V1:
# raise invalidAttr("forkChoiceUpdated" & $apiVersion &
# " doesn't support head block with timestamp earlier than Shanghai")
elif com.isShanghaiOrLater(header.timestamp):
if apiVersion != Version.V2:
raise invalidAttr("forkChoiceUpdated" & $apiVersion &
" doesn't support head block with Shanghai timestamp")
else:
if apiVersion != Version.V1:
raise invalidAttr("forkChoiceUpdated" & $apiVersion &
" doesn't support head block with timestamp earlier than Shanghai")

proc forkchoiceUpdated*(ben: BeaconEngineRef,
apiVersion: Version,
Expand Down
2 changes: 1 addition & 1 deletion nimbus/core/validate.nim
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ proc validateTxBasic*(

let maxBlobsPerBlock = getMaxBlobsPerBlock(com, fork)
if tx.versionedHashes.len.uint64 > maxBlobsPerBlock:
return err(&"invalid tx: versioned hashes len exceeds MAX_BLOBS_PER_BLOCK={maxBlobsPerBlock}, get={tx.versionedHashes.len}, fork={fork}")
return err(&"invalid tx: versioned hashes len exceeds MAX_BLOBS_PER_BLOCK={maxBlobsPerBlock}, get={tx.versionedHashes.len}")

for i, bv in tx.versionedHashes:
if bv.data[0] != VERSIONED_HASH_VERSION_KZG:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_genesis.nim
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ proc customGenesisTest() =
validateBlobSchedule(cg, Osaka, 6, 9)

check loadNetworkParams("blobschedule_prague.json".findFilePath, cg)
validateBlobSchedule(cg, Cancun, 0, 0)
validateBlobSchedule(cg, Cancun, 3, 6) # default fallback case
validateBlobSchedule(cg, Prague, 6, 9)
validateBlobSchedule(cg, Osaka, 6, 9)

Expand Down

0 comments on commit 1b58d95

Please sign in to comment.