aboutsummaryrefslogtreecommitdiffstats
path: root/core/interfaces.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-18 09:07:52 +0800
committerGitHub <noreply@github.com>2018-09-18 09:07:52 +0800
commit81cf96477127a2da8843d544802027c7061a9c06 (patch)
tree70c06aec5df92df1dd93b605cc7afdbd2b8b0347 /core/interfaces.go
parent8a908e98279d7e80978cd412057eddd4a6bbf06c (diff)
downloaddexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.gz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.bz2
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.lz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.xz
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.tar.zst
dexon-consensus-81cf96477127a2da8843d544802027c7061a9c06.zip
core: remove ticker parameter from NewConsensus
- remove BlockProposingInterval, it's replaced by lambda. - remove ticker parameter of NewConsensus, ticker would be derived from governance. - leave a backdoor to hook the construction of ticker. - move 'Lambda' config from to consensus.
Diffstat (limited to 'core/interfaces.go')
-rw-r--r--core/interfaces.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/interfaces.go b/core/interfaces.go
index 68f210e..2b616ab 100644
--- a/core/interfaces.go
+++ b/core/interfaces.go
@@ -84,9 +84,6 @@ type Governance interface {
// Get PhiRatio.
GetPhiRatio() float32
- // Get block proposing interval (in milliseconds).
- GetBlockProposingInterval() int
-
// Get Number of shards.
GetNumShards() uint32
@@ -99,6 +96,9 @@ type Governance interface {
// Get configuration change events after an epoch.
GetConfigurationChangeEvent(epoch int) []types.ConfigurationChangeEvent
+ // Get lambda for BA.
+ GetLambda() time.Duration
+
// AddDKGComplaint adds a DKGComplaint.
AddDKGComplaint(complaint *types.DKGComplaint)
@@ -111,3 +111,11 @@ type Governance interface {
// DKGMasterPublicKeys gets all the DKGMasterPublicKey of round.
DKGMasterPublicKeys(round uint64) []*types.DKGMasterPublicKey
}
+
+// Ticker define the capability to tick by interval.
+type Ticker interface {
+ // Tick would return a channel, which would be triggered until next tick.
+ Tick() <-chan time.Time
+ // Stop the ticker.
+ Stop()
+}