f(eip-8141): add bogota fork

This commit is contained in:
0xjvn 2026-03-05 01:18:59 +05:30
parent c3cd62d4f8
commit 23c6a6c174
3 changed files with 35 additions and 4 deletions

View file

@ -232,10 +232,13 @@ var (
TerminalTotalDifficulty: big.NewInt(0), TerminalTotalDifficulty: big.NewInt(0),
PragueTime: newUint64(0), PragueTime: newUint64(0),
OsakaTime: newUint64(0), OsakaTime: newUint64(0),
AmsterdamTime: newUint64(0),
BogotaTime: newUint64(0),
BlobScheduleConfig: &BlobScheduleConfig{ BlobScheduleConfig: &BlobScheduleConfig{
Cancun: DefaultCancunBlobConfig, Cancun: DefaultCancunBlobConfig,
Prague: DefaultPragueBlobConfig, Prague: DefaultPragueBlobConfig,
Osaka: DefaultOsakaBlobConfig, Osaka: DefaultOsakaBlobConfig,
Amsterdam: DefaultOsakaBlobConfig,
}, },
} }
@ -466,6 +469,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)
BogotaTime *uint64 `json:"bogotaTime,omitempty"` // Bogota switch time (nil = no fork, 0 = already on bogota)
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
@ -595,6 +599,9 @@ func (c *ChainConfig) String() string {
if c.AmsterdamTime != nil { if c.AmsterdamTime != nil {
result += fmt.Sprintf(", AmsterdamTime: %v", *c.AmsterdamTime) result += fmt.Sprintf(", AmsterdamTime: %v", *c.AmsterdamTime)
} }
if c.BogotaTime != nil {
result += fmt.Sprintf(", BogotaTime: %v", *c.BogotaTime)
}
if c.VerkleTime != nil { if c.VerkleTime != nil {
result += fmt.Sprintf(", VerkleTime: %v", *c.VerkleTime) result += fmt.Sprintf(", VerkleTime: %v", *c.VerkleTime)
} }
@ -690,6 +697,9 @@ func (c *ChainConfig) Description() string {
if c.AmsterdamTime != nil { if c.AmsterdamTime != nil {
banner += fmt.Sprintf(" - Amsterdam: @%-10v blob: (%s)\n", *c.AmsterdamTime, c.BlobScheduleConfig.Amsterdam) banner += fmt.Sprintf(" - Amsterdam: @%-10v blob: (%s)\n", *c.AmsterdamTime, c.BlobScheduleConfig.Amsterdam)
} }
if c.BogotaTime != nil {
banner += fmt.Sprintf(" - Bogota: @%-10v\n", *c.BogotaTime)
}
if c.VerkleTime != nil { if c.VerkleTime != nil {
banner += fmt.Sprintf(" - Verkle: @%-10v blob: (%s)\n", *c.VerkleTime, c.BlobScheduleConfig.Verkle) banner += fmt.Sprintf(" - Verkle: @%-10v blob: (%s)\n", *c.VerkleTime, c.BlobScheduleConfig.Verkle)
} }
@ -866,6 +876,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)
} }
// IsBogota returns whether time is either equal to the Bogota fork time or greater.
func (c *ChainConfig) IsBogota(num *big.Int, time uint64) bool {
return c.IsLondon(num) && isTimestampForked(c.BogotaTime, 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)
@ -952,6 +967,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{name: "bpo4", timestamp: c.BPO4Time, optional: true}, {name: "bpo4", timestamp: c.BPO4Time, optional: true},
{name: "bpo5", timestamp: c.BPO5Time, optional: true}, {name: "bpo5", timestamp: c.BPO5Time, optional: true},
{name: "amsterdam", timestamp: c.AmsterdamTime, optional: true}, {name: "amsterdam", timestamp: c.AmsterdamTime, optional: true},
{name: "bogota", timestamp: c.BogotaTime, optional: true},
} { } {
if lastFork.name != "" { if lastFork.name != "" {
switch { switch {
@ -1125,6 +1141,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkTimestampIncompatible(c.AmsterdamTime, newcfg.AmsterdamTime, headTimestamp) { if isForkTimestampIncompatible(c.AmsterdamTime, newcfg.AmsterdamTime, headTimestamp) {
return newTimestampCompatError("Amsterdam fork timestamp", c.AmsterdamTime, newcfg.AmsterdamTime) return newTimestampCompatError("Amsterdam fork timestamp", c.AmsterdamTime, newcfg.AmsterdamTime)
} }
if isForkTimestampIncompatible(c.BogotaTime, newcfg.BogotaTime, headTimestamp) {
return newTimestampCompatError("Bogota fork timestamp", c.BogotaTime, newcfg.BogotaTime)
}
return nil return nil
} }
@ -1144,6 +1163,8 @@ func (c *ChainConfig) LatestFork(time uint64) forks.Fork {
london := c.LondonBlock london := c.LondonBlock
switch { switch {
case c.IsBogota(london, time):
return forks.Bogota
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):
@ -1380,7 +1401,7 @@ type Rules struct {
IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
IsBerlin, IsLondon bool IsBerlin, IsLondon bool
IsMerge, IsShanghai, IsCancun, IsPrague, IsOsaka bool IsMerge, IsShanghai, IsCancun, IsPrague, IsOsaka bool
IsAmsterdam, IsVerkle bool IsAmsterdam, IsBogota, IsVerkle bool
} }
// Rules ensures c's ChainID is not nil. // Rules ensures c's ChainID is not nil.
@ -1406,6 +1427,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
IsPrague: isMerge && c.IsPrague(num, timestamp), IsPrague: isMerge && c.IsPrague(num, timestamp),
IsOsaka: isMerge && c.IsOsaka(num, timestamp), IsOsaka: isMerge && c.IsOsaka(num, timestamp),
IsAmsterdam: isMerge && c.IsAmsterdam(num, timestamp), IsAmsterdam: isMerge && c.IsAmsterdam(num, timestamp),
IsBogota: isMerge && c.IsBogota(num, timestamp),
IsVerkle: isVerkle, IsVerkle: isVerkle,
IsEIP4762: isVerkle, IsEIP4762: isVerkle,
} }

View file

@ -46,6 +46,7 @@ const (
BPO4 BPO4
BPO5 BPO5
Amsterdam Amsterdam
Bogota
) )
// String implements fmt.Stringer. // String implements fmt.Stringer.
@ -84,4 +85,5 @@ var forkToString = map[Fork]string{
BPO4: "BPO4", BPO4: "BPO4",
BPO5: "BPO5", BPO5: "BPO5",
Amsterdam: "Amsterdam", Amsterdam: "Amsterdam",
Bogota: "Bogota",
} }

