aboutsummaryrefslogtreecommitdiffstats
path: root/core/interfaces.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-09-27 14:27:18 +0800
committerGitHub <noreply@github.com>2018-09-27 14:27:18 +0800
commit506014f22faba150cd7197e7dd817e72a914dc84 (patch)
tree3f61287a4578c31c447cc8d9283fc3c728dd6cb7 /core/interfaces.go
parent9c2f700be09c27e8a8d12fc5bc0ccd017d408a32 (diff)
downloaddexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.gz
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.bz2
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.lz
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.xz
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.zst
dexon-consensus-506014f22faba150cd7197e7dd817e72a914dc84.zip
core: update governance interface and config (#145)
1) Remove RoundHeight from config. 2) NotarySet is not from governance contract, we get Node set intead. Notary set is caculated from the NodeSet using CRS. 3) CRS is not in the governance interface.
Diffstat (limited to 'core/interfaces.go')
-rw-r--r--core/interfaces.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/interfaces.go b/core/interfaces.go
index eebf8ff..b0a85ae 100644
--- a/core/interfaces.go
+++ b/core/interfaces.go
@@ -89,13 +89,17 @@ type Network interface {
// Note that there are a lot more methods in the governance contract, that this
// interface only define those that are required to run the consensus algorithm.
type Governance interface {
- // GetConfiguration returns the configuration at a given block height.
- // Return the genesis configuration if blockHeight == 0.
- GetConfiguration(blockHeight uint64) *types.Config
+ // GetConfiguration returns the configuration at a given round.
+ // Return the genesis configuration if round == 0.
+ GetConfiguration(round uint64) *types.Config
- // Get the current notary set.
- // Return the genesis notary set if blockHeight == 0.
- GetNotarySet(blockHeight uint64) map[types.NodeID]struct{}
+ // GetCRS returns the CRS for a given round.
+ // Return the genesis CRS if round == 0.
+ GetCRS(round uint64) []byte
+
+ // GetNodeSet returns the node set at a given round.
+ // Return the genesis node set if round == 0.
+ GetNodeSet(round uint64) map[types.NodeID]struct{}
// Porpose a ThresholdSignature of round.
ProposeThresholdSignature(round uint64, signature crypto.Signature)