From 756a7a4d7b42287ec6d784fbf45a2e3ba69e8443 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Thu, 10 Apr 2025 10:46:26 +0800 Subject: [PATCH 1/7] BEP-524: Short Block Interval Phase Two: 0.75 seconds --- cmd/geth/config.go | 2 +- consensus/misc/eip4844/eip4844.go | 10 +++++++++- consensus/parlia/parlia.go | 9 +++++++-- consensus/parlia/ramanujanfork.go | 2 +- consensus/parlia/snapshot.go | 6 ++++++ internal/ethapi/api.go | 2 +- miner/bid_simulator.go | 2 +- params/config.go | 29 ++++++++++++++++++++--------- params/protocol_params.go | 8 ++++---- 9 files changed, 50 insertions(+), 20 deletions(-) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 26e28d43db..8d18a9fd19 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -223,7 +223,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { } if ctx.IsSet(utils.OverrideMinBlocksForBlobRequests.Name) { params.MinBlocksForBlobRequests = ctx.Uint64(utils.OverrideMinBlocksForBlobRequests.Name) - params.MinTimeDurationForBlobRequests = uint64(float64(params.MinBlocksForBlobRequests) * 1.5 /*lorentzBlockInterval*/) + params.MinTimeDurationForBlobRequests = uint64(float64(params.MinBlocksForBlobRequests) * 0.75 /*maxwellBlockInterval*/) } if ctx.IsSet(utils.OverrideDefaultExtraReserveForBlobRequests.Name) { params.DefaultExtraReserveForBlobRequests = ctx.Uint64(utils.OverrideDefaultExtraReserveForBlobRequests.Name) diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 382ce67a1e..d653b9b680 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -83,7 +83,9 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int { var frac uint64 switch config.LatestFork(header.Time) { - case forks.Maxwell, forks.Lorentz, forks.Prague: + case forks.Maxwell: + frac = config.BlobScheduleConfig.Maxwell.UpdateFraction + case forks.Lorentz, forks.Prague: frac = config.BlobScheduleConfig.Prague.UpdateFraction case forks.Cancun: frac = config.BlobScheduleConfig.Cancun.UpdateFraction @@ -103,6 +105,8 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int { s = cfg.BlobScheduleConfig ) switch { + case cfg.IsMaxwell(london, time) && s.Maxwell != nil: + return s.Maxwell.Max case cfg.IsPrague(london, time) && s.Prague != nil: return s.Prague.Max case cfg.IsCancun(london, time) && s.Cancun != nil: @@ -125,6 +129,8 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int { return 0 } switch { + case s.Maxwell != nil: + return s.Maxwell.Max case s.Prague != nil: return s.Prague.Max case s.Cancun != nil: @@ -144,6 +150,8 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int { s = cfg.BlobScheduleConfig ) switch { + case cfg.IsMaxwell(london, time) && s.Maxwell != nil: + return s.Maxwell.Target case cfg.IsPrague(london, time) && s.Prague != nil: return s.Prague.Target case cfg.IsCancun(london, time) && s.Cancun != nil: diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 21d7761b00..15034b9cc7 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -60,6 +60,7 @@ const ( maxwellEpochLength uint64 = 1000 // Epoch length starting from the Maxwell hard fork defaultBlockInterval uint64 = 3000 // Default block interval in milliseconds lorentzBlockInterval uint64 = 1500 // Block interval starting from the Lorentz hard fork + maxwellBlockInterval uint64 = 750 // Block interval starting from the Maxwell hard fork defaultTurnLength uint8 = 1 // Default consecutive number of blocks a validator receives priority for block production extraVanity = 32 // Fixed number of extra-data prefix bytes reserved for signer vanity @@ -795,14 +796,18 @@ func (p *Parlia) snapshot(chain consensus.ChainHeaderReader, number uint64, hash blockHeader := chain.GetHeaderByNumber(number) if blockHeader != nil { blockHash = blockHeader.Hash() - if p.chainConfig.IsLorentz(blockHeader.Number, blockHeader.Time) { + if p.chainConfig.IsMaxwell(blockHeader.Number, blockHeader.Time) { + blockInterval = maxwellBlockInterval + } else if p.chainConfig.IsLorentz(blockHeader.Number, blockHeader.Time) { blockInterval = lorentzBlockInterval } } if number > offset { // exclude `number == 200` blockBeforeCheckpoint := chain.GetHeaderByNumber(number - offset - 1) if blockBeforeCheckpoint != nil { - if p.chainConfig.IsLorentz(blockBeforeCheckpoint.Number, blockBeforeCheckpoint.Time) { + if p.chainConfig.IsMaxwell(blockBeforeCheckpoint.Number, blockBeforeCheckpoint.Time) { + epochLength = maxwellEpochLength + } else if p.chainConfig.IsLorentz(blockBeforeCheckpoint.Number, blockBeforeCheckpoint.Time) { epochLength = lorentzEpochLength } } diff --git a/consensus/parlia/ramanujanfork.go b/consensus/parlia/ramanujanfork.go index 64d149bf28..e26cebc9d8 100644 --- a/consensus/parlia/ramanujanfork.go +++ b/consensus/parlia/ramanujanfork.go @@ -12,7 +12,7 @@ import ( const ( wiggleTimeBeforeFork = 500 * time.Millisecond // Random delay (per signer) to allow concurrent signers fixedBackOffTimeBeforeFork = 200 * time.Millisecond - millisecondsUnit = 500 // Set to 250 if block interval is 750ms; not enforced at the consensus level + millisecondsUnit = 250 // not enforced at the consensus level ) func (p *Parlia) delayForRamanujanFork(snap *Snapshot, header *types.Header) time.Duration { diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index ebdbcbe1ed..8ad2affd85 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -331,6 +331,12 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea } snap.BlockInterval = lorentzBlockInterval } + if chainConfig.IsMaxwell(header.Number, header.Time) { + if (header.Number.Uint64()+1)%maxwellEpochLength == 0 { + snap.EpochLength = maxwellEpochLength + } + snap.BlockInterval = maxwellBlockInterval + } // change validator set if number > 0 && number%epochLength == snap.minerHistoryCheckLen() { epochKey := math.MaxUint64 - header.Number.Uint64()/epochLength // impossible used as a block number diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index fdd3f85352..908cdd02ad 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -564,7 +564,7 @@ func (api *BlockChainAPI) getFinalizedNumber(ctx context.Context, verifiedValida lastHeader := latestHeader confirmedValSet := make(map[common.Address]struct{}, valLen) confirmedValSet[lastHeader.Coinbase] = struct{}{} - epochLength := int(500) // TODO(Nathan)(BEP-524 Phase Two): use `maxwellEpochLength` instead + epochLength := int(1000) // maxwellEpochLength for count := 1; int64(len(confirmedValSet)) < verifiedValidatorNum && count <= epochLength && lastHeader.Number.Int64() > max(fastFinalizedHeader.Number.Int64(), 1); count++ { lastHeader, err = api.b.HeaderByHash(ctx, lastHeader.ParentHash) if err != nil { // impossible diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 8068fd6261..f30ee45617 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -480,7 +480,7 @@ func (b *bidSimulator) newBidLoop() { // get block interval for current block by using parent header func (b *bidSimulator) getBlockInterval(parentHeader *types.Header) uint64 { if parentHeader == nil { - return 1500 // lorentzBlockInterval + return 750 // maxwellBlockInterval } parlia, _ := b.engine.(*parlia.Parlia) // only `Number` and `ParentHash` are used when `BlockInterval` diff --git a/params/config.go b/params/config.go index 2524ae77c8..823a64b648 100644 --- a/params/config.go +++ b/params/config.go @@ -194,8 +194,9 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, + Maxwell: DefaultMaxwellBlobConfig, }, } @@ -240,8 +241,9 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, + Maxwell: DefaultMaxwellBlobConfig, }, } @@ -288,8 +290,9 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, + Maxwell: DefaultMaxwellBlobConfig, }, } @@ -547,6 +550,13 @@ var ( } DefaultPragueBlobConfigBSC = DefaultCancunBlobConfig + + // DefaultMaxwellBlobConfig is the default blob configuration for the Maxwell fork. + DefaultMaxwellBlobConfig = &BlobConfig{ + Target: 1, + Max: 2, + UpdateFraction: DefaultPragueBlobConfigBSC.UpdateFraction, + } ) // NetworkNames are user friendly names to use in the chain spec banner. @@ -831,9 +841,10 @@ type BlobConfig struct { // BlobScheduleConfig determines target and max number of blobs allow per fork. type BlobScheduleConfig struct { - Cancun *BlobConfig `json:"cancun,omitempty"` - Prague *BlobConfig `json:"prague,omitempty"` - Verkle *BlobConfig `json:"verkle,omitempty"` + Cancun *BlobConfig `json:"cancun,omitempty"` + Prague *BlobConfig `json:"prague,omitempty"` + Maxwell *BlobConfig `json:"lorentz,omitempty"` + Verkle *BlobConfig `json:"verkle,omitempty"` } // IsHomestead returns whether num is either equal to the homestead block or greater. diff --git a/params/protocol_params.go b/params/protocol_params.go index 74a9ec3fb9..f00f63adf2 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -194,10 +194,10 @@ const ( ) var ( - // lorentzBlockInterval = 1.5 - MinTimeDurationForBlobRequests uint64 = uint64(float64(24*3600) * 18.2) // it keeps blob data available for 18.2 days in local - MinBlocksForBlobRequests uint64 = uint64(float64(MinTimeDurationForBlobRequests) / 1.5) // ref: https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-524.md#421-change-table. - DefaultExtraReserveForBlobRequests uint64 = uint64(24 * 3600 / 1.5) // it adds more time for expired blobs for some request cases, like expiry blob when remote peer is syncing, default 1 day. + // maxwellBlockInterval = 0.75 + MinTimeDurationForBlobRequests uint64 = uint64(float64(24*3600) * 18.2) // it keeps blob data available for 18.2 days in local + MinBlocksForBlobRequests uint64 = uint64(float64(MinTimeDurationForBlobRequests) / 0.75) // ref: https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-524.md#421-change-table. + DefaultExtraReserveForBlobRequests uint64 = uint64(24 * 3600 / 0.75) // it adds more time for expired blobs for some request cases, like expiry blob when remote peer is syncing, default 1 day. BreatheBlockInterval uint64 = 24 * 3600 // Controls the interval for updateValidatorSetV2 From 4c7c65e3273497ddad37ec2e26e292d3e8721d03 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 11:26:12 +0800 Subject: [PATCH 2/7] consensus/parlia: clear minerHistory based on latest finalized blocks --- consensus/parlia/snapshot.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 8ad2affd85..47b76cba4d 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -269,6 +269,13 @@ func (s *Snapshot) SignRecently(validator common.Address) bool { return s.signRecentlyByCounts(validator, s.countRecents()) } +func (s *Snapshot) getFinalizedNumber() uint64 { + if s.Attestation != nil { + return s.Attestation.SourceNumber + } + return 0 +} + func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderReader, parents []*types.Header, chainConfig *params.ChainConfig) (*Snapshot, error) { // Allow passing in no headers for cleaner code if len(headers) == 0 { @@ -323,7 +330,16 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea snap.Recents[number] = validator snap.RecentForkHashes[number] = hex.EncodeToString(header.Extra[extraVanity-nextForkHashSize : extraVanity]) epochLength := snap.EpochLength + snap.updateAttestation(header, chainConfig, epochLength) + latestFinalizedBlockNumber := s.getFinalizedNumber() + // BEP-524: Clear entries up to the latest finalized block + for blockNumber := range snap.Recents { + if blockNumber <= latestFinalizedBlockNumber { + delete(snap.Recents, blockNumber) + } + } + if chainConfig.IsLorentz(header.Number, header.Time) { // Without this condition, an incorrect block might be used to parse validators for certain blocks after the Lorentz hard fork. if (header.Number.Uint64()+1)%lorentzEpochLength == 0 { From c0f41a35d16759f9c0947e0db3199b9b712536eb Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 15:01:53 +0800 Subject: [PATCH 3/7] cmd/jsutils: print blockinterval when getPerformanceData --- cmd/jsutils/getchainstatus.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/cmd/jsutils/getchainstatus.js b/cmd/jsutils/getchainstatus.js index ceb7ae4eaa..58fdc2a6bd 100644 --- a/cmd/jsutils/getchainstatus.js +++ b/cmd/jsutils/getchainstatus.js @@ -404,8 +404,10 @@ async function getPerformanceData() { let gasUsedTotal = 0; let inturnBlocks = 0; let justifiedBlocks = 0; - let turnLength = 1; + let turnLength = 4; + let lastTimestamp = null; let parliaEnabled = true; + try { turnLength = await provider.send("parlia_getTurnLength", [ethers.toQuantity(program.startNum)]); } catch (error) { @@ -426,14 +428,7 @@ async function getPerformanceData() { inturnBlocks += 1; } let timestamp = eval(eval(header.milliTimestamp).toString(10)); - if (parliaEnabled) { - let justifiedNumber = await provider.send("parlia_getJustifiedNumber", [ethers.toQuantity(i)]); - if (justifiedNumber + 1 == i) { - justifiedBlocks += 1; - } else { - console.log("justified unexpected", "BlockNumber =", i, "justifiedNumber", justifiedNumber); - } - } + let blockInterval = lastTimestamp !== null ? timestamp - lastTimestamp : null; console.log( "BlockNumber =", i, @@ -448,8 +443,20 @@ async function getPerformanceData() { "gasUsed", gasUsed, "timestamp", - timestamp + timestamp, + "blockInterval", + blockInterval !== null ? blockInterval : "N/A" ); + lastTimestamp = timestamp; + + if (parliaEnabled) { + let justifiedNumber = await provider.send("parlia_getJustifiedNumber", [ethers.toQuantity(i)]); + if (justifiedNumber + 1 == i) { + justifiedBlocks += 1; + } else { + console.log("justified unexpected", "BlockNumber =", i, "justifiedNumber", justifiedNumber); + } + } } let blockCount = program.endNum - program.startNum; let txCountPerBlock = txCountTotal / blockCount; From a2ca6716b611ff1eca921236d1380c750a6f7f39 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 15:27:33 +0800 Subject: [PATCH 4/7] consensus/parlia: clear minerhistory once IsMaxwell enabled --- consensus/parlia/snapshot.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 47b76cba4d..25ec46c03d 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -332,11 +332,13 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea epochLength := snap.EpochLength snap.updateAttestation(header, chainConfig, epochLength) - latestFinalizedBlockNumber := s.getFinalizedNumber() - // BEP-524: Clear entries up to the latest finalized block - for blockNumber := range snap.Recents { - if blockNumber <= latestFinalizedBlockNumber { - delete(snap.Recents, blockNumber) + if chainConfig.IsMaxwell(header.Number, header.Time) { + latestFinalizedBlockNumber := s.getFinalizedNumber() + // BEP-524: Clear entries up to the latest finalized block + for blockNumber := range snap.Recents { + if blockNumber <= latestFinalizedBlockNumber { + delete(snap.Recents, blockNumber) + } } } From f57a97cf16f30189bd2b07eb5d50465b89bcdb46 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 16:37:45 +0800 Subject: [PATCH 5/7] consensus/parlia: fix epochlength update --- consensus/parlia/snapshot.go | 39 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index 25ec46c03d..f79305e6ca 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -196,13 +196,13 @@ func (s *Snapshot) isMajorityFork(forkHash string) bool { return ally > len(s.RecentForkHashes)/2 } -func (s *Snapshot) updateAttestation(header *types.Header, chainConfig *params.ChainConfig, epochLength uint64) { +func (s *Snapshot) updateAttestation(header *types.Header, chainConfig *params.ChainConfig) { if !chainConfig.IsLuban(header.Number) { return } // The attestation should have been checked in verify header, update directly - attestation, _ := getVoteAttestationFromHeader(header, chainConfig, epochLength) + attestation, _ := getVoteAttestationFromHeader(header, chainConfig, s.EpochLength) if attestation == nil { return } @@ -327,11 +327,10 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea } } } - snap.Recents[number] = validator - snap.RecentForkHashes[number] = hex.EncodeToString(header.Extra[extraVanity-nextForkHashSize : extraVanity]) - epochLength := snap.EpochLength - snap.updateAttestation(header, chainConfig, epochLength) + snap.updateAttestation(header, chainConfig) + + snap.Recents[number] = validator if chainConfig.IsMaxwell(header.Number, header.Time) { latestFinalizedBlockNumber := s.getFinalizedNumber() // BEP-524: Clear entries up to the latest finalized block @@ -342,18 +341,26 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea } } - if chainConfig.IsLorentz(header.Number, header.Time) { - // Without this condition, an incorrect block might be used to parse validators for certain blocks after the Lorentz hard fork. - if (header.Number.Uint64()+1)%lorentzEpochLength == 0 { - snap.EpochLength = lorentzEpochLength - } - snap.BlockInterval = lorentzBlockInterval - } + snap.RecentForkHashes[number] = hex.EncodeToString(header.Extra[extraVanity-nextForkHashSize : extraVanity]) + if chainConfig.IsMaxwell(header.Number, header.Time) { - if (header.Number.Uint64()+1)%maxwellEpochLength == 0 { - snap.EpochLength = maxwellEpochLength - } snap.BlockInterval = maxwellBlockInterval + } else if chainConfig.IsLorentz(header.Number, header.Time) { + snap.BlockInterval = lorentzBlockInterval + } + + epochLength := snap.EpochLength + nextBlockNumber := header.Number.Uint64() + 1 + if snap.EpochLength == defaultEpochLength && + chainConfig.IsLorentz(header.Number, header.Time) && + // Without this condition, an incorrect block might be used to parse validators for certain blocks after the Lorentz hard fork. + nextBlockNumber%lorentzEpochLength == 0 { + snap.EpochLength = lorentzEpochLength + } + if snap.EpochLength == lorentzEpochLength && + chainConfig.IsMaxwell(header.Number, header.Time) && + nextBlockNumber%maxwellEpochLength == 0 { + snap.EpochLength = maxwellEpochLength } // change validator set if number > 0 && number%epochLength == snap.minerHistoryCheckLen() { From 18070e02a3fb0531d24297e42f509705713f5e7f Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 18:01:21 +0800 Subject: [PATCH 6/7] consensus/parlia: fix clear minerhistory --- consensus/parlia/snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index f79305e6ca..d5df7abd43 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -332,7 +332,7 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea snap.Recents[number] = validator if chainConfig.IsMaxwell(header.Number, header.Time) { - latestFinalizedBlockNumber := s.getFinalizedNumber() + latestFinalizedBlockNumber := snap.getFinalizedNumber() // BEP-524: Clear entries up to the latest finalized block for blockNumber := range snap.Recents { if blockNumber <= latestFinalizedBlockNumber { From acf5e57006edb4216d451dd244b7102ac3d5bbb9 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 16 Apr 2025 18:02:50 +0800 Subject: [PATCH 7/7] params: remove Maxwell in BlobScheduleConfig --- consensus/misc/eip4844/eip4844.go | 10 +--------- params/config.go | 29 +++++++++-------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index d653b9b680..382ce67a1e 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -83,9 +83,7 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int { var frac uint64 switch config.LatestFork(header.Time) { - case forks.Maxwell: - frac = config.BlobScheduleConfig.Maxwell.UpdateFraction - case forks.Lorentz, forks.Prague: + case forks.Maxwell, forks.Lorentz, forks.Prague: frac = config.BlobScheduleConfig.Prague.UpdateFraction case forks.Cancun: frac = config.BlobScheduleConfig.Cancun.UpdateFraction @@ -105,8 +103,6 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int { s = cfg.BlobScheduleConfig ) switch { - case cfg.IsMaxwell(london, time) && s.Maxwell != nil: - return s.Maxwell.Max case cfg.IsPrague(london, time) && s.Prague != nil: return s.Prague.Max case cfg.IsCancun(london, time) && s.Cancun != nil: @@ -129,8 +125,6 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int { return 0 } switch { - case s.Maxwell != nil: - return s.Maxwell.Max case s.Prague != nil: return s.Prague.Max case s.Cancun != nil: @@ -150,8 +144,6 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int { s = cfg.BlobScheduleConfig ) switch { - case cfg.IsMaxwell(london, time) && s.Maxwell != nil: - return s.Maxwell.Target case cfg.IsPrague(london, time) && s.Prague != nil: return s.Prague.Target case cfg.IsCancun(london, time) && s.Cancun != nil: diff --git a/params/config.go b/params/config.go index 823a64b648..2524ae77c8 100644 --- a/params/config.go +++ b/params/config.go @@ -194,9 +194,8 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, - Maxwell: DefaultMaxwellBlobConfig, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, }, } @@ -241,9 +240,8 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, - Maxwell: DefaultMaxwellBlobConfig, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, }, } @@ -290,9 +288,8 @@ var ( Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ - Cancun: DefaultCancunBlobConfig, - Prague: DefaultPragueBlobConfigBSC, - Maxwell: DefaultMaxwellBlobConfig, + Cancun: DefaultCancunBlobConfig, + Prague: DefaultPragueBlobConfigBSC, }, } @@ -550,13 +547,6 @@ var ( } DefaultPragueBlobConfigBSC = DefaultCancunBlobConfig - - // DefaultMaxwellBlobConfig is the default blob configuration for the Maxwell fork. - DefaultMaxwellBlobConfig = &BlobConfig{ - Target: 1, - Max: 2, - UpdateFraction: DefaultPragueBlobConfigBSC.UpdateFraction, - } ) // NetworkNames are user friendly names to use in the chain spec banner. @@ -841,10 +831,9 @@ type BlobConfig struct { // BlobScheduleConfig determines target and max number of blobs allow per fork. type BlobScheduleConfig struct { - Cancun *BlobConfig `json:"cancun,omitempty"` - Prague *BlobConfig `json:"prague,omitempty"` - Maxwell *BlobConfig `json:"lorentz,omitempty"` - Verkle *BlobConfig `json:"verkle,omitempty"` + Cancun *BlobConfig `json:"cancun,omitempty"` + Prague *BlobConfig `json:"prague,omitempty"` + Verkle *BlobConfig `json:"verkle,omitempty"` } // IsHomestead returns whether num is either equal to the homestead block or greater.