OSDN Git Service

Mov (#518)
[bytom/vapor.git] / consensus / general.go
index b34f19d..799185e 100644 (file)
@@ -4,7 +4,7 @@ import (
        "encoding/binary"
        "fmt"
 
-       "github.com/vapor/protocol/bc"
+       "github.com/bytom/vapor/protocol/bc"
 )
 
 // basic constant
@@ -75,6 +75,13 @@ type ProducerSubsidy struct {
        Subsidy    uint64
 }
 
+// MovRewardProgram is a reward address corresponding to the range of the specified block height when matching transactions
+type MovRewardProgram struct {
+       BeginBlock uint64
+       EndBlock   uint64
+       Program    string
+}
+
 // Params store the config for different network
 type Params struct {
        // Name defines a human-readable identifier for the network.
@@ -103,6 +110,12 @@ type Params struct {
        ProducerSubsidys []ProducerSubsidy
 
        SoftForkPoint map[uint64]uint64
+
+       // Mov will only start when the block height is greater than this value
+       MovStartHeight uint64
+
+       // Used to receive rewards for matching transactions
+       MovRewardPrograms []MovRewardProgram
 }
 
 // ActiveNetParams is the active NetParams
@@ -144,7 +157,15 @@ var MainNetParams = Params{
        ProducerSubsidys: []ProducerSubsidy{
                {BeginBlock: 1, EndBlock: 63072000, Subsidy: 9512938},
        },
-       SoftForkPoint: map[uint64]uint64{SoftFork001: 10461600},
+       SoftForkPoint:  map[uint64]uint64{SoftFork001: 10461600},
+       MovStartHeight: 43354800,
+       MovRewardPrograms: []MovRewardProgram{
+               {
+                       BeginBlock: 1,
+                       EndBlock:   126144000,
+                       Program:    "00141d00f85e220e35a23282cfc7f91fe7b34bf6dc18",
+               },
+       },
 }
 
 // TestNetParams is the config for vapor-testnet
@@ -155,12 +176,12 @@ var TestNetParams = Params{
        DNSSeeds:        []string{"www.testnetseed.vapor.io"},
        BasicConfig: BasicConfig{
                MaxBlockGas:                uint64(10000000),
-               MaxGasAmount:               int64(200000),
+               MaxGasAmount:               int64(640000),
                DefaultGasCredit:           int64(160000),
                StorageGasRate:             int64(1),
                VMGasRate:                  int64(200),
-               VotePendingBlockNumber:     uint64(10000),
-               CoinbasePendingBlockNumber: uint64(1200),
+               VotePendingBlockNumber:     uint64(3456000),
+               CoinbasePendingBlockNumber: uint64(7200),
                CoinbaseArbitrarySizeLimit: 128,
        },
        DPOSConfig: DPOSConfig{
@@ -233,6 +254,7 @@ func BytomMainNetParams(vaporParam *Params) *Params {
        return &Params{Bech32HRPSegwit: bech32HRPSegwit}
 }
 
+// InitActiveNetParams load the config by chain ID
 func InitActiveNetParams(chainID string) error {
        var exist bool
        if ActiveNetParams, exist = NetParams[chainID]; !exist {