-
Notifications
You must be signed in to change notification settings - Fork 20
/
post_finish.go
123 lines (120 loc) · 5.09 KB
/
post_finish.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
package postconsensus
import (
"github.com/attestantio/go-eth2-client/spec"
"github.com/bloxapp/ssv-spec/qbft"
"github.com/bloxapp/ssv-spec/ssv/spectest/tests"
"github.com/bloxapp/ssv-spec/types"
"github.com/bloxapp/ssv-spec/types/testingutils"
)
// PostFinish tests a valid SignedPartialSignatureMessage post finished runner
func PostFinish() tests.SpecTest {
ks := testingutils.Testing4SharesSet()
err := "failed processing post consensus message: invalid post-consensus message: no running duty"
return &tests.MultiMsgProcessingSpecTest{
Name: "post consensus post finish",
Tests: []*tests.MsgProcessingSpecTest{
{
Name: "sync committee contribution",
Runner: finishRunner(
testingutils.SyncCommitteeContributionRunner(ks),
&testingutils.TestingSyncCommitteeContributionDuty,
testingutils.TestSyncCommitteeContributionConsensusData,
),
Duty: &testingutils.TestingSyncCommitteeContributionDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PostConsensusSyncCommitteeContributionMsg(ks.Shares[4], 4, ks))),
},
PostDutyRunnerStateRoot: "122821beec6412f898b5bb3862016591f1bb08af1513828d4d671a379402c117",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
{
Name: "sync committee",
Runner: finishRunner(
testingutils.SyncCommitteeRunner(ks),
&testingutils.TestingSyncCommitteeDuty,
testingutils.TestSyncCommitteeConsensusData,
),
Duty: &testingutils.TestingSyncCommitteeDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgSyncCommittee(nil, testingutils.PostConsensusSyncCommitteeMsg(ks.Shares[4], 4))),
},
PostDutyRunnerStateRoot: "43d4404e8bb20f18d68dd9bfacf06c3ebce8a1cdf686b83ec09690af5ba0318e",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
{
Name: "proposer",
Runner: finishRunner(
testingutils.ProposerRunner(ks),
testingutils.TestingProposerDutyV(spec.DataVersionDeneb),
testingutils.TestProposerConsensusDataV(spec.DataVersionDeneb),
),
Duty: testingutils.TestingProposerDutyV(spec.DataVersionDeneb),
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[4], 4, spec.DataVersionDeneb))),
},
PostDutyRunnerStateRoot: "cef894bfee42ce998eeccd3bfbb21caebbe6226384466e66ee296d8c5d0e4521",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
{
Name: "proposer (blinded block)",
Runner: finishRunner(
testingutils.ProposerBlindedBlockRunner(ks),
testingutils.TestingProposerDutyV(spec.DataVersionDeneb),
testingutils.TestProposerBlindedBlockConsensusDataV(spec.DataVersionDeneb),
),
Duty: testingutils.TestingProposerDutyV(spec.DataVersionDeneb),
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[4], 4, spec.DataVersionDeneb))),
},
PostDutyRunnerStateRoot: "68050789dfbfaa7d82d7ce6ed910be9580c61b4de8c8b72e9258efc9580b5e04",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
{
Name: "aggregator",
Runner: finishRunner(
testingutils.AggregatorRunner(ks),
&testingutils.TestingAggregatorDuty,
testingutils.TestAggregatorConsensusData,
),
Duty: &testingutils.TestingAggregatorDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgAggregator(nil, testingutils.PostConsensusAggregatorMsg(ks.Shares[4], 4))),
},
PostDutyRunnerStateRoot: "7c0857b766096e33a04cb5043418ba8d69081998b6584b179051c2ab92413a0d",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
{
Name: "attester",
Runner: finishRunner(
testingutils.AttesterRunner(ks),
&testingutils.TestingAttesterDuty,
testingutils.TestAttesterConsensusData,
),
Duty: &testingutils.TestingAttesterDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignedSSVMessageF(ks, testingutils.SSVMsgAttester(nil, testingutils.PostConsensusAttestationMsg(ks.Shares[4], 4, qbft.FirstHeight))),
},
PostDutyRunnerStateRoot: "8e21027a3f7f1a8b4507beefee7fa1d242e4bec09fae83fb489a349e64f7ee34",
OutputMessages: []*types.SignedPartialSignatureMessage{},
BeaconBroadcastedRoots: []string{},
DontStartDuty: true,
ExpectedError: err,
},
},
}
}