Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom genesis config fallback case for blobs #3020

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading