Skip to content

Commit

Permalink
config: update tip11 height
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyilanzhou committed Aug 27, 2020
1 parent 216afa9 commit c8d8996
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ 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
if hh != 0 {
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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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},
Expand Down
11 changes: 8 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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{
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit c8d8996

Please sign in to comment.