-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathtest_helpers.go
101 lines (93 loc) · 5.16 KB
/
test_helpers.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
package ops
// OCR2Config Default config for OCR2 for starknet
type OCR2Config struct {
F int `json:"f"`
Signers []string `json:"signers"`
Transmitters []string `json:"transmitters"`
OnchainConfig string `json:"onchainConfig"`
OffchainConfig *OffchainConfig `json:"offchainConfig"`
OffchainConfigVersion int `json:"offchainConfigVersion"`
Secret string `json:"secret"`
}
type OffchainConfig struct {
DeltaProgressNanoseconds int64 `json:"deltaProgressNanoseconds"`
DeltaResendNanoseconds int64 `json:"deltaResendNanoseconds"`
DeltaRoundNanoseconds int64 `json:"deltaRoundNanoseconds"`
DeltaGraceNanoseconds int `json:"deltaGraceNanoseconds"`
DeltaStageNanoseconds int64 `json:"deltaStageNanoseconds"`
RMax int `json:"rMax"`
S []int `json:"s"`
OffchainPublicKeys []string `json:"offchainPublicKeys"`
PeerIDs []string `json:"peerIds"`
ReportingPluginConfig *ReportingPluginConfig `json:"reportingPluginConfig"`
MaxDurationQueryNanoseconds int `json:"maxDurationQueryNanoseconds"`
MaxDurationObservationNanoseconds int `json:"maxDurationObservationNanoseconds"`
MaxDurationReportNanoseconds int `json:"maxDurationReportNanoseconds"`
MaxDurationShouldAcceptFinalizedReportNanoseconds int `json:"maxDurationShouldAcceptFinalizedReportNanoseconds"`
MaxDurationShouldTransmitAcceptedReportNanoseconds int `json:"maxDurationShouldTransmitAcceptedReportNanoseconds"`
ConfigPublicKeys []string `json:"configPublicKeys"`
}
type ReportingPluginConfig struct {
AlphaReportInfinite bool `json:"alphaReportInfinite"`
AlphaReportPpb int `json:"alphaReportPpb"`
AlphaAcceptInfinite bool `json:"alphaAcceptInfinite"`
AlphaAcceptPpb int `json:"alphaAcceptPpb"`
DeltaCNanoseconds int `json:"deltaCNanoseconds"`
}
var TestOCR2Config = OCR2Config{
F: 1,
// Signers: onChainKeys, // user defined
// Transmitters: txKeys, // user defined
OnchainConfig: "",
OffchainConfig: &OffchainConfig{
// todo: increase delta round but decrease delta stage
DeltaProgressNanoseconds: 150000000000, // 120s
DeltaResendNanoseconds: 150000000000, // 150s
DeltaRoundNanoseconds: 90000000000, // 90s
DeltaGraceNanoseconds: 5000000000, // 5s
DeltaStageNanoseconds: 30000000000, // 20s
RMax: 5,
S: []int{1, 1}, // Needs to array with length of transmitting nodes
// OffchainPublicKeys: offChainKeys, // user defined
// PeerIDs: peerIds, // user defined
ReportingPluginConfig: &ReportingPluginConfig{
AlphaReportInfinite: false,
AlphaReportPpb: 0,
AlphaAcceptInfinite: false,
AlphaAcceptPpb: 0,
DeltaCNanoseconds: 1000000000,
},
MaxDurationQueryNanoseconds: 2000000000,
MaxDurationObservationNanoseconds: 1000000000,
MaxDurationReportNanoseconds: 2000000000,
MaxDurationShouldAcceptFinalizedReportNanoseconds: 2000000000,
MaxDurationShouldTransmitAcceptedReportNanoseconds: 2000000000,
// ConfigPublicKeys: cfgKeys, // user defined
},
OffchainConfigVersion: 2,
Secret: "awe accuse polygon tonic depart acuity onyx inform bound gilbert expire",
}
var TestOnKeys = []string{
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603730",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603731",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603732",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603733",
}
var TestTxKeys = []string{
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603734",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603735",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603736",
"0x04cc1bfa99e282e434aef2815ca17337a923cd2c61cf0c7de5b326d7a8603737",
}
var TestOffKeys = []string{
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852090",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852091",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852092",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852093",
}
var TestCfgKeys = []string{
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852094",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852095",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852096",
"af400004fa5d02cd5170b5261032e71f2847ead36159cf8dee68affc3c852097",
}