From c79aea5271cdb0c6b1a3a396ecb05a44970fcfbd Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 8 Jul 2025 15:01:45 +0800 Subject: [PATCH] consensus/misc/eip4844, params: add more bpo checks --- consensus/misc/eip4844/eip4844.go | 2 +- params/config.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 2b9896985e..fc143027dd 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -145,7 +145,7 @@ func latestBlobConfig(cfg *params.ChainConfig, time uint64) *params.BlobConfig { } } -// MaxBlobsPerBlock returns the maximum blob gas that can be spent in a block at the given timestamp. +// MaxBlobGasPerBlock returns the maximum blob gas that can be spent in a block at the given timestamp. func MaxBlobGasPerBlock(cfg *params.ChainConfig, time uint64) uint64 { return uint64(MaxBlobsPerBlock(cfg, time)) * params.BlobTxBlobGasPerBlob } diff --git a/params/config.go b/params/config.go index c0109ba273..85619bbe22 100644 --- a/params/config.go +++ b/params/config.go @@ -779,6 +779,11 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "pragueTime", timestamp: c.PragueTime, optional: true}, {name: "osakaTime", timestamp: c.OsakaTime, optional: true}, {name: "verkleTime", timestamp: c.VerkleTime, optional: true}, + {name: "bpo1", timestamp: c.BPO1Time, optional: true}, + {name: "bpo2", timestamp: c.BPO2Time, optional: true}, + {name: "bpo3", timestamp: c.BPO3Time, optional: true}, + {name: "bpo4", timestamp: c.BPO4Time, optional: true}, + {name: "bpo5", timestamp: c.BPO5Time, optional: true}, } { if lastFork.name != "" { switch { @@ -933,6 +938,21 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkTimestampIncompatible(c.VerkleTime, newcfg.VerkleTime, headTimestamp) { return newTimestampCompatError("Verkle fork timestamp", c.VerkleTime, newcfg.VerkleTime) } + if isForkTimestampIncompatible(c.BPO1Time, newcfg.BPO1Time, headTimestamp) { + return newTimestampCompatError("BPO1 fork timestamp", c.BPO1Time, newcfg.BPO1Time) + } + if isForkTimestampIncompatible(c.BPO2Time, newcfg.BPO2Time, headTimestamp) { + return newTimestampCompatError("BPO2 fork timestamp", c.BPO2Time, newcfg.BPO2Time) + } + if isForkTimestampIncompatible(c.BPO3Time, newcfg.BPO3Time, headTimestamp) { + return newTimestampCompatError("BPO3 fork timestamp", c.BPO3Time, newcfg.BPO3Time) + } + if isForkTimestampIncompatible(c.BPO4Time, newcfg.BPO4Time, headTimestamp) { + return newTimestampCompatError("BPO4 fork timestamp", c.BPO4Time, newcfg.BPO4Time) + } + if isForkTimestampIncompatible(c.BPO5Time, newcfg.BPO5Time, headTimestamp) { + return newTimestampCompatError("BPO5 fork timestamp", c.BPO5Time, newcfg.BPO5Time) + } return nil }