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

Version Block Support - testing infrastructure #223

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d73e088
implementation
olegshmuelov Mar 15, 2023
518c3d5
tmp
olegshmuelov Mar 16, 2023
59cc9aa
remove unused
olegshmuelov Mar 16, 2023
2ceb26a
use latest go-eth2-client version
olegshmuelov Mar 16, 2023
82a241b
use latest go-eth2-client version
olegshmuelov Mar 16, 2023
3c967f9
return block data as versioned & hashroot
olegshmuelov Mar 16, 2023
8538093
improve log
olegshmuelov Mar 16, 2023
a65f312
upgrade go-eth2-client v0.15.8
olegshmuelov May 2, 2023
47ba782
proposerCalls interface change
olegshmuelov May 2, 2023
611c19f
versioned block spec tests
olegshmuelov May 2, 2023
e7b4a53
Merge remote-tracking branch 'upstream/main' into version-block-suppo…
olegshmuelov May 2, 2023
06f8ccb
generate test json
olegshmuelov May 2, 2023
4701836
include all versioned block spec tests
olegshmuelov May 2, 2023
03295fb
remove unused fields
olegshmuelov May 3, 2023
cfb3893
use block version instead of hardcoded
olegshmuelov May 3, 2023
48a865b
Merge branch 'main' into version-block-support-base
olegshmuelov May 7, 2023
86c2aa1
keep only bellatrix block version
olegshmuelov May 8, 2023
464b2fa
mention github issue
olegshmuelov May 8, 2023
fdee3c7
SSV comparable state #215
olegshmuelov May 7, 2023
1baf187
use proper package names
olegshmuelov May 8, 2023
fc85574
Create beacon_node_versioned.go
olegshmuelov May 8, 2023
8679236
Create ssv_msgs_versioned.go
olegshmuelov May 8, 2023
a69fc06
versioned state comparison example
olegshmuelov May 8, 2023
9fe7938
TestProposerWithJustificationsConsensusData versioned example
olegshmuelov May 8, 2023
f229f06
versioned TestingProposerDutyNextEpoch example
olegshmuelov May 8, 2023
dd2a2ba
versioned PostConsensusWrongProposerMsg example
olegshmuelov May 8, 2023
4749be4
versioned PostConsensusWrongSigProposerMsg example
olegshmuelov May 8, 2023
3f03a45
versioned PostConsensusProposerTooManyRootsMsg example
olegshmuelov May 8, 2023
e0438e6
versioned PostConsensusSigProposerWrongBeaconSignerMsg example
olegshmuelov May 8, 2023
2921579
return testing blocks as versioned
olegshmuelov May 8, 2023
9a3b37d
use TestingProposerDuty versioned slot
olegshmuelov May 8, 2023
087a7a5
add versioned PostConsensusProposerTooFewRootsMsg
olegshmuelov May 9, 2023
b7b9479
versioned PostConsensusProposerTooFewRootsMsg example
olegshmuelov May 9, 2023
2dd7d86
Merge branch 'main' into version-block-support-testing-infra
olegshmuelov May 9, 2023
370dc1d
versioned runner decided msgs
olegshmuelov May 9, 2023
499a916
randao versioned
olegshmuelov May 9, 2023
3a834f4
versioned PreConsensusRandaoMsg SSVDecidingMsgs example
olegshmuelov May 9, 2023
6cda40a
versioned PreConsensusRandaoNextEpochMsg example
olegshmuelov May 9, 2023
28e363f
versioned PreConsensusRandaoDifferentEpochMsg example
olegshmuelov May 9, 2023
ecb5653
versioned PreConsensusRandaoTooManyRootsMsg example
olegshmuelov May 9, 2023
bc216d9
versioned PreConsensusRandaoTooFewRootsMsg example
olegshmuelov May 9, 2023
753740b
versioned PreConsensusRandaoWrongBeaconSigMsg example
olegshmuelov May 9, 2023
cb1dc6e
versioned PreConsensusRandaoDifferentSignerMsg example
olegshmuelov May 9, 2023
052c2a2
go fmt ./...
olegshmuelov May 9, 2023
cd01e48
use versioned PreConsensusRandaoMsg
olegshmuelov May 9, 2023
a592bc2
use versioned TestingProposerDuty
olegshmuelov May 9, 2023
eea2685
delete redundant tests (#1)
GalRogozinski May 9, 2023
61a1a28
remove (versioned) name
olegshmuelov May 9, 2023
21756f5
remove unused
olegshmuelov May 9, 2023
f810ebf
versioned GetBeaconBlock/GetBlindedBeaconBlock
olegshmuelov May 9, 2023
f5bf038
Merge branch 'main' into version-block-support-testing-infra
olegshmuelov May 10, 2023
068766c
fix merge conflict
olegshmuelov May 10, 2023
b47a9ad
use TestingDutySlotBellatrixNextEpoch
olegshmuelov May 10, 2023
f904ebe
add versioned TestingInvalidDutySlot
olegshmuelov May 10, 2023
876bd62
versioned TestingInvalidDutySlot example
olegshmuelov May 10, 2023
24ceff2
versioned TestingInvalidDutySlot example2
olegshmuelov May 10, 2023
2ca1614
add an issue comment
olegshmuelov May 11, 2023
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
10 changes: 6 additions & 4 deletions ssv/spectest/tests/runner/consensus/future_msg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package consensus

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"
Expand Down Expand Up @@ -71,10 +73,10 @@ func FutureMessage() tests.SpecTest {
{
Name: "proposer",
Runner: testingutils.ProposerRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Duty: testingutils.TestingProposerDutyV(spec.DataVersionBellatrix),
Messages: []*types.SSVMessage{
testingutils.SSVMsgProposer(
futureMsgF(testingutils.TestProposerWithJustificationsConsensusData(ks), testingutils.ProposerMsgID),
futureMsgF(testingutils.TestProposerWithJustificationsConsensusDataV(ks, spec.DataVersionBellatrix), testingutils.ProposerMsgID),
nil),
},
PostDutyRunnerStateRoot: "32dd1d1d7a4c34bb7dafc0866f69eb49f6a0a23755b135f83ad14d12e39fff82",
Expand All @@ -84,10 +86,10 @@ func FutureMessage() tests.SpecTest {
{
Name: "proposer (blinded block)",
Runner: testingutils.ProposerBlindedBlockRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Duty: testingutils.TestingProposerDutyV(spec.DataVersionBellatrix),
Messages: []*types.SSVMessage{
testingutils.SSVMsgProposer(
futureMsgF(testingutils.TestProposerBlindedWithJustificationsConsensusData(ks), testingutils.ProposerMsgID),
futureMsgF(testingutils.TestProposerBlindedWithJustificationsConsensusDataV(ks, spec.DataVersionBellatrix), testingutils.ProposerMsgID),
nil),
},
PostDutyRunnerStateRoot: "58b946451dc5ccbd52fbc9e6bbe0ac888253d1708be018a3ff0b07762dd28891",
Expand Down
22 changes: 12 additions & 10 deletions ssv/spectest/tests/runner/consensus/invalid_decided_value.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package consensus

import (
"github.com/attestantio/go-eth2-client/spec"
"github.com/herumi/bls-eth-go-binary/bls"

"github.com/bloxapp/ssv-spec/ssv/spectest/tests"
"github.com/bloxapp/ssv-spec/types"
"github.com/bloxapp/ssv-spec/types/testingutils"
"github.com/herumi/bls-eth-go-binary/bls"
)

// InvalidDecidedValue tests an invalid decided value ConsensusData.Validate() != nil (unknown duty role)
Expand Down Expand Up @@ -98,11 +100,11 @@ func InvalidDecidedValue() tests.SpecTest {
{
Name: "proposer",
Runner: testingutils.ProposerRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Duty: testingutils.TestingProposerDutyV(spec.DataVersionBellatrix),
Messages: []*types.SSVMessage{
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[1], ks.Shares[1], 1, 1)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[2], ks.Shares[2], 2, 2)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[3], ks.Shares[3], 3, 3)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, spec.DataVersionBellatrix)),

testingutils.SSVMsgProposer(
testingutils.TestingCommitMultiSignerMessageWithIdentifierAndFullData(
Expand All @@ -114,7 +116,7 @@ func InvalidDecidedValue() tests.SpecTest {
},
PostDutyRunnerStateRoot: "69a1c7fc8cbd3cc8d7aa6cfb4493f849e08df3bb37c218d88eee97e87044b810",
OutputMessages: []*types.SignedPartialSignatureMessage{
testingutils.PreConsensusRandaoMsg(ks.Shares[1], 1),
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
},
ExpectedError: expectedErr,
},
Expand All @@ -123,9 +125,9 @@ func InvalidDecidedValue() tests.SpecTest {
Runner: testingutils.ProposerBlindedBlockRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Messages: []*types.SSVMessage{
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[1], ks.Shares[1], 1, 1)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[2], ks.Shares[2], 2, 2)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsg(ks.Shares[3], ks.Shares[3], 3, 3)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[1], ks.Shares[1], 1, 1, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[2], ks.Shares[2], 2, 2, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PreConsensusRandaoDifferentSignerMsgV(ks.Shares[3], ks.Shares[3], 3, 3, spec.DataVersionBellatrix)),

testingutils.SSVMsgProposer(
testingutils.TestingCommitMultiSignerMessageWithIdentifierAndFullData(
Expand All @@ -137,7 +139,7 @@ func InvalidDecidedValue() tests.SpecTest {
},
PostDutyRunnerStateRoot: "cec247510f2c061613cf71cca2a343cc02ac1488cf2f6150f0b7b7787aff7fb3",
OutputMessages: []*types.SignedPartialSignatureMessage{
testingutils.PreConsensusRandaoMsg(ks.Shares[1], 1),
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
},
ExpectedError: expectedErr,
},
Expand Down
8 changes: 5 additions & 3 deletions ssv/spectest/tests/runner/duties/newduty/decided.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package newduty

import (
"github.com/attestantio/go-eth2-client/spec"

"github.com/bloxapp/ssv-spec/qbft"
"github.com/bloxapp/ssv-spec/ssv"
"github.com/bloxapp/ssv-spec/ssv/spectest/tests"
Expand Down Expand Up @@ -57,11 +59,11 @@ func PostDecided() tests.SpecTest {
},
{
Name: "proposer",
Runner: finishRunner(testingutils.ProposerRunner(ks), &testingutils.TestingProposerDutyNextEpoch),
Duty: &testingutils.TestingProposerDutyNextEpoch,
Runner: finishRunner(testingutils.ProposerRunner(ks), testingutils.TestingProposerDutyNextEpochV(spec.DataVersionBellatrix)),
Duty: testingutils.TestingProposerDutyNextEpochV(spec.DataVersionBellatrix),
PostDutyRunnerStateRoot: "8bb7114ca6cb9d4247a2fc955e9c881f9c1909752a0f330270251dfaa52adcc3",
OutputMessages: []*types.SignedPartialSignatureMessage{
testingutils.PreConsensusRandaoNextEpochMsg(ks.Shares[1], 1), // broadcasts when starting a new duty
testingutils.PreConsensusRandaoNextEpochMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix), // broadcasts when starting a new duty
},
},
{
Expand Down
39 changes: 20 additions & 19 deletions ssv/spectest/tests/runner/full_happy_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package runner
import (
"encoding/hex"

"github.com/attestantio/go-eth2-client/spec"
ssz "github.com/ferranbt/fastssz"

"github.com/bloxapp/ssv-spec/qbft"
Expand Down Expand Up @@ -101,42 +102,42 @@ func FullHappyFlow() tests.SpecTest {
{
Name: "proposer",
Runner: testingutils.ProposerRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Duty: testingutils.TestingProposerDutyV(spec.DataVersionBellatrix),
Messages: append(
testingutils.SSVDecidingMsgs(testingutils.TestProposerConsensusData, ks, types.BNRoleProposer), // consensus
testingutils.SSVDecidingMsgsV(testingutils.TestProposerConsensusDataV(spec.DataVersionBellatrix), ks, types.BNRoleProposer), // consensus
[]*types.SSVMessage{ // post consensus
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[1], 1)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[2], 2)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[3], 3)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[2], 2, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[3], 3, spec.DataVersionBellatrix)),
}...,
),
PostDutyRunnerStateRoot: fullHappyFlowProposerSC().Root(), // "76812c0f14ff09067547e9528730749b0c0090d1a4872689a0b8480d7b538884",
PostDutyRunnerState: fullHappyFlowProposerSC().ExpectedState,
PostDutyRunnerStateRoot: fullHappyFlowProposerSCV(spec.DataVersionBellatrix).Root(), // "76812c0f14ff09067547e9528730749b0c0090d1a4872689a0b8480d7b538884",
PostDutyRunnerState: fullHappyFlowProposerSCV(spec.DataVersionBellatrix).ExpectedState,
OutputMessages: []*types.SignedPartialSignatureMessage{
testingutils.PreConsensusRandaoMsg(ks.Shares[1], 1),
testingutils.PostConsensusProposerMsg(ks.Shares[1], 1),
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
testingutils.PostConsensusProposerMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
},
BeaconBroadcastedRoots: []string{
getSSZRootNoError(testingutils.TestingSignedBeaconBlock(ks)),
getSSZRootNoError(testingutils.TestingSignedBeaconBlockV(ks, spec.DataVersionBellatrix)),
},
},
{
Name: "proposer blinded block",
Runner: testingutils.ProposerBlindedBlockRunner(ks),
Duty: &testingutils.TestingProposerDuty,
Duty: testingutils.TestingProposerDutyV(spec.DataVersionBellatrix),
Messages: append(
testingutils.SSVDecidingMsgs(testingutils.TestProposerBlindedBlockConsensusData, ks, types.BNRoleProposer), // consensus
testingutils.SSVDecidingMsgsV(testingutils.TestProposerBlindedBlockConsensusDataV(spec.DataVersionBellatrix), ks, types.BNRoleProposer), // consensus
[]*types.SSVMessage{ // post consensus
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[1], 1)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[2], 2)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsg(ks.Shares[3], 3)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[2], 2, spec.DataVersionBellatrix)),
testingutils.SSVMsgProposer(nil, testingutils.PostConsensusProposerMsgV(ks.Shares[3], 3, spec.DataVersionBellatrix)),
}...,
),
PostDutyRunnerStateRoot: fullHappyFlowBlindedProposerSC().Root(), // "90755cc41b814519fd9fdd14bc82d239997ba51340c297f25f5f1552f27f66c7",
PostDutyRunnerState: fullHappyFlowBlindedProposerSC().ExpectedState,
PostDutyRunnerStateRoot: fullHappyFlowBlindedProposerSCV(spec.DataVersionBellatrix).Root(), // "90755cc41b814519fd9fdd14bc82d239997ba51340c297f25f5f1552f27f66c7",
PostDutyRunnerState: fullHappyFlowBlindedProposerSCV(spec.DataVersionBellatrix).ExpectedState,
OutputMessages: []*types.SignedPartialSignatureMessage{
testingutils.PreConsensusRandaoMsg(ks.Shares[1], 1),
testingutils.PostConsensusProposerMsg(ks.Shares[1], 1),
testingutils.PreConsensusRandaoMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
testingutils.PostConsensusProposerMsgV(ks.Shares[1], 1, spec.DataVersionBellatrix),
},
BeaconBroadcastedRoots: []string{
getSSZRootNoError(testingutils.TestingSignedBeaconBlock(ks)),
Expand Down
Loading