Skip to content

Commit

Permalink
add wrongly removed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusFranco99 committed Jan 8, 2025
1 parent a686609 commit d4e1cfd
Show file tree
Hide file tree
Showing 9 changed files with 2,556 additions and 87 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"BaseRunner": {
"State": {
"PreConsensusContainer": {
"Signatures": {
"1": {
"921b07b8aa67eab7c38b8214bd22c43ac3d8b7137c09535f843242558db21786": {
"1": "kzWpbPb8gucHyXb52aAScQBW3LmuAlm8QSLQJDlfBnvF3HxkDbDWHPGZmSlTYMh/Bl1UORnmfzkOUpH82YKAU9XmAdjL/v0Ud5RMkHVWd2mL0JFRvp27IqyKg8gC92K7",
"2": "oatAafZcLe9hP8r8gIKSCiccyq1NRoqJhYkL5J1ioRVPt3O+udVVg6XkVCvvc337Fw9OkS9d3SrvSiRqGBEctVXGG18P2362oSUGjX1MxlXTqQJR0+fRsUGbM7FoBg9z",
"3": "oMA1HyQg/WxlynyHFxQNDaFwmMWOS2vZu4C8eaQeuQ4p3BuWqVLhNzZpdWeL6jjSGSI8yNtQpXZYuYcyiSqYylr+PHtI7MDUl0sPWHFv2MJ+/hCKJxZcGwK6Y0toDZlG"
}
}
},
"Quorum": 3
},
"PostConsensusContainer": {
"Signatures": {},
"Quorum": 3
},
"RunningInstance": null,
"DecidedValue": null,
"Finished": true,
"ValidatorDuty": {
"Type": 6,
"PubKey": "0x8e80066551a81b318258709edaf7dd1f63cd686a0e4db8b29bbb7acfe65608677af5a527d9448ee47835485e02b50bc0",
"Slot": "12",
"ValidatorIndex": "1",
"CommitteeIndex": 0,
"CommitteeLength": 0,
"CommitteesAtSlot": 0,
"ValidatorCommitteeIndex": 0,
"ValidatorSyncCommitteeIndices": null
}
},
"Share": {
"1": {
"ValidatorIndex": "1",
"ValidatorPubKey": [
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
],
"SharePubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn",
"Committee": [
{
"SharePubKey": "l9lKgR1kSTYFKp0tSs1kcYl0z2eNvv0mcyTI6fjnA0pKa32HeeJ6AZU4w8Qlw+Xn",
"Signer": 1
},
{
"SharePubKey": "przr4wl9dBcbQMcSoDHOsDcds9PEAs8s5pG5Eg87q3XU1W36DzdZFUSZm/GMU1Pt",
"Signer": 2
},
{
"SharePubKey": "gJDgt2ZqRezF1O90GKyZ8J5sskQCn+pqCn/Mvp7gi8U53g36Zr5rq8hJPdmd0amN",
"Signer": 3
},
{
"SharePubKey": "p8CidrcKXuM5XH1tJlXtYFKKolLU0h7KX8xSI+UMxCvRaLKAq3q1MXNU3d/PPfnk",
"Signer": 4
}
],
"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": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
}
},
"QBFTController": null,
"BeaconNetwork": "now_test_network",
"RunnerRoleType": 5
}
}
Binary file modified ssv/spectest/generate/tests.json.gz
Binary file not shown.
177 changes: 90 additions & 87 deletions ssv/spectest/tests/runner/preconsensus/quorum.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package preconsensus

import (
"fmt"

"github.com/attestantio/go-eth2-client/spec"
"github.com/ssvlabs/ssv-spec/ssv/spectest/tests"
"github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv-spec/types/testingutils"
Expand All @@ -13,36 +16,36 @@ func Quorum() tests.SpecTest {
multiSpecTest := &tests.MultiMsgProcessingSpecTest{
Name: "pre consensus quorum",
Tests: []*tests.MsgProcessingSpecTest{
// {
// Name: "sync committee aggregator selection proof",
// Runner: testingutils.SyncCommitteeContributionRunner(ks),
// Duty: &testingutils.TestingSyncCommitteeContributionDuty,
// Messages: []*types.SignedSSVMessage{
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[2], ks.Shares[2], 2, 2))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[3], ks.Shares[3], 3, 3))),
// },
// PostDutyRunnerStateRoot: quorumSyncCommitteeContributionSC().Root(),
// PostDutyRunnerState: quorumSyncCommitteeContributionSC().ExpectedState,
// OutputMessages: []*types.PartialSignatureMessages{
// testingutils.PreConsensusContributionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1), // broadcasts when starting a new duty
// },
// },
// {
// Name: "aggregator selection proof",
// Runner: testingutils.AggregatorRunner(ks),
// Duty: &testingutils.TestingAggregatorDuty,
// Messages: []*types.SignedSSVMessage{
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[2], ks.Shares[2], 2, 2))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[3], ks.Shares[3], 3, 3))),
// },
// PostDutyRunnerStateRoot: quorumAggregatorSC().Root(),
// PostDutyRunnerState: quorumAggregatorSC().ExpectedState,
// OutputMessages: []*types.PartialSignatureMessages{
// testingutils.PreConsensusSelectionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1), // broadcasts when starting a new duty
// },
// },
{
Name: "sync committee aggregator selection proof",
Runner: testingutils.SyncCommitteeContributionRunner(ks),
Duty: &testingutils.TestingSyncCommitteeContributionDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[2], ks.Shares[2], 2, 2))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgSyncCommitteeContribution(nil, testingutils.PreConsensusContributionProofMsg(ks.Shares[3], ks.Shares[3], 3, 3))),
},
PostDutyRunnerStateRoot: quorumSyncCommitteeContributionSC().Root(),
PostDutyRunnerState: quorumSyncCommitteeContributionSC().ExpectedState,
OutputMessages: []*types.PartialSignatureMessages{
testingutils.PreConsensusContributionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1), // broadcasts when starting a new duty
},
},
{
Name: "aggregator selection proof",
Runner: testingutils.AggregatorRunner(ks),
Duty: &testingutils.TestingAggregatorDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[2], ks.Shares[2], 2, 2))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgAggregator(nil, testingutils.PreConsensusSelectionProofMsg(ks.Shares[3], ks.Shares[3], 3, 3))),
},
PostDutyRunnerStateRoot: quorumAggregatorSC().Root(),
PostDutyRunnerState: quorumAggregatorSC().ExpectedState,
OutputMessages: []*types.PartialSignatureMessages{
testingutils.PreConsensusSelectionProofMsg(ks.Shares[1], ks.Shares[1], 1, 1), // broadcasts when starting a new duty
},
},
{
Name: "validator registration",
Runner: testingutils.ValidatorRegistrationRunner(ks),
Expand All @@ -61,68 +64,68 @@ func Quorum() tests.SpecTest {
testingutils.GetSSZRootNoError(testingutils.TestingSignedValidatorRegistration(ks)),
},
},
// {
// Name: "voluntary exit",
// Runner: testingutils.VoluntaryExitRunner(ks),
// Duty: &testingutils.TestingVoluntaryExitDuty,
// Messages: []*types.SignedSSVMessage{
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[1], 1))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[2], 2))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[3], 3))),
// },
// PostDutyRunnerStateRoot: quorumVoluntaryExitSC().Root(),
// PostDutyRunnerState: quorumVoluntaryExitSC().ExpectedState,
// OutputMessages: []*types.PartialSignatureMessages{
// testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[1], 1), // broadcasts when starting a new duty
// },
// BeaconBroadcastedRoots: []string{
// testingutils.GetSSZRootNoError(testingutils.TestingSignedVoluntaryExit(ks)),
// },
// },
{
Name: "voluntary exit",
Runner: testingutils.VoluntaryExitRunner(ks),
Duty: &testingutils.TestingVoluntaryExitDuty,
Messages: []*types.SignedSSVMessage{
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[1], 1))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[2], 2))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgVoluntaryExit(nil, testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[3], 3))),
},
PostDutyRunnerStateRoot: quorumVoluntaryExitSC().Root(),
PostDutyRunnerState: quorumVoluntaryExitSC().ExpectedState,
OutputMessages: []*types.PartialSignatureMessages{
testingutils.PreConsensusVoluntaryExitMsg(ks.Shares[1], 1), // broadcasts when starting a new duty
},
BeaconBroadcastedRoots: []string{
testingutils.GetSSZRootNoError(testingutils.TestingSignedVoluntaryExit(ks)),
},
},
},
}

// // proposerV creates a test specification for versioned proposer.
// proposerV := func(version spec.DataVersion) *tests.MsgProcessingSpecTest {
// return &tests.MsgProcessingSpecTest{
// Name: fmt.Sprintf("randao (%s)", version.String()),
// Runner: testingutils.ProposerRunner(ks),
// Duty: testingutils.TestingProposerDutyV(version),
// Messages: []*types.SignedSSVMessage{
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, version))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, version))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, version))),
// },
// PostDutyRunnerStateRoot: quorumProposerSC(version).Root(),
// PostDutyRunnerState: quorumProposerSC(version).ExpectedState,
// OutputMessages: []*types.PartialSignatureMessages{
// testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, version), // broadcasts when starting a new duty
// },
// }
// }
// proposerV creates a test specification for versioned proposer.
proposerV := func(version spec.DataVersion) *tests.MsgProcessingSpecTest {
return &tests.MsgProcessingSpecTest{
Name: fmt.Sprintf("randao (%s)", version.String()),
Runner: testingutils.ProposerRunner(ks),
Duty: testingutils.TestingProposerDutyV(version),
Messages: []*types.SignedSSVMessage{
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, version))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, version))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, version))),
},
PostDutyRunnerStateRoot: quorumProposerSC(version).Root(),
PostDutyRunnerState: quorumProposerSC(version).ExpectedState,
OutputMessages: []*types.PartialSignatureMessages{
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, version), // broadcasts when starting a new duty
},
}
}

// // proposerBlindedV creates a test specification for versioned proposer with blinded block.
// proposerBlindedV := func(version spec.DataVersion) *tests.MsgProcessingSpecTest {
// return &tests.MsgProcessingSpecTest{
// Name: fmt.Sprintf("randao blinded block (%s)", version.String()),
// Runner: testingutils.ProposerBlindedBlockRunner(ks),
// Duty: testingutils.TestingProposerDutyV(version),
// Messages: []*types.SignedSSVMessage{
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, version))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, version))),
// testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, version))),
// },
// PostDutyRunnerStateRoot: quorumBlindedProposerSC(version).Root(),
// PostDutyRunnerState: quorumBlindedProposerSC(version).ExpectedState,
// OutputMessages: []*types.PartialSignatureMessages{
// testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, version), // broadcasts when starting a new duty
// },
// }
// }
// proposerBlindedV creates a test specification for versioned proposer with blinded block.
proposerBlindedV := func(version spec.DataVersion) *tests.MsgProcessingSpecTest {
return &tests.MsgProcessingSpecTest{
Name: fmt.Sprintf("randao blinded block (%s)", version.String()),
Runner: testingutils.ProposerBlindedBlockRunner(ks),
Duty: testingutils.TestingProposerDutyV(version),
Messages: []*types.SignedSSVMessage{
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, version))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, version))),
testingutils.SignPartialSigSSVMessage(ks, testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, version))),
},
PostDutyRunnerStateRoot: quorumBlindedProposerSC(version).Root(),
PostDutyRunnerState: quorumBlindedProposerSC(version).ExpectedState,
OutputMessages: []*types.PartialSignatureMessages{
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, version), // broadcasts when starting a new duty
},
}
}

// for _, v := range testingutils.SupportedBlockVersions {
// multiSpecTest.Tests = append(multiSpecTest.Tests, []*tests.MsgProcessingSpecTest{proposerV(v), proposerBlindedV(v)}...)
// }
for _, v := range testingutils.SupportedBlockVersions {
multiSpecTest.Tests = append(multiSpecTest.Tests, []*tests.MsgProcessingSpecTest{proposerV(v), proposerBlindedV(v)}...)
}

return multiSpecTest
}

0 comments on commit d4e1cfd

Please sign in to comment.