mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-09 06:24:27 +00:00
parent
d8ce54db87
commit
75c05e5dde
7 changed files with 44 additions and 6 deletions
|
|
@ -65,6 +65,7 @@ type constant struct {
|
||||||
eip1559Block *big.Int
|
eip1559Block *big.Int
|
||||||
cancunBlock *big.Int
|
cancunBlock *big.Int
|
||||||
pragueBlock *big.Int
|
pragueBlock *big.Int
|
||||||
|
osakaBlock *big.Int
|
||||||
dynamicGasLimitBlock *big.Int
|
dynamicGasLimitBlock *big.Int
|
||||||
|
|
||||||
trc21IssuerSMC Address
|
trc21IssuerSMC Address
|
||||||
|
|
@ -101,6 +102,7 @@ var (
|
||||||
Eip1559Block = MainnetConstant.eip1559Block
|
Eip1559Block = MainnetConstant.eip1559Block
|
||||||
CancunBlock = MainnetConstant.cancunBlock
|
CancunBlock = MainnetConstant.cancunBlock
|
||||||
PragueBlock = MainnetConstant.pragueBlock
|
PragueBlock = MainnetConstant.pragueBlock
|
||||||
|
OsakaBlock = MainnetConstant.osakaBlock
|
||||||
DynamicGasLimitBlock = MainnetConstant.dynamicGasLimitBlock
|
DynamicGasLimitBlock = MainnetConstant.dynamicGasLimitBlock
|
||||||
TIPUpgradeReward = MainnetConstant.tipUpgradeReward
|
TIPUpgradeReward = MainnetConstant.tipUpgradeReward
|
||||||
TipUpgradePenalty = MainnetConstant.tipUpgradePenalty
|
TipUpgradePenalty = MainnetConstant.tipUpgradePenalty
|
||||||
|
|
@ -165,6 +167,7 @@ func CopyConstants(chainID uint64) {
|
||||||
Eip1559Block = c.eip1559Block
|
Eip1559Block = c.eip1559Block
|
||||||
CancunBlock = c.cancunBlock
|
CancunBlock = c.cancunBlock
|
||||||
PragueBlock = c.pragueBlock
|
PragueBlock = c.pragueBlock
|
||||||
|
OsakaBlock = c.osakaBlock
|
||||||
DynamicGasLimitBlock = c.dynamicGasLimitBlock
|
DynamicGasLimitBlock = c.dynamicGasLimitBlock
|
||||||
TIPUpgradeReward = c.tipUpgradeReward
|
TIPUpgradeReward = c.tipUpgradeReward
|
||||||
TipUpgradePenalty = c.tipUpgradePenalty
|
TipUpgradePenalty = c.tipUpgradePenalty
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ var DevnetConstant = constant{
|
||||||
eip1559Block: big.NewInt(32400),
|
eip1559Block: big.NewInt(32400),
|
||||||
cancunBlock: big.NewInt(43200),
|
cancunBlock: big.NewInt(43200),
|
||||||
pragueBlock: big.NewInt(math.MaxInt64),
|
pragueBlock: big.NewInt(math.MaxInt64),
|
||||||
|
osakaBlock: big.NewInt(math.MaxInt64),
|
||||||
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ var localConstant = constant{
|
||||||
tipXDCXReceiverDisable: big.NewInt(0),
|
tipXDCXReceiverDisable: big.NewInt(0),
|
||||||
eip1559Block: big.NewInt(0),
|
eip1559Block: big.NewInt(0),
|
||||||
cancunBlock: big.NewInt(0),
|
cancunBlock: big.NewInt(0),
|
||||||
pragueBlock: big.NewInt(math.MaxInt64),
|
pragueBlock: big.NewInt(0),
|
||||||
|
osakaBlock: big.NewInt(0),
|
||||||
dynamicGasLimitBlock: big.NewInt(0),
|
dynamicGasLimitBlock: big.NewInt(0),
|
||||||
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ var MainnetConstant = constant{
|
||||||
eip1559Block: big.NewInt(98800200), // Target 28th Jan 2026
|
eip1559Block: big.NewInt(98800200), // Target 28th Jan 2026
|
||||||
cancunBlock: big.NewInt(98802000), // Target 28th Jan 2026
|
cancunBlock: big.NewInt(98802000), // Target 28th Jan 2026
|
||||||
pragueBlock: big.NewInt(math.MaxInt64),
|
pragueBlock: big.NewInt(math.MaxInt64),
|
||||||
|
osakaBlock: big.NewInt(math.MaxInt64),
|
||||||
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ var TestnetConstant = constant{
|
||||||
eip1559Block: big.NewInt(71550000), // Target 14th Feb 2025
|
eip1559Block: big.NewInt(71550000), // Target 14th Feb 2025
|
||||||
cancunBlock: big.NewInt(71551800),
|
cancunBlock: big.NewInt(71551800),
|
||||||
pragueBlock: big.NewInt(math.MaxInt64),
|
pragueBlock: big.NewInt(math.MaxInt64),
|
||||||
|
osakaBlock: big.NewInt(math.MaxInt64),
|
||||||
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
dynamicGasLimitBlock: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
tipUpgradeReward: big.NewInt(math.MaxInt64),
|
||||||
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
tipUpgradePenalty: big.NewInt(math.MaxInt64),
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,10 @@ import (
|
||||||
// the rules.
|
// the rules.
|
||||||
func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
|
func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
|
||||||
switch {
|
switch {
|
||||||
|
case rules.IsOsaka:
|
||||||
|
return newPragueInstructionSet(), errors.New("osaka-fork not defined yet")
|
||||||
case rules.IsPrague:
|
case rules.IsPrague:
|
||||||
return newCancunInstructionSet(), errors.New("prague-fork not defined yet")
|
return newPragueInstructionSet(), nil
|
||||||
case rules.IsCancun:
|
case rules.IsCancun:
|
||||||
return newCancunInstructionSet(), nil
|
return newCancunInstructionSet(), nil
|
||||||
case rules.IsEIP1559:
|
case rules.IsEIP1559:
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ var (
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
// TestnetChainConfig contains the chain parameters to run a node on the Apothem testnet.
|
||||||
TestnetChainConfig = &ChainConfig{
|
TestnetChainConfig = &ChainConfig{
|
||||||
ChainID: big.NewInt(51),
|
ChainID: big.NewInt(51),
|
||||||
HomesteadBlock: big.NewInt(1),
|
HomesteadBlock: big.NewInt(1),
|
||||||
|
|
@ -290,7 +290,7 @@ var (
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// DevnetChainConfig contains the chain parameters to run a node on the Ropsten test network.
|
// DevnetChainConfig contains the chain parameters to run a node on the devnet.
|
||||||
DevnetChainConfig = &ChainConfig{
|
DevnetChainConfig = &ChainConfig{
|
||||||
ChainID: big.NewInt(551),
|
ChainID: big.NewInt(551),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
|
|
@ -334,6 +334,7 @@ var (
|
||||||
Eip1559Block: nil,
|
Eip1559Block: nil,
|
||||||
CancunBlock: nil,
|
CancunBlock: nil,
|
||||||
PragueBlock: nil,
|
PragueBlock: nil,
|
||||||
|
OsakaBlock: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
XDPoS: nil,
|
XDPoS: nil,
|
||||||
|
|
@ -353,7 +354,16 @@ var (
|
||||||
EIP155Block: big.NewInt(0),
|
EIP155Block: big.NewInt(0),
|
||||||
EIP158Block: big.NewInt(0),
|
EIP158Block: big.NewInt(0),
|
||||||
ByzantiumBlock: big.NewInt(0),
|
ByzantiumBlock: big.NewInt(0),
|
||||||
ConstantinopleBlock: nil,
|
ConstantinopleBlock: big.NewInt(0),
|
||||||
|
PetersburgBlock: big.NewInt(0),
|
||||||
|
IstanbulBlock: big.NewInt(0),
|
||||||
|
BerlinBlock: big.NewInt(0),
|
||||||
|
LondonBlock: big.NewInt(0),
|
||||||
|
ShanghaiBlock: big.NewInt(0),
|
||||||
|
Eip1559Block: big.NewInt(0),
|
||||||
|
CancunBlock: big.NewInt(0),
|
||||||
|
PragueBlock: big.NewInt(0),
|
||||||
|
OsakaBlock: big.NewInt(0),
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
XDPoS: &XDPoSConfig{Period: 0, Epoch: 900},
|
XDPoS: &XDPoSConfig{Period: 0, Epoch: 900},
|
||||||
|
|
@ -376,9 +386,10 @@ var (
|
||||||
BerlinBlock: big.NewInt(0),
|
BerlinBlock: big.NewInt(0),
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
Eip1559Block: nil,
|
Eip1559Block: big.NewInt(0),
|
||||||
CancunBlock: nil,
|
CancunBlock: nil,
|
||||||
PragueBlock: nil,
|
PragueBlock: nil,
|
||||||
|
OsakaBlock: nil,
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: &CliqueConfig{Period: 0, Epoch: 900},
|
Clique: &CliqueConfig{Period: 0, Epoch: 900},
|
||||||
XDPoS: nil,
|
XDPoS: nil,
|
||||||
|
|
@ -432,6 +443,7 @@ var (
|
||||||
Eip1559Block: nil,
|
Eip1559Block: nil,
|
||||||
CancunBlock: nil,
|
CancunBlock: nil,
|
||||||
PragueBlock: nil,
|
PragueBlock: nil,
|
||||||
|
OsakaBlock: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
XDPoS: nil,
|
XDPoS: nil,
|
||||||
|
|
@ -457,6 +469,7 @@ var (
|
||||||
Eip1559Block: big.NewInt(0),
|
Eip1559Block: big.NewInt(0),
|
||||||
CancunBlock: big.NewInt(0),
|
CancunBlock: big.NewInt(0),
|
||||||
PragueBlock: big.NewInt(0),
|
PragueBlock: big.NewInt(0),
|
||||||
|
OsakaBlock: big.NewInt(0),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
XDPoS: nil,
|
XDPoS: nil,
|
||||||
|
|
@ -494,6 +507,7 @@ type ChainConfig struct {
|
||||||
Eip1559Block *big.Int `json:"eip1559Block,omitempty"`
|
Eip1559Block *big.Int `json:"eip1559Block,omitempty"`
|
||||||
CancunBlock *big.Int `json:"cancunBlock,omitempty"`
|
CancunBlock *big.Int `json:"cancunBlock,omitempty"`
|
||||||
PragueBlock *big.Int `json:"pragueBlock,omitempty"`
|
PragueBlock *big.Int `json:"pragueBlock,omitempty"`
|
||||||
|
OsakaBlock *big.Int `json:"osakaBlock,omitempty"`
|
||||||
|
|
||||||
DynamicGasLimitBlock *big.Int `json:"dynamicGasLimitBlock,omitempty"` // Dynamic gas limit adjustment algorithm activation block (nil = no fork)
|
DynamicGasLimitBlock *big.Int `json:"dynamicGasLimitBlock,omitempty"` // Dynamic gas limit adjustment algorithm activation block (nil = no fork)
|
||||||
|
|
||||||
|
|
@ -912,6 +926,10 @@ func (c *ChainConfig) Description() string {
|
||||||
if c.PragueBlock != nil {
|
if c.PragueBlock != nil {
|
||||||
pragueBlock = c.PragueBlock
|
pragueBlock = c.PragueBlock
|
||||||
}
|
}
|
||||||
|
osakaBlock := common.OsakaBlock
|
||||||
|
if c.OsakaBlock != nil {
|
||||||
|
osakaBlock = c.OsakaBlock
|
||||||
|
}
|
||||||
dynamicGasLimitBlock := common.DynamicGasLimitBlock
|
dynamicGasLimitBlock := common.DynamicGasLimitBlock
|
||||||
if c.DynamicGasLimitBlock != nil {
|
if c.DynamicGasLimitBlock != nil {
|
||||||
dynamicGasLimitBlock = c.DynamicGasLimitBlock
|
dynamicGasLimitBlock = c.DynamicGasLimitBlock
|
||||||
|
|
@ -948,6 +966,7 @@ func (c *ChainConfig) Description() string {
|
||||||
banner += fmt.Sprintf(" - Eip1559: %-8v\n", eip1559Block)
|
banner += fmt.Sprintf(" - Eip1559: %-8v\n", eip1559Block)
|
||||||
banner += fmt.Sprintf(" - Cancun: %-8v\n", cancunBlock)
|
banner += fmt.Sprintf(" - Cancun: %-8v\n", cancunBlock)
|
||||||
banner += fmt.Sprintf(" - Prague: %-8v\n", pragueBlock)
|
banner += fmt.Sprintf(" - Prague: %-8v\n", pragueBlock)
|
||||||
|
banner += fmt.Sprintf(" - Osaka: %-8v\n", osakaBlock)
|
||||||
banner += fmt.Sprintf(" - DynamicGasLimitBlock: %-8v\n", dynamicGasLimitBlock)
|
banner += fmt.Sprintf(" - DynamicGasLimitBlock: %-8v\n", dynamicGasLimitBlock)
|
||||||
banner += fmt.Sprintf(" - TIPUpgradeReward: %-8v\n", common.TIPUpgradeReward)
|
banner += fmt.Sprintf(" - TIPUpgradeReward: %-8v\n", common.TIPUpgradeReward)
|
||||||
banner += fmt.Sprintf(" - TipUpgradePenalty: %-8v\n", common.TipUpgradePenalty)
|
banner += fmt.Sprintf(" - TipUpgradePenalty: %-8v\n", common.TipUpgradePenalty)
|
||||||
|
|
@ -1034,6 +1053,11 @@ func (c *ChainConfig) IsPrague(num *big.Int) bool {
|
||||||
return isForked(common.PragueBlock, num) || isForked(c.PragueBlock, num)
|
return isForked(common.PragueBlock, num) || isForked(c.PragueBlock, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsOsaka returns whether num is either equal to the Osaka fork block or greater.
|
||||||
|
func (c *ChainConfig) IsOsaka(num *big.Int) bool {
|
||||||
|
return isForked(common.OsakaBlock, num) || isForked(c.OsakaBlock, num)
|
||||||
|
}
|
||||||
|
|
||||||
// IsDynamicGasLimitBlock returns whether num is either equal to the DynamicGasLimitBlock fork block or greater.
|
// IsDynamicGasLimitBlock returns whether num is either equal to the DynamicGasLimitBlock fork block or greater.
|
||||||
func (c *ChainConfig) IsDynamicGasLimitBlock(num *big.Int) bool {
|
func (c *ChainConfig) IsDynamicGasLimitBlock(num *big.Int) bool {
|
||||||
return isForked(common.DynamicGasLimitBlock, num) || isForked(c.DynamicGasLimitBlock, num)
|
return isForked(common.DynamicGasLimitBlock, num) || isForked(c.DynamicGasLimitBlock, num)
|
||||||
|
|
@ -1189,6 +1213,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
||||||
if isForkIncompatible(c.PragueBlock, newcfg.PragueBlock, head) {
|
if isForkIncompatible(c.PragueBlock, newcfg.PragueBlock, head) {
|
||||||
return newCompatError("Prague fork block", c.PragueBlock, newcfg.PragueBlock)
|
return newCompatError("Prague fork block", c.PragueBlock, newcfg.PragueBlock)
|
||||||
}
|
}
|
||||||
|
if isForkIncompatible(c.OsakaBlock, newcfg.OsakaBlock, head) {
|
||||||
|
return newCompatError("Osaka fork block", c.OsakaBlock, newcfg.OsakaBlock)
|
||||||
|
}
|
||||||
if !XDPoSConfigEqual(c.XDPoS, newcfg.XDPoS) {
|
if !XDPoSConfigEqual(c.XDPoS, newcfg.XDPoS) {
|
||||||
storedblock := big.NewInt(1)
|
storedblock := big.NewInt(1)
|
||||||
if c.XDPoS != nil && c.XDPoS.V2 != nil && c.XDPoS.V2.SwitchBlock != nil {
|
if c.XDPoS != nil && c.XDPoS.V2 != nil && c.XDPoS.V2.SwitchBlock != nil {
|
||||||
|
|
@ -1281,6 +1308,7 @@ type Rules struct {
|
||||||
IsEIP1559 bool
|
IsEIP1559 bool
|
||||||
IsCancun bool
|
IsCancun bool
|
||||||
IsPrague bool
|
IsPrague bool
|
||||||
|
IsOsaka bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChainConfig) Rules(num *big.Int) Rules {
|
func (c *ChainConfig) Rules(num *big.Int) Rules {
|
||||||
|
|
@ -1306,5 +1334,6 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
|
||||||
IsEIP1559: c.IsEIP1559(num),
|
IsEIP1559: c.IsEIP1559(num),
|
||||||
IsCancun: c.IsCancun(num),
|
IsCancun: c.IsCancun(num),
|
||||||
IsPrague: c.IsPrague(num),
|
IsPrague: c.IsPrague(num),
|
||||||
|
IsOsaka: c.IsOsaka(num),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue