diff --git a/chain/chain_config.go b/chain/chain_config.go index 104eca64d..3e7cace3f 100644 --- a/chain/chain_config.go +++ b/chain/chain_config.go @@ -65,6 +65,7 @@ type Config struct { ShanghaiTime *big.Int `json:"shanghaiTime,omitempty"` // Shanghai switch time (nil = no fork, 0 = already activated) CancunTime *big.Int `json:"cancunTime,omitempty"` // Cancun switch time (nil = no fork, 0 = already activated) ShardingForkTime *big.Int `json:"shardingForkTime,omitempty"` // Mini-Danksharding switch block (nil = no fork, 0 = already activated) + PragueTime *big.Int `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already activated) // Parlia fork blocks RamanujanBlock *big.Int `json:"ramanujanBlock,omitempty" toml:",omitempty"` // ramanujanBlock switch block (nil = no fork, 0 = already activated) @@ -109,7 +110,7 @@ func (c *Config) String() string { ) } - return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, DAO Support: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Engine: %v}", + return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, DAO Support: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Sharding: %v, Prague: %v, Engine: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -129,6 +130,8 @@ func (c *Config) String() string { c.MergeNetsplitBlock, c.ShanghaiTime, c.CancunTime, + c.ShardingForkTime, + c.PragueTime, engine, ) } @@ -307,6 +310,11 @@ func (c *Config) IsCancun(time uint64) bool { return isForked(c.CancunTime, time) } +// IsPrague returns whether time is either equal to the Prague fork time or greater. +func (c *Config) IsPrague(time uint64) bool { + return isForked(c.PragueTime, time) +} + func (c *Config) IsEip1559FeeCollector(num uint64) bool { return c.Eip1559FeeCollector != nil && isForked(c.Eip1559FeeCollectorTransition, num) } @@ -660,7 +668,7 @@ type Rules struct { IsHomestead, IsTangerineWhistle, IsSpuriousDragon bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsShanghai, IsCancun bool - IsSharding bool + IsSharding, IsPrague bool IsNano, IsMoran, IsGibbs bool IsEip1559FeeCollector bool IsParlia, IsAura bool @@ -686,6 +694,8 @@ func (c *Config) Rules(num uint64, time uint64) *Rules { IsLondon: c.IsLondon(num), IsShanghai: c.IsShanghai(time), IsCancun: c.IsCancun(time), + IsSharding: c.IsSharding(time), + IsPrague: c.IsPrague(time), IsNano: c.IsNano(num), IsMoran: c.IsMoran(num), IsEip1559FeeCollector: c.IsEip1559FeeCollector(num),