aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-02 13:42:54 +0800
committerGitHub <noreply@github.com>2018-11-02 13:42:54 +0800
commitbd5e5b4c79d990d65823b3630c0f76d21af9b52d (patch)
treec32f1ef5f20d129758785efb9f8e20c78a0de1bb
parentf521279b0d3d33e072d0dc439288fa16cbbf34d3 (diff)
downloaddexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar.gz
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar.bz2
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar.lz
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar.xz
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.tar.zst
dexon-consensus-bd5e5b4c79d990d65823b3630c0f76d21af9b52d.zip
core: Remove max block interval (#287)
-rw-r--r--.circleci/config.yml2
-rw-r--r--GNUmakefile2
-rw-r--r--README.md8
-rw-r--r--core/consensus.go3
-rw-r--r--core/lattice-data.go22
-rw-r--r--core/lattice-data_test.go16
-rw-r--r--core/lattice_test.go3
-rw-r--r--core/test/blocks-generator.go16
-rw-r--r--core/test/blocks-generator_test.go18
-rw-r--r--core/test/revealer_test.go3
-rw-r--r--core/test/state.go1
-rw-r--r--core/test/state_test.go2
-rw-r--r--core/total-ordering-syncer_test.go3
-rw-r--r--core/total-ordering_test.go18
-rw-r--r--core/types/config.go6
-rw-r--r--core/types/config_test.go1
-rw-r--r--simulation/governance.go1
17 files changed, 41 insertions, 84 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index e05d1a8..35470e9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,7 +4,7 @@ jobs:
docker:
- image: circleci/golang:1.10
- working_directory: /go/src/github.com/dexon-foundation/dexon-consensus-core
+ working_directory: /go/src/github.com/dexon-foundation/dexon-consensus
environment:
diff --git a/GNUmakefile b/GNUmakefile
index cf4639f..4988fa3 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -6,7 +6,7 @@ BINDIR := $(CURDIR)/build
else
BINDIR := $(abspath $(BINDIR))
endif
-PROJECT_ROOT=github.com/dexon-foundation/dexon-consensus-core
+PROJECT_ROOT=github.com/dexon-foundation/dexon-consensus
BLS_REPO = dexonfoundation/bls-go-alpine
BLS_LIB = vendor/github.com/dexon-foundation/bls/lib/libbls384.a
BUILDER_REPO = dexonfoundation/dexon-alpine
diff --git a/README.md b/README.md
index ae9d41b..315cc06 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-[![CircleCI](https://circleci.com/gh/dexon-foundation/dexon-consensus-core.svg?style=svg&circle-token=faed911ec07618dfbd6868b09181aa2046b550d8)](https://circleci.com/gh/dexon-foundation/dexon-consensus-core)
+[![CircleCI](https://circleci.com/gh/dexon-foundation/dexon-consensus.svg?style=svg&circle-token=faed911ec07618dfbd6868b09181aa2046b550d8)](https://circleci.com/gh/dexon-foundation/dexon-consensus)
-DEXON Consensus Core
+DEXON Consensus
====================
## Getting Started
@@ -13,8 +13,8 @@ DEXON Consensus Core
1. Clone the repo
```
- git clone https://github.com/dexon-foundation/dexon-consensus-core.git
- cd dexon-consensus-core
+ git clone https://github.com/dexon-foundation/dexon-consensus.git
+ cd dexon-consensus
```
2. Install go dependency management tool
diff --git a/core/consensus.go b/core/consensus.go
index 7e6934f..cec3c4f 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -367,6 +367,9 @@ func NewConsensus(
}
validLeader := func(block *types.Block) bool {
+ if block.Timestamp.After(time.Now()) {
+ return false
+ }
return lattice.SanityCheck(block) == nil
}
diff --git a/core/lattice-data.go b/core/lattice-data.go
index 5646757..ca24661 100644
--- a/core/lattice-data.go
+++ b/core/lattice-data.go
@@ -73,28 +73,24 @@ type latticeDataConfig struct {
// Block interval specifies reasonable time difference between
// parent/child blocks.
minBlockTimeInterval time.Duration
- maxBlockTimeInterval time.Duration
}
// Initiate latticeDataConfig from types.Config.
func (config *latticeDataConfig) fromConfig(roundID uint64, cfg *types.Config) {
config.numChains = cfg.NumChains
config.minBlockTimeInterval = cfg.MinBlockInterval
- config.maxBlockTimeInterval = cfg.MaxBlockInterval
config.setupRoundBasedFields(roundID, cfg)
}
// Check if timestamp of a block is valid according to a reference time.
func (config *latticeDataConfig) isValidBlockTime(
b *types.Block, ref time.Time) bool {
- return !(b.Timestamp.Before(ref.Add(config.minBlockTimeInterval)) ||
- b.Timestamp.After(ref.Add(config.maxBlockTimeInterval)))
+ return !b.Timestamp.Before(ref.Add(config.minBlockTimeInterval))
}
// isValidGenesisBlockTime check if a timestamp is valid for a genesis block.
func (config *latticeDataConfig) isValidGenesisBlockTime(b *types.Block) bool {
- return !(b.Timestamp.Before(config.roundBeginTime) || b.Timestamp.After(
- config.roundBeginTime.Add(config.maxBlockTimeInterval)))
+ return !b.Timestamp.Before(config.roundBeginTime)
}
// newGenesisLatticeDataConfig constructs a latticeDataConfig instance.
@@ -380,11 +376,11 @@ func (data *latticeData) addFinalizedBlock(
// genesis block.
func (data *latticeData) prepareBlock(b *types.Block) error {
var (
- minTimestamp, maxTimestamp time.Time
- config *latticeDataConfig
- acks common.Hashes
- bindTip bool
- chainTip *types.Block
+ minTimestamp time.Time
+ config *latticeDataConfig
+ acks common.Hashes
+ bindTip bool
+ chainTip *types.Block
)
if config = data.getConfig(b.Position.Round); config == nil {
return ErrUnknownRoundID
@@ -425,7 +421,6 @@ func (data *latticeData) prepareBlock(b *types.Block) error {
// parent block and bound config.
if bindTip {
minTimestamp = chainTip.Timestamp.Add(config.minBlockTimeInterval)
- maxTimestamp = chainTip.Timestamp.Add(config.maxBlockTimeInterval)
// When a chain is removed and added back, the reference block
// of previous round can't be used as parent block.
b.ParentHash = chainTip.Hash
@@ -434,13 +429,10 @@ func (data *latticeData) prepareBlock(b *types.Block) error {
// Discontinuous round ID detected, another fresh start of
// new round.
minTimestamp = config.roundBeginTime
- maxTimestamp = config.roundBeginTime.Add(config.maxBlockTimeInterval)
}
// Fix timestamp if the given one is invalid.
if b.Timestamp.Before(minTimestamp) {
b.Timestamp = minTimestamp
- } else if b.Timestamp.After(maxTimestamp) {
- b.Timestamp = maxTimestamp
}
// Setup acks fields.
for _, status := range data.chains {
diff --git a/core/lattice-data_test.go b/core/lattice-data_test.go
index 576c5ff..ae14e37 100644
--- a/core/lattice-data_test.go
+++ b/core/lattice-data_test.go
@@ -58,7 +58,6 @@ func (s *LatticeDataTestSuite) genTestCase1() (
RoundInterval: 500 * time.Second,
NumChains: chainNum,
MinBlockInterval: 2 * time.Nanosecond,
- MaxBlockInterval: 1000 * time.Second,
}
db, err := blockdb.NewMemBackedBlockDB()
req.NoError(err)
@@ -67,7 +66,6 @@ func (s *LatticeDataTestSuite) genTestCase1() (
RoundInterval: 1000 * time.Second,
NumChains: chainNum,
MinBlockInterval: 2 * time.Nanosecond,
- MaxBlockInterval: 1000 * time.Second,
}
data.appendConfig(1, config)
// Add genesis blocks.
@@ -310,9 +308,6 @@ func (s *LatticeDataTestSuite) TestSanityCheck() {
Acks: common.NewSortedHashes(common.Hashes{blocks[2][0].Hash}),
Timestamp: time.Now().UTC(),
}
- b.Timestamp = blocks[2][0].Timestamp.Add(
- data.getConfig(0).maxBlockTimeInterval + time.Nanosecond)
- check(ErrIncorrectBlockTime, b)
// Violet minimum block time interval.
b.Timestamp = blocks[2][0].Timestamp.Add(1 * time.Nanosecond)
check(ErrIncorrectBlockTime, b)
@@ -366,8 +361,7 @@ func (s *LatticeDataTestSuite) TestRandomlyGeneratedBlocks() {
genesisConfig := &types.Config{
RoundInterval: 1000 * time.Second,
NumChains: chainNum,
- MinBlockInterval: 0,
- MaxBlockInterval: 1000 * time.Second,
+ MinBlockInterval: 1 * time.Second,
}
// Prepare a randomly generated blocks.
db, err := blockdb.NewMemBackedBlockDB()
@@ -375,7 +369,6 @@ func (s *LatticeDataTestSuite) TestRandomlyGeneratedBlocks() {
gen := test.NewBlocksGenerator(&test.BlocksGeneratorConfig{
NumChains: genesisConfig.NumChains,
MinBlockTimeInterval: genesisConfig.MinBlockInterval,
- MaxBlockTimeInterval: genesisConfig.MaxBlockInterval,
}, nil, hashBlock)
req.NoError(gen.Generate(
0,
@@ -480,8 +473,7 @@ func (s *LatticeDataTestSuite) TestPrepareBlock() {
genesisConfig := &types.Config{
RoundInterval: 3000 * time.Second,
NumChains: chainNum,
- MinBlockInterval: 0,
- MaxBlockInterval: 3000 * time.Second,
+ MinBlockInterval: 1 * time.Second,
}
db, err := blockdb.NewMemBackedBlockDB()
req.NoError(err)
@@ -569,8 +561,7 @@ func (s *LatticeDataTestSuite) TestNextPosition() {
genesisConfig := &types.Config{
RoundInterval: 1000 * time.Second,
NumChains: 4,
- MinBlockInterval: 0,
- MaxBlockInterval: 1000 * time.Second,
+ MinBlockInterval: 1 * time.Second,
}
data = newLatticeData(
nil, newGenesisLatticeDataConfig(time.Now().UTC(), genesisConfig))
@@ -608,7 +599,6 @@ func (s *LatticeDataTestSuite) TestNumChainsChange() {
// - The delivered blocks should form a valid DAG.
fixConfig := func(config *types.Config) *types.Config {
config.MinBlockInterval = 10 * time.Second
- config.MaxBlockInterval = time.Hour // We don't care time.
config.RoundInterval = 100 * time.Second
return config
}
diff --git a/core/lattice_test.go b/core/lattice_test.go
index 9e44694..ca3cfbb 100644
--- a/core/lattice_test.go
+++ b/core/lattice_test.go
@@ -146,7 +146,6 @@ func (s *LatticeTestSuite) TestBasicUsage() {
PhiRatio: float32(2) / float32(3),
K: 0,
MinBlockInterval: 0,
- MaxBlockInterval: 3000 * time.Second,
RoundInterval: time.Hour,
}
dMoment = time.Now().UTC()
@@ -239,7 +238,6 @@ func (s *LatticeTestSuite) TestSync() {
PhiRatio: float32(2) / float32(3),
K: 0,
MinBlockInterval: 0,
- MaxBlockInterval: 3000 * time.Second,
RoundInterval: time.Hour,
}
dMoment = time.Now().UTC()
@@ -354,7 +352,6 @@ func (s *LatticeTestSuite) TestSanityCheck() {
PhiRatio: float32(2) / float32(3),
K: 0,
MinBlockInterval: 0,
- MaxBlockInterval: 3000 * time.Second,
}
lattice = s.newTestLatticeMgr(&cfg, time.Now().UTC()).lattice
auth = lattice.authModule // Steal auth module from lattice, :(
diff --git a/core/test/blocks-generator.go b/core/test/blocks-generator.go
index 9f39ac1..e97985f 100644
--- a/core/test/blocks-generator.go
+++ b/core/test/blocks-generator.go
@@ -255,12 +255,12 @@ func generateNodePicker() func([]types.NodeID) types.NodeID {
}
}
-// defaultTimePicker would pick a time based on reference time and
-// the given minimum/maximum time range.
-func generateTimePicker(min, max time.Duration) (f func(time.Time) time.Time) {
+// defaultTimePicker would pick a time based on reference time plus min.
+func generateTimePicker(min time.Duration) (f func(time.Time) time.Time) {
privateRand := rand.New(rand.NewSource(time.Now().UnixNano()))
return func(ref time.Time) time.Time {
- return ref.Add(min + time.Duration(privateRand.Int63n(int64(max-min))))
+ return ref.Add(min + time.Duration(
+ privateRand.Int63n(int64(500*time.Millisecond))))
}
}
@@ -268,7 +268,6 @@ func generateTimePicker(min, max time.Duration) (f func(time.Time) time.Time) {
type BlocksGeneratorConfig struct {
NumChains uint32
MinBlockTimeInterval time.Duration
- MaxBlockTimeInterval time.Duration
}
// NewBlocksGeneratorConfig construct a BlocksGeneratorConfig instance.
@@ -276,7 +275,6 @@ func NewBlocksGeneratorConfig(c *types.Config) *BlocksGeneratorConfig {
return &BlocksGeneratorConfig{
NumChains: c.NumChains,
MinBlockTimeInterval: c.MinBlockInterval,
- MaxBlockTimeInterval: c.MaxBlockInterval,
}
}
@@ -302,14 +300,16 @@ func NewBlocksGenerator(
config *BlocksGeneratorConfig,
ackingCountGenerator func() int,
hashBlock hashBlockFn) *BlocksGenerator {
+ if config.MinBlockTimeInterval == time.Duration(0) {
+ panic(errors.New("min block interval cannot be 0"))
+ }
if ackingCountGenerator == nil {
ackingCountGenerator = normalAckingCountGenerator(
config.NumChains,
float64(config.NumChains/5),
float64(config.NumChains/7+1))
}
- timePicker := generateTimePicker(
- config.MinBlockTimeInterval, config.MaxBlockTimeInterval)
+ timePicker := generateTimePicker(config.MinBlockTimeInterval)
return &BlocksGenerator{
config: config,
nodePicker: generateNodePicker(),
diff --git a/core/test/blocks-generator_test.go b/core/test/blocks-generator_test.go
index e53a044..8dcc2b7 100644
--- a/core/test/blocks-generator_test.go
+++ b/core/test/blocks-generator_test.go
@@ -37,8 +37,7 @@ func (s *BlocksGeneratorTestSuite) TestGenerate() {
var (
config = &BlocksGeneratorConfig{
NumChains: 19,
- MinBlockTimeInterval: 50 * time.Millisecond,
- MaxBlockTimeInterval: 400 * time.Millisecond,
+ MinBlockTimeInterval: 200 * time.Millisecond,
}
gen = NewBlocksGenerator(config, nil, stableRandomHash)
req = s.Require()
@@ -120,8 +119,7 @@ func (s *BlocksGeneratorTestSuite) TestGenerateWithMaxAckCount() {
var (
config = &BlocksGeneratorConfig{
NumChains: 13,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}
req = s.Require()
totalAckingCount = 0
@@ -186,8 +184,7 @@ func (s *BlocksGeneratorTestSuite) TestFindTips() {
var (
config = &BlocksGeneratorConfig{
NumChains: 10,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}
req = s.Require()
genesisTime = time.Now().UTC()
@@ -222,8 +219,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
// Generate round 0 blocks.
gen := NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 4,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, nil, stableRandomHash)
req.NoError(gen.Generate(
0,
@@ -236,8 +232,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
// Generate round 1 blocks.
gen = NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 10,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, nil, stableRandomHash)
req.NoError(gen.Generate(
1,
@@ -250,8 +245,7 @@ func (s *BlocksGeneratorTestSuite) TestConcateBlocksFromRounds() {
// Generate round 2 blocks.
gen = NewBlocksGenerator(&BlocksGeneratorConfig{
NumChains: 7,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, nil, stableRandomHash)
req.NoError(gen.Generate(
2,
diff --git a/core/test/revealer_test.go b/core/test/revealer_test.go
index abdf918..d9920c7 100644
--- a/core/test/revealer_test.go
+++ b/core/test/revealer_test.go
@@ -46,8 +46,7 @@ func (s *RevealerTestSuite) SetupSuite() {
// Randomly generate blocks.
config := &BlocksGeneratorConfig{
NumChains: 19,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}
gen := NewBlocksGenerator(config, nil, stableRandomHash)
s.Require().NoError(gen.Generate(
diff --git a/core/test/state.go b/core/test/state.go
index dfc1c03..05394ed 100644
--- a/core/test/state.go
+++ b/core/test/state.go
@@ -207,7 +207,6 @@ func (s *State) Snapshot() (*types.Config, []crypto.PublicKey) {
DKGSetSize: s.dkgSetSize,
RoundInterval: s.roundInterval,
MinBlockInterval: s.minBlockInterval,
- MaxBlockInterval: s.maxBlockInterval,
}, nodes
}
diff --git a/core/test/state_test.go b/core/test/state_test.go
index 542e016..fc43ab7 100644
--- a/core/test/state_test.go
+++ b/core/test/state_test.go
@@ -146,7 +146,6 @@ func (s *StateTestSuite) checkConfigChanges(config *types.Config) {
req.Equal(config.LambdaDKG, time.Millisecond)
req.Equal(config.RoundInterval, time.Hour)
req.Equal(config.MinBlockInterval, time.Second)
- req.Equal(config.MaxBlockInterval, time.Minute)
req.Equal(config.K, 1)
req.Equal(config.PhiRatio, float32(0.5))
req.Equal(config.NotarySetSize, uint32(5))
@@ -258,7 +257,6 @@ func (s *StateTestSuite) TestLocalMode() {
req.Equal(config1.LambdaBA, lambda)
req.Equal(config1.LambdaDKG, lambda*10)
req.Equal(config1.RoundInterval, lambda*10000)
- req.Equal(config1.MaxBlockInterval, lambda*8)
req.Equal(config1.NotarySetSize, uint32(len(genesisNodes)))
req.Equal(config1.DKGSetSize, uint32(len(genesisNodes)))
req.Equal(config1.K, 0)
diff --git a/core/total-ordering-syncer_test.go b/core/total-ordering-syncer_test.go
index fb61c6c..e20b438 100644
--- a/core/total-ordering-syncer_test.go
+++ b/core/total-ordering-syncer_test.go
@@ -52,8 +52,7 @@ func (s *TotalOrderingSyncerTestSuite) genDeliverySet(numChains uint32) (
gen := test.NewBlocksGenerator(&test.BlocksGeneratorConfig{
NumChains: numChains,
- MinBlockTimeInterval: 100 * time.Millisecond,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, nil, hashBlock)
db, err := blockdb.NewMemBackedBlockDB()
diff --git a/core/total-ordering_test.go b/core/total-ordering_test.go
index 1b7c06b..25fbfd1 100644
--- a/core/total-ordering_test.go
+++ b/core/total-ordering_test.go
@@ -943,8 +943,7 @@ func (s *TotalOrderingTestSuite) baseTestRandomlyGeneratedBlocks(
)
gen := test.NewBlocksGenerator(&test.BlocksGeneratorConfig{
NumChains: chainNum,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, ackingCountGenerator, hashBlock)
db, err := blockdb.NewMemBackedBlockDB()
req.NoError(err)
@@ -1115,8 +1114,7 @@ func (s *TotalOrderingTestSuite) TestNumChainsChanged() {
fix := func(c *types.Config) *types.Config {
c.K = 1
c.PhiRatio = 0.5
- c.MinBlockInterval = 0
- c.MaxBlockInterval = 500 * time.Millisecond
+ c.MinBlockInterval = 250 * time.Millisecond
c.RoundInterval = 10 * time.Second
return c
}
@@ -1138,8 +1136,7 @@ func (s *TotalOrderingTestSuite) TestPhiChanged() {
fix := func(c *types.Config) *types.Config {
c.K = 1
c.NumChains = 10
- c.MinBlockInterval = 0
- c.MaxBlockInterval = 500 * time.Millisecond
+ c.MinBlockInterval = 250 * time.Millisecond
c.RoundInterval = 10 * time.Second
return c
}
@@ -1161,8 +1158,7 @@ func (s *TotalOrderingTestSuite) TestKChanged() {
fix := func(c *types.Config) *types.Config {
c.NumChains = 10
c.PhiRatio = 0.7
- c.MinBlockInterval = 0
- c.MaxBlockInterval = 500 * time.Millisecond
+ c.MinBlockInterval = 250 * time.Millisecond
c.RoundInterval = 10 * time.Second
return c
}
@@ -1182,8 +1178,7 @@ func (s *TotalOrderingTestSuite) TestKChanged() {
func (s *TotalOrderingTestSuite) TestRoundChanged() {
// This test changes everything when round changed.
fix := func(c *types.Config) *types.Config {
- c.MinBlockInterval = 0
- c.MaxBlockInterval = 500 * time.Millisecond
+ c.MinBlockInterval = 250 * time.Millisecond
c.RoundInterval = 10 * time.Second
return c
}
@@ -1210,8 +1205,7 @@ func (s *TotalOrderingTestSuite) TestRunFromNonGenesis() {
)
gen := test.NewBlocksGenerator(&test.BlocksGeneratorConfig{
NumChains: numChains,
- MinBlockTimeInterval: 0,
- MaxBlockTimeInterval: 500 * time.Millisecond,
+ MinBlockTimeInterval: 250 * time.Millisecond,
}, nil, hashBlock)
db, err := blockdb.NewMemBackedBlockDB()
req.NoError(err)
diff --git a/core/types/config.go b/core/types/config.go
index 975eec9..c9d31f8 100644
--- a/core/types/config.go
+++ b/core/types/config.go
@@ -43,7 +43,6 @@ type Config struct {
// Time related.
RoundInterval time.Duration
MinBlockInterval time.Duration
- MaxBlockInterval time.Duration
}
// Clone return a copied configuration.
@@ -58,7 +57,6 @@ func (c *Config) Clone() *Config {
DKGSetSize: c.DKGSetSize,
RoundInterval: c.RoundInterval,
MinBlockInterval: c.MinBlockInterval,
- MaxBlockInterval: c.MaxBlockInterval,
}
}
@@ -90,9 +88,6 @@ func (c *Config) Bytes() []byte {
binaryMinBlockInterval := make([]byte, 8)
binary.LittleEndian.PutUint64(binaryMinBlockInterval,
uint64(c.MinBlockInterval.Nanoseconds()))
- binaryMaxBlockInterval := make([]byte, 8)
- binary.LittleEndian.PutUint64(binaryMaxBlockInterval,
- uint64(c.MaxBlockInterval.Nanoseconds()))
enc := make([]byte, 0, 40)
enc = append(enc, binaryNumChains...)
@@ -104,6 +99,5 @@ func (c *Config) Bytes() []byte {
enc = append(enc, binaryDKGSetSize...)
enc = append(enc, binaryRoundInterval...)
enc = append(enc, binaryMinBlockInterval...)
- enc = append(enc, binaryMaxBlockInterval...)
return enc
}
diff --git a/core/types/config_test.go b/core/types/config_test.go
index d238f18..bf6e422 100644
--- a/core/types/config_test.go
+++ b/core/types/config_test.go
@@ -38,7 +38,6 @@ func (s *ConfigTestSuite) TestClone() {
DKGSetSize: 6,
RoundInterval: 3 * time.Second,
MinBlockInterval: 7 * time.Nanosecond,
- MaxBlockInterval: 9 * time.Minute,
}
s.Require().Equal(c, c.Clone())
}
diff --git a/simulation/governance.go b/simulation/governance.go
index 7c64605..4c501b6 100644
--- a/simulation/governance.go
+++ b/simulation/governance.go
@@ -102,7 +102,6 @@ func (g *simGovernance) Configuration(round uint64) *types.Config {
NotarySetSize: uint32(len(g.nodeSet)),
DKGSetSize: uint32(len(g.nodeSet)),
MinBlockInterval: g.lambdaBA * 3,
- MaxBlockInterval: g.lambdaBA * 8,
RoundInterval: g.roundInterval,
}
}