aboutsummaryrefslogtreecommitdiffstats
path: root/params
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-02-22 13:14:55 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:57 +0800
commit11e2de8c43f867764d4dd1146d467cb6e9bf114b (patch)
treefb821d64098f7c62dabf879f9edfc4490b033a58 /params
parentaf12f1f869609d2f3acf27c9315b6bbe816d9761 (diff)
downloaddexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.gz
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.bz2
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.lz
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.xz
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.tar.zst
dexon-11e2de8c43f867764d4dd1146d467cb6e9bf114b.zip
core: Remove K, Phi and NumChains from Governance (#198)
* change default sync_core.sh * vendor: sync to latest core * core: Remove K, Phi and NumChain
Diffstat (limited to 'params')
-rw-r--r--params/config.go31
-rw-r--r--params/gen_dexcon_config.go28
2 files changed, 13 insertions, 46 deletions
diff --git a/params/config.go b/params/config.go
index 1dce0938c..a5cd860cb 100644
--- a/params/config.go
+++ b/params/config.go
@@ -26,8 +26,8 @@ import (
// Genesis hashes to enforce below configs on.
var (
- MainnetGenesisHash = common.HexToHash("0xe972af2797b02f4dab95ffa229714c35d5c55685f20261b9498c8b8a3fe33856")
- TestnetGenesisHash = common.HexToHash("0x9fab095bee4b3dc7dcde324beb6c791bc21025a33d50793ed995d8ef1739f35b")
+ MainnetGenesisHash = common.HexToHash("0x09fd8e9d8db083831e0793a41643721d5becc0f9742b5344021a06b20b5a7fed")
+ TestnetGenesisHash = common.HexToHash("0x713fca1f1a31ad516f05945ae9bc1455c39d442db57c9f3c85ee593cc40ea239")
)
var (
@@ -54,14 +54,11 @@ var (
NextHalvingSupply: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2.5e9)),
LastHalvedAmount: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1.5e9)),
BlockGasLimit: 40000000,
- NumChains: 6,
LambdaBA: 250,
LambdaDKG: 2500,
- K: 0,
- PhiRatio: 0.667,
NotarySetSize: 4,
DKGSetSize: 4,
- RoundInterval: 600000,
+ RoundLength: 600,
MinBlockInterval: 1000,
FineValues: []*big.Int{
new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e4)),
@@ -102,14 +99,11 @@ var (
NextHalvingSupply: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2e7)),
LastHalvedAmount: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(4e6)),
BlockGasLimit: 40000000,
- NumChains: 4,
LambdaBA: 250,
LambdaDKG: 10000,
- K: 0,
- PhiRatio: 0.667,
NotarySetSize: 4,
DKGSetSize: 4,
- RoundInterval: 1200000,
+ RoundLength: 1200,
MinBlockInterval: 1000,
FineValues: []*big.Int{
new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e4)),
@@ -141,14 +135,11 @@ var (
NextHalvingSupply: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(2e7)),
LastHalvedAmount: new(big.Int).Mul(big.NewInt(1e18), big.NewInt(4e6)),
BlockGasLimit: 40000000,
- NumChains: 4,
LambdaBA: 250,
LambdaDKG: 10000,
- K: 0,
- PhiRatio: 0.667,
NotarySetSize: 4,
DKGSetSize: 4,
- RoundInterval: 1200000,
+ RoundLength: 1200000,
MinBlockInterval: 1000,
FineValues: []*big.Int{
new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e4)),
@@ -294,14 +285,11 @@ type DexconConfig struct {
NextHalvingSupply *big.Int `json:"nextHalvingSupply"`
LastHalvedAmount *big.Int `json:"lastHalvedAmount"`
BlockGasLimit uint64 `json:"blockGasLimit"`
- NumChains uint32 `json:"numChains"`
LambdaBA uint64 `json:"lambdaBA"`
LambdaDKG uint64 `json:"lambdaDKG"`
- K uint32 `json:"k"`
- PhiRatio float32 `json:"phiRatio"`
NotarySetSize uint32 `json:"notarySetSize"`
DKGSetSize uint32 `json:"dkgSetSize"`
- RoundInterval uint64 `json:"roundInterval"`
+ RoundLength uint64 `json:"roundLength"`
MinBlockInterval uint64 `json:"minBlockInterval"`
FineValues []*big.Int `json:"fineValues"`
}
@@ -315,7 +303,7 @@ type dexconConfigSpecMarshaling struct {
// String implements the stringer interface, returning the consensus engine details.
func (d *DexconConfig) String() string {
- return fmt.Sprintf("{GenesisCRSText: %v Owner: %v MinStake: %v LockupPeriod: %v MiningVelocity: %v NextHalvingSupply: %v LastHalvedAmount: %v BlockGasLimit: %v NumChains: %v LambdaBA: %v LambdaDKG: %v K: %v PhiRatio: %v NotarySetSize: %v DKGSetSize: %v RoundInterval: %v MinBlockInterval: %v FineValues: %v}",
+ return fmt.Sprintf("{GenesisCRSText: %v Owner: %v MinStake: %v LockupPeriod: %v MiningVelocity: %v NextHalvingSupply: %v LastHalvedAmount: %v BlockGasLimit: %v LambdaBA: %v LambdaDKG: %v NotarySetSize: %v DKGSetSize: %v RoundLength: %v MinBlockInterval: %v FineValues: %v}",
d.GenesisCRSText,
d.Owner,
d.MinStake,
@@ -324,14 +312,11 @@ func (d *DexconConfig) String() string {
d.NextHalvingSupply,
d.LastHalvedAmount,
d.BlockGasLimit,
- d.NumChains,
d.LambdaBA,
d.LambdaDKG,
- d.K,
- d.PhiRatio,
d.NotarySetSize,
d.DKGSetSize,
- d.RoundInterval,
+ d.RoundLength,
d.MinBlockInterval,
d.FineValues,
)
diff --git a/params/gen_dexcon_config.go b/params/gen_dexcon_config.go
index 29ebf2eaf..566ed9fcd 100644
--- a/params/gen_dexcon_config.go
+++ b/params/gen_dexcon_config.go
@@ -23,14 +23,11 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) {
NextHalvingSupply *math.HexOrDecimal256 `json:"nextHalvingSupply"`
LastHalvedAmount *math.HexOrDecimal256 `json:"lastHalvedAmount"`
BlockGasLimit uint64 `json:"blockGasLimit"`
- NumChains uint32 `json:"numChains"`
LambdaBA uint64 `json:"lambdaBA"`
LambdaDKG uint64 `json:"lambdaDKG"`
- K uint32 `json:"k"`
- PhiRatio float32 `json:"phiRatio"`
NotarySetSize uint32 `json:"notarySetSize"`
DKGSetSize uint32 `json:"dkgSetSize"`
- RoundInterval uint64 `json:"roundInterval"`
+ RoundLength uint64 `json:"roundLength"`
MinBlockInterval uint64 `json:"minBlockInterval"`
FineValues []*math.HexOrDecimal256 `json:"fineValues"`
}
@@ -43,14 +40,11 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) {
enc.NextHalvingSupply = (*math.HexOrDecimal256)(d.NextHalvingSupply)
enc.LastHalvedAmount = (*math.HexOrDecimal256)(d.LastHalvedAmount)
enc.BlockGasLimit = d.BlockGasLimit
- enc.NumChains = d.NumChains
enc.LambdaBA = d.LambdaBA
enc.LambdaDKG = d.LambdaDKG
- enc.K = d.K
- enc.PhiRatio = d.PhiRatio
enc.NotarySetSize = d.NotarySetSize
enc.DKGSetSize = d.DKGSetSize
- enc.RoundInterval = d.RoundInterval
+ enc.RoundLength = d.RoundLength
enc.MinBlockInterval = d.MinBlockInterval
if d.FineValues != nil {
enc.FineValues = make([]*math.HexOrDecimal256, len(d.FineValues))
@@ -72,14 +66,11 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error {
NextHalvingSupply *math.HexOrDecimal256 `json:"nextHalvingSupply"`
LastHalvedAmount *math.HexOrDecimal256 `json:"lastHalvedAmount"`
BlockGasLimit *uint64 `json:"blockGasLimit"`
- NumChains *uint32 `json:"numChains"`
LambdaBA *uint64 `json:"lambdaBA"`
LambdaDKG *uint64 `json:"lambdaDKG"`
- K *uint32 `json:"k"`
- PhiRatio *float32 `json:"phiRatio"`
NotarySetSize *uint32 `json:"notarySetSize"`
DKGSetSize *uint32 `json:"dkgSetSize"`
- RoundInterval *uint64 `json:"roundInterval"`
+ RoundLength *uint64 `json:"roundLength"`
MinBlockInterval *uint64 `json:"minBlockInterval"`
FineValues []*math.HexOrDecimal256 `json:"fineValues"`
}
@@ -111,29 +102,20 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error {
if dec.BlockGasLimit != nil {
d.BlockGasLimit = *dec.BlockGasLimit
}
- if dec.NumChains != nil {
- d.NumChains = *dec.NumChains
- }
if dec.LambdaBA != nil {
d.LambdaBA = *dec.LambdaBA
}
if dec.LambdaDKG != nil {
d.LambdaDKG = *dec.LambdaDKG
}
- if dec.K != nil {
- d.K = *dec.K
- }
- if dec.PhiRatio != nil {
- d.PhiRatio = *dec.PhiRatio
- }
if dec.NotarySetSize != nil {
d.NotarySetSize = *dec.NotarySetSize
}
if dec.DKGSetSize != nil {
d.DKGSetSize = *dec.DKGSetSize
}
- if dec.RoundInterval != nil {
- d.RoundInterval = *dec.RoundInterval
+ if dec.RoundLength != nil {
+ d.RoundLength = *dec.RoundLength
}
if dec.MinBlockInterval != nil {
d.MinBlockInterval = *dec.MinBlockInterval