View file

@ -183,6 +183,10 @@ const (
HistoryServeWindow = 8191 // Number of blocks to serve historical block hashes for, EIP-2935. HistoryServeWindow = 8191 // Number of blocks to serve historical block hashes for, EIP-2935.
MaxBlockSize = 8_388_608 // maximum size of an RLP-encoded block MaxBlockSize = 8_388_608 // maximum size of an RLP-encoded block
// EIP-8141: Frame Transaction constants
FrameTxIntrinsicGas uint64 = 15000 // Intrinsic gas for frame transactions
FrameTxMaxFrames int = 1000 // Maximum number of frames allowed in a frame transaction.
) )
// Bls12381G1MultiExpDiscountTable is the gas discount table for BLS12-381 G1 multi exponentiation operation // Bls12381G1MultiExpDiscountTable is the gas discount table for BLS12-381 G1 multi exponentiation operation
@ -219,4 +223,7 @@ var (
// EIP-7251 - Increase the MAX_EFFECTIVE_BALANCE // EIP-7251 - Increase the MAX_EFFECTIVE_BALANCE
ConsolidationQueueAddress = common.HexToAddress("0x0000BBdDc7CE488642fb579F8B00f3a590007251") ConsolidationQueueAddress = common.HexToAddress("0x0000BBdDc7CE488642fb579F8B00f3a590007251")
ConsolidationQueueCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd") ConsolidationQueueCode = common.FromHex("3373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd")
// EIP-8141 - Frame Transaction entry point address
FrameEntryPointAddress = common.HexToAddress("0x00000000000000000000000000000000000000aa")
) )