forked from vguardbc/vguardbft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msgformat.go
70 lines (58 loc) · 1.39 KB
/
msgformat.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
// This file describes the message format in VGuard. Each message is encoded and
// decoded by gob encoders. An encoded message will be transmitted and decoded to
// another server. Thus, all feilds must be capitilized.
//
type Proposal struct {
Timestamp int64
Transaction []byte
}
type Entry struct {
TimeStamp int64
Tx []byte
}
type ProposerOPAEntry struct {
Booth
BlockId int64
Entries map[int]Entry
Hash []byte
}
type ValidatorOPAReply struct {
BlockId int64
ParSig []byte
}
type ProposerOPBEntry struct {
Booth
BlockId int64
CombSig []byte
//Entries only enabled calling from ProposerCPAEntry
Entries map[int]Entry
Hash []byte
}
type ProposerCPAEntry struct {
//PrevOPBEntries is only piggybacked when the participant did not see the ordered entries
PrevOPBEntries []ProposerOPBEntry
Booth
BIDs []int64 // starting BlockID in this range (included in tx)
ConsInstID int // ending BlockID in this range (included in tx)
RangeHash map[int64][]byte // <BlockID, hash>
TotalHash []byte
}
func (p *ProposerCPAEntry) SetPrevOPBEntries(m []ProposerOPBEntry) {
p.PrevOPBEntries = m
}
type ValidatorCPAReply struct {
ConsInstID int
ParSig []byte
}
type ProposerCPBEntry struct {
Booth
ConsInstID int
ComSig []byte
Hash []byte
}
type ValidatorCPBReply struct {
ConsInstID int
Done bool
//ParSig []byte
}