From c8d8996f4cfbc99367a369767cb24d762a211acc Mon Sep 17 00:00:00 2001 From: jiyilanzhou <450595468@qq.com> Date: Thu, 27 Aug 2020 17:34:31 +0800 Subject: [PATCH] config: update tip11 height --- core/genesis.go | 8 ++++---- params/config.go | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 14b1f44f1..eb4753750 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -257,7 +257,7 @@ func (g *Genesis) ToFastBlock(db etruedb.Database) *types.Block { statedb.SetState(addr, key, value) } } - consensus.OnceInitImpawnState(g.Config,statedb,new(big.Int).SetUint64(g.Number)) + consensus.OnceInitImpawnState(g.Config, statedb, new(big.Int).SetUint64(g.Number)) if consensus.IsTIP8(new(big.Int).SetUint64(g.Number), g.Config, nil) { impl := vm.NewImpawnImpl() hh := g.Number @@ -265,7 +265,7 @@ func (g *Genesis) ToFastBlock(db etruedb.Database) *types.Block { hh = hh - 1 } for _, member := range g.Committee { - err := impl.InsertSAccount2(hh,g.Config.TIP10.FastNumber.Uint64(), member.Coinbase, member.Publickey, big.NewInt(1000000000000000000), big.NewInt(100), true) + err := impl.InsertSAccount2(hh, g.Config.TIP10.FastNumber.Uint64(), member.Coinbase, member.Publickey, params.ElectionMinLimitForStaking, big.NewInt(100), true) if err != nil { log.Error("ToFastBlock InsertSAccount", "error", err) } @@ -275,7 +275,7 @@ func (g *Genesis) ToFastBlock(db etruedb.Database) *types.Block { if err != nil { log.Error("ToFastBlock DoElections", "error", err) } - err = impl.Shift(1,g.Config.TIP10.FastNumber.Uint64()) + err = impl.Shift(1, g.Config.TIP10.FastNumber.Uint64()) if err != nil { log.Error("ToFastBlock Shift", "error", err) } @@ -583,7 +583,7 @@ func DefaultSingleNodeGenesisBlock() *Genesis { common.HexToAddress("0x3c2e0a65a023465090aaedaa6ed2975aec9ef7f9"): {Balance: i}, common.HexToAddress("0x7c357530174275dd30e46319b89f71186256e4f7"): {Balance: i}, common.HexToAddress("0xeeb69c67751e9f4917b605840fa9a28be4517871"): {Balance: i}, - common.HexToAddress("0x9810a954bb88fdc251374d666ed7e06748ea672d"): {Balance: i}, + common.HexToAddress("0x76ea2f3a002431fede1141b660dbb75c26ba6d97"): {Balance: i}, }, Committee: []*types.CommitteeMember{ {Coinbase: common.HexToAddress("0x76ea2f3a002431fede1141b660dbb75c26ba6d97"), Publickey: key1}, diff --git a/params/config.go b/params/config.go index 0ef885002..b5e5e0ccc 100644 --- a/params/config.go +++ b/params/config.go @@ -62,7 +62,7 @@ var ( TIP8: &BlockConfig{FastNumber: big.NewInt(0), CID: big.NewInt(293)}, TIP9: &BlockConfig{SnailNumber: big.NewInt(47000)}, TIP10: &BlockConfig{FastNumber: big.NewInt(6520000), CID: big.NewInt(302)}, - TIP11: &BlockConfig{FastNumber: big.NewInt(9878855), CID: big.NewInt(400)}, + TIP11: &BlockConfig{FastNumber: big.NewInt(8996000)}, } // MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network. @@ -100,6 +100,7 @@ var ( TIP8: &BlockConfig{FastNumber: big.NewInt(0), CID: big.NewInt(215)}, TIP9: &BlockConfig{SnailNumber: big.NewInt(38648)}, TIP10: &BlockConfig{FastNumber: big.NewInt(5034600), CID: big.NewInt(229)}, + TIP11: &BlockConfig{FastNumber: big.NewInt(7552000)}, } // TestnetTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network. @@ -137,6 +138,7 @@ var ( TIP8: &BlockConfig{FastNumber: big.NewInt(0), CID: big.NewInt(0)}, TIP9: &BlockConfig{SnailNumber: big.NewInt(20)}, TIP10: &BlockConfig{FastNumber: big.NewInt(40000), CID: big.NewInt(117)}, + TIP11: &BlockConfig{FastNumber: big.NewInt(0)}, } SingleNodeChainConfig = &ChainConfig{ @@ -152,6 +154,7 @@ var ( TIP8: &BlockConfig{FastNumber: big.NewInt(100), CID: big.NewInt(-1)}, TIP9: &BlockConfig{SnailNumber: big.NewInt(20)}, TIP10: &BlockConfig{FastNumber: big.NewInt(0), CID: big.NewInt(1)}, + TIP11: &BlockConfig{FastNumber: big.NewInt(0)}, } // TestnetTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network. @@ -169,13 +172,15 @@ var ( // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllMinervaProtocolChanges = &ChainConfig{ChainID: chainId, Minerva: new(MinervaConfig), TIP3: &BlockConfig{FastNumber: big.NewInt(0)}, - TIP5: nil, TIP7: nil, TIP8: nil, TIP9: nil, TIP10: nil} + TIP5: nil, TIP7: nil, TIP8: nil, TIP9: nil, TIP10: nil, TIP11: &BlockConfig{FastNumber: big.NewInt(0)}, + } // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. TestChainConfig = &ChainConfig{ChainID: chainId, Minerva: &MinervaConfig{MinimumDifficulty, MinimumFruitDifficulty, DurationLimit}, TIP3: &BlockConfig{FastNumber: big.NewInt(0)}, - TIP5: nil, TIP7: nil, TIP8: nil, TIP9: nil, TIP10: nil} + TIP5: nil, TIP7: nil, TIP8: nil, TIP9: nil, TIP10: nil, TIP11: &BlockConfig{FastNumber: big.NewInt(0)}, + } ) // TrustedCheckpoint represents a set of post-processed trie roots (CHT and