mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
params: support eip7805 fork
This commit is contained in:
parent
3e487c0a73
commit
d03a817f9c
2 changed files with 9 additions and 0 deletions
|
|
@ -458,6 +458,7 @@ type ChainConfig struct {
|
||||||
BPO4Time *uint64 `json:"bpo4Time,omitempty"` // BPO4 switch time (nil = no fork, 0 = already on bpo4)
|
BPO4Time *uint64 `json:"bpo4Time,omitempty"` // BPO4 switch time (nil = no fork, 0 = already on bpo4)
|
||||||
BPO5Time *uint64 `json:"bpo5Time,omitempty"` // BPO5 switch time (nil = no fork, 0 = already on bpo5)
|
BPO5Time *uint64 `json:"bpo5Time,omitempty"` // BPO5 switch time (nil = no fork, 0 = already on bpo5)
|
||||||
AmsterdamTime *uint64 `json:"amsterdamTime,omitempty"` // Amsterdam switch time (nil = no fork, 0 = already on amsterdam)
|
AmsterdamTime *uint64 `json:"amsterdamTime,omitempty"` // Amsterdam switch time (nil = no fork, 0 = already on amsterdam)
|
||||||
|
Eip7805Time *uint64 `json:"eip7805Time,omitempty"` // Eip7805 switch time (nil = no fork, 0 = already on eip7805)
|
||||||
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
VerkleTime *uint64 `json:"verkleTime,omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle)
|
||||||
|
|
||||||
// TerminalTotalDifficulty is the amount of total difficulty reached by
|
// TerminalTotalDifficulty is the amount of total difficulty reached by
|
||||||
|
|
@ -858,6 +859,11 @@ func (c *ChainConfig) IsAmsterdam(num *big.Int, time uint64) bool {
|
||||||
return c.IsLondon(num) && isTimestampForked(c.AmsterdamTime, time)
|
return c.IsLondon(num) && isTimestampForked(c.AmsterdamTime, time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsEip7805 returns whether time is either equal to the Eip7805 fork time or greater.
|
||||||
|
func (c *ChainConfig) IsEip7805(num *big.Int, time uint64) bool {
|
||||||
|
return c.IsLondon(num) && isTimestampForked(c.Eip7805Time, time)
|
||||||
|
}
|
||||||
|
|
||||||
// IsVerkle returns whether time is either equal to the Verkle fork time or greater.
|
// IsVerkle returns whether time is either equal to the Verkle fork time or greater.
|
||||||
func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool {
|
func (c *ChainConfig) IsVerkle(num *big.Int, time uint64) bool {
|
||||||
return c.IsLondon(num) && isTimestampForked(c.VerkleTime, time)
|
return c.IsLondon(num) && isTimestampForked(c.VerkleTime, time)
|
||||||
|
|
@ -1136,6 +1142,8 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork {
|
||||||
london := c.LondonBlock
|
london := c.LondonBlock
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
case c.IsEip7805(london, time):
|
||||||
|
return forks.Eip7805
|
||||||
case c.IsAmsterdam(london, time):
|
case c.IsAmsterdam(london, time):
|
||||||
return forks.Amsterdam
|
return forks.Amsterdam
|
||||||
case c.IsBPO5(london, time):
|
case c.IsBPO5(london, time):
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ const (
|
||||||
BPO4
|
BPO4
|
||||||
BPO5
|
BPO5
|
||||||
Amsterdam
|
Amsterdam
|
||||||
|
Eip7805
|
||||||
)
|
)
|
||||||
|
|
||||||
// String implements fmt.Stringer.
|
// String implements fmt.Stringer.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue