mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 22:43:47 +00:00
feat: rename next upgrade to Darwin (#863)
This commit is contained in:
parent
574ebf82bb
commit
418bc6f728
7 changed files with 25 additions and 25 deletions
|
|
@ -3722,7 +3722,7 @@ func TestCurieTransition(t *testing.T) {
|
||||||
b, _ := json.Marshal(params.AllEthashProtocolChanges)
|
b, _ := json.Marshal(params.AllEthashProtocolChanges)
|
||||||
json.Unmarshal(b, &config)
|
json.Unmarshal(b, &config)
|
||||||
config.CurieBlock = big.NewInt(2)
|
config.CurieBlock = big.NewInt(2)
|
||||||
config.DescartesTime = nil
|
config.DarwinTime = nil
|
||||||
|
|
||||||
var (
|
var (
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(0),
|
BernoulliBlock: big.NewInt(0),
|
||||||
CurieBlock: big.NewInt(0),
|
CurieBlock: big.NewInt(0),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
}
|
}
|
||||||
signer = types.LatestSigner(config)
|
signer = types.LatestSigner(config)
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
|
||||||
if cfg.JumpTable[STOP] == nil {
|
if cfg.JumpTable[STOP] == nil {
|
||||||
var jt JumpTable
|
var jt JumpTable
|
||||||
switch {
|
switch {
|
||||||
case evm.chainRules.IsDescartes:
|
case evm.chainRules.IsDarwin:
|
||||||
jt = descartesInstructionSet
|
jt = darwinInstructionSet
|
||||||
case evm.chainRules.IsCurie:
|
case evm.chainRules.IsCurie:
|
||||||
jt = curieInstructionSet
|
jt = curieInstructionSet
|
||||||
case evm.chainRules.IsShanghai:
|
case evm.chainRules.IsShanghai:
|
||||||
|
|
|
||||||
|
|
@ -60,15 +60,15 @@ var (
|
||||||
londonInstructionSet = newLondonInstructionSet()
|
londonInstructionSet = newLondonInstructionSet()
|
||||||
shanghaiInstructionSet = newShanghaiInstructionSet()
|
shanghaiInstructionSet = newShanghaiInstructionSet()
|
||||||
curieInstructionSet = newCurieInstructionSet()
|
curieInstructionSet = newCurieInstructionSet()
|
||||||
descartesInstructionSet = newDescartesInstructionSet()
|
darwinInstructionSet = newDarwinInstructionSet()
|
||||||
)
|
)
|
||||||
|
|
||||||
// JumpTable contains the EVM opcodes supported at a given fork.
|
// JumpTable contains the EVM opcodes supported at a given fork.
|
||||||
type JumpTable [256]*operation
|
type JumpTable [256]*operation
|
||||||
|
|
||||||
// newDescartesInstructionSet returns the frontier, homestead, byzantium,
|
// newDarwinInstructionSet returns the frontier, homestead, byzantium,
|
||||||
// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and descartes instructions.
|
// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and darwin instructions.
|
||||||
func newDescartesInstructionSet() JumpTable {
|
func newDarwinInstructionSet() JumpTable {
|
||||||
instructionSet := newCurieInstructionSet()
|
instructionSet := newCurieInstructionSet()
|
||||||
return instructionSet
|
return instructionSet
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ func setDefaults(cfg *Config) {
|
||||||
ShanghaiBlock: new(big.Int),
|
ShanghaiBlock: new(big.Int),
|
||||||
BernoulliBlock: new(big.Int),
|
BernoulliBlock: new(big.Int),
|
||||||
CurieBlock: new(big.Int),
|
CurieBlock: new(big.Int),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool, pendingTxC
|
||||||
config.ShanghaiBlock = londonBlock
|
config.ShanghaiBlock = londonBlock
|
||||||
config.BernoulliBlock = londonBlock
|
config.BernoulliBlock = londonBlock
|
||||||
config.CurieBlock = londonBlock
|
config.CurieBlock = londonBlock
|
||||||
config.DescartesTime = nil
|
config.DarwinTime = nil
|
||||||
engine := ethash.NewFaker()
|
engine := ethash.NewFaker()
|
||||||
db := rawdb.NewMemoryDatabase()
|
db := rawdb.NewMemoryDatabase()
|
||||||
genesis, err := gspec.Commit(db)
|
genesis, err := gspec.Commit(db)
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ var (
|
||||||
ShanghaiBlock: nil,
|
ShanghaiBlock: nil,
|
||||||
BernoulliBlock: nil,
|
BernoulliBlock: nil,
|
||||||
CurieBlock: nil,
|
CurieBlock: nil,
|
||||||
DescartesTime: nil,
|
DarwinTime: nil,
|
||||||
Clique: &CliqueConfig{
|
Clique: &CliqueConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 30000,
|
Epoch: 30000,
|
||||||
|
|
@ -320,7 +320,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(3747132),
|
BernoulliBlock: big.NewInt(3747132),
|
||||||
CurieBlock: big.NewInt(4740239),
|
CurieBlock: big.NewInt(4740239),
|
||||||
DescartesTime: nil,
|
DarwinTime: nil,
|
||||||
Clique: &CliqueConfig{
|
Clique: &CliqueConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 30000,
|
Epoch: 30000,
|
||||||
|
|
@ -359,7 +359,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(5220340),
|
BernoulliBlock: big.NewInt(5220340),
|
||||||
CurieBlock: big.NewInt(7096836),
|
CurieBlock: big.NewInt(7096836),
|
||||||
DescartesTime: nil,
|
DarwinTime: nil,
|
||||||
Clique: &CliqueConfig{
|
Clique: &CliqueConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 30000,
|
Epoch: 30000,
|
||||||
|
|
@ -404,7 +404,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(0),
|
BernoulliBlock: big.NewInt(0),
|
||||||
CurieBlock: big.NewInt(0),
|
CurieBlock: big.NewInt(0),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
@ -447,7 +447,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(0),
|
BernoulliBlock: big.NewInt(0),
|
||||||
CurieBlock: big.NewInt(0),
|
CurieBlock: big.NewInt(0),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
||||||
|
|
@ -485,7 +485,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(0),
|
BernoulliBlock: big.NewInt(0),
|
||||||
CurieBlock: big.NewInt(0),
|
CurieBlock: big.NewInt(0),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
@ -524,7 +524,7 @@ var (
|
||||||
ShanghaiBlock: big.NewInt(0),
|
ShanghaiBlock: big.NewInt(0),
|
||||||
BernoulliBlock: big.NewInt(0),
|
BernoulliBlock: big.NewInt(0),
|
||||||
CurieBlock: big.NewInt(0),
|
CurieBlock: big.NewInt(0),
|
||||||
DescartesTime: new(uint64),
|
DarwinTime: new(uint64),
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
|
|
@ -622,7 +622,7 @@ type ChainConfig struct {
|
||||||
ShanghaiBlock *big.Int `json:"shanghaiBlock,omitempty"` // Shanghai switch block (nil = no fork, 0 = already on shanghai)
|
ShanghaiBlock *big.Int `json:"shanghaiBlock,omitempty"` // Shanghai switch block (nil = no fork, 0 = already on shanghai)
|
||||||
BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli)
|
BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli)
|
||||||
CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie)
|
CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie)
|
||||||
DescartesTime *uint64 `json:"descartesTime,omitempty"` // Descartes switch time (nil = no fork, 0 = already on descartes)
|
DarwinTime *uint64 `json:"darwinTime,omitempty"` // Darwin switch time (nil = no fork, 0 = already on darwin)
|
||||||
|
|
||||||
// TerminalTotalDifficulty is the amount of total difficulty reached by
|
// TerminalTotalDifficulty is the amount of total difficulty reached by
|
||||||
// the network that triggers the consensus upgrade.
|
// the network that triggers the consensus upgrade.
|
||||||
|
|
@ -739,7 +739,7 @@ func (c *ChainConfig) String() string {
|
||||||
default:
|
default:
|
||||||
engine = "unknown"
|
engine = "unknown"
|
||||||
}
|
}
|
||||||
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, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Descartes: %v, Engine: %v, Scroll config: %v}",
|
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, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Engine: %v, Scroll config: %v}",
|
||||||
c.ChainID,
|
c.ChainID,
|
||||||
c.HomesteadBlock,
|
c.HomesteadBlock,
|
||||||
c.DAOForkBlock,
|
c.DAOForkBlock,
|
||||||
|
|
@ -759,7 +759,7 @@ func (c *ChainConfig) String() string {
|
||||||
c.ShanghaiBlock,
|
c.ShanghaiBlock,
|
||||||
c.BernoulliBlock,
|
c.BernoulliBlock,
|
||||||
c.CurieBlock,
|
c.CurieBlock,
|
||||||
c.DescartesTime,
|
c.DarwinTime,
|
||||||
engine,
|
engine,
|
||||||
c.Scroll,
|
c.Scroll,
|
||||||
)
|
)
|
||||||
|
|
@ -852,9 +852,9 @@ func (c *ChainConfig) IsCurie(num *big.Int) bool {
|
||||||
return isForked(c.CurieBlock, num)
|
return isForked(c.CurieBlock, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsDescartes returns whether num is either equal to the Descartes fork block or greater.
|
// IsDarwin returns whether num is either equal to the Darwin fork block or greater.
|
||||||
func (c *ChainConfig) IsDescartes(now uint64) bool {
|
func (c *ChainConfig) IsDarwin(now uint64) bool {
|
||||||
return isForkedTime(now, c.DescartesTime)
|
return isForkedTime(now, c.DarwinTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsTerminalPoWBlock returns whether the given block is the last block of PoW stage.
|
// IsTerminalPoWBlock returns whether the given block is the last block of PoW stage.
|
||||||
|
|
@ -1069,7 +1069,7 @@ type Rules struct {
|
||||||
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
|
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
|
||||||
IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
|
IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
|
||||||
IsBerlin, IsLondon, IsArchimedes, IsShanghai bool
|
IsBerlin, IsLondon, IsArchimedes, IsShanghai bool
|
||||||
IsBernoulli, IsCurie, IsDescartes bool
|
IsBernoulli, IsCurie, IsDarwin bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rules ensures c's ChainID is not nil.
|
// Rules ensures c's ChainID is not nil.
|
||||||
|
|
@ -1094,6 +1094,6 @@ func (c *ChainConfig) Rules(num *big.Int, time uint64) Rules {
|
||||||
IsShanghai: c.IsShanghai(num),
|
IsShanghai: c.IsShanghai(num),
|
||||||
IsBernoulli: c.IsBernoulli(num),
|
IsBernoulli: c.IsBernoulli(num),
|
||||||
IsCurie: c.IsCurie(num),
|
IsCurie: c.IsCurie(num),
|
||||||
IsDescartes: c.IsDescartes(time),
|
IsDarwin: c.IsDarwin(time),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue