mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
all: remove terminalTotalDifficultyPassed
This commit is contained in:
parent
368e16f39d
commit
75ca47f657
32 changed files with 341 additions and 405 deletions
|
|
@ -18,7 +18,6 @@
|
||||||
"shanghaiTime": 780,
|
"shanghaiTime": 780,
|
||||||
"cancunTime": 840,
|
"cancunTime": 840,
|
||||||
"terminalTotalDifficulty": 9454784,
|
"terminalTotalDifficulty": 9454784,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
},
|
},
|
||||||
"nonce": "0x0",
|
"nonce": "0x0",
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,7 @@ var customGenesisTests = []struct {
|
||||||
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"timestamp" : "0x00",
|
"timestamp" : "0x00",
|
||||||
"config" : {
|
"config" : {}
|
||||||
"terminalTotalDifficultyPassed": true
|
|
||||||
}
|
|
||||||
}`,
|
}`,
|
||||||
query: "eth.getBlock(0).nonce",
|
query: "eth.getBlock(0).nonce",
|
||||||
result: "0x0000000000001338",
|
result: "0x0000000000001338",
|
||||||
|
|
@ -64,7 +62,6 @@ var customGenesisTests = []struct {
|
||||||
"homesteadBlock" : 42,
|
"homesteadBlock" : 42,
|
||||||
"daoForkBlock" : 141,
|
"daoForkBlock" : 141,
|
||||||
"daoForkSupport" : true,
|
"daoForkSupport" : true,
|
||||||
"terminalTotalDifficultyPassed" : true
|
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
query: "eth.getBlock(0).nonce",
|
query: "eth.getBlock(0).nonce",
|
||||||
|
|
@ -114,9 +111,7 @@ func TestCustomBackend(t *testing.T) {
|
||||||
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"timestamp" : "0x00",
|
"timestamp" : "0x00",
|
||||||
"config" : {
|
"config" : {}
|
||||||
"terminalTotalDifficultyPassed": true
|
|
||||||
}
|
|
||||||
}`
|
}`
|
||||||
type backendTest struct {
|
type backendTest struct {
|
||||||
initArgs []string
|
initArgs []string
|
||||||
|
|
|
||||||
1
cmd/geth/testdata/clique.json
vendored
1
cmd/geth/testdata/clique.json
vendored
|
|
@ -8,7 +8,6 @@
|
||||||
"byzantiumBlock": 0,
|
"byzantiumBlock": 0,
|
||||||
"constantinopleBlock": 0,
|
"constantinopleBlock": 0,
|
||||||
"petersburgBlock": 0,
|
"petersburgBlock": 0,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"clique": {
|
"clique": {
|
||||||
"period": 5,
|
"period": 5,
|
||||||
"epoch": 30000
|
"epoch": 30000
|
||||||
|
|
|
||||||
|
|
@ -1866,9 +1866,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Could not read genesis from database: %v", err)
|
Fatalf("Could not read genesis from database: %v", err)
|
||||||
}
|
}
|
||||||
if !genesis.Config.TerminalTotalDifficultyPassed {
|
|
||||||
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficultyPassed must be true")
|
|
||||||
}
|
|
||||||
if genesis.Config.TerminalTotalDifficulty == nil {
|
if genesis.Config.TerminalTotalDifficulty == nil {
|
||||||
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified")
|
Fatalf("Bad developer-mode genesis configuration: terminalTotalDifficulty must be specified")
|
||||||
} else if genesis.Config.TerminalTotalDifficulty.Cmp(big.NewInt(0)) != 0 {
|
} else if genesis.Config.TerminalTotalDifficulty.Cmp(big.NewInt(0)) != 0 {
|
||||||
|
|
|
||||||
|
|
@ -4091,7 +4091,6 @@ func TestEIP3651(t *testing.T) {
|
||||||
gspec.Config.BerlinBlock = common.Big0
|
gspec.Config.BerlinBlock = common.Big0
|
||||||
gspec.Config.LondonBlock = common.Big0
|
gspec.Config.LondonBlock = common.Big0
|
||||||
gspec.Config.TerminalTotalDifficulty = common.Big0
|
gspec.Config.TerminalTotalDifficulty = common.Big0
|
||||||
gspec.Config.TerminalTotalDifficultyPassed = true
|
|
||||||
gspec.Config.ShanghaiTime = u64(0)
|
gspec.Config.ShanghaiTime = u64(0)
|
||||||
signer := types.LatestSigner(gspec.Config)
|
signer := types.LatestSigner(gspec.Config)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ func TestGeneratePOSChain(t *testing.T) {
|
||||||
db = rawdb.NewMemoryDatabase()
|
db = rawdb.NewMemoryDatabase()
|
||||||
)
|
)
|
||||||
|
|
||||||
config.TerminalTotalDifficultyPassed = true
|
|
||||||
config.TerminalTotalDifficulty = common.Big0
|
config.TerminalTotalDifficulty = common.Big0
|
||||||
config.ShanghaiTime = u64(0)
|
config.ShanghaiTime = u64(0)
|
||||||
config.CancunTime = u64(0)
|
config.CancunTime = u64(0)
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,6 @@ func TestTimeBasedForkInGenesis(t *testing.T) {
|
||||||
BerlinBlock: big.NewInt(0),
|
BerlinBlock: big.NewInt(0),
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
MergeNetsplitBlock: big.NewInt(0),
|
MergeNetsplitBlock: big.NewInt(0),
|
||||||
ShanghaiTime: &shanghai,
|
ShanghaiTime: &shanghai,
|
||||||
CancunTime: &cancun,
|
CancunTime: &cancun,
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,6 @@ func TestVerkleGenesisCommit(t *testing.T) {
|
||||||
PragueTime: &verkleTime,
|
PragueTime: &verkleTime,
|
||||||
VerkleTime: &verkleTime,
|
VerkleTime: &verkleTime,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
LondonBlock: big.NewInt(0),
|
LondonBlock: big.NewInt(0),
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
ShanghaiTime: new(uint64),
|
ShanghaiTime: new(uint64),
|
||||||
CancunTime: new(uint64),
|
CancunTime: new(uint64),
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +256,7 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
want: "could not apply tx 0 [0x6c11015985ce82db691d7b2d017acda296db88b811c3c60dc71449c76256c716]: max fee per gas less than block base fee: address 0x71562b71999873DB5b286dF957af199Ec94617F7, maxFeePerGas: 1, baseFee: 875000000",
|
want: "could not apply tx 0 [0x6c11015985ce82db691d7b2d017acda296db88b811c3c60dc71449c76256c716]: max fee per gas less than block base fee: address 0x71562b71999873DB5b286dF957af199Ec94617F7, maxFeePerGas: 1, baseFee: 875000000",
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
block := GenerateBadBlock(gspec.ToBlock(), beacon.New(ethash.NewFaker()), tt.txs, gspec.Config)
|
block := GenerateBadBlock(gspec.ToBlock(), beacon.New(ethash.NewFaker()), tt.txs, gspec.Config, true)
|
||||||
_, err := blockchain.InsertChain(types.Blocks{block})
|
_, err := blockchain.InsertChain(types.Blocks{block})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("block imported without errors")
|
t.Fatal("block imported without errors")
|
||||||
|
|
@ -306,7 +305,7 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
want: "could not apply tx 0 [0x88626ac0d53cb65308f2416103c62bb1f18b805573d4f96a3640bbbfff13c14f]: transaction type not supported",
|
want: "could not apply tx 0 [0x88626ac0d53cb65308f2416103c62bb1f18b805573d4f96a3640bbbfff13c14f]: transaction type not supported",
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
block := GenerateBadBlock(gspec.ToBlock(), ethash.NewFaker(), tt.txs, gspec.Config)
|
block := GenerateBadBlock(gspec.ToBlock(), ethash.NewFaker(), tt.txs, gspec.Config, false)
|
||||||
_, err := blockchain.InsertChain(types.Blocks{block})
|
_, err := blockchain.InsertChain(types.Blocks{block})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("block imported without errors")
|
t.Fatal("block imported without errors")
|
||||||
|
|
@ -345,7 +344,7 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
want: "could not apply tx 0 [0x88626ac0d53cb65308f2416103c62bb1f18b805573d4f96a3640bbbfff13c14f]: sender not an eoa: address 0x71562b71999873DB5b286dF957af199Ec94617F7, codehash: 0x9280914443471259d4570a8661015ae4a5b80186dbc619658fb494bebc3da3d1",
|
want: "could not apply tx 0 [0x88626ac0d53cb65308f2416103c62bb1f18b805573d4f96a3640bbbfff13c14f]: sender not an eoa: address 0x71562b71999873DB5b286dF957af199Ec94617F7, codehash: 0x9280914443471259d4570a8661015ae4a5b80186dbc619658fb494bebc3da3d1",
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
block := GenerateBadBlock(gspec.ToBlock(), beacon.New(ethash.NewFaker()), tt.txs, gspec.Config)
|
block := GenerateBadBlock(gspec.ToBlock(), beacon.New(ethash.NewFaker()), tt.txs, gspec.Config, true)
|
||||||
_, err := blockchain.InsertChain(types.Blocks{block})
|
_, err := blockchain.InsertChain(types.Blocks{block})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("block imported without errors")
|
t.Fatal("block imported without errors")
|
||||||
|
|
@ -361,9 +360,9 @@ func TestStateProcessorErrors(t *testing.T) {
|
||||||
// valid, and no proper post-state can be made. But from the perspective of the blockchain, the block is sufficiently
|
// valid, and no proper post-state can be made. But from the perspective of the blockchain, the block is sufficiently
|
||||||
// valid to be considered for import:
|
// valid to be considered for import:
|
||||||
// - valid pow (fake), ancestry, difficulty, gaslimit etc
|
// - valid pow (fake), ancestry, difficulty, gaslimit etc
|
||||||
func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Transactions, config *params.ChainConfig) *types.Block {
|
func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Transactions, config *params.ChainConfig, postMerge bool) *types.Block {
|
||||||
difficulty := big.NewInt(0)
|
difficulty := big.NewInt(0)
|
||||||
if !config.TerminalTotalDifficultyPassed {
|
if !postMerge {
|
||||||
fakeChainReader := newChainMaker(nil, config, engine)
|
fakeChainReader := newChainMaker(nil, config, engine)
|
||||||
difficulty = engine.CalcDifficulty(fakeChainReader, parent.Time()+10, &types.Header{
|
difficulty = engine.CalcDifficulty(fakeChainReader, parent.Time()+10, &types.Header{
|
||||||
Number: parent.Number(),
|
Number: parent.Number(),
|
||||||
|
|
@ -457,7 +456,6 @@ func TestProcessVerkle(t *testing.T) {
|
||||||
ShanghaiTime: u64(0),
|
ShanghaiTime: u64(0),
|
||||||
VerkleTime: u64(0),
|
VerkleTime: u64(0),
|
||||||
TerminalTotalDifficulty: common.Big0,
|
TerminalTotalDifficulty: common.Big0,
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
// TODO uncomment when proof generation is merged
|
// TODO uncomment when proof generation is merged
|
||||||
// ProofInBlocks: true,
|
// ProofInBlocks: true,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ func setDefaults(cfg *Config) {
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: &shanghaiTime,
|
ShanghaiTime: &shanghaiTime,
|
||||||
CancunTime: &cancunTime}
|
CancunTime: &cancunTime}
|
||||||
|
|
@ -110,7 +109,7 @@ func setDefaults(cfg *Config) {
|
||||||
cfg.BlobBaseFee = big.NewInt(params.BlobTxMinBlobGasprice)
|
cfg.BlobBaseFee = big.NewInt(params.BlobTxMinBlobGasprice)
|
||||||
}
|
}
|
||||||
// Merge indicators
|
// Merge indicators
|
||||||
if t := cfg.ChainConfig.ShanghaiTime; cfg.ChainConfig.TerminalTotalDifficultyPassed || (t != nil && *t == 0) {
|
if t := cfg.ChainConfig.ShanghaiTime; t != nil && *t == 0 {
|
||||||
cfg.Random = &(common.Hash{})
|
cfg.Random = &(common.Hash{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ func generateMergeChain(n int, merged bool) (*core.Genesis, []*types.Block) {
|
||||||
engine := consensus.Engine(beaconConsensus.New(ethash.NewFaker()))
|
engine := consensus.Engine(beaconConsensus.New(ethash.NewFaker()))
|
||||||
if merged {
|
if merged {
|
||||||
config.TerminalTotalDifficulty = common.Big0
|
config.TerminalTotalDifficulty = common.Big0
|
||||||
config.TerminalTotalDifficultyPassed = true
|
|
||||||
engine = beaconConsensus.NewFaker()
|
engine = beaconConsensus.NewFaker()
|
||||||
}
|
}
|
||||||
genesis := &core.Genesis{
|
genesis := &core.Genesis{
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
package ethconfig
|
package ethconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -162,11 +161,6 @@ type Config struct {
|
||||||
// Clique is allowed for now to live standalone, but ethash is forbidden and can
|
// Clique is allowed for now to live standalone, but ethash is forbidden and can
|
||||||
// only exist on already merged networks.
|
// only exist on already merged networks.
|
||||||
func CreateConsensusEngine(config *params.ChainConfig, db ethdb.Database) (consensus.Engine, error) {
|
func CreateConsensusEngine(config *params.ChainConfig, db ethdb.Database) (consensus.Engine, error) {
|
||||||
// Geth v1.14.0 dropped support for non-merged networks in any consensus
|
|
||||||
// mode. If such a network is requested, reject startup.
|
|
||||||
if !config.TerminalTotalDifficultyPassed {
|
|
||||||
return nil, errors.New("only PoS networks are supported, please transition old ones with Geth v1.13.x")
|
|
||||||
}
|
|
||||||
// Wrap previously supported consensus engines into their post-merge counterpart
|
// Wrap previously supported consensus engines into their post-merge counterpart
|
||||||
if config.Clique != nil {
|
if config.Clique != nil {
|
||||||
return beacon.New(clique.New(config.Clique, db)), nil
|
return beacon.New(clique.New(config.Clique, db)), nil
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ func newTestBackendWithGenerator(blocks int, shanghai bool, generator func(int,
|
||||||
MergeNetsplitBlock: big.NewInt(0),
|
MergeNetsplitBlock: big.NewInt(0),
|
||||||
ShanghaiTime: u64(0),
|
ShanghaiTime: u64(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
}
|
}
|
||||||
engine = beacon.NewFaker()
|
engine = beacon.NewFaker()
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@
|
||||||
"grayGlacierBlock": 0,
|
"grayGlacierBlock": 0,
|
||||||
"shanghaiTime": 0,
|
"shanghaiTime": 0,
|
||||||
"cancunTime": 0,
|
"cancunTime": 0,
|
||||||
"terminalTotalDifficulty": 0,
|
"terminalTotalDifficulty": 0
|
||||||
"terminalTotalDifficultyPassed": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"context": {
|
"context": {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@
|
||||||
"berlinBlock": 4460644,
|
"berlinBlock": 4460644,
|
||||||
"londonBlock": 5062605,
|
"londonBlock": 5062605,
|
||||||
"terminalTotalDifficulty": 10790000,
|
"terminalTotalDifficulty": 10790000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"clique": {
|
"clique": {
|
||||||
"period": 15,
|
"period": 15,
|
||||||
"epoch": 30000
|
"epoch": 30000
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,6 @@
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"shanghaiTime": 1681338455,
|
"shanghaiTime": 1681338455,
|
||||||
"terminalTotalDifficulty": 7797655526461000,
|
"terminalTotalDifficulty": 7797655526461000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@
|
||||||
"grayGlacierBlock": 0,
|
"grayGlacierBlock": 0,
|
||||||
"shanghaiTime": 0,
|
"shanghaiTime": 0,
|
||||||
"cancunTime": 0,
|
"cancunTime": 0,
|
||||||
"terminalTotalDifficulty": 0,
|
"terminalTotalDifficulty": 0
|
||||||
"terminalTotalDifficultyPassed": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"context": {
|
"context": {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@
|
||||||
"grayGlacierBlock": 0,
|
"grayGlacierBlock": 0,
|
||||||
"shanghaiTime": 0,
|
"shanghaiTime": 0,
|
||||||
"terminalTotalDifficulty": 0,
|
"terminalTotalDifficulty": 0,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"isDev": true
|
"isDev": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@
|
||||||
"londonBlock": 12965000,
|
"londonBlock": 12965000,
|
||||||
"arrowGlacierBlock": 13773000,
|
"arrowGlacierBlock": 13773000,
|
||||||
"grayGlacierBlock": 15050000,
|
"grayGlacierBlock": 15050000,
|
||||||
"terminalTotalDifficultyPassed": true,
|
|
||||||
"ethash": {}
|
"ethash": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -460,7 +460,6 @@ func newGQLService(t *testing.T, stack *node.Node, shanghai bool, gspec *core.Ge
|
||||||
if shanghai {
|
if shanghai {
|
||||||
engine = beacon.NewFaker()
|
engine = beacon.NewFaker()
|
||||||
chainCfg := gspec.Config
|
chainCfg := gspec.Config
|
||||||
chainCfg.TerminalTotalDifficultyPassed = true
|
|
||||||
chainCfg.TerminalTotalDifficulty = common.Big0
|
chainCfg.TerminalTotalDifficulty = common.Big0
|
||||||
// GenerateChain will increment timestamps by 10.
|
// GenerateChain will increment timestamps by 10.
|
||||||
// Shanghai upgrade at block 1.
|
// Shanghai upgrade at block 1.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ var (
|
||||||
ArrowGlacierBlock: big.NewInt(13_773_000),
|
ArrowGlacierBlock: big.NewInt(13_773_000),
|
||||||
GrayGlacierBlock: big.NewInt(15_050_000),
|
GrayGlacierBlock: big.NewInt(15_050_000),
|
||||||
TerminalTotalDifficulty: MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
|
TerminalTotalDifficulty: MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
ShanghaiTime: newUint64(1681338455),
|
ShanghaiTime: newUint64(1681338455),
|
||||||
CancunTime: newUint64(1710338135),
|
CancunTime: newUint64(1710338135),
|
||||||
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cbb839cbe05303d7705fa"),
|
DepositContractAddress: common.HexToAddress("0x00000000219ab540356cbb839cbe05303d7705fa"),
|
||||||
|
|
@ -80,7 +79,6 @@ var (
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
MergeNetsplitBlock: nil,
|
MergeNetsplitBlock: nil,
|
||||||
ShanghaiTime: newUint64(1696000704),
|
ShanghaiTime: newUint64(1696000704),
|
||||||
CancunTime: newUint64(1707305664),
|
CancunTime: newUint64(1707305664),
|
||||||
|
|
@ -105,7 +103,6 @@ var (
|
||||||
ArrowGlacierBlock: nil,
|
ArrowGlacierBlock: nil,
|
||||||
GrayGlacierBlock: nil,
|
GrayGlacierBlock: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
|
TerminalTotalDifficulty: big.NewInt(17_000_000_000_000_000),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
MergeNetsplitBlock: big.NewInt(1735371),
|
MergeNetsplitBlock: big.NewInt(1735371),
|
||||||
ShanghaiTime: newUint64(1677557088),
|
ShanghaiTime: newUint64(1677557088),
|
||||||
CancunTime: newUint64(1706655072),
|
CancunTime: newUint64(1706655072),
|
||||||
|
|
@ -136,7 +133,6 @@ var (
|
||||||
PragueTime: nil,
|
PragueTime: nil,
|
||||||
VerkleTime: nil,
|
VerkleTime: nil,
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +156,6 @@ var (
|
||||||
CancunTime: newUint64(0),
|
CancunTime: newUint64(0),
|
||||||
PragueTime: newUint64(0),
|
PragueTime: newUint64(0),
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
||||||
|
|
@ -188,7 +183,6 @@ var (
|
||||||
PragueTime: nil,
|
PragueTime: nil,
|
||||||
VerkleTime: nil,
|
VerkleTime: nil,
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
TerminalTotalDifficultyPassed: false,
|
|
||||||
Ethash: nil,
|
Ethash: nil,
|
||||||
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
|
||||||
}
|
}
|
||||||
|
|
@ -218,7 +212,6 @@ var (
|
||||||
PragueTime: nil,
|
PragueTime: nil,
|
||||||
VerkleTime: nil,
|
VerkleTime: nil,
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
TerminalTotalDifficultyPassed: false,
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
}
|
}
|
||||||
|
|
@ -248,7 +241,6 @@ var (
|
||||||
PragueTime: newUint64(0),
|
PragueTime: newUint64(0),
|
||||||
VerkleTime: nil,
|
VerkleTime: nil,
|
||||||
TerminalTotalDifficulty: big.NewInt(0),
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
}
|
}
|
||||||
|
|
@ -278,7 +270,6 @@ var (
|
||||||
PragueTime: nil,
|
PragueTime: nil,
|
||||||
VerkleTime: nil,
|
VerkleTime: nil,
|
||||||
TerminalTotalDifficulty: nil,
|
TerminalTotalDifficulty: nil,
|
||||||
TerminalTotalDifficultyPassed: false,
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
Clique: nil,
|
Clique: nil,
|
||||||
}
|
}
|
||||||
|
|
@ -332,13 +323,6 @@ type ChainConfig struct {
|
||||||
// the network that triggers the consensus upgrade.
|
// the network that triggers the consensus upgrade.
|
||||||
TerminalTotalDifficulty *big.Int `json:"terminalTotalDifficulty,omitempty"`
|
TerminalTotalDifficulty *big.Int `json:"terminalTotalDifficulty,omitempty"`
|
||||||
|
|
||||||
// TerminalTotalDifficultyPassed is a flag specifying that the network already
|
|
||||||
// passed the terminal total difficulty. Its purpose is to disable legacy sync
|
|
||||||
// even without having seen the TTD locally (safer long term).
|
|
||||||
//
|
|
||||||
// TODO(karalabe): Drop this field eventually (always assuming PoS mode)
|
|
||||||
TerminalTotalDifficultyPassed bool `json:"terminalTotalDifficultyPassed,omitempty"`
|
|
||||||
|
|
||||||
DepositContractAddress common.Address `json:"depositContractAddress,omitempty"`
|
DepositContractAddress common.Address `json:"depositContractAddress,omitempty"`
|
||||||
|
|
||||||
// Various consensus engines
|
// Various consensus engines
|
||||||
|
|
@ -379,16 +363,12 @@ func (c *ChainConfig) Description() string {
|
||||||
case c.Ethash != nil:
|
case c.Ethash != nil:
|
||||||
if c.TerminalTotalDifficulty == nil {
|
if c.TerminalTotalDifficulty == nil {
|
||||||
banner += "Consensus: Ethash (proof-of-work)\n"
|
banner += "Consensus: Ethash (proof-of-work)\n"
|
||||||
} else if !c.TerminalTotalDifficultyPassed {
|
|
||||||
banner += "Consensus: Beacon (proof-of-stake), merging from Ethash (proof-of-work)\n"
|
|
||||||
} else {
|
} else {
|
||||||
banner += "Consensus: Beacon (proof-of-stake), merged from Ethash (proof-of-work)\n"
|
banner += "Consensus: Beacon (proof-of-stake), merged from Ethash (proof-of-work)\n"
|
||||||
}
|
}
|
||||||
case c.Clique != nil:
|
case c.Clique != nil:
|
||||||
if c.TerminalTotalDifficulty == nil {
|
if c.TerminalTotalDifficulty == nil {
|
||||||
banner += "Consensus: Clique (proof-of-authority)\n"
|
banner += "Consensus: Clique (proof-of-authority)\n"
|
||||||
} else if !c.TerminalTotalDifficultyPassed {
|
|
||||||
banner += "Consensus: Beacon (proof-of-stake), merging from Clique (proof-of-authority)\n"
|
|
||||||
} else {
|
} else {
|
||||||
banner += "Consensus: Beacon (proof-of-stake), merged from Clique (proof-of-authority)\n"
|
banner += "Consensus: Beacon (proof-of-stake), merged from Clique (proof-of-authority)\n"
|
||||||
}
|
}
|
||||||
|
|
@ -432,7 +412,6 @@ func (c *ChainConfig) Description() string {
|
||||||
} else {
|
} else {
|
||||||
banner += "Merge configured:\n"
|
banner += "Merge configured:\n"
|
||||||
banner += " - Hard-fork specification: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md\n"
|
banner += " - Hard-fork specification: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md\n"
|
||||||
banner += fmt.Sprintf(" - Network known to be merged: %v\n", c.TerminalTotalDifficultyPassed)
|
|
||||||
banner += fmt.Sprintf(" - Total terminal difficulty: %v\n", c.TerminalTotalDifficulty)
|
banner += fmt.Sprintf(" - Total terminal difficulty: %v\n", c.TerminalTotalDifficulty)
|
||||||
if c.MergeNetsplitBlock != nil {
|
if c.MergeNetsplitBlock != nil {
|
||||||
banner += fmt.Sprintf(" - Merge netsplit block: #%-8v\n", c.MergeNetsplitBlock)
|
banner += fmt.Sprintf(" - Merge netsplit block: #%-8v\n", c.MergeNetsplitBlock)
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ var (
|
||||||
BerlinBlock: big.NewInt(9_812_189),
|
BerlinBlock: big.NewInt(9_812_189),
|
||||||
LondonBlock: big.NewInt(10_499_401),
|
LondonBlock: big.NewInt(10_499_401),
|
||||||
TerminalTotalDifficulty: new(big.Int).SetUint64(50_000_000_000_000_000),
|
TerminalTotalDifficulty: new(big.Int).SetUint64(50_000_000_000_000_000),
|
||||||
TerminalTotalDifficultyPassed: true,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue