Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Cluster consensus - Several duties #401

Merged
merged 24 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3bad0df
Refactor existing committee tests to the new committeesingleduty package
MatheusFranco99 May 15, 2024
c5faeb6
Implement singleton pattern for TestingVerifier for speed-up
MatheusFranco99 May 15, 2024
b816aba
Extend "compare output" functionality to handle msgs asynchronicity
MatheusFranco99 May 15, 2024
744ded2
Use new network for each new committee runner; fix slot/height in som…
MatheusFranco99 May 15, 2024
08e989f
Add test: sequenced decided duties
MatheusFranco99 May 15, 2024
ae1f86d
Add test: sequenced happy flow duties
MatheusFranco99 May 15, 2024
2c4121f
Fix: avoid concurrent read and writes
MatheusFranco99 May 15, 2024
9f34304
Fix Committee: Add nil check to BeaconDuty
MatheusFranco99 May 16, 2024
d7073ba
Add test: shuffled decided duties
MatheusFranco99 May 16, 2024
e5db32e
Compare output messages in asynchornous order only for committee spec…
MatheusFranco99 May 16, 2024
fbc9663
Reduce size of tests.json by removing big tests
MatheusFranco99 May 16, 2024
a822eb4
Add test: shuffled happy flow duties with the same validators
MatheusFranco99 May 16, 2024
2491faa
Generate JSON tests
MatheusFranco99 May 16, 2024
b143528
Refactor input, output and beacon root to testing utils
MatheusFranco99 May 16, 2024
3545642
Refactor committee tests utils (input, output, beacon roots)
MatheusFranco99 May 16, 2024
30fbda2
Add test: shuffled happy flow duties with different validators
MatheusFranco99 May 16, 2024
48d3b7e
Add test: failed duties then successful duties
MatheusFranco99 May 16, 2024
6975a6d
Improve test comment
MatheusFranco99 May 17, 2024
852ea4a
Enable test cases with 500 validators
MatheusFranco99 May 20, 2024
32ca5f8
Add cache to TestingKeyManager to speed up tests
MatheusFranco99 May 20, 2024
711de12
Merge branch 'alan' into cluster-consensus-test-multiple-duties
MatheusFranco99 May 20, 2024
1f8aa6e
Merge branch 'alan' into cluster-consensus-test-multiple-duties
MatheusFranco99 May 21, 2024
c76e289
Merge branch 'alan' into cluster-consensus-test-multiple-duties
GalRogozinski May 21, 2024
95f8856
add json.gz
GalRogozinski May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ssv/committee.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ func (c *Committee) ProcessMessage(signedSSVMessage *types.SignedSSVMessage) err
func (c *Committee) updateDutySlotMap(duty *types.CommitteeDuty) {
for _, beaconDuty := range duty.BeaconDuties {

if beaconDuty == nil {
continue
}

if _, exists := c.HighestDutySlotMap[beaconDuty.Type]; !exists {
c.HighestDutySlotMap[beaconDuty.Type] = make(map[spec.ValidatorIndex]spec.Slot)
}
Expand Down
24 changes: 16 additions & 8 deletions ssv/spectest/all_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package spectest

import (
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests"
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests/committee"
committeemultipleduty "github.com/ssvlabs/ssv-spec/ssv/spectest/tests/committee/multipleduty"
committeesingleduty "github.com/ssvlabs/ssv-spec/ssv/spectest/tests/committee/singleduty"
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests/dutyexe"
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests/partialsigcontainer"
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests/runner"
Expand Down Expand Up @@ -68,13 +69,20 @@ var AllTests = []tests.TestF{
newduty.DuplicateDutyNotFinished,
newduty.FirstHeight,

committee.StartDuty,
committee.StartNoDuty,
committee.ValidConsensusData,
committee.WrongConsensusData,
committee.Decided,
committee.HappyFlow,
committee.PastMessageDutyNotFinished,
committeesingleduty.StartDuty,
committeesingleduty.StartNoDuty,
committeesingleduty.ValidConsensusData,
committeesingleduty.WrongConsensusData,
committeesingleduty.Decided,
committeesingleduty.HappyFlow,
committeesingleduty.PastMessageDutyNotFinished,

committeemultipleduty.SequencedDecidedDuties,
committeemultipleduty.SequencedHappyFlowDuties,
committeemultipleduty.ShuffledDecidedDuties,
committeemultipleduty.ShuffledHappyFlowDutiesWithTheSameValidators,
committeemultipleduty.ShuffledHappyFlowDutiesWithDifferentValidators,
committeemultipleduty.FailedThanSuccessfulDuties,

consensus.FutureDecidedNoInstance,
consensus.FutureDecided,
Expand Down
Loading
Loading