aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/block.go
diff options
context:
space:
mode:
authorHaoping Ku <haoping.ku@dexon.org>2018-08-17 17:57:15 +0800
committerGitHub <noreply@github.com>2018-08-17 17:57:15 +0800
commitfd8358a607ccd564a5e8158451a5d9ef9cb7b55b (patch)
treeda476d0227f9e979bc2b4bedd35407d72560d0dc /core/types/block.go
parenta146ce5ee9eea1a37d86059dcc13cdf147c9e38e (diff)
downloadtangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar.gz
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar.bz2
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar.lz
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar.xz
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.tar.zst
tangerine-consensus-fd8358a607ccd564a5e8158451a5d9ef9cb7b55b.zip
core: implicit fields in types.Block used in reliable broadcast (#59)
Diffstat (limited to 'core/types/block.go')
-rw-r--r--core/types/block.go24
1 files changed, 9 insertions, 15 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 9665043..0386ed7 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -28,17 +28,6 @@ import (
"github.com/dexon-foundation/dexon-consensus-core/crypto"
)
-// Status represents the block process state.
-type Status int
-
-// Block Status.
-const (
- BlockStatusInit Status = iota
- BlockStatusAcked
- BlockStatusOrdering
- BlockStatusFinal
-)
-
// NotaryAck represents the acking to the compaction chain.
type NotaryAck struct {
NotaryBlockHash common.Hash `json:"notary_block_hash"`
@@ -47,6 +36,14 @@ type NotaryAck struct {
NotarySignature crypto.Signature `json:"notary_signature"`
}
+// CompactionChainAck represents the acking to the compaction chain.
+type CompactionChainAck struct {
+ AckingBlockHash common.Hash `json:"acking_block_hash"`
+ // Signature is the signature of the hash value of
+ // Block.ConsensusInfoParentHash and Block.ConsensusInfo.
+ ConsensusSignature crypto.Signature `json:"consensus_signature"`
+}
+
// Notary represents the consensus information on the compaction chain.
type Notary struct {
Timestamp time.Time `json:"timestamp"`
@@ -70,10 +67,7 @@ type Block struct {
// the compaction chain.
NotaryParentHash common.Hash `json:"notary_parent_hash"`
- Ackeds map[common.Hash]struct{} `json:"-"`
- AckedValidators map[ValidatorID]struct{} `json:"-"`
- Status Status `json:"-"`
- ReceivedTime time.Time `json:"-"`
+ ConsensusInfoParentHash common.Hash `json:"consensus_info_parent_hash"`
}
// Block implements BlockConverter interface.