Skip to content

Commit

Permalink
custom genesis config fallback case for blobs (#3020)
Browse files Browse the repository at this point in the history
* clear re-org misconception

* fcuV3 allow shanghai head

* add fallback blobcount for custom network

* fix tests
  • Loading branch information
advaita-saha authored Jan 24, 2025
1 parent b917be5 commit 8372736
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nimbus/common/chain_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ proc validateChainConfig(conf: ChainConfig): bool =
proc configureBlobSchedule(conf: ChainConfig) =
var prevFork = Cancun
if conf.blobSchedule[Cancun].isNone:
conf.blobSchedule[Cancun] = Opt.some(BlobSchedule())
conf.blobSchedule[Cancun] = Opt.some(BlobSchedule(target: 3'u64, max: 6'u64))
for fork in Prague..HardFork.high:
if conf.blobSchedule[fork].isNone:
conf.blobSchedule[fork] = conf.blobSchedule[prevFork]
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}")
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 8372736

Please sign in to comment.