From c4cd3f6f708e2accdd8359db87cf709daa5e9193 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:47:04 +0800 Subject: [PATCH 01/21] cmd/jsutils: adjust nodereal builders (#3447) --- cmd/jsutils/getchainstatus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/jsutils/getchainstatus.js b/cmd/jsutils/getchainstatus.js index c890f89d89..939b09c183 100644 --- a/cmd/jsutils/getchainstatus.js +++ b/cmd/jsutils/getchainstatus.js @@ -266,9 +266,9 @@ const builderMap = new Map([ // Chapel ["0x627fE6AFA2E84e461CB7AE7C2c46e8adf9a954a2", "txboost"], - ["0x5EC60f73f938e36400ec3CC3Ff4d7a7703F7c005", "nodereal ap"], + ["0xa5559F1761e6dCa79Ac0c7A301CCDcC71D378fee", "nodereal ap"], ["0x6C98EB21139F6E12db5b78a4AeD4d8eBA147FB7b", "nodereal eu"], - ["0x5b67a234592331e85fC57Bb148769c1d2fF62520", "nodereal us"], + ["0x4E8cbf5912717B212db5b450ae7737455A5cc0aF", "nodereal us"], ["0x4827b423D03a349b7519Dda537e9A28d31ecBB48", "club48 ap"], ["0x48B2665E5E9a343409199D70F7495c8aB660BB48", "club48 eu"], ["0x48B4bBEbF0655557A461e91B8905b85864B8BB48", "club48 us"], From 03f168d6126f2c9f80fa0e457169438f6ae565a1 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Mon, 17 Nov 2025 10:48:53 +0800 Subject: [PATCH 02/21] cmd/utils: define OverrideOsaka (#3446) --- cmd/geth/chaincmd.go | 5 +++++ cmd/geth/config.go | 4 ++++ cmd/geth/main.go | 1 + cmd/utils/flags.go | 5 +++++ core/genesis.go | 4 ++++ eth/backend.go | 4 ++++ eth/ethconfig/gen_config.go | 4 ++-- params/config.go | 34 ++++++++++++++++++++++++++++------ 8 files changed, 53 insertions(+), 8 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index fe53b074b0..ccedad0731 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -71,6 +71,7 @@ var ( utils.OverrideLorentz, utils.OverrideMaxwell, utils.OverrideFermi, + utils.OverrideOsaka, utils.OverrideVerkle, utils.MultiDataBaseFlag, }, utils.DatabaseFlags), @@ -344,6 +345,10 @@ func initGenesis(ctx *cli.Context) error { v := ctx.Uint64(utils.OverrideFermi.Name) overrides.OverrideFermi = &v } + if ctx.IsSet(utils.OverrideOsaka.Name) { + v := ctx.Uint64(utils.OverrideOsaka.Name) + overrides.OverrideOsaka = &v + } if ctx.IsSet(utils.OverrideVerkle.Name) { v := ctx.Uint64(utils.OverrideVerkle.Name) overrides.OverrideVerkle = &v diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 55c7d5d008..16786ae249 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -270,6 +270,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { v := ctx.Uint64(utils.OverrideFermi.Name) cfg.Eth.OverrideFermi = &v } + if ctx.IsSet(utils.OverrideOsaka.Name) { + v := ctx.Uint64(utils.OverrideOsaka.Name) + cfg.Eth.OverrideOsaka = &v + } if ctx.IsSet(utils.OverrideVerkle.Name) { v := ctx.Uint64(utils.OverrideVerkle.Name) cfg.Eth.OverrideVerkle = &v diff --git a/cmd/geth/main.go b/cmd/geth/main.go index a2f470945e..700758a1e1 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -76,6 +76,7 @@ var ( utils.OverrideLorentz, utils.OverrideMaxwell, utils.OverrideFermi, + utils.OverrideOsaka, utils.OverrideVerkle, utils.OverrideFullImmutabilityThreshold, utils.OverrideMinBlocksForBlobRequests, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index aa7bef1a97..51a17de863 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -315,6 +315,11 @@ var ( Usage: "Manually specify the Fermi fork timestamp, overriding the bundled setting", Category: flags.EthCategory, } + OverrideOsaka = &cli.Uint64Flag{ + Name: "override.osaka", + Usage: "Manually specify the Osaka fork timestamp, overriding the bundled setting", + Category: flags.EthCategory, + } OverrideVerkle = &cli.Uint64Flag{ Name: "override.verkle", Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting", diff --git a/core/genesis.go b/core/genesis.go index 7ab5c7156c..2437089b2a 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -271,6 +271,7 @@ type ChainOverrides struct { OverrideLorentz *uint64 OverrideMaxwell *uint64 OverrideFermi *uint64 + OverrideOsaka *uint64 OverrideVerkle *uint64 } @@ -300,6 +301,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error { if o.OverrideFermi != nil { cfg.FermiTime = o.OverrideFermi } + if o.OverrideOsaka != nil { + cfg.OsakaTime = o.OverrideOsaka + } if o.OverrideVerkle != nil { cfg.VerkleTime = o.OverrideVerkle } diff --git a/eth/backend.go b/eth/backend.go index 63f1fa9121..a4f6f08586 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -252,6 +252,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { chainConfig.FermiTime = config.OverrideFermi overrides.OverrideFermi = config.OverrideFermi } + if config.OverrideOsaka != nil { + chainConfig.OsakaTime = config.OverrideOsaka + overrides.OverrideOsaka = config.OverrideOsaka + } if config.OverrideVerkle != nil { chainConfig.VerkleTime = config.OverrideVerkle overrides.OverrideVerkle = config.OverrideVerkle diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 5a2c8315e3..cce5e6b576 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -77,6 +77,7 @@ func (c Config) MarshalTOML() (interface{}, error) { OverrideOsaka *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"` BlobExtraReserve uint64 + EnableOpcodeOptimizing bool EnableIncrSnapshots bool IncrSnapshotPath string IncrSnapshotBlockInterval uint64 @@ -84,7 +85,6 @@ func (c Config) MarshalTOML() (interface{}, error) { IncrSnapshotKeptBlocks uint64 UseRemoteIncrSnapshot bool RemoteIncrSnapshotURL string - EnableOpcodeOptimizing bool } var enc Config enc.Genesis = c.Genesis @@ -219,6 +219,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { OverrideOsaka *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"` BlobExtraReserve *uint64 + EnableOpcodeOptimizing *bool EnableIncrSnapshots *bool IncrSnapshotPath *string IncrSnapshotBlockInterval *uint64 @@ -226,7 +227,6 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { IncrSnapshotKeptBlocks *uint64 UseRemoteIncrSnapshot *bool RemoteIncrSnapshotURL *string - EnableOpcodeOptimizing *bool } var dec Config if err := unmarshal(&dec); err != nil { diff --git a/params/config.go b/params/config.go index 6c107231a2..7c96e8a68e 100644 --- a/params/config.go +++ b/params/config.go @@ -226,11 +226,13 @@ var ( LorentzTime: newUint64(1745903100), // 2025-04-29 05:05:00 AM UTC MaxwellTime: newUint64(1751250600), // 2025-06-30 02:30:00 AM UTC FermiTime: nil, + OsakaTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ Cancun: DefaultCancunBlobConfig, Prague: DefaultPragueBlobConfigBSC, + Osaka: DefaultOsakaBlobConfigBSC, }, } @@ -273,11 +275,13 @@ var ( LorentzTime: newUint64(1744097580), // 2025-04-08 07:33:00 AM UTC MaxwellTime: newUint64(1748243100), // 2025-05-26 07:05:00 AM UTC FermiTime: newUint64(1762741500), // 2025-11-10 02:25:00 AM UTC + OsakaTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ Cancun: DefaultCancunBlobConfig, Prague: DefaultPragueBlobConfigBSC, + Osaka: DefaultOsakaBlobConfigBSC, }, } @@ -322,11 +326,13 @@ var ( MaxwellTime: newUint64(0), // TODO: set them to `0` when passed on the mainnet FermiTime: nil, + OsakaTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ Cancun: DefaultCancunBlobConfig, Prague: DefaultPragueBlobConfigBSC, + Osaka: DefaultOsakaBlobConfigBSC, }, } @@ -592,6 +598,7 @@ var ( } DefaultPragueBlobConfigBSC = DefaultCancunBlobConfig + DefaultOsakaBlobConfigBSC = DefaultCancunBlobConfig ) // NetworkNames are user friendly names to use in the chain spec banner. @@ -645,10 +652,10 @@ type ChainConfig struct { BohrTime *uint64 `json:"bohrTime,omitempty"` // Bohr switch time (nil = no fork, 0 = already on bohr) PascalTime *uint64 `json:"pascalTime,omitempty"` // Pascal switch time (nil = no fork, 0 = already on pascal) PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague) - OsakaTime *uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka) LorentzTime *uint64 `json:"lorentzTime,omitempty"` // Lorentz switch time (nil = no fork, 0 = already on lorentz) MaxwellTime *uint64 `json:"maxwellTime,omitempty"` // Maxwell switch time (nil = no fork, 0 = already on maxwell) FermiTime *uint64 `json:"fermiTime,omitempty"` // Fermi switch time (nil = no fork, 0 = already on fermi) + OsakaTime *uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka) VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle) // TerminalTotalDifficulty is the amount of total difficulty reached by @@ -825,9 +832,14 @@ func (c *ChainConfig) String() string { FermiTime = big.NewInt(0).SetUint64(*c.FermiTime) } + var OsakaTime *big.Int + if c.OsakaTime != nil { + OsakaTime = big.NewInt(0).SetUint64(*c.OsakaTime) + } + return fmt.Sprintf("{ChainID: %v, Engine: %v, Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, "+ "MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, "+ - "ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v}", + "ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v, OsakaTime: %v}", c.ChainID, engine, c.HomesteadBlock, @@ -873,6 +885,7 @@ func (c *ChainConfig) String() string { LorentzTime, MaxwellTime, FermiTime, + OsakaTime, ) } @@ -1278,6 +1291,15 @@ func (c *ChainConfig) IsOsaka(num *big.Int, time uint64) bool { return c.IsLondon(num) && isTimestampForked(c.OsakaTime, time) } +// IsOnOsaka eturns whether currentBlockTime is either equal to the Osaka fork time or greater firstly. +func (c *ChainConfig) IsOnOsaka(currentBlockNumber *big.Int, lastBlockTime uint64, currentBlockTime uint64) bool { + lastBlockNumber := new(big.Int) + if currentBlockNumber.Cmp(big.NewInt(1)) >= 0 { + lastBlockNumber.Sub(currentBlockNumber, big.NewInt(1)) + } + return !c.IsOsaka(lastBlockNumber, lastBlockTime) && c.IsOsaka(currentBlockNumber, currentBlockTime) +} + // IsVerkle returns whether time is either equal to the Verkle fork time or greater. func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool { return c.IsLondon(num) && isTimestampForked(c.VerkleTime, time) @@ -1360,10 +1382,10 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "bohrTime", timestamp: c.BohrTime}, {name: "pascalTime", timestamp: c.PascalTime}, {name: "pragueTime", timestamp: c.PragueTime}, - {name: "osakaTime", timestamp: c.OsakaTime, optional: true}, {name: "lorentzTime", timestamp: c.LorentzTime}, {name: "maxwellTime", timestamp: c.MaxwellTime}, {name: "fermiTime", timestamp: c.FermiTime}, + {name: "osakaTime", timestamp: c.OsakaTime}, {name: "verkleTime", timestamp: c.VerkleTime, optional: true}, } { if lastFork.name != "" { @@ -1565,9 +1587,6 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) { return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime) } - if isForkTimestampIncompatible(c.OsakaTime, newcfg.OsakaTime, headTimestamp) { - return newTimestampCompatError("Osaka fork timestamp", c.OsakaTime, newcfg.OsakaTime) - } if isForkTimestampIncompatible(c.LorentzTime, newcfg.LorentzTime, headTimestamp) { return newTimestampCompatError("Lorentz fork timestamp", c.LorentzTime, newcfg.LorentzTime) } @@ -1577,6 +1596,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkTimestampIncompatible(c.FermiTime, newcfg.FermiTime, headTimestamp) { return newTimestampCompatError("FermiTime fork timestamp", c.FermiTime, newcfg.FermiTime) } + if isForkTimestampIncompatible(c.OsakaTime, newcfg.OsakaTime, headTimestamp) { + return newTimestampCompatError("Osaka fork timestamp", c.OsakaTime, newcfg.OsakaTime) + } if isForkTimestampIncompatible(c.VerkleTime, newcfg.VerkleTime, headTimestamp) { return newTimestampCompatError("Verkle fork timestamp", c.VerkleTime, newcfg.VerkleTime) } From ac08602f273c5622493a1019c7beced5ec0b1117 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Mon, 17 Nov 2025 11:13:00 +0800 Subject: [PATCH 03/21] consensus/parlia: filter by source number when fetching votes (#3449) --- consensus/consensus.go | 2 +- consensus/parlia/parlia.go | 2 +- core/vote/vote_manager.go | 27 ++++++++++++++------------- core/vote/vote_pool.go | 12 +++++++++--- eth/handler_test.go | 2 +- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/consensus/consensus.go b/consensus/consensus.go index 714382f37d..e5df31b820 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -68,7 +68,7 @@ type ChainHeaderReader interface { } type VotePool interface { - FetchVotesByBlockHash(blockHash common.Hash) []*types.VoteEnvelope + FetchVotesByBlockHash(targetBlockHash common.Hash, sourceBlockNum uint64) []*types.VoteEnvelope } // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 72c73589a0..d5fe807763 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1072,7 +1072,7 @@ func (p *Parlia) assembleVoteAttestation(chain consensus.ChainHeaderReader, head if err != nil { return err } - votes = p.VotePool.FetchVotesByBlockHash(targetHeader.Hash()) + votes = p.VotePool.FetchVotesByBlockHash(targetHeader.Hash(), justifiedBlockNumber) quorum := cmath.CeilDiv(len(snap.Validators)*2, 3) if len(votes) >= quorum { targetHeaderParentSnap = snap diff --git a/core/vote/vote_manager.go b/core/vote/vote_manager.go index c3db8f0881..ad83b4e51f 100644 --- a/core/vote/vote_manager.go +++ b/core/vote/vote_manager.go @@ -152,19 +152,6 @@ func (voteManager *VoteManager) loop() { } curHead := cHead.Header - if p, ok := voteManager.engine.(*parlia.Parlia); ok { - // Approximately equal to the block interval of next block, except for the switch block. - blockInterval, err := p.BlockInterval(voteManager.chain, curHead) - if err != nil { - log.Debug("failed to get BlockInterval when voting") - } - voteAssembledTime := time.UnixMilli(int64((curHead.MilliTimestamp() + p.GetAncestorGenerationDepth(curHead)*blockInterval))) - timeForBroadcast := 50 * time.Millisecond // enough to broadcast a vote in the same region - if time.Now().Add(timeForBroadcast).After(voteAssembledTime) { - log.Warn("too late to vote", "Head.Time(Millisecond)", curHead.MilliTimestamp(), "Now(Millisecond)", time.Now().UnixMilli()) - continue - } - } // Check if cur validator is within the validatorSet at curHead if !voteManager.engine.IsActiveValidatorAt(voteManager.chain, curHead, @@ -192,6 +179,20 @@ func (voteManager *VoteManager) loop() { continue } + if p, ok := voteManager.engine.(*parlia.Parlia); ok { + // Approximately equal to the block interval of next block, except for the switch block. + blockInterval, err := p.BlockInterval(voteManager.chain, curHead) + if err != nil { + log.Debug("failed to get BlockInterval when voting") + } + voteAssembledTime := time.UnixMilli(int64((curHead.MilliTimestamp() + p.GetAncestorGenerationDepth(curHead)*blockInterval))) + timeForBroadcast := 50 * time.Millisecond // enough to broadcast a vote in the same region + if time.Now().Add(timeForBroadcast).After(voteAssembledTime) { + log.Warn("too late to vote", "Head.Time(Millisecond)", curHead.MilliTimestamp(), "Now(Millisecond)", time.Now().UnixMilli()) + continue + } + } + voteMessage.Data.SourceNumber = sourceNumber voteMessage.Data.SourceHash = sourceHash diff --git a/core/vote/vote_pool.go b/core/vote/vote_pool.go index c7a0cf7b3d..3b376f11f5 100644 --- a/core/vote/vote_pool.go +++ b/core/vote/vote_pool.go @@ -345,11 +345,17 @@ func (pool *VotePool) GetVotes() []*types.VoteEnvelope { return votesRes } -func (pool *VotePool) FetchVotesByBlockHash(blockHash common.Hash) []*types.VoteEnvelope { +func (pool *VotePool) FetchVotesByBlockHash(targetBlockHash common.Hash, sourceBlockNum uint64) []*types.VoteEnvelope { pool.mu.RLock() defer pool.mu.RUnlock() - if _, ok := pool.curVotes[blockHash]; ok { - return pool.curVotes[blockHash].voteMessages + if voteBox, ok := pool.curVotes[targetBlockHash]; ok { + var res []*types.VoteEnvelope + for _, vote := range voteBox.voteMessages { + if vote.Data.SourceNumber == sourceBlockNum { + res = append(res, vote) + } + } + return res } return nil } diff --git a/eth/handler_test.go b/eth/handler_test.go index a09285443d..4cda82f5cd 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -376,7 +376,7 @@ func (t *testVotePool) PutVote(vote *types.VoteEnvelope) { t.voteFeed.Send(core.NewVoteEvent{Vote: vote}) } -func (t *testVotePool) FetchVotesByBlockHash(blockHash common.Hash) []*types.VoteEnvelope { +func (t *testVotePool) FetchVotesByBlockHash(targetBlockHash common.Hash, sourceBlockNum uint64) []*types.VoteEnvelope { panic("implement me") } From 8a3d2053a9e558b0dac7ccf0291f9aa9597c51fd Mon Sep 17 00:00:00 2001 From: zzzckck <152148891+zzzckck@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:36:29 +0800 Subject: [PATCH 04/21] TxPool: change lifetime back to 3 hours (#3448) rollback the lifetime change made in PR#3111 3 hours could be reasonable for non-validator nodes --- core/txpool/legacypool/legacypool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index dc6b7eaa43..882496c09f 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -174,7 +174,7 @@ var DefaultConfig = Config{ GlobalQueue: 4000, OverflowPoolSlots: 0, - Lifetime: 10 * time.Minute, + Lifetime: 3 * time.Hour, ReannounceTime: 10 * 365 * 24 * time.Hour, } From 31dcdb8787a8133caa6f286df3fe5a60be7374b3 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:15:06 +0800 Subject: [PATCH 05/21] cmd/geth: stop supporting multidatabase flag (#3457) --- cmd/geth/chaincmd.go | 2 +- cmd/geth/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index ccedad0731..658f5c27a9 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -73,7 +73,7 @@ var ( utils.OverrideFermi, utils.OverrideOsaka, utils.OverrideVerkle, - utils.MultiDataBaseFlag, + // utils.MultiDataBaseFlag, }, utils.DatabaseFlags), Description: ` The init command initializes a new genesis block and definition for the network. diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 700758a1e1..4e164ee78b 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -129,7 +129,7 @@ var ( utils.CacheSnapshotFlag, // utils.CacheNoPrefetchFlag, utils.CachePreimagesFlag, - utils.MultiDataBaseFlag, + // utils.MultiDataBaseFlag, utils.PruneAncientDataFlag, // deprecated utils.CacheLogSizeFlag, utils.FDLimitFlag, From 975205095f83a67fbe4fe3e524742b9a4a65e992 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 16:37:45 +0800 Subject: [PATCH 06/21] build(deps): bump golang.org/x/crypto from 0.36.0 to 0.45.0 (#3456) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.45.0. - [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.45.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.45.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: lx <92799281+brilliant-lx@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 17 +++++++++-------- go.sum | 34 ++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index ad228f96db..a838e8273f 100644 --- a/go.mod +++ b/go.mod @@ -80,13 +80,13 @@ require ( github.com/willf/bitset v1.1.3 go.uber.org/automaxprocs v1.5.2 go.uber.org/goleak v1.3.0 - golang.org/x/crypto v0.36.0 + golang.org/x/crypto v0.45.0 golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 - golang.org/x/sync v0.12.0 - golang.org/x/sys v0.31.0 - golang.org/x/text v0.23.0 + golang.org/x/sync v0.18.0 + golang.org/x/sys v0.38.0 + golang.org/x/text v0.31.0 golang.org/x/time v0.9.0 - golang.org/x/tools v0.30.0 + golang.org/x/tools v0.38.0 google.golang.org/protobuf v1.36.3 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 @@ -302,10 +302,11 @@ require ( go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/mod v0.23.0 // indirect - golang.org/x/net v0.38.0 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.27.0 // indirect - golang.org/x/term v0.30.0 // indirect + golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect + golang.org/x/term v0.37.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/grpc v1.69.4 // indirect diff --git a/go.sum b/go.sum index b333de6c62..e3b0e709f0 100644 --- a/go.sum +++ b/go.sum @@ -1263,8 +1263,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= +golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1304,8 +1304,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1360,8 +1360,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1389,8 +1389,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= +golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1478,8 +1478,10 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 h1:LvzTn0GQhWuvKH/kVRS3R3bVAsdQWI7hvfLHGgh9+lU= +golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1488,8 +1490,8 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1504,8 +1506,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1575,8 +1577,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From d550840922f8bc4727bcc93777f46a9604ed459f Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Fri, 21 Nov 2025 15:40:38 +0800 Subject: [PATCH 07/21] params: define MendelTime (#3458) --- cmd/geth/chaincmd.go | 5 ++++ cmd/geth/config.go | 4 +++ cmd/geth/main.go | 1 + cmd/utils/flags.go | 5 ++++ consensus/misc/eip4844/eip4844.go | 2 +- core/genesis.go | 4 +++ eth/backend.go | 4 +++ eth/catalyst/simulated_beacon.go | 2 +- eth/ethconfig/config.go | 3 +++ eth/ethconfig/gen_config.go | 6 +++++ eth/tracers/api.go | 44 +++++++++++++++++++++++++++++++ params/config.go | 42 ++++++++++++++++++++++++++--- params/forks/forks.go | 2 ++ 13 files changed, 118 insertions(+), 6 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 658f5c27a9..f7ce4240c0 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -72,6 +72,7 @@ var ( utils.OverrideMaxwell, utils.OverrideFermi, utils.OverrideOsaka, + utils.OverrideMendel, utils.OverrideVerkle, // utils.MultiDataBaseFlag, }, utils.DatabaseFlags), @@ -349,6 +350,10 @@ func initGenesis(ctx *cli.Context) error { v := ctx.Uint64(utils.OverrideOsaka.Name) overrides.OverrideOsaka = &v } + if ctx.IsSet(utils.OverrideMendel.Name) { + v := ctx.Uint64(utils.OverrideMendel.Name) + overrides.OverrideMendel = &v + } if ctx.IsSet(utils.OverrideVerkle.Name) { v := ctx.Uint64(utils.OverrideVerkle.Name) overrides.OverrideVerkle = &v diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 16786ae249..84e107667d 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -274,6 +274,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { v := ctx.Uint64(utils.OverrideOsaka.Name) cfg.Eth.OverrideOsaka = &v } + if ctx.IsSet(utils.OverrideMendel.Name) { + v := ctx.Uint64(utils.OverrideMendel.Name) + cfg.Eth.OverrideMendel = &v + } if ctx.IsSet(utils.OverrideVerkle.Name) { v := ctx.Uint64(utils.OverrideVerkle.Name) cfg.Eth.OverrideVerkle = &v diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 4e164ee78b..e4a71282d5 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -77,6 +77,7 @@ var ( utils.OverrideMaxwell, utils.OverrideFermi, utils.OverrideOsaka, + utils.OverrideMendel, utils.OverrideVerkle, utils.OverrideFullImmutabilityThreshold, utils.OverrideMinBlocksForBlobRequests, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 51a17de863..f27bca90ab 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -320,6 +320,11 @@ var ( Usage: "Manually specify the Osaka fork timestamp, overriding the bundled setting", Category: flags.EthCategory, } + OverrideMendel = &cli.Uint64Flag{ + Name: "override.mendel", + Usage: "Manually specify the Mendel fork timestamp, overriding the bundled setting", + Category: flags.EthCategory, + } OverrideVerkle = &cli.Uint64Flag{ Name: "override.verkle", Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting", diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 15e427deca..985893cf9e 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -83,7 +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.Osaka: + case forks.Mendel, forks.Osaka: frac = config.BlobScheduleConfig.Osaka.UpdateFraction case forks.Fermi, forks.Maxwell, forks.Lorentz, forks.Prague: frac = config.BlobScheduleConfig.Prague.UpdateFraction diff --git a/core/genesis.go b/core/genesis.go index 2437089b2a..883db7d751 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -272,6 +272,7 @@ type ChainOverrides struct { OverrideMaxwell *uint64 OverrideFermi *uint64 OverrideOsaka *uint64 + OverrideMendel *uint64 OverrideVerkle *uint64 } @@ -304,6 +305,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error { if o.OverrideOsaka != nil { cfg.OsakaTime = o.OverrideOsaka } + if o.OverrideMendel != nil { + cfg.MendelTime = o.OverrideMendel + } if o.OverrideVerkle != nil { cfg.VerkleTime = o.OverrideVerkle } diff --git a/eth/backend.go b/eth/backend.go index a4f6f08586..9fc86e248f 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -256,6 +256,10 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { chainConfig.OsakaTime = config.OverrideOsaka overrides.OverrideOsaka = config.OverrideOsaka } + if config.OverrideMendel != nil { + chainConfig.MendelTime = config.OverrideMendel + overrides.OverrideMendel = config.OverrideMendel + } if config.OverrideVerkle != nil { chainConfig.VerkleTime = config.OverrideVerkle overrides.OverrideVerkle = config.OverrideVerkle diff --git a/eth/catalyst/simulated_beacon.go b/eth/catalyst/simulated_beacon.go index 0642d6a1ad..2c94a95f36 100644 --- a/eth/catalyst/simulated_beacon.go +++ b/eth/catalyst/simulated_beacon.go @@ -100,7 +100,7 @@ type SimulatedBeacon struct { func payloadVersion(config *params.ChainConfig, time uint64) engine.PayloadVersion { switch config.LatestFork(time) { - case forks.Prague, forks.Cancun: + case forks.Mendel, forks.Osaka, forks.Fermi, forks.Maxwell, forks.Lorentz, forks.Prague, forks.Cancun: return engine.PayloadV3 case forks.Paris, forks.Shanghai: return engine.PayloadV2 diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 3b3faa18ea..a95f0dfd14 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -210,6 +210,9 @@ type Config struct { // OverrideOsaka (TODO: remove after the fork) OverrideOsaka *uint64 `toml:",omitempty"` + // OverrideMendel (TODO: remove after the fork) + OverrideMendel *uint64 `toml:",omitempty"` + // OverrideVerkle (TODO: remove after the fork) OverrideVerkle *uint64 `toml:",omitempty"` diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index cce5e6b576..70b5ef0bae 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -75,6 +75,7 @@ func (c Config) MarshalTOML() (interface{}, error) { OverrideMaxwell *uint64 `toml:",omitempty"` OverrideFermi *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"` + OverrideMendel *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"` BlobExtraReserve uint64 EnableOpcodeOptimizing bool @@ -144,6 +145,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.OverrideMaxwell = c.OverrideMaxwell enc.OverrideFermi = c.OverrideFermi enc.OverrideOsaka = c.OverrideOsaka + enc.OverrideMendel = c.OverrideMendel enc.OverrideVerkle = c.OverrideVerkle enc.BlobExtraReserve = c.BlobExtraReserve enc.EnableOpcodeOptimizing = c.EnableOpcodeOptimizing @@ -217,6 +219,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { OverrideMaxwell *uint64 `toml:",omitempty"` OverrideFermi *uint64 `toml:",omitempty"` OverrideOsaka *uint64 `toml:",omitempty"` + OverrideMendel *uint64 `toml:",omitempty"` OverrideVerkle *uint64 `toml:",omitempty"` BlobExtraReserve *uint64 EnableOpcodeOptimizing *bool @@ -403,6 +406,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.OverrideOsaka != nil { c.OverrideOsaka = dec.OverrideOsaka } + if dec.OverrideMendel != nil { + c.OverrideMendel = dec.OverrideMendel + } if dec.OverrideVerkle != nil { c.OverrideVerkle = dec.OverrideVerkle } diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 42fbd62770..681652518d 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -1246,18 +1246,62 @@ func overrideConfig(original *params.ChainConfig, override *params.ChainConfig) copy.ShanghaiTime = timestamp canon = false } + if timestamp := override.KeplerTime; timestamp != nil { + copy.KeplerTime = timestamp + canon = false + } + if timestamp := override.FeynmanTime; timestamp != nil { + copy.FeynmanTime = timestamp + canon = false + } + if timestamp := override.FeynmanFixTime; timestamp != nil { + copy.FeynmanFixTime = timestamp + canon = false + } if timestamp := override.CancunTime; timestamp != nil { copy.CancunTime = timestamp canon = false } + if timestamp := override.HaberTime; timestamp != nil { + copy.HaberTime = timestamp + canon = false + } + if timestamp := override.HaberFixTime; timestamp != nil { + copy.HaberFixTime = timestamp + canon = false + } + if timestamp := override.BohrTime; timestamp != nil { + copy.BohrTime = timestamp + canon = false + } + if timestamp := override.PascalTime; timestamp != nil { + copy.PascalTime = timestamp + canon = false + } if timestamp := override.PragueTime; timestamp != nil { copy.PragueTime = timestamp canon = false } + if timestamp := override.LorentzTime; timestamp != nil { + copy.LorentzTime = timestamp + canon = false + } + if timestamp := override.MaxwellTime; timestamp != nil { + copy.MaxwellTime = timestamp + canon = false + } + if timestamp := override.FermiTime; timestamp != nil { + copy.FermiTime = timestamp + canon = false + } if timestamp := override.OsakaTime; timestamp != nil { copy.OsakaTime = timestamp canon = false } + if timestamp := override.MendelTime; timestamp != nil { + copy.MendelTime = timestamp + canon = false + } if timestamp := override.VerkleTime; timestamp != nil { copy.VerkleTime = timestamp canon = false diff --git a/params/config.go b/params/config.go index 7c96e8a68e..bbac109aee 100644 --- a/params/config.go +++ b/params/config.go @@ -227,6 +227,7 @@ var ( MaxwellTime: newUint64(1751250600), // 2025-06-30 02:30:00 AM UTC FermiTime: nil, OsakaTime: nil, + MendelTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ @@ -276,6 +277,7 @@ var ( MaxwellTime: newUint64(1748243100), // 2025-05-26 07:05:00 AM UTC FermiTime: newUint64(1762741500), // 2025-11-10 02:25:00 AM UTC OsakaTime: nil, + MendelTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ @@ -325,8 +327,9 @@ var ( LorentzTime: newUint64(0), MaxwellTime: newUint64(0), // TODO: set them to `0` when passed on the mainnet - FermiTime: nil, - OsakaTime: nil, + FermiTime: nil, + OsakaTime: nil, + MendelTime: nil, Parlia: &ParliaConfig{}, BlobScheduleConfig: &BlobScheduleConfig{ @@ -656,6 +659,7 @@ type ChainConfig struct { MaxwellTime *uint64 `json:"maxwellTime,omitempty"` // Maxwell switch time (nil = no fork, 0 = already on maxwell) FermiTime *uint64 `json:"fermiTime,omitempty"` // Fermi switch time (nil = no fork, 0 = already on fermi) OsakaTime *uint64 `json:"osakaTime,omitempty"` // Osaka switch time (nil = no fork, 0 = already on osaka) + MendelTime *uint64 `json:"mendelTime,omitempty"` // Mendel switch time (nil = no fork, 0 = already on mendel) VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle) // TerminalTotalDifficulty is the amount of total difficulty reached by @@ -837,9 +841,15 @@ func (c *ChainConfig) String() string { OsakaTime = big.NewInt(0).SetUint64(*c.OsakaTime) } + var MendelTime *big.Int + if c.MendelTime != nil { + MendelTime = big.NewInt(0).SetUint64(*c.MendelTime) + } + return fmt.Sprintf("{ChainID: %v, Engine: %v, Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, "+ "MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, "+ - "ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v, OsakaTime: %v}", + "ShanghaiTime: %v, KeplerTime: %v, FeynmanTime: %v, FeynmanFixTime: %v, CancunTime: %v, HaberTime: %v, HaberFixTime: %v, BohrTime: %v, PascalTime: %v, PragueTime: %v, LorentzTime: %v, MaxwellTime: %v, FermiTime: %v, "+ + "OsakaTime: %v, MendelTime: %v}", c.ChainID, engine, c.HomesteadBlock, @@ -886,6 +896,7 @@ func (c *ChainConfig) String() string { MaxwellTime, FermiTime, OsakaTime, + MendelTime, ) } @@ -1300,6 +1311,20 @@ func (c *ChainConfig) IsOnOsaka(currentBlockNumber *big.Int, lastBlockTime uint6 return !c.IsOsaka(lastBlockNumber, lastBlockTime) && c.IsOsaka(currentBlockNumber, currentBlockTime) } +// IsMendel returns whether time is either equal to the Mendel fork time or greater. +func (c *ChainConfig) IsMendel(num *big.Int, time uint64) bool { + return c.IsLondon(num) && isTimestampForked(c.MendelTime, time) +} + +// IsOnMendel eturns whether currentBlockTime is either equal to the Mendel fork time or greater firstly. +func (c *ChainConfig) IsOnMendel(currentBlockNumber *big.Int, lastBlockTime uint64, currentBlockTime uint64) bool { + lastBlockNumber := new(big.Int) + if currentBlockNumber.Cmp(big.NewInt(1)) >= 0 { + lastBlockNumber.Sub(currentBlockNumber, big.NewInt(1)) + } + return !c.IsMendel(lastBlockNumber, lastBlockTime) && c.IsMendel(currentBlockNumber, currentBlockTime) +} + // IsVerkle returns whether time is either equal to the Verkle fork time or greater. func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool { return c.IsLondon(num) && isTimestampForked(c.VerkleTime, time) @@ -1386,6 +1411,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error { {name: "maxwellTime", timestamp: c.MaxwellTime}, {name: "fermiTime", timestamp: c.FermiTime}, {name: "osakaTime", timestamp: c.OsakaTime}, + {name: "mendelTime", timestamp: c.MendelTime}, {name: "verkleTime", timestamp: c.VerkleTime, optional: true}, } { if lastFork.name != "" { @@ -1599,6 +1625,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkTimestampIncompatible(c.OsakaTime, newcfg.OsakaTime, headTimestamp) { return newTimestampCompatError("Osaka fork timestamp", c.OsakaTime, newcfg.OsakaTime) } + if isForkTimestampIncompatible(c.MendelTime, newcfg.MendelTime, headTimestamp) { + return newTimestampCompatError("Mendel fork timestamp", c.MendelTime, newcfg.MendelTime) + } if isForkTimestampIncompatible(c.VerkleTime, newcfg.VerkleTime, headTimestamp) { return newTimestampCompatError("Verkle fork timestamp", c.VerkleTime, newcfg.VerkleTime) } @@ -1622,6 +1651,8 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork { london := c.LondonBlock switch { + case c.IsMendel(london, time): + return forks.Mendel case c.IsOsaka(london, time): return forks.Osaka case c.IsFermi(london, time): @@ -1645,6 +1676,8 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork { // the fork isn't defined or isn't a time-based fork. func (c *ChainConfig) Timestamp(fork forks.Fork) *uint64 { switch { + case fork == forks.Mendel: + return c.MendelTime case fork == forks.Osaka: return c.OsakaTime case fork == forks.Fermi: @@ -1814,7 +1847,7 @@ type Rules struct { IsHertzfix bool IsShanghai, IsKepler, IsFeynman, IsCancun, IsHaber bool IsBohr, IsPascal, IsPrague, IsLorentz, IsMaxwell bool - IsFermi, IsOsaka, IsVerkle bool + IsFermi, IsOsaka, IsMendel, IsVerkle bool } // Rules ensures c's ChainID is not nil. @@ -1859,6 +1892,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules IsMaxwell: c.IsMaxwell(num, timestamp), IsFermi: c.IsFermi(num, timestamp), IsOsaka: c.IsOsaka(num, timestamp), + IsMendel: c.IsMendel(num, timestamp), IsVerkle: c.IsVerkle(num, timestamp), IsEIP4762: isVerkle, } diff --git a/params/forks/forks.go b/params/forks/forks.go index 27ac421c0c..ff12e1f464 100644 --- a/params/forks/forks.go +++ b/params/forks/forks.go @@ -44,6 +44,7 @@ const ( Maxwell Fermi Osaka + Mendel ) // String implements fmt.Stringer. @@ -79,4 +80,5 @@ var forkToString = map[Fork]string{ Maxwell: "Maxwell", Fermi: "Fermi", Osaka: "Osaka", + Mendel: "Mendel", } From e9f5535bea1a7217a795948bf37fc1a4a80da3f3 Mon Sep 17 00:00:00 2001 From: wayen <19421226+flywukong@users.noreply.github.com> Date: Tue, 25 Nov 2025 11:27:54 +0800 Subject: [PATCH 08/21] eth: support fetch commit id info from extra data (#3454) --- cmd/jsutils/getchainstatus.js | 53 +++++++++++++++++++++++++++++++---- eth/backend.go | 24 ++++++++++++---- 2 files changed, 66 insertions(+), 11 deletions(-) diff --git a/cmd/jsutils/getchainstatus.js b/cmd/jsutils/getchainstatus.js index 939b09c183..ee6d050283 100644 --- a/cmd/jsutils/getchainstatus.js +++ b/cmd/jsutils/getchainstatus.js @@ -315,10 +315,53 @@ async function getBinaryVersion() { let turnLength = program.turnLength; for (let i = 0; i < program.num; i++) { let blockData = await provider.getBlock(blockNum - i * turnLength); - // 1.get Geth client version - let major = ethers.toNumber(ethers.dataSlice(blockData.extraData, 2, 3)); - let minor = ethers.toNumber(ethers.dataSlice(blockData.extraData, 3, 4)); - let patch = ethers.toNumber(ethers.dataSlice(blockData.extraData, 4, 5)); + + let major = 0, minor = 0, patch = 0; + let commitID = ""; + + try { + major = ethers.toNumber(ethers.dataSlice(blockData.extraData, 2, 3)); + minor = ethers.toNumber(ethers.dataSlice(blockData.extraData, 3, 4)); + patch = ethers.toNumber(ethers.dataSlice(blockData.extraData, 4, 5)); + + // Check version: >= 1.6.4 uses new format with commitID + const isNewFormat = major > 1 || (major === 1 && minor > 6) || (major === 1 && minor === 6 && patch >= 4); + + if (isNewFormat) { + const extraVanity = 28; + let vanityBytes = ethers.getBytes(ethers.dataSlice(blockData.extraData, 0, extraVanity)); + + let rlpLength = vanityBytes.length; + if (vanityBytes[0] >= 0xC0 && vanityBytes[0] <= 0xF7) { + rlpLength = (vanityBytes[0] - 0xC0) + 1; + } + + const rlpData = ethers.dataSlice(blockData.extraData, 0, rlpLength); + const decoded = ethers.decodeRlp(rlpData); + + if (Array.isArray(decoded) && decoded.length >= 2) { + const secondElemHex = decoded[1]; + let secondElemStr = ""; + try { + secondElemStr = ethers.toUtf8String(secondElemHex); + } catch (e) { + secondElemStr = secondElemHex; + } + + if (secondElemStr.length > 0 && secondElemStr !== "geth") { + commitID = secondElemStr.startsWith("0x") ? secondElemStr.substring(2) : secondElemStr; + } + } + } + } catch (e) { + console.log("Parsing failed:", e.message); + } + + // Format version string + let versionStr = major + "." + minor + "." + patch; + if (commitID && commitID.length > 0) { + versionStr = versionStr + "-" + commitID; + } // 2.get minimum txGasPrice based on the last non-zero-gasprice transaction let lastGasPrice = 0; @@ -332,7 +375,7 @@ async function getBinaryVersion() { break; } var moniker = await getValidatorMoniker(blockData.miner, blockNum); - console.log(blockNum - i * turnLength, blockData.miner, "version =", major + "." + minor + "." + patch, " MinGasPrice = " + lastGasPrice, moniker); + console.log(blockNum - i * turnLength, blockData.miner, "version =", versionStr, " MinGasPrice = " + lastGasPrice, moniker); } } diff --git a/eth/backend.go b/eth/backend.go index 9fc86e248f..6b83607f81 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -28,11 +28,12 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/parlia" "github.com/ethereum/go-ethereum/core" @@ -66,7 +67,6 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/dnsdisc" "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/triedb/pathdb" @@ -514,12 +514,24 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { func makeExtraData(extra []byte) []byte { if len(extra) == 0 { - // create default extradata + // For version >= 1.6.4, use compact format: [version(uint32), commitID, go_version, os] + commitID := "" + git, ok := version.VCS() + if ok && len(git.Commit) >= 8 { + commitID = git.Commit[:8] + } + + osName := runtime.GOOS + if len(osName) > 3 { + osName = osName[:3] + } + + versionWord := uint32(gethversion.Major<<16 | gethversion.Minor<<8 | gethversion.Patch) extra, _ = rlp.EncodeToBytes([]interface{}{ - uint(gethversion.Major<<16 | gethversion.Minor<<8 | gethversion.Patch), - "geth", + versionWord, + commitID, runtime.Version(), - runtime.GOOS, + osName, }) } if uint64(len(extra)) > params.MaximumExtraDataSize-params.ForkIDSize { From 554f7e87c6595aa81e53ebb04315b5e9ae8ac4d6 Mon Sep 17 00:00:00 2001 From: wayen <19421226+flywukong@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:53:05 +0800 Subject: [PATCH 09/21] eth: improve prefetch by using cached reader (#3445) --- core/state_prefetcher.go | 2 +- miner/bid_simulator.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index 4f71e33cb1..68fb444188 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -66,7 +66,7 @@ func (p *statePrefetcher) Prefetch(transactions types.Transactions, header *type // Iterate over and process the individual transactions for i, tx := range transactions { - stateCpy := statedb.CopyDoPrefetch() // closure + stateCpy := statedb.CopyDoPrefetch() workers.Go(func() error { // If block precaching was interrupted, abort if interrupt != nil && interrupt.Load() { diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index b81ab2614e..9bcb6a1da3 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -771,8 +771,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { if len(bidRuntime.bid.Txs) > prefetchTxNumber { var interrupt atomic.Bool defer interrupt.Store(true) // terminate the prefetch at the end - // TODO(Nathan): use ReadersWithCacheStats to accelerate - throwaway := bidRuntime.env.state.CopyDoPrefetch() + throwaway := bidRuntime.env.state.StateForPrefetch() // Disable tracing for prefetcher executions. vmCfg := *b.chain.GetVMConfig() vmCfg.Tracer = nil From b135fd9fdcf820082e7370916e64eb3669de38d2 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Wed, 26 Nov 2025 09:53:01 +0800 Subject: [PATCH 10/21] eth: fix stuck when starting up a new network (#3460) * eth: fix stuck when starting up a new network * eth: fix UT * eth: improve fixing UT --- eth/handler.go | 3 ++- eth/handler_eth.go | 4 ++++ eth/sync.go | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 6f2bb7cdde..bb63d64bfa 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -833,7 +833,8 @@ func (h *handler) BroadcastBlock(block *types.Block, propagate bool) { // Step 1: Select target peers for initial broadcast. limit := totalPeers - if !h.directBroadcast { + if !h.directBroadcast && + !(h.networkID == 714 /*RialtoChainConfig.ChainID*/ && block.NumberU64() == 1) { // Populate TD from every receiver on startup to establish proper sync. limit = int(math.Sqrt(float64(totalPeers))) } diff --git a/eth/handler_eth.go b/eth/handler_eth.go index 0099fb0873..d96b3b849c 100644 --- a/eth/handler_eth.go +++ b/eth/handler_eth.go @@ -165,6 +165,10 @@ func (h *ethHandler) handleBlockBroadcast(peer *eth.Peer, packet *eth.NewBlockPa trueHead = block.ParentHash() trueTD = new(big.Int).Sub(td, block.Difficulty()) ) + if block.NumberU64() == 1 { // this enable sync with the right peer when starting up a new network + trueHead = block.Hash() + trueTD = td + } // Update the peer's total difficulty if better than the previous if _, td := peer.Head(); trueTD.Cmp(td) > 0 { peer.SetHead(trueHead, trueTD) diff --git a/eth/sync.go b/eth/sync.go index 9c608f374c..cf66a324d4 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -260,7 +260,11 @@ func (h *handler) doSync(op *chainSyncOp) error { // degenerate connectivity, but it should be healthy for the mainnet too to // more reliably update peers or the local TD state. if block := h.chain.GetBlock(head.Hash(), head.Number.Uint64()); block != nil { - h.BroadcastBlock(block, false) + if head.Number.Uint64() == 1 { // Update TD from all receivers during network initialization. + h.BroadcastBlock(block, true) + } else { + h.BroadcastBlock(block, false) + } } } return nil From a35c6d21c2caff7f1f61ee71d790d26c71cde15b Mon Sep 17 00:00:00 2001 From: Eric <45141191+zlacfzy@users.noreply.github.com> Date: Wed, 26 Nov 2025 10:30:13 +0800 Subject: [PATCH 11/21] feat: transactionReceipts auto-unsubscribe implementation (#3459) --- eth/filters/api.go | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/eth/filters/api.go b/eth/filters/api.go index b577d58d14..499610cd45 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -452,7 +452,19 @@ func (api *FilterAPI) TransactionReceipts(ctx context.Context, filter *Transacti gopool.Submit(func() { defer receiptsSub.Unsubscribe() - signer := types.LatestSigner(api.sys.backend.ChainConfig()) + var ( + signer = types.LatestSigner(api.sys.backend.ChainConfig()) + pending map[common.Hash]struct{} // Track pending receipts, nil means never auto-unsubscribe + gracePeriod <-chan time.Time + ) + + // Initialize pending map for specific tx hashes + if len(txHashes) > 0 { + pending = make(map[common.Hash]struct{}, len(txHashes)) + for _, hash := range txHashes { + pending[hash] = struct{}{} + } + } for { select { @@ -473,7 +485,21 @@ func (api *FilterAPI) TransactionReceipts(ctx context.Context, filter *Transacti // Send a batch of tx receipts in one notification notifier.Notify(rpcSub.ID, marshaledReceipts) + + // Auto-unsubscribe when all receipts received (with grace period for reorgs) + if pending != nil { + for _, receiptWithTx := range receiptsWithTxs { + if receiptWithTx.Transaction != nil { + delete(pending, receiptWithTx.Transaction.Hash()) + } + } + if len(pending) == 0 && gracePeriod == nil { + gracePeriod = time.After(12 * time.Second) // Grace period for reorg handling + } + } } + case <-gracePeriod: + return case <-rpcSub.Err(): return } From 57e3e976d0ec79e2ee9aea3459f4945d535cd033 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:47:01 +0800 Subject: [PATCH 12/21] cmd/geth: config staticnodes for fullnode when init-network (#3462) --- cmd/geth/chaincmd.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index f7ce4240c0..12fdfdb062 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -456,7 +456,7 @@ func createPorts(ipStr string, port int, size int) []int { } // Create config for node i in the cluster -func createNodeConfig(baseConfig gethConfig, ip string, port int, enodes []*enode.Node, index int, staticConnect bool) gethConfig { +func createNodeConfig(baseConfig gethConfig, prefix string, ip string, port int, enodes []*enode.Node, index int) gethConfig { baseConfig.Node.HTTPHost = ip baseConfig.Node.P2P.ListenAddr = fmt.Sprintf(":%d", port) connectEnodes := make([]*enode.Node, 0, len(enodes)-1) @@ -467,9 +467,10 @@ func createNodeConfig(baseConfig gethConfig, ip string, port int, enodes []*enod connectEnodes = append(connectEnodes, enodes[j]) } // Set the P2P connections between this node and the other nodes - if staticConnect { - baseConfig.Node.P2P.StaticNodes = connectEnodes - } else { + baseConfig.Node.P2P.StaticNodes = connectEnodes + if prefix == "fullnode" { + // Fullnodes may reside in different regions than the `enodes`. + // StaticNodes cannot connect to them directly, but can still discover them. baseConfig.Node.P2P.BootstrapNodes = connectEnodes } return baseConfig @@ -544,7 +545,7 @@ func initNetwork(ctx *cli.Context) error { connectOneExtraEnodes = true } - configs, enodes, accounts, err := createConfigs(config, initDir, "node", ips, ports, sentryEnodes, connectOneExtraEnodes, true) + configs, enodes, accounts, err := createConfigs(config, initDir, "node", ips, ports, sentryEnodes, connectOneExtraEnodes) if err != nil { utils.Fatalf("Failed to create node configs: %v", err) } @@ -625,7 +626,7 @@ func createSentryNodeConfigs(ctx *cli.Context, baseConfig gethConfig, initDir st if err != nil { utils.Fatalf("Failed to parse ports: %v", err) } - configs, enodes, _, err := createConfigs(baseConfig, initDir, "sentry", ips, ports, nil, false, true) + configs, enodes, _, err := createConfigs(baseConfig, initDir, "sentry", ips, ports, nil, false) if err != nil { utils.Fatalf("Failed to create config: %v", err) } @@ -648,7 +649,7 @@ func createAndSaveFullNodeConfigs(ctx *cli.Context, inGenesisFile *os.File, base utils.Fatalf("Failed to parse ports: %v", err) } - configs, enodes, _, err := createConfigs(baseConfig, initDir, "fullnode", ips, ports, extraEnodes, false, false) + configs, enodes, _, err := createConfigs(baseConfig, initDir, "fullnode", ips, ports, extraEnodes, false) if err != nil { utils.Fatalf("Failed to create config: %v", err) } @@ -663,7 +664,7 @@ func createAndSaveFullNodeConfigs(ctx *cli.Context, inGenesisFile *os.File, base return configs, enodes, nil } -func createConfigs(base gethConfig, initDir string, prefix string, ips []string, ports []int, extraEnodes []*enode.Node, connectOneExtraEnodes bool, staticConnect bool) ([]gethConfig, []*enode.Node, [][]common.Address, error) { +func createConfigs(base gethConfig, initDir string, prefix string, ips []string, ports []int, extraEnodes []*enode.Node, connectOneExtraEnodes bool) ([]gethConfig, []*enode.Node, [][]common.Address, error) { if len(ips) != len(ports) { return nil, nil, nil, errors.New("mismatch of size and length of ports") } @@ -694,7 +695,7 @@ func createConfigs(base gethConfig, initDir string, prefix string, ips []string, allEnodes = []*enode.Node{enodes[i], extraEnodes[i]} index = 0 } - configs[i] = createNodeConfig(base, ips[i], ports[i], allEnodes, index, staticConnect) + configs[i] = createNodeConfig(base, prefix, ips[i], ports[i], allEnodes, index) } return configs, enodes, accounts, nil } From 032ccc77861e9013041bd455ba08c271b78ba3ff Mon Sep 17 00:00:00 2001 From: hongmengning Date: Thu, 27 Nov 2025 17:52:20 -0800 Subject: [PATCH 13/21] refactor: replace context.WithCancel with t.Context (#3285) Signed-off-by: hongmengning --- core/state_prefetcher_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/state_prefetcher_test.go b/core/state_prefetcher_test.go index c40e9c0a07..9e04ec915f 100644 --- a/core/state_prefetcher_test.go +++ b/core/state_prefetcher_test.go @@ -26,8 +26,7 @@ import ( ) func TestPrefetchLeaking(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx := t.Context() var ( gendb = rawdb.NewMemoryDatabase() key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") From d3157ef7c98406fdce39be1755d58ebf03b9166e Mon Sep 17 00:00:00 2001 From: stellrust Date: Fri, 28 Nov 2025 13:40:32 +0800 Subject: [PATCH 14/21] refactor: use slices.Contains to simplify code (#3245) Signed-off-by: stellrust --- miner/worker.go | 16 +++++++--------- p2p/peer.go | 6 ++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/miner/worker.go b/miner/worker.go index dbabc947dd..e0f6c3c41f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -20,6 +20,7 @@ import ( "errors" "fmt" "math/big" + "slices" "sync" "sync/atomic" "time" @@ -589,15 +590,12 @@ func (w *worker) resultLoop() { if prev, ok := w.recentMinedBlocks.Get(block.NumberU64()); ok { doubleSign := false prevParents := prev - for _, prevParent := range prevParents { - if prevParent == block.ParentHash() { - log.Error("Reject Double Sign!!", "block", block.NumberU64(), - "hash", block.Hash(), - "root", block.Root(), - "ParentHash", block.ParentHash()) - doubleSign = true - break - } + if slices.Contains(prevParents, block.ParentHash()) { + log.Error("Reject Double Sign!!", "block", block.NumberU64(), + "hash", block.Hash(), + "root", block.Root(), + "ParentHash", block.ParentHash()) + doubleSign = true } if doubleSign { continue diff --git a/p2p/peer.go b/p2p/peer.go index f9e9d424da..1f781fe0c3 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -209,10 +209,8 @@ func (p *Peer) Caps() []Cap { // versions is supported by both this node and the peer p. func (p *Peer) RunningCap(protocol string, versions []uint) bool { if proto, ok := p.running[protocol]; ok { - for _, ver := range versions { - if proto.Version == ver { - return true - } + if slices.Contains(versions, proto.Version) { + return true } } return false From 313c220c9c9245047ccf708ebbb5e5f76b3a361c Mon Sep 17 00:00:00 2001 From: pinglanlu Date: Fri, 28 Nov 2025 13:41:03 +0800 Subject: [PATCH 15/21] refactor: replace Split in loops with more efficient SplitSeq (#3262) * refactor: replace Split in loops with more efficient SplitSeq Signed-off-by: pinglanlu * Update node/api.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: pinglanlu Co-authored-by: buddho <7995985+buddh0@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- internal/cmdtest/test_cmd.go | 4 ++-- internal/debug/api.go | 2 +- log/handler_glog.go | 4 ++-- node/api.go | 10 +++++----- node/rpcstack_test.go | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/cmdtest/test_cmd.go b/internal/cmdtest/test_cmd.go index f6f0425598..cabd0fe63b 100644 --- a/internal/cmdtest/test_cmd.go +++ b/internal/cmdtest/test_cmd.go @@ -255,8 +255,8 @@ type testlogger struct { } func (tl *testlogger) Write(b []byte) (n int, err error) { - lines := bytes.Split(b, []byte("\n")) - for _, line := range lines { + lines := bytes.SplitSeq(b, []byte("\n")) + for line := range lines { if len(line) > 0 { tl.t.Logf("(stderr:%v) %s", tl.name, line) } diff --git a/internal/debug/api.go b/internal/debug/api.go index 1bac36e908..21592c2b27 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -217,7 +217,7 @@ func (*HandlerT) Stacks(filter *string) string { dump := buf.String() buf.Reset() - for _, trace := range strings.Split(dump, "\n\n") { + for trace := range strings.SplitSeq(dump, "\n\n") { if ok, _ := expr.Evaluate(map[string]string{"Value": trace}); ok { buf.WriteString(trace) buf.WriteString("\n\n") diff --git a/log/handler_glog.go b/log/handler_glog.go index 739f8c5b42..021d507c05 100644 --- a/log/handler_glog.go +++ b/log/handler_glog.go @@ -86,7 +86,7 @@ func (h *GlogHandler) Verbosity(level slog.Level) { // sets V to 3 in all files of any packages whose import path contains "foo" func (h *GlogHandler) Vmodule(ruleset string) error { var filter []pattern - for _, rule := range strings.Split(ruleset, ",") { + for rule := range strings.SplitSeq(ruleset, ",") { // Empty strings such as from a trailing comma can be ignored if len(rule) == 0 { continue @@ -113,7 +113,7 @@ func (h *GlogHandler) Vmodule(ruleset string) error { } // Compile the rule pattern into a regular expression matcher := ".*" - for _, comp := range strings.Split(parts[0], "/") { + for comp := range strings.SplitSeq(parts[0], "/") { if comp == "*" { matcher += "(/.*)?" } else if comp != "" { diff --git a/node/api.go b/node/api.go index 27b91d4aee..43367b1dab 100644 --- a/node/api.go +++ b/node/api.go @@ -186,19 +186,19 @@ func (api *adminAPI) StartHTTP(host *string, port *int, cors *string, apis *stri } if cors != nil { config.CorsAllowedOrigins = nil - for _, origin := range strings.Split(*cors, ",") { + for origin := range strings.SplitSeq(*cors, ",") { config.CorsAllowedOrigins = append(config.CorsAllowedOrigins, strings.TrimSpace(origin)) } } if vhosts != nil { config.Vhosts = nil - for _, vhost := range strings.Split(*host, ",") { + for vhost := range strings.SplitSeq(*vhosts, ",") { config.Vhosts = append(config.Vhosts, strings.TrimSpace(vhost)) } } if apis != nil { config.Modules = nil - for _, m := range strings.Split(*apis, ",") { + for m := range strings.SplitSeq(*apis, ",") { config.Modules = append(config.Modules, strings.TrimSpace(m)) } } @@ -265,13 +265,13 @@ func (api *adminAPI) StartWS(host *string, port *int, allowedOrigins *string, ap } if apis != nil { config.Modules = nil - for _, m := range strings.Split(*apis, ",") { + for m := range strings.SplitSeq(*apis, ",") { config.Modules = append(config.Modules, strings.TrimSpace(m)) } } if allowedOrigins != nil { config.Origins = nil - for _, origin := range strings.Split(*allowedOrigins, ",") { + for origin := range strings.SplitSeq(*allowedOrigins, ",") { config.Origins = append(config.Origins, strings.TrimSpace(origin)) } } diff --git a/node/rpcstack_test.go b/node/rpcstack_test.go index 54e58cccb2..5bf05aebb0 100644 --- a/node/rpcstack_test.go +++ b/node/rpcstack_test.go @@ -74,8 +74,8 @@ type originTest struct { // and trims excessive white space from the substrings. // Copied over from flags.go func splitAndTrim(input string) (ret []string) { - l := strings.Split(input, ",") - for _, r := range l { + l := strings.SplitSeq(input, ",") + for r := range l { r = strings.TrimSpace(r) if len(r) > 0 { ret = append(ret, r) From 713eb44535cf913b3fa38552c019d5bb9977ebb5 Mon Sep 17 00:00:00 2001 From: rifeplight Date: Fri, 28 Nov 2025 14:13:12 +0800 Subject: [PATCH 16/21] refactor: drop legacy // +build comment (#3464) Signed-off-by: rifeplight --- accounts/keystore/watch.go | 1 - accounts/keystore/watch_fallback.go | 1 - cmd/utils/diskusage.go | 1 - cmd/utils/diskusage_openbsd.go | 1 - common/fdlimit/fdlimit_bsd.go | 1 - common/fdlimit/fdlimit_unix.go | 1 - core/mkalloc.go | 1 - crypto/blake2b/blake2bAVX2_amd64.go | 1 - crypto/blake2b/blake2b_amd64.go | 1 - crypto/blake2b/blake2b_f_fuzz_test.go | 1 - crypto/blake2b/blake2b_ref.go | 1 - crypto/blake2b/register.go | 1 - crypto/bn256/bn256_fast.go | 1 - crypto/bn256/bn256_slow.go | 1 - crypto/bn256/cloudflare/gfp_decl.go | 1 - crypto/bn256/cloudflare/gfp_generic.go | 1 - crypto/secp256k1/dummy.go | 1 - crypto/secp256k1/scalar_mult_nocgo.go | 1 - crypto/secp256k1/secp256_test.go | 1 - crypto/signature_cgo.go | 1 - crypto/signature_nocgo.go | 1 - crypto/signify/signify_fuzz.go | 1 - ethdb/leveldb/leveldb.go | 1 - metrics/cpu_disabled.go | 1 - metrics/cpu_enabled.go | 1 - metrics/cputime_nop.go | 1 - metrics/cputime_unix.go | 1 - metrics/disk_nop.go | 1 - metrics/syslog.go | 1 - p2p/netutil/toobig_notwindows.go | 1 - p2p/netutil/toobig_windows.go | 1 - rlp/safe.go | 1 - rlp/unsafe.go | 1 - rpc/ipc_js.go | 1 - rpc/ipc_unix.go | 1 - rpc/ipc_wasip1.go | 1 - rpc/ipc_windows.go | 1 - tests/fuzzers/bls12381/bls12381_fuzz.go | 1 - tests/fuzzers/bls12381/bls12381_test.go | 1 - 39 files changed, 39 deletions(-) diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 1bef321cd1..b623e7d7bb 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build (darwin && !ios && cgo) || freebsd || (linux && !arm64) || netbsd || solaris -// +build darwin,!ios,cgo freebsd linux,!arm64 netbsd solaris package keystore diff --git a/accounts/keystore/watch_fallback.go b/accounts/keystore/watch_fallback.go index e3c133b3f6..17513ae3bc 100644 --- a/accounts/keystore/watch_fallback.go +++ b/accounts/keystore/watch_fallback.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build (darwin && !cgo) || ios || (linux && arm64) || windows || (!darwin && !freebsd && !linux && !netbsd && !solaris) -// +build darwin,!cgo ios linux,arm64 windows !darwin,!freebsd,!linux,!netbsd,!solaris // This is the fallback implementation of directory watching. // It is used on unsupported platforms. diff --git a/cmd/utils/diskusage.go b/cmd/utils/diskusage.go index 8174236ab7..ec9b2e424a 100644 --- a/cmd/utils/diskusage.go +++ b/cmd/utils/diskusage.go @@ -15,7 +15,6 @@ // along with go-ethereum. If not, see . //go:build !windows && !openbsd && !wasip1 -// +build !windows,!openbsd,!wasip1 package utils diff --git a/cmd/utils/diskusage_openbsd.go b/cmd/utils/diskusage_openbsd.go index 0d71d84a67..fce27070b4 100644 --- a/cmd/utils/diskusage_openbsd.go +++ b/cmd/utils/diskusage_openbsd.go @@ -15,7 +15,6 @@ // along with go-ethereum. If not, see . //go:build openbsd -// +build openbsd package utils diff --git a/common/fdlimit/fdlimit_bsd.go b/common/fdlimit/fdlimit_bsd.go index a3a6902c09..ede9955168 100644 --- a/common/fdlimit/fdlimit_bsd.go +++ b/common/fdlimit/fdlimit_bsd.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build freebsd || dragonfly -// +build freebsd dragonfly package fdlimit diff --git a/common/fdlimit/fdlimit_unix.go b/common/fdlimit/fdlimit_unix.go index a1f388ebb7..704ca27f26 100644 --- a/common/fdlimit/fdlimit_unix.go +++ b/common/fdlimit/fdlimit_unix.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build linux || netbsd || openbsd || solaris -// +build linux netbsd openbsd solaris package fdlimit diff --git a/core/mkalloc.go b/core/mkalloc.go index cc4955f038..f21e349e16 100644 --- a/core/mkalloc.go +++ b/core/mkalloc.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build none -// +build none /* The mkalloc tool creates the genesis allocation constants in genesis_alloc.go diff --git a/crypto/blake2b/blake2bAVX2_amd64.go b/crypto/blake2b/blake2bAVX2_amd64.go index 3a85d0e73a..bfeee2be9e 100644 --- a/crypto/blake2b/blake2bAVX2_amd64.go +++ b/crypto/blake2b/blake2bAVX2_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build go1.7 && amd64 && !gccgo && !appengine -// +build go1.7,amd64,!gccgo,!appengine package blake2b diff --git a/crypto/blake2b/blake2b_amd64.go b/crypto/blake2b/blake2b_amd64.go index a318b2b617..7f933ecb92 100644 --- a/crypto/blake2b/blake2b_amd64.go +++ b/crypto/blake2b/blake2b_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !go1.7 && amd64 && !gccgo && !appengine -// +build !go1.7,amd64,!gccgo,!appengine package blake2b diff --git a/crypto/blake2b/blake2b_f_fuzz_test.go b/crypto/blake2b/blake2b_f_fuzz_test.go index 1de9a62de9..1913ede34d 100644 --- a/crypto/blake2b/blake2b_f_fuzz_test.go +++ b/crypto/blake2b/blake2b_f_fuzz_test.go @@ -1,6 +1,5 @@ // Only enable fuzzer on platforms with AVX enabled //go:build go1.7 && amd64 && !gccgo && !appengine -// +build go1.7,amd64,!gccgo,!appengine package blake2b diff --git a/crypto/blake2b/blake2b_ref.go b/crypto/blake2b/blake2b_ref.go index 095c71a648..682544100f 100644 --- a/crypto/blake2b/blake2b_ref.go +++ b/crypto/blake2b/blake2b_ref.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !amd64 || appengine || gccgo -// +build !amd64 appengine gccgo package blake2b diff --git a/crypto/blake2b/register.go b/crypto/blake2b/register.go index 9d8633963c..d9fcac3a4d 100644 --- a/crypto/blake2b/register.go +++ b/crypto/blake2b/register.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build go1.9 -// +build go1.9 package blake2b diff --git a/crypto/bn256/bn256_fast.go b/crypto/bn256/bn256_fast.go index e3c9b60518..eda11b02a0 100644 --- a/crypto/bn256/bn256_fast.go +++ b/crypto/bn256/bn256_fast.go @@ -3,7 +3,6 @@ // in the LICENSE file. //go:build amd64 || arm64 -// +build amd64 arm64 // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 diff --git a/crypto/bn256/bn256_slow.go b/crypto/bn256/bn256_slow.go index 4c0c351e2d..1b021fd4ef 100644 --- a/crypto/bn256/bn256_slow.go +++ b/crypto/bn256/bn256_slow.go @@ -3,7 +3,6 @@ // in the LICENSE file. //go:build !amd64 && !arm64 -// +build !amd64,!arm64 // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 diff --git a/crypto/bn256/cloudflare/gfp_decl.go b/crypto/bn256/cloudflare/gfp_decl.go index 1954d14a4a..129babd241 100644 --- a/crypto/bn256/cloudflare/gfp_decl.go +++ b/crypto/bn256/cloudflare/gfp_decl.go @@ -1,5 +1,4 @@ //go:build (amd64 && !generic) || (arm64 && !generic) -// +build amd64,!generic arm64,!generic package bn256 diff --git a/crypto/bn256/cloudflare/gfp_generic.go b/crypto/bn256/cloudflare/gfp_generic.go index 7742dda4c9..944208c67b 100644 --- a/crypto/bn256/cloudflare/gfp_generic.go +++ b/crypto/bn256/cloudflare/gfp_generic.go @@ -1,5 +1,4 @@ //go:build (!amd64 && !arm64) || generic -// +build !amd64,!arm64 generic package bn256 diff --git a/crypto/secp256k1/dummy.go b/crypto/secp256k1/dummy.go index 65a75080f6..3e3b6f2623 100644 --- a/crypto/secp256k1/dummy.go +++ b/crypto/secp256k1/dummy.go @@ -1,5 +1,4 @@ //go:build dummy -// +build dummy // This file is part of a workaround for `go mod vendor` which won't vendor // C files if there's no Go file in the same directory. diff --git a/crypto/secp256k1/scalar_mult_nocgo.go b/crypto/secp256k1/scalar_mult_nocgo.go index feb13a8dfd..f26aecc068 100644 --- a/crypto/secp256k1/scalar_mult_nocgo.go +++ b/crypto/secp256k1/scalar_mult_nocgo.go @@ -3,7 +3,6 @@ // the LICENSE file. //go:build gofuzz || !cgo -// +build gofuzz !cgo package secp256k1 diff --git a/crypto/secp256k1/secp256_test.go b/crypto/secp256k1/secp256_test.go index 4827cc5b25..109872b1e9 100644 --- a/crypto/secp256k1/secp256_test.go +++ b/crypto/secp256k1/secp256_test.go @@ -3,7 +3,6 @@ // the LICENSE file. //go:build !gofuzz && cgo -// +build !gofuzz,cgo package secp256k1 diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index 18b78f4aac..8b0625a4e3 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !nacl && !js && !wasip1 && cgo && !gofuzz && !tinygo -// +build !nacl,!js,!wasip1,cgo,!gofuzz,!tinygo package crypto diff --git a/crypto/signature_nocgo.go b/crypto/signature_nocgo.go index d76127c258..dd8afdaece 100644 --- a/crypto/signature_nocgo.go +++ b/crypto/signature_nocgo.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build nacl || js || wasip1 || !cgo || gofuzz || tinygo -// +build nacl js wasip1 !cgo gofuzz tinygo package crypto diff --git a/crypto/signify/signify_fuzz.go b/crypto/signify/signify_fuzz.go index 239a2134df..7e86da54a9 100644 --- a/crypto/signify/signify_fuzz.go +++ b/crypto/signify/signify_fuzz.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build gofuzz -// +build gofuzz package signify diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index 736a44d73d..3d7c0ece0b 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !js && !wasip1 -// +build !js,!wasip1 // Package leveldb implements the key-value database layer based on LevelDB. package leveldb diff --git a/metrics/cpu_disabled.go b/metrics/cpu_disabled.go index 37c3e1b8f7..415240f498 100644 --- a/metrics/cpu_disabled.go +++ b/metrics/cpu_disabled.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build ios || js || wasip1 || tinygo -// +build ios js wasip1 tinygo package metrics diff --git a/metrics/cpu_enabled.go b/metrics/cpu_enabled.go index 37c23cad1a..9cab1387a3 100644 --- a/metrics/cpu_enabled.go +++ b/metrics/cpu_enabled.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !ios && !js && !wasip1 && !tinygo -// +build !ios,!js,!wasip1,!tinygo package metrics diff --git a/metrics/cputime_nop.go b/metrics/cputime_nop.go index 465d88c4d2..4eb962f228 100644 --- a/metrics/cputime_nop.go +++ b/metrics/cputime_nop.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build windows || js -// +build windows js package metrics diff --git a/metrics/cputime_unix.go b/metrics/cputime_unix.go index a44bf80876..a3485049ba 100644 --- a/metrics/cputime_unix.go +++ b/metrics/cputime_unix.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !windows && !js && !wasip1 -// +build !windows,!js,!wasip1 package metrics diff --git a/metrics/disk_nop.go b/metrics/disk_nop.go index 41bbe9adb2..79ea3b7c02 100644 --- a/metrics/disk_nop.go +++ b/metrics/disk_nop.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !linux -// +build !linux package metrics diff --git a/metrics/syslog.go b/metrics/syslog.go index b265328f87..6ce98bad1c 100644 --- a/metrics/syslog.go +++ b/metrics/syslog.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package metrics diff --git a/p2p/netutil/toobig_notwindows.go b/p2p/netutil/toobig_notwindows.go index f9f936ae56..a9c5601c7c 100644 --- a/p2p/netutil/toobig_notwindows.go +++ b/p2p/netutil/toobig_notwindows.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !windows -// +build !windows package netutil diff --git a/p2p/netutil/toobig_windows.go b/p2p/netutil/toobig_windows.go index 652903e83c..13a1ace051 100644 --- a/p2p/netutil/toobig_windows.go +++ b/p2p/netutil/toobig_windows.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build windows -// +build windows package netutil diff --git a/rlp/safe.go b/rlp/safe.go index 3c910337b6..72807abe74 100644 --- a/rlp/safe.go +++ b/rlp/safe.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build nacl || js || !cgo -// +build nacl js !cgo package rlp diff --git a/rlp/unsafe.go b/rlp/unsafe.go index 10868caaf2..b8f334ac1b 100644 --- a/rlp/unsafe.go +++ b/rlp/unsafe.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build !nacl && !js && cgo -// +build !nacl,!js,cgo package rlp diff --git a/rpc/ipc_js.go b/rpc/ipc_js.go index 453a20bc1a..ce0779b656 100644 --- a/rpc/ipc_js.go +++ b/rpc/ipc_js.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build js -// +build js package rpc diff --git a/rpc/ipc_unix.go b/rpc/ipc_unix.go index 588bf62605..bd5639c119 100644 --- a/rpc/ipc_unix.go +++ b/rpc/ipc_unix.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || solaris -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris package rpc diff --git a/rpc/ipc_wasip1.go b/rpc/ipc_wasip1.go index 2608e29222..ceced01d12 100644 --- a/rpc/ipc_wasip1.go +++ b/rpc/ipc_wasip1.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build wasip1 -// +build wasip1 package rpc diff --git a/rpc/ipc_windows.go b/rpc/ipc_windows.go index efec38cf37..62a6d4b84e 100644 --- a/rpc/ipc_windows.go +++ b/rpc/ipc_windows.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build windows -// +build windows package rpc diff --git a/tests/fuzzers/bls12381/bls12381_fuzz.go b/tests/fuzzers/bls12381/bls12381_fuzz.go index a17c128b7f..6b4db1278a 100644 --- a/tests/fuzzers/bls12381/bls12381_fuzz.go +++ b/tests/fuzzers/bls12381/bls12381_fuzz.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build cgo -// +build cgo package bls diff --git a/tests/fuzzers/bls12381/bls12381_test.go b/tests/fuzzers/bls12381/bls12381_test.go index cb89d8a7a7..b33eb7716f 100644 --- a/tests/fuzzers/bls12381/bls12381_test.go +++ b/tests/fuzzers/bls12381/bls12381_test.go @@ -15,7 +15,6 @@ // along with the go-ethereum library. If not, see . //go:build cgo -// +build cgo package bls From 2a2674558a867c37cee9b1461a79f1f312522dd5 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Fri, 28 Nov 2025 14:38:14 +0800 Subject: [PATCH 17/21] config: update BSC Mainnet hardfork time: Fermi (#3466) --- params/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/config.go b/params/config.go index bbac109aee..ed6512ece5 100644 --- a/params/config.go +++ b/params/config.go @@ -225,7 +225,7 @@ var ( PragueTime: newUint64(1742436600), // 2025-03-20 02:10:00 AM UTC LorentzTime: newUint64(1745903100), // 2025-04-29 05:05:00 AM UTC MaxwellTime: newUint64(1751250600), // 2025-06-30 02:30:00 AM UTC - FermiTime: nil, + FermiTime: newUint64(1768357800), // 2026-01-14 02:30:00 AM UTC OsakaTime: nil, MendelTime: nil, From 23324ffd22af6af28543369926e2dce3cf9c2746 Mon Sep 17 00:00:00 2001 From: Eric <45141191+zlacfzy@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:42:12 +0800 Subject: [PATCH 18/21] metric: add metric for vote count (#3468) * metric: add metric for vote count * metric: add metric for vote count --- consensus/parlia/parlia.go | 1 + consensus/parlia/snapshot.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index d5fe807763..2742469e6e 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -99,6 +99,7 @@ var ( validVotesfromSelfCounter = metrics.NewRegisteredCounter("parlia/VerifyVote/self", nil) doubleSignCounter = metrics.NewRegisteredCounter("parlia/doublesign", nil) intentionalDelayMiningCounter = metrics.NewRegisteredCounter("parlia/intentionalDelayMining", nil) + attestationVoteCountGauge = metrics.NewRegisteredGauge("parlia/attestation/voteCount", nil) systemContracts = map[common.Address]bool{ common.HexToAddress(systemcontracts.ValidatorContract): true, diff --git a/consensus/parlia/snapshot.go b/consensus/parlia/snapshot.go index ecabc62a56..047ddf4754 100644 --- a/consensus/parlia/snapshot.go +++ b/consensus/parlia/snapshot.go @@ -33,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + "github.com/willf/bitset" ) // Snapshot is the state of the validatorSet at a given point. @@ -219,6 +220,10 @@ func (s *Snapshot) updateAttestation(header *types.Header, chainConfig *params.C } } + // Update vote count metric after validation passed + voteCount := bitset.From([]uint64{uint64(attestation.VoteAddressSet)}).Count() + attestationVoteCountGauge.Update(int64(voteCount)) + // Update attestation // Two scenarios for s.Attestation being nil: // 1) The first attestation is assembled. From 5e1ded986d990e980ccce13e8ab6bd565051f0fd Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:07:06 +0800 Subject: [PATCH 19/21] .github/workflows: replace BLS for Windows (#3467) --- .github/workflows/pre-release.yml | 5 +++++ .github/workflows/release.yml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index aa10ee9ec1..71d80a1830 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -57,6 +57,11 @@ jobs: GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d') GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth + - name: Temporary replace BLS for Windows + if: matrix.os == 'windows-latest' + shell: cmd + run: go mod edit -replace=github.com/herumi/bls-eth-go-binary=github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e && go mod tidy + - name: Build Binary for ${{matrix.os}} if: matrix.os != 'ubuntu-latest' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29b5f836c6..1b20a3fb81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,6 +56,12 @@ jobs: GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d') GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth + # ============================== + - name: Temporary replace BLS for Windows + if: matrix.os == 'windows-latest' + shell: cmd + run: go mod edit -replace=github.com/herumi/bls-eth-go-binary=github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e && go mod tidy + - name: Build Binary for ${{matrix.os}} if: matrix.os != 'ubuntu-latest' run: | From 6d3c89e1ffb50e6f7c070906bb41a44d42b2b6c6 Mon Sep 17 00:00:00 2001 From: formless <213398294+allformless@users.noreply.github.com> Date: Tue, 2 Dec 2025 09:41:38 +0800 Subject: [PATCH 20/21] release: prepare for release v1.6.4 (#3470) * release: prepare for release v1.6.4 * version: update version --- CHANGELOG.md | 15 +++++++++++++++ version/version.go | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90be155caf..098479e745 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # Changelog +## v1.6.4 +### FEATURE +[\#3466](https://github.com/bnb-chain/bsc/pull/3466) config: update BSC Mainnet hardfork time: Fermi +[\#3454](https://github.com/bnb-chain/bsc/pull/3454) eth: support fetch commit id info from extra data + +### BUGFIX +[\#3448](https://github.com/bnb-chain/bsc/pull/3448) TxPool: change lifetime back to 3 hours +[\#3457](https://github.com/bnb-chain/bsc/pull/3457) cmd/geth: stop supporting multidatabase flag +[\#3467](https://github.com/bnb-chain/bsc/pull/3467) go.mod: downgrade bls-eth-go-binary to run on windows + +### IMPROVEMENT +[\#3445](https://github.com/bnb-chain/bsc/pull/3445) eth: improve prefetch by using cached reader +[\#3459](https://github.com/bnb-chain/bsc/pull/3459) feat: transactionReceipts auto-unsubscribe implementation +[\#3468](https://github.com/bnb-chain/bsc/pull/3468) metric: add metric for vote count + ## v1.6.3 ### FEATURE NA diff --git a/version/version.go b/version/version.go index d7fef55d94..89e9276185 100644 --- a/version/version.go +++ b/version/version.go @@ -19,6 +19,6 @@ package version const ( Major = 1 // Major version component of the current release Minor = 6 // Minor version component of the current release - Patch = 3 // Patch version component of the current release + Patch = 4 // Patch version component of the current release Meta = "" // Version metadata to append to the version string ) From e003767572cf566cbdb1536647797efd251b1d67 Mon Sep 17 00:00:00 2001 From: wayen <19421226+flywukong@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:18:04 +0800 Subject: [PATCH 21/21] fix: fix the flag docment (#3472) --- cmd/utils/flags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index f27bca90ab..76606cd1f0 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -368,7 +368,7 @@ var ( } GCModeFlag = &cli.StringFlag{ Name: "gcmode", - Usage: `Blockchain garbage collection mode, only relevant in state.scheme=hash ("full", "archive")`, + Usage: `Blockchain garbage collection mode ("full", "archive")`, Value: "full", Category: flags.StateCategory, } @@ -391,7 +391,7 @@ var ( } StateHistoryFlag = &cli.Uint64Flag{ Name: "history.state", - Usage: "Number of recent blocks to retain state history for, only relevant in state.scheme=path (default = 90,000 blocks, 0 = entire chain)", + Usage: "Number of recent blocks to retain state history for, only relevant in state.scheme=path (default = 600,000 blocks, 0 = entire chain)", Value: ethconfig.Defaults.StateHistory, Category: flags.StateCategory, }