/
eventMsg.go
132 lines (112 loc) · 3.47 KB
/
eventMsg.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package onchain
import (
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
type LogCommon struct {
Tx string
BlockN uint64
Removed bool
Raw types.Log
log interface{}
}
//LogUrl is an onchain event that DOSProxy requests a query result from the specified URL
type LogUrl struct {
QueryId *big.Int
Timeout *big.Int
DataSource string
Selector string
Randomness *big.Int
DispatchedGroupId *big.Int
}
//LogRequestUserRandom is an onchain event that DOSProxy requests a random number with RequestID
type LogRequestUserRandom struct {
RequestId *big.Int
LastSystemRandomness *big.Int
UserSeed *big.Int
DispatchedGroupId *big.Int
}
//LogUpdateRandom is an onchain event that DOSProxy requests a system random number
type LogUpdateRandom struct {
LastRandomness *big.Int
DispatchedGroupId *big.Int
}
//LogValidationResult is an onchain event that shows a quesry result
type LogValidationResult struct {
TrafficType uint8
TrafficId *big.Int
Message []byte
Signature [2]*big.Int
PubKey [4]*big.Int
Pass bool
Version uint8
}
//LogGroupingInitiated is an onchain event that DOSProxy has requested a random number to form a new group
type LogGroupingInitiated struct {
NumPendingNodes *big.Int
GroupSize *big.Int
}
//LogInsufficientWorkingGroup is an onchain event that means there are no enough working groups to mix with pending nodes to form a new group
type LogInsufficientWorkingGroup struct {
NumWorkingGroups *big.Int
}
//LogInsufficientPendingNode is an onchain event that means there are no enough pending nodes to form a new group
type LogInsufficientPendingNode struct {
NumPendingNodes *big.Int
}
//LogGrouping is an onchain event that DOSProxy requests the specified nodes to start DKG to generate a new pubkey
type LogGrouping struct {
GroupId *big.Int
NodeId [][]byte
}
//LogPublicKeyAccepted is an onchain event that DOSProxy receives enough suggested pubkey so accepts it as a new pubkey
type LogPublicKeyAccepted struct {
GroupId *big.Int
WorkingGroupSize *big.Int
}
//LogPublicKeySuggested is an onchain event that DOSProxy accepts a suggested pubkey
type LogPublicKeySuggested struct {
GroupId *big.Int
Count *big.Int
GroupSize *big.Int
}
//LogGroupDissolve is an onchain event that DOSProxy requests to dissolve a specified group
type LogGroupDissolve struct {
GroupId *big.Int
}
//LogUpdateGroupToPick is an onchain event that means GroupToPick is updated
type LogUpdateGroupToPick struct {
OldNum *big.Int
NewNum *big.Int
}
//LogUpdateGroupSize is an onchain event that means GroupSize is updated
type LogUpdateGroupSize struct {
OldSize *big.Int
NewSize *big.Int
}
//LogStartCommitReveal is an onchain event that means DOSProxy starts a new commit-revel process
type LogStartCommitReveal struct {
Cid *big.Int
StartBlock *big.Int
CommitDuration *big.Int
RevealDuration *big.Int
RevealThreshold *big.Int
}
//LogCommit is an onchain event that means a secret is committed
type LogCommit struct {
Cid *big.Int
From common.Address
Commitment [32]byte
}
//LogReveal is an onchain event that means a secret is revealed
type LogReveal struct {
Cid *big.Int
From common.Address
Secret *big.Int
}
//LogRandom is an onchain event that means a new random is generated by a commit-reveal process with Cid
type LogRandom struct {
Cid *big.Int
Random *big.Int
}