VMGasRate = int64(200)
StorageGasRate = int64(1)
MaxGasAmount = int64(200000)
- DefaultGasCredit = int64(30000)
+ DefaultGasCredit = int64(160000)
//config parameter for coinbase reward
CoinbasePendingBlockNumber = uint64(100)
- subsidyReductionInterval = uint64(840000)
- baseSubsidy = uint64(41250000000)
- InitialBlockSubsidy = uint64(140700041250000000)
- // config for pow mining
- BlocksPerRetarget = uint64(2016)
- TargetSecondsPerBlock = uint64(150)
- SeedPerRetarget = uint64(256)
+ //config parameter for vote
+ VotePendingBlockNumber = uint64(10000)
+
+ //DPOS parameter
+ NumOfConsensusNode = 10
+ BlockNumEachNode = 12
+ RoundVoteBlockNums = NumOfConsensusNode * BlockNumEachNode * 10
+ MinConsensusNodeVoteNum = uint64(100000000000000) // min is 1 million BTM
+ MinVoteOutputAmount = uint64(100000000) // min is 1 BTM
+
+ // BlockTimeInterval indicate product one block per 500 milliseconds
+ BlockTimeInterval = 500
// MaxTimeOffsetMs is the maximum number of seconds a block time is allowed to be ahead of the current time
- MaxTimeOffsetMs = uint64(60 * 60 * 1000)
+ MaxTimeOffsetMs = uint64(BlockTimeInterval * BlockNumEachNode / 3)
MedianTimeBlocks = 11
PayToWitnessPubKeyHashDataSize = 20
// BlockSubsidy calculate the coinbase rewards on given block height
func BlockSubsidy(height uint64) uint64 {
- if height == 0 {
- return InitialBlockSubsidy
+ for _, subsidy := range ActiveNetParams.ProducerSubsidys {
+ if height >= subsidy.BeginBlock && height <= subsidy.EndBlock {
+ return subsidy.Subsidy
+ }
}
- return baseSubsidy >> uint(height/subsidyReductionInterval)
+ return 0
}
// IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
Hash bc.Hash
}
+// ProducerSubsidy is a subsidy to the producer of the generated block
+type ProducerSubsidy struct {
+ BeginBlock uint64
+ EndBlock uint64
+ Subsidy uint64
+}
+
// Params store the config for different network
type Params struct {
// Name defines a human-readable identifier for the network.
// DNSSeeds defines a list of DNS seeds for the network that are used
// as one method to discover peers.
- DNSSeeds []string
- Checkpoints []Checkpoint
+ DNSSeeds []string
+ Checkpoints []Checkpoint
+ ProducerSubsidys []ProducerSubsidy
}
// ActiveNetParams is ...
Name: "solo",
Bech32HRPSegwit: "sm",
Checkpoints: []Checkpoint{},
+ ProducerSubsidys: []ProducerSubsidy{
+ {BeginBlock: 0, EndBlock: 0, Subsidy: 24},
+ {BeginBlock: 1, EndBlock: 840000, Subsidy: 24},
+ {BeginBlock: 840001, EndBlock: 1680000, Subsidy: 12},
+ {BeginBlock: 1680001, EndBlock: 3360000, Subsidy: 6},
+ },
}
// VaporNetParams is the config for vapor-net
Name: "vapor",
Bech32HRPSegwit: "vp",
Checkpoints: []Checkpoint{},
+ ProducerSubsidys: []ProducerSubsidy{
+ {BeginBlock: 1, EndBlock: 63072000, Subsidy: 15000000},
+ },
}