|
|
|
@ -188,6 +188,9 @@ var (
|
|
|
|
|
KeplerTime: newUint64(1702972800),
|
|
|
|
|
FeynmanTime: newUint64(1710136800),
|
|
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
FeynmanFixTime: nil,
|
|
|
|
|
|
|
|
|
|
Parlia: &ParliaConfig{
|
|
|
|
|
Period: 3,
|
|
|
|
|
Epoch: 200,
|
|
|
|
@ -223,11 +226,12 @@ var (
|
|
|
|
|
HertzfixBlock: big.NewInt(8),
|
|
|
|
|
ShanghaiTime: newUint64(0),
|
|
|
|
|
KeplerTime: newUint64(0),
|
|
|
|
|
FeynmanTime: newUint64(0),
|
|
|
|
|
FeynmanTime: _rialto_upgrade_height_,
|
|
|
|
|
FeynmanFixTime: _rialto_upgrade_height_,
|
|
|
|
|
|
|
|
|
|
Parlia: &ParliaConfig{
|
|
|
|
|
Period: 3,
|
|
|
|
|
Epoch: 200,
|
|
|
|
|
Period: _rialto_parlia_period_,
|
|
|
|
|
Epoch: _rialto_parlia_epoch_,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -459,12 +463,13 @@ type ChainConfig struct {
|
|
|
|
|
|
|
|
|
|
// Fork scheduling was switched from blocks to timestamps here
|
|
|
|
|
|
|
|
|
|
ShanghaiTime *uint64 `json:"shanghaiTime,omitempty"` // Shanghai switch time (nil = no fork, 0 = already on shanghai)
|
|
|
|
|
KeplerTime *uint64 `json:"keplerTime,omitempty"` // Kepler switch time (nil = no fork, 0 = already activated)
|
|
|
|
|
FeynmanTime *uint64 `json:"feynmanTime,omitempty"` // Feynman switch time (nil = no fork, 0 = already activated)
|
|
|
|
|
CancunTime *uint64 `json:"cancunTime,omitempty"` // Cancun switch time (nil = no fork, 0 = already on cancun)
|
|
|
|
|
PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
|
|
|
|
|
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
|
|
|
|
ShanghaiTime *uint64 `json:"shanghaiTime,omitempty"` // Shanghai switch time (nil = no fork, 0 = already on shanghai)
|
|
|
|
|
KeplerTime *uint64 `json:"keplerTime,omitempty"` // Kepler switch time (nil = no fork, 0 = already activated)
|
|
|
|
|
FeynmanTime *uint64 `json:"feynmanTime,omitempty"` // Feynman switch time (nil = no fork, 0 = already activated)
|
|
|
|
|
FeynmanFixTime *uint64 `json:"feynmanFixTime,omitempty"` // Feynman switch time (nil = no fork, 0 = already activated)
|
|
|
|
|
CancunTime *uint64 `json:"cancunTime,omitempty"` // Cancun switch time (nil = no fork, 0 = already on cancun)
|
|
|
|
|
PragueTime *uint64 `json:"pragueTime,omitempty"` // Prague switch time (nil = no fork, 0 = already on prague)
|
|
|
|
|
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
|
|
|
|
|
|
|
|
|
// TerminalTotalDifficulty is the amount of total difficulty reached by
|
|
|
|
|
// the network that triggers the consensus upgrade.
|
|
|
|
@ -559,7 +564,12 @@ func (c *ChainConfig) String() string {
|
|
|
|
|
FeynmanTime = big.NewInt(0).SetUint64(*c.FeynmanTime)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Sprintf("{ChainID: %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, Engine: %v}",
|
|
|
|
|
var FeynmanFixTime *big.Int
|
|
|
|
|
if c.FeynmanFixTime != nil {
|
|
|
|
|
FeynmanFixTime = big.NewInt(0).SetUint64(*c.FeynmanFixTime)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fmt.Sprintf("{ChainID: %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, Engine: %v}",
|
|
|
|
|
c.ChainID,
|
|
|
|
|
c.HomesteadBlock,
|
|
|
|
|
c.DAOForkBlock,
|
|
|
|
@ -594,6 +604,7 @@ func (c *ChainConfig) String() string {
|
|
|
|
|
ShanghaiTime,
|
|
|
|
|
KeplerTime,
|
|
|
|
|
FeynmanTime,
|
|
|
|
|
FeynmanFixTime,
|
|
|
|
|
engine,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -842,6 +853,20 @@ func (c *ChainConfig) IsOnFeynman(currentBlockNumber *big.Int, lastBlockTime uin
|
|
|
|
|
return !c.IsFeynman(lastBlockNumber, lastBlockTime) && c.IsFeynman(currentBlockNumber, currentBlockTime)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsFeynmanFix returns whether time is either equal to the FeynmanFix fork time or greater.
|
|
|
|
|
func (c *ChainConfig) IsFeynmanFix(num *big.Int, time uint64) bool {
|
|
|
|
|
return c.IsLondon(num) && isTimestampForked(c.FeynmanFixTime, time)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsOnFeynmanFix returns whether currentBlockTime is either equal to the FeynmanFix fork time or greater firstly.
|
|
|
|
|
func (c *ChainConfig) IsOnFeynmanFix(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.IsFeynmanFix(lastBlockNumber, lastBlockTime) && c.IsFeynmanFix(currentBlockNumber, currentBlockTime)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsCancun returns whether num is either equal to the Cancun fork time or greater.
|
|
|
|
|
func (c *ChainConfig) IsCancun(num *big.Int, time uint64) bool {
|
|
|
|
|
return c.IsLondon(num) && isTimestampForked(c.CancunTime, time)
|
|
|
|
@ -908,6 +933,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
|
|
|
|
{name: "hertzfixBlock", block: c.HertzfixBlock},
|
|
|
|
|
{name: "keplerTime", timestamp: c.KeplerTime},
|
|
|
|
|
{name: "feynmanTime", timestamp: c.FeynmanTime},
|
|
|
|
|
{name: "feynmanFixTime", timestamp: c.FeynmanFixTime},
|
|
|
|
|
{name: "cancunTime", timestamp: c.CancunTime, optional: true},
|
|
|
|
|
{name: "pragueTime", timestamp: c.PragueTime, optional: true},
|
|
|
|
|
{name: "verkleTime", timestamp: c.VerkleTime, optional: true},
|
|
|
|
@ -1050,6 +1076,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
|
|
|
|
|
if isForkTimestampIncompatible(c.FeynmanTime, newcfg.FeynmanTime, headTimestamp) {
|
|
|
|
|
return newTimestampCompatError("Feynman fork timestamp", c.FeynmanTime, newcfg.FeynmanTime)
|
|
|
|
|
}
|
|
|
|
|
if isForkTimestampIncompatible(c.FeynmanFixTime, newcfg.FeynmanFixTime, headTimestamp) {
|
|
|
|
|
return newTimestampCompatError("FeynmanFix fork timestamp", c.FeynmanFixTime, newcfg.FeynmanFixTime)
|
|
|
|
|
}
|
|
|
|
|
if isForkTimestampIncompatible(c.CancunTime, newcfg.CancunTime, headTimestamp) {
|
|
|
|
|
return newTimestampCompatError("Cancun fork timestamp", c.CancunTime, newcfg.CancunTime)
|
|
|
|
|
}
|
|
|
|
|