Skip to content

Commit

Permalink
Spec - Consider first height in should process duty (#316)
Browse files Browse the repository at this point in the history
* take care of height equals 0 case

* new duty first height tests

* fix broadcast messages
  • Loading branch information
GalRogozinski authored Oct 31, 2023
1 parent 071ed76 commit 58f3ed8
Show file tree
Hide file tree
Showing 11 changed files with 1,438 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ssv/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (b *BaseRunner) hasRunningDuty() bool {
}

func (b *BaseRunner) ShouldProcessDuty(duty *types.Duty) error {
if b.QBFTController.Height >= qbft.Height(duty.Slot) {
if b.QBFTController.Height >= qbft.Height(duty.Slot) && b.QBFTController.Height != 0 {
return errors.Errorf("duty for slot %d already passed. Current height is %d", duty.Slot,
b.QBFTController.Height)
}
Expand Down
1 change: 1 addition & 0 deletions ssv/spectest/all_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var AllTests = []tests.TestF{
newduty.PostFutureDecided,
newduty.DuplicateDutyFinished,
newduty.DuplicateDutyNotFinished,
newduty.FirstHeight,

consensus.FutureDecided,
consensus.InvalidDecidedValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"BaseRunner": {
"State": {
"PreConsensusContainer": {
"Signatures": {},
"Quorum": 3
},
"PostConsensusContainer": {
"Signatures": {},
"Quorum": 3
},
"RunningInstance": null,
"DecidedValue": null,
"StartingDuty": {
"Type": 1,
"PubKey": [
142,
128,
6,
101,
81,
168,
27,
49,
130,
88,
112,
158,
218,
247,
221,
31,
99,
205,
104,
106,
14,
77,
184,
178,
155,
187,
122,
207,
230,
86,
8,
103,
122,
245,
165,
39,
217,
68,
142,
228,
120,
53,
72,
94,
2,
181,
11,
192
],
"Slot": 0,
"ValidatorIndex": 1,
"CommitteeIndex": 22,
"CommitteeLength": 128,
"CommitteesAtSlot": 36,
"ValidatorCommitteeIndex": 11,
"ValidatorSyncCommitteeIndices": null
},
"Finished": false
},
"Share": {
"OperatorID": 1,
"ValidatorPubKey": "joAGZVGoGzGCWHCe2vfdH2PNaGoOTbiym7t6z+ZWCGd69aUn2USO5Hg1SF4CtQvA",
"SharePubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn",
"Committee": [
{
"OperatorID": 1,
"PubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn"
},
{
"OperatorID": 2,
"PubKey": "przr4wl9dBcbQMcSoDHOsDcds9PEAs8s5pG5Eg87q3XU1W36DzdZFUSZm/GMU1Pt"
},
{
"OperatorID": 3,
"PubKey": "gJDgt2ZqRezF1O90GKyZ8J5sskQCn+pqCn/Mvp7gi8U53g36Zr5rq8hJPdmd0amN"
},
{
"OperatorID": 4,
"PubKey": "p8CidrcKXuM5XH1tJlXtYFKKolLU0h7KX8xSI+UMxCvRaLKAq3q1MXNU3d/PPfnk"
}
],
"Quorum": 3,
"PartialQuorum": 2,
"DomainType": [
0,
0,
3,
1
],
"FeeRecipientAddress": [
83,
89,
83,
181,
166,
4,
0,
116,
148,
140,
241,
133,
234,
167,
210,
171,
189,
102,
128,
143
],
"Graffiti": null
},
"QBFTController": {
"Identifier": "AAADAY6ABmVRqBsxglhwntr33R9jzWhqDk24spu7es/mVghnevWlJ9lEjuR4NUheArULwAEAAAA=",
"Height": 0,
"StoredInstances": [],
"Domain": [
0,
0,
3,
1
],
"Share": {
"OperatorID": 1,
"ValidatorPubKey": "joAGZVGoGzGCWHCe2vfdH2PNaGoOTbiym7t6z+ZWCGd69aUn2USO5Hg1SF4CtQvA",
"SharePubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn",
"Committee": [
{
"OperatorID": 1,
"PubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn"
},
{
"OperatorID": 2,
"PubKey": "przr4wl9dBcbQMcSoDHOsDcds9PEAs8s5pG5Eg87q3XU1W36DzdZFUSZm/GMU1Pt"
},
{
"OperatorID": 3,
"PubKey": "gJDgt2ZqRezF1O90GKyZ8J5sskQCn+pqCn/Mvp7gi8U53g36Zr5rq8hJPdmd0amN"
},
{
"OperatorID": 4,
"PubKey": "p8CidrcKXuM5XH1tJlXtYFKKolLU0h7KX8xSI+UMxCvRaLKAq3q1MXNU3d/PPfnk"
}
],
"Quorum": 3,
"PartialQuorum": 2,
"DomainType": [
0,
0,
3,
1
],
"FeeRecipientAddress": [
83,
89,
83,
181,
166,
4,
0,
116,
148,
140,
241,
133,
234,
167,
210,
171,
189,
102,
128,
143
],
"Graffiti": null
}
},
"BeaconNetwork": "now_test_network",
"BeaconRoleType": 1
}
}
Loading

0 comments on commit 58f3ed8

Please sign in to comment.