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

Update rockx-sg/ssv-spec with ssv-spec master branch #30

Open
wants to merge 125 commits into
base: staging
Choose a base branch
from

Conversation

aayush-rockx
Copy link

No description provided.

alonmuroch and others added 30 commits December 13, 2022 12:40
* WIP msg validation func

* QBFT spec tests pass, didn't remove legacy validation

* qbft tests pass + removed old validation

* passes tests + json
* validate msg round against state round

* allow future round change message to be processed

* fix tests

* change round for every consensus message and revert previous change

* fix tests
* align duty struct + beacon interface

* sync committee subnet id

* sync committee spec vars

* align beacon intefrace

* pass tests

* remove json ignore

* aggregate panic and bug fixes

* align interface

* updated roots

* post invalid decided fix

* post consensus validaiton fix

* fix tests

* json update
* WIP

* finished

* json tests + lint

* fix + json
* spec tests pass

* added blidned block flag in runner

* testing beacon block transactions

* blinded block integration

* all tests pass

* WIP blinded block tests

* NowTestNetwork genesis time fix

* refactor beacon test network

* WIP validator registration runnner

* WIP validator registration tests

* validator registration pre consensus tests

* validator registration runner consensus and post consensus tests

* compiles

* added missing tests

* support decided blinded/ regular dynamically

* blinded block pre consensus tests

* blinded block consensus tests

* blinded block post consensus tests

* rebase fix

* mod tidy

* change domain application value + tests

* consensus data validation spec test

* post consensus spec tests pass

* new duty, consensus, sync committee, proposer and pre consensus spec test aligment

* all ssv tests pass + json

* qbft tests pass + json

* lint
* share ssz

* ssv message ssz

- change domain type to [4]byte
- change message id to [58]byte

* SSZ encoding generate

- Duty
- ConsensusData
- other adjustments

* QBFT ssz

- signed message + message ssz encoding
- full data on signed message, root in message
- remove stage specific data for a more stream lined message struct

* add pre consensus justifications to consensus data

* fix previous

* change root to [32]byte{}

* spec test stubs

* building WIP

* qbft commit tests build

* decided spec tests compile

* added slot to partial signatures

* Make tests compilable (#156)

* Make tests compilable

* Simplify futuremsg.Cleanup

* Fix operator ID in `proposal.FutureRound`

* Fix issues in roundchange.HappyFlow

* Fix issue `ks.Shares[2], types.OperatorID(2), 3` -> `ks.Shares[3], types.OperatorID(3), 2`

* Fix WrongProposer

* Fix roundchange.AfterProposal

* Fix roundchange.RoundChangePartialQuorum

* Fix CommitDataInvalid

* Fix prepare.UnknownSigner

* Fix DuplicateMsgQuorumPreparedRCFirst

* Fix proposal.FutureRound

* Fix proposal.FutureRoundPrevNotPrepared

* Fix issues in generators of testing messages

* Use DecidingMsgsForHeight

* Set FullData for prepare multi signer message

* Fix InputValue and DecidedVal in qbft controller spectests

* Revert "Fix InputValue and DecidedVal in qbft controller spectests"

This reverts commit 25f1531.

* Fix DecidedVal in controller/decided tests

* Fix DecidedVal in NoInstanceRunning and LateCommit

* Fix proposal message in CurrentInstancePastRound

* Fix proposal message and decided value in latemsg.LateCommitPastRound

* Fix signers in proposal.FutureRoundPrevNotPrepared

* Set FullData when creating testing round change message

* Change start value for qbft base instance to TestingQBFTFullData

* Adjust round change message in roundchange.HappyFlow

* Fix output message in roundchange.F1Speedup

* Fix round change messages in roundchange.F1SpeedupPrevPrepared and roundchange.F1SpeedupPrevPrepared

* Fix issues in sanity futuremsg tests

* Fix signers in startinstance.PostFutureDecided

* remove full data on marshaling justifications + tests

* fix test import cycle

* fix linting

* partial sig slot validation + tests

* ssv full happy flow spec passes

* Remove irrelevant tests

* Remove irrelevant tests [2]

* Fix futuremsg.InvalidMsg

* Fix processmsg.InvalidIdentifier

* Remove irrelevant tests [3]

* Remove irrelevant tests [4]

* Fix round change message validation for MsgSpecTest type

* Remove messages.RoundChangeDataInvalidPreparedValue

* Fix issues with DecidedVal and lack of RC justifications in latemsg tests

* Fix some startinstance and processmsg tests

* Add a TODO to check InvalidRoundChangeJustificationPrepared test

* validRoundChange->validRoundChangeForData

---------

Co-authored-by: Alon Muroch <[email protected]>
Co-authored-by: aaron <[email protected]>
Co-authored-by: aaron-blox <[email protected]>

* Fix failing tests

* Make tests compilable

* Simplify futuremsg.Cleanup

* Fix operator ID in `proposal.FutureRound`

* Fix issues in roundchange.HappyFlow

* Fix issue `ks.Shares[2], types.OperatorID(2), 3` -> `ks.Shares[3], types.OperatorID(3), 2`

* Fix WrongProposer

* Fix roundchange.AfterProposal

* Fix roundchange.RoundChangePartialQuorum

* Fix CommitDataInvalid

* Fix prepare.UnknownSigner

* Fix DuplicateMsgQuorumPreparedRCFirst

* Fix proposal.FutureRound

* Fix proposal.FutureRoundPrevNotPrepared

* Add a comment

* Fix tests.HappyFlow

* Fix tests.SevenOperators

* Fix tests.TenOperators

* Fix tests.ThirteenOperators

* Fix prepare.HappyFlow

* Fix commit.HappyFlow

* Fix issues in generators of testing messages

* sanity tests

* WIP spec testsd

* WIP base sanity tests

* Use DecidingMsgsForHeight

* Set FullData for prepare multi signer message

* Fix InputValue and DecidedVal in qbft controller spectests

* Fix proposal.CurrentRoundPrevPrepared()

* Fix proposal.PastRoundProposalPrevPrepared()

* Revert "Fix InputValue and DecidedVal in qbft controller spectests"

This reverts commit 25f1531.

* Fix DecidedVal in controller/decided tests

* Fix decided.HasQuorum()

* Fix decided.LateDecidedBiggerQuorum(), decided.LateDecidedSmallerQuorum(), decided.DuplicateMsg()

* Fix DecidedVal in NoInstanceRunning and LateCommit

* Fix proposal message in CurrentInstancePastRound

* Fix decided.CurrentInstancePastRound

* Fix decided.CurrentInstanceFutureRound

* Fix proposal message and decided value in latemsg.LateCommitPastRound

* Fix startinstance.EmptyValue, startinstance.NilValue, startinstance.Valid

* Fix processmsg.NoInstanceRunning()

* Fix latemsg.LateCommit()

* Fix latemsg.LateCommitPastRound()

* Fix signers in proposal.FutureRoundPrevNotPrepared

* Fix:
	proposal.FirstRoundJustification(),
	proposal.FutureRoundPrevNotPrepared(),
	proposal.FutureRound(),
	proposal.NoRCJustification(),
	proposal.WrongProposer(),
	proposal.WrongSignature(),

* Set FullData when creating testing round change message

* Fix proposal: CurrentRoundPrevPrepared, FutureRound, FutureRoundPrevNotPrepared, PreparedPreviouslyJustification

* Update roots for controller tests

* Remove PreparedPreviouslyJustificationDebug

* Change start value for qbft base instance to TestingQBFTFullData

* Adjust round change message in roundchange.HappyFlow

* Fix roundchange.HappyFlow

* Fix output message in roundchange.F1Speedup

* Fix round change messages in roundchange.F1SpeedupPrevPrepared and roundchange.F1SpeedupPrevPrepared

* Fix roots in remaining sanity round change tests

* Fix issues in sanity futuremsg tests

* Fix remaining sanity futuremsg tests

* Add proposal.InvalidFullData test

* Fix root in proposal.CurrentRoundPrevNotPrepared

* Fix checks if H(data) != root

* Fix signers in startinstance.PostFutureDecided

* remove full data on marshaling justifications + tests

* fix test import cycle

* fix linting

* partial sig slot validation + tests

* ssv full happy flow spec passes

* Remove irrelevant tests

* Remove irrelevant tests [2]

* Fix futuremsg.InvalidMsg

* Fix processmsg.InvalidIdentifier

* Remove irrelevant tests [3]

* Remove irrelevant tests [4]

* Fix round change message validation for MsgSpecTest type

* Remove messages.RoundChangeDataInvalidPreparedValue

* Fix issues with DecidedVal and lack of RC justifications in latemsg tests

* Fix some startinstance and processmsg tests

* Add a TODO to check InvalidRoundChangeJustificationPrepared test

* validRoundChange->validRoundChangeForData

* Fix roots of some tests; fix missing justification in some proposal tests; add FullData to `TestingPrepareMessageWithParams`

* Fix issues after merging

* Uncomment sanity tests

* Remove duplicated sanity tests

* Fix a comment in proposal.InvalidFullData

* Create helper functions receiving identifiers for all futuremsg tests

* Remove duplicated tests

* Fix root for NotPreparedPreviouslyJustification

---------

Co-authored-by: Alon Muroch <[email protected]>
Co-authored-by: aaron <[email protected]>
Co-authored-by: aaron-blox <[email protected]>

* ssz: fix ssv sanity tests (#162)

* Make tests compilable

* Simplify futuremsg.Cleanup

* Fix operator ID in `proposal.FutureRound`

* Fix issues in roundchange.HappyFlow

* Fix issue `ks.Shares[2], types.OperatorID(2), 3` -> `ks.Shares[3], types.OperatorID(3), 2`

* Fix WrongProposer

* Fix roundchange.AfterProposal

* Fix roundchange.RoundChangePartialQuorum

* Fix CommitDataInvalid

* Fix prepare.UnknownSigner

* Fix DuplicateMsgQuorumPreparedRCFirst

* Fix proposal.FutureRound

* Fix proposal.FutureRoundPrevNotPrepared

* Add a comment

* Fix tests.HappyFlow

* Fix tests.SevenOperators

* Fix tests.TenOperators

* Fix tests.ThirteenOperators

* Fix prepare.HappyFlow

* Fix commit.HappyFlow

* Fix issues in generators of testing messages

* sanity tests

* WIP spec testsd

* WIP base sanity tests

* Use DecidingMsgsForHeight

* Set FullData for prepare multi signer message

* Fix InputValue and DecidedVal in qbft controller spectests

* Fix proposal.CurrentRoundPrevPrepared()

* Fix proposal.PastRoundProposalPrevPrepared()

* Revert "Fix InputValue and DecidedVal in qbft controller spectests"

This reverts commit 25f1531.

* Fix DecidedVal in controller/decided tests

* Fix decided.HasQuorum()

* Fix decided.LateDecidedBiggerQuorum(), decided.LateDecidedSmallerQuorum(), decided.DuplicateMsg()

* Fix DecidedVal in NoInstanceRunning and LateCommit

* Fix proposal message in CurrentInstancePastRound

* Fix decided.CurrentInstancePastRound

* Fix decided.CurrentInstanceFutureRound

* Fix proposal message and decided value in latemsg.LateCommitPastRound

* Fix startinstance.EmptyValue, startinstance.NilValue, startinstance.Valid

* Fix processmsg.NoInstanceRunning()

* Fix latemsg.LateCommit()

* Fix latemsg.LateCommitPastRound()

* Fix signers in proposal.FutureRoundPrevNotPrepared

* Fix:
	proposal.FirstRoundJustification(),
	proposal.FutureRoundPrevNotPrepared(),
	proposal.FutureRound(),
	proposal.NoRCJustification(),
	proposal.WrongProposer(),
	proposal.WrongSignature(),

* Set FullData when creating testing round change message

* Fix proposal: CurrentRoundPrevPrepared, FutureRound, FutureRoundPrevNotPrepared, PreparedPreviouslyJustification

* Update roots for controller tests

* Remove PreparedPreviouslyJustificationDebug

* Change start value for qbft base instance to TestingQBFTFullData

* Adjust round change message in roundchange.HappyFlow

* Fix roundchange.HappyFlow

* Fix output message in roundchange.F1Speedup

* Fix round change messages in roundchange.F1SpeedupPrevPrepared and roundchange.F1SpeedupPrevPrepared

* Fix roots in remaining sanity round change tests

* Fix issues in sanity futuremsg tests

* Fix remaining sanity futuremsg tests

* Add proposal.InvalidFullData test

* Fix root in proposal.CurrentRoundPrevNotPrepared

* Fix checks if H(data) != root

* Fix signers in startinstance.PostFutureDecided

* remove full data on marshaling justifications + tests

* fix test import cycle

* fix linting

* partial sig slot validation + tests

* ssv full happy flow spec passes

* Remove irrelevant tests

* Remove irrelevant tests [2]

* Fix futuremsg.InvalidMsg

* Fix processmsg.InvalidIdentifier

* Remove irrelevant tests [3]

* Remove irrelevant tests [4]

* Fix round change message validation for MsgSpecTest type

* Remove messages.RoundChangeDataInvalidPreparedValue

* Fix issues with DecidedVal and lack of RC justifications in latemsg tests

* Fix some startinstance and processmsg tests

* Add a TODO to check InvalidRoundChangeJustificationPrepared test

* validRoundChange->validRoundChangeForData

* Fix roots of some tests; fix missing justification in some proposal tests; add FullData to `TestingPrepareMessageWithParams`

* Fix issues after merging

* Uncomment sanity tests

* Remove duplicated sanity tests

* Fix a comment in proposal.InvalidFullData

* Create helper functions receiving identifiers for all futuremsg tests

* Remove duplicated tests

* Fix root for NotPreparedPreviouslyJustification

* Fix timeout tests

* Fix justification validation for MsgSpecTest

* Simplify identifier usage in testingutils

* Delete messages.RoundChangeDataInvalidPreparedRound()

* Remove messages.SignedMsgSigTooLong and messages.SignedMsgSigTooShort

* Rename testing variables

* Fix generating proposal message with different root and proposal.DuplicateMsgDifferentValue

* Mark tests that have issues other that different instance roots with TODOs

* Remove outdated TODO from startinstance.PostFutureDecided

* Update TODO comments

* Comment out accidentally uncommented tests

* Fix proposal.PreparedPreviouslyNoPrepareJustificationQuorum

* Fix proposal.InvalidPrepareJustificationValue

* Fix proposal.InvalidPrepareJustificationRound

* Delete commit.InvalidCommitData and prepare.InvalidPrepareData

* Mark decided.CurrentInstancePastRound and decided.CurrentInstanceFutureRound as fixed

* Fix decided.CurrentInstance

* Delete roundchange.JustificationInvalidPrepareData

* Delete roundchange.JustificationWrongValue

* Fix decided.CurrentInstance root

* Remove roundchange.InvalidRoundChangeData

* Fix issues in remaining round change tests

* Fix decided.InvalidValCheckData

* Mark decided.InvalidValCheckData as fixed

* Mark recently fixed round change tests as fixed

* Delete proposal.JustificationsValueNotJustified

* Fix ssv sanity tests

* Remove debug print

* Fix DecidingMsgsForHeight

* Fix returned error if no running duty on consensus message processing

* Fix consensus.PostFinish test

* Delete messages.RoundChangeDataInvalidJustifications

* Attempt to fix consensus.PostFinish

* Revert roundchange.JustificationWrongValue removal

* Revert roundchange.JustificationWrongValue removal in all_tests.go

* Fix roundchange.JustificationWrongValue

* Comment out roundchange.JustificationWrongValue

* Fix consensus.NoRunningDuty

---------

Co-authored-by: Alon Muroch <[email protected]>
Co-authored-by: aaron <[email protected]>
Co-authored-by: aaron-blox <[email protected]>

* ssz: fix remaining qbft and ssv tests (#164)

* Make tests compilable

* Simplify futuremsg.Cleanup

* Fix operator ID in `proposal.FutureRound`

* Fix issues in roundchange.HappyFlow

* Fix issue `ks.Shares[2], types.OperatorID(2), 3` -> `ks.Shares[3], types.OperatorID(3), 2`

* Fix WrongProposer

* Fix roundchange.AfterProposal

* Fix roundchange.RoundChangePartialQuorum

* Fix CommitDataInvalid

* Fix prepare.UnknownSigner

* Fix DuplicateMsgQuorumPreparedRCFirst

* Fix proposal.FutureRound

* Fix proposal.FutureRoundPrevNotPrepared

* Add a comment

* Fix tests.HappyFlow

* Fix tests.SevenOperators

* Fix tests.TenOperators

* Fix tests.ThirteenOperators

* Fix prepare.HappyFlow

* Fix commit.HappyFlow

* Fix issues in generators of testing messages

* sanity tests

* WIP spec testsd

* WIP base sanity tests

* Use DecidingMsgsForHeight

* Set FullData for prepare multi signer message

* Fix InputValue and DecidedVal in qbft controller spectests

* Fix proposal.CurrentRoundPrevPrepared()

* Fix proposal.PastRoundProposalPrevPrepared()

* Revert "Fix InputValue and DecidedVal in qbft controller spectests"

This reverts commit 25f1531.

* Fix DecidedVal in controller/decided tests

* Fix decided.HasQuorum()

* Fix decided.LateDecidedBiggerQuorum(), decided.LateDecidedSmallerQuorum(), decided.DuplicateMsg()

* Fix DecidedVal in NoInstanceRunning and LateCommit

* Fix proposal message in CurrentInstancePastRound

* Fix decided.CurrentInstancePastRound

* Fix decided.CurrentInstanceFutureRound

* Fix proposal message and decided value in latemsg.LateCommitPastRound

* Fix startinstance.EmptyValue, startinstance.NilValue, startinstance.Valid

* Fix processmsg.NoInstanceRunning()

* Fix latemsg.LateCommit()

* Fix latemsg.LateCommitPastRound()

* Fix signers in proposal.FutureRoundPrevNotPrepared

* Fix:
	proposal.FirstRoundJustification(),
	proposal.FutureRoundPrevNotPrepared(),
	proposal.FutureRound(),
	proposal.NoRCJustification(),
	proposal.WrongProposer(),
	proposal.WrongSignature(),

* Set FullData when creating testing round change message

* Fix proposal: CurrentRoundPrevPrepared, FutureRound, FutureRoundPrevNotPrepared, PreparedPreviouslyJustification

* Update roots for controller tests

* Remove PreparedPreviouslyJustificationDebug

* Change start value for qbft base instance to TestingQBFTFullData

* Adjust round change message in roundchange.HappyFlow

* Fix roundchange.HappyFlow

* Fix output message in roundchange.F1Speedup

* Fix round change messages in roundchange.F1SpeedupPrevPrepared and roundchange.F1SpeedupPrevPrepared

* Fix roots in remaining sanity round change tests

* Fix issues in sanity futuremsg tests

* Fix remaining sanity futuremsg tests

* Add proposal.InvalidFullData test

* Fix root in proposal.CurrentRoundPrevNotPrepared

* Fix checks if H(data) != root

* Fix signers in startinstance.PostFutureDecided

* remove full data on marshaling justifications + tests

* fix test import cycle

* fix linting

* partial sig slot validation + tests

* ssv full happy flow spec passes

* Remove irrelevant tests

* Remove irrelevant tests [2]

* Fix futuremsg.InvalidMsg

* Fix processmsg.InvalidIdentifier

* Remove irrelevant tests [3]

* Remove irrelevant tests [4]

* Fix round change message validation for MsgSpecTest type

* Remove messages.RoundChangeDataInvalidPreparedValue

* Fix issues with DecidedVal and lack of RC justifications in latemsg tests

* Fix some startinstance and processmsg tests

* Add a TODO to check InvalidRoundChangeJustificationPrepared test

* validRoundChange->validRoundChangeForData

* Fix roots of some tests; fix missing justification in some proposal tests; add FullData to `TestingPrepareMessageWithParams`

* Fix issues after merging

* Uncomment sanity tests

* Remove duplicated sanity tests

* Fix a comment in proposal.InvalidFullData

* Create helper functions receiving identifiers for all futuremsg tests

* Remove duplicated tests

* Fix root for NotPreparedPreviouslyJustification

* Fix timeout tests

* Fix justification validation for MsgSpecTest

* Simplify identifier usage in testingutils

* Delete messages.RoundChangeDataInvalidPreparedRound()

* Remove messages.SignedMsgSigTooLong and messages.SignedMsgSigTooShort

* Rename testing variables

* Fix generating proposal message with different root and proposal.DuplicateMsgDifferentValue

* Mark tests that have issues other that different instance roots with TODOs

* Remove outdated TODO from startinstance.PostFutureDecided

* Update TODO comments

* Comment out accidentally uncommented tests

* Fix proposal.PreparedPreviouslyNoPrepareJustificationQuorum

* Fix proposal.InvalidPrepareJustificationValue

* Fix proposal.InvalidPrepareJustificationRound

* Delete commit.InvalidCommitData and prepare.InvalidPrepareData

* Mark decided.CurrentInstancePastRound and decided.CurrentInstanceFutureRound as fixed

* Fix decided.CurrentInstance

* Delete roundchange.JustificationInvalidPrepareData

* Delete roundchange.JustificationWrongValue

* Fix decided.CurrentInstance root

* Remove roundchange.InvalidRoundChangeData

* Fix issues in remaining round change tests

* Fix decided.InvalidValCheckData

* Mark decided.InvalidValCheckData as fixed

* Mark recently fixed round change tests as fixed

* Delete proposal.JustificationsValueNotJustified

* Fix ssv sanity tests

* Remove debug print

* Fix DecidingMsgsForHeight

* Fix returned error if no running duty on consensus message processing

* Fix consensus.PostFinish test

* Fix ssv tests

* Fix qbft tests

* Fix preconsensus.InvalidMessageSlot test name

* Generate JSONs

* Fix consensus.NoRunningDuty

* Fix tests in message_container_test.go

* Generate JSONs

* Fix running consensus.PostFinish from TestJSON

* Generate JSONs

* Fix consensus.PostFinish

* Generate JSONs

---------

Co-authored-by: Alon Muroch <[email protected]>
Co-authored-by: aaron <[email protected]>
Co-authored-by: aaron-blox <[email protected]>

* types encoding tests + json (#169)

* increase test timeout to 25min

---------

Co-authored-by: Alon Muroch <[email protected]>
Co-authored-by: Nikita Kryuchkov <[email protected]>
Co-authored-by: aaron <[email protected]>
Co-authored-by: aaron-blox <[email protected]>
…#167)

* fix: missing `Slot` in `PartialSignatureMessages` construction

* test for correct slots in `MsgProcessingSpecTest`
* WIP comparable state spec tests

* qbft happy flow with state

* WIP ssv comparison works

* comparables (to be deleted_)

* removed custom diff

* revert changes to pass tests

* helper functions for ssv state comparison

* happy flow sync committee state comparison

* wip happy flow sync committee state comparison

* state comparison struct + separating state comparison to files with suffix "_sc"

* qbft state comparison refactor

* all ssv spec tests
* fixed github pipline + json testing

* fix prev

* fix create json test

* lint fix

* fix prev
* SSV spec tests speed up

* qbft spec tests speed fix

* ssv json spec test sparallel

* revert back to single make test
* message max size fixes + calculation

* regenerate ssz

* increase max SSVMessage data size to accommodate qbtf signed message

* fixes + explanations

* regenerate ssz and json specs (recerted qbft message size to not break)
* copied all changes

* lint fix

* merge fixes

* fixed merge first height future message

* fix no running instance test

* spec test naming issue resolved

* lint fix

* TMP - faster ssv tests

* fixes

* all tests pass + json

* last few fixes

* move isFutureMessage outside of func

* Update qbft/spectest/tests/controller/futuremsg/first_height_not_started.go

Co-authored-by: Gal Rogozinski <[email protected]>

* Update qbft/spectest/tests/controller/futuremsg/first_height_started.go

Co-authored-by: Gal Rogozinski <[email protected]>

* remvoe cosnensus/no_running_consensus_instance test

In the past it tested cases in which a consensus message is received but no running qbft instance is present.
After a few changes in the code (over the past few months) in such cases it will either be a future message or carrying a pre-consensus in which case a qbft instance will be started.

Essentially it doesn't test anything anymore

* bundled fixes from review

* highest decided comparison readability

* renaming func

* invalid data func comment

* merge fixes

* fix expected error

* Update ssv/spectest/tests/runner/pre_consensus_justifications/invalid_msg_type.go

* Update ssv/spectest/tests/runner/pre_consensus_justifications/invalid_slot.go

* fix comment of auto suggestion

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* Fix decided.InvalidFullData and proposal.InvalidValueCheck

* Implement messages.MarshalJustifications, messages.MarshalJustificationsWithFullData, messages.UnmarshalJustifications

* Fix MarshalJustifications and MarshalJustificationsWithFullData

* Fix code review requests

* resolve merge conflicts

* make generate-jsons

---------

Co-authored-by: olegshmuelov <[email protected]>
Co-authored-by: Gal Rogozinski <[email protected]>
* move rootgetter interface to types package

* use existing interface & move to independent file

* get rid of RootRegister map global state

* use Root interface everywhere possible
* Implementation

* upgrade go-eth2-client v0.15.8

* proposerCalls interface change

* versioned block spec tests

* generate test json

* include all versioned block spec tests

* remove unused fields

* use block version instead of hardcoded

* keep only Bellatrix block version
* ssv comparable state

* use qbft state comparison struct

* rename import pkg name

* add sc to controller spectest

* add sc to controller sync spec test

* Pr/215 ssv comparable state (#2)

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* wrong message type check

* generate json
MatheusFranco99 and others added 30 commits February 12, 2024 10:22
* Add singleton pattern for TestingKeyManager

* Invert lock place

* Use fnv
* Non-duplicated late proposal

* Drop instance data for height 1

* generate-jsons

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* Equal height no running instance

* Invalid hash data root [skip ci]

* Invalid Justification Unmarshalling [skip ci]

* Marshal Justifications [skip ci]

* Round change justification unmarshalling [skip ci]

* Prepare justification unmarshalling

* Valid Hash Data Root [skip ci]

* SSZ Marshalling [skip ci]

* Round-Change Prepared

* Fix lint. Get error from unmarshal call

* Check encoded message and message root.

* Extend StartHeight for post state

* add to tests all and generate

* generate-jsons

* generate-jsons

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* Invalid then quorum pre consensus test

* Invalid then quorum post consensus test

* Generate tests

* generate-jsons

* Fix blinded proposer runner test

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* Wrong duty role

* Wrong duty pubkey

* Generate ssv tests

* generate-jsons

---------

Co-authored-by: Gal Rogozinski <[email protected]>
* Add SignedSSVMessage

* Add SSZ encoding

* Test structures for SignedSSVMessage

* Test utils and encoding test

* Tests

* Generate tests

* Adapt message validation

* Fix expected error; Bring back commented tests

* Add comment on signature

* Adjust ssz-max in SignedSSVMessage

* Include RSA check in test

* Generate JSONs

* Change SignedSSVMessage encoding

* Generate JSON

* Add message validation interface

* Fix lint. Remove unused functions

* Apply comments

* Apply suggestions
* Add SignedSSVMessage

* Add SSZ encoding

* Test structures for SignedSSVMessage

* Test utils and encoding test

* Tests

* Generate tests

* Adapt message validation

* Fix expected error; Bring back commented tests

* Add comment on signature

* Adjust ssz-max in SignedSSVMessage

* Include RSA check in test

* Generate JSONs

* Optimistic approach in pre-consensus messages

* Extend optimistic approach to pre-consensus

* Extend to post-consensus

* Add approach to validator reg. and exit duties

* Add errors

* Rename fall back function

* Check duplicated signature case

* Add in-committee check

* Fix unknown signer error messages

* Drop expected error in invalid signature since it's deprecated

* Change invalid beacon sig test to trigger error once quorum is reached

* Drop errors in invalid then quorum test

* GenerateTests

* Fall back and verify for all roots

* Test: Invalid quorum then valid quorum

* Test: invalid quorum then valid quorum for pre-consensus

* Fix name

* Generate tests

* Fix lint

* remove commits from signed ssv message branch

* Fix revert issues. Generate tests

* Simplify if clause
* Drop BLS check where redundant

* Check that the message signers belong to the instance committee

* Add signer in committee check for proposal

* Fix tests error msgs. Drop old tests

* Refactor into WithVerification NoVerification functions

* Drop unnecessary config arguments

* Add msg.Validate() tests for round-change

* Remove unused argument

* Add NetworkPubKey to Operator

* Fix roots due to changes in field names in the Operator type

* Generate JSON tests

* Make validator.ProcessMsg receive a SignedSSVMessage; Add SignatureVerifier module to Validator

* Add validation checks to Validator.ProcessMessage

* Testing util for SignedSSVMessage conversion

* Add SignedSSVMessage to tests

* Generate tests JSON

* Add tests for Validator.ProcessMessage

* Generate tests JSONs

* Rename BeaconPubKey to SharePubKey

* Fix roots due to the field name change

* Generate tests JSONs

* Store SignedSSVMessage in broadcaster

* Rename NetworkKey to SSVKey

* Fix tests roots due to name change

* Generate JSON tests

* Rename NoVerification to IgnoreSignature

* Test msg with invalid signature for runner-consensus

* Split signer into SSVShare and SSVOperator. Rename SSVKey to SSVOperatorKey

* Add mutex and fix test roots

* Generate test JSONs

* Fix lock usage

* Drop duplicated check in msg validation

* Verify RSA signatures of broadcasted messages

* Apply suggestions

* Add suggestions

* Change decode and verify order

* Rename SSVOperatorKeys to OperatorKeys in testing util

* Define signature to have 256 bytes

* Rename Network to Operator in tests
* implementation

* generate tests
* implementation

* reorg params

* use GetID for message id
Meta - rename Go module to `ssvlabs` (#385)
* remove ProducesBlindedBlocks from usage

* generate tests.json without producedBlindedBlock

* remove blinded block condition

* generate new tests files

* comment unrelevant tests

* comment unrelevant tests

* comment unrelevant tests

* comment unrelevant tests

* comment unrelevant tests

* remove sig from signedBlock

* remove sig from signedBlock

* add signature

* upgrade go-eth2-client to latest

* add back all tests

* remove generated tests

* generate new tests

* generate new tests

* removed unnecessary variable declerations

* removed unused GetBlindedBeaconBlock

* fix lint by removing unreachable code

* update go-eth2-client to match ssv v0.21.3 and align generate.go to the same version

* update go-eth2-client to match ssv v0.21.3 and align generate.go to the same version

* update go-eth2-client to match ssv v0.21.1 and align generate.go to the same version

* update go-eth2-client to match implementation

* update go-eth2-client to match ssv v0.21.3 and align generate.go to the same version

* return whitespace between imports

---------

Co-authored-by: guy muroch <[email protected]>
Co-authored-by: moshe-blox <[email protected]>
* update go

* add .x

* up actions versions
* init wip

* process consensus msg wip

* Replace to "attestation and sync committee" tests. Duties tests

* new share and operator

* cluster validations

* add methods to operator and share

* validation with message ID

* beacon types encoding

* use operator instead of share

* more changes to cluster runner

* beacon_types.go + partial_sig

* Extend SignedSSVMessage to multiple signers and add FullData

* Update tests and utils to multiple signers change

* post consensus

* use operators

* shares

* shares

* more error fixes

* Deprecate SignedMessage and use SignedSSVMessage

* Deprecate SignedMessage in testingutil

* Deprecate SignedMessage in tests

* Generate JSON tests

* Deprecate SignedPartialSignature to use PartialSignatureMessages

* Deprecate SignedPartialSignature in testingutils

* Deprecate SignedPartialSignature in tests

* Fix lint issues. Add change to msg validation

* Generate JSON tests

* more error fixes

* Apply renaming suggestions

* Generate JSON tests

* fix one more conflict

* fix more conflicts

* resolved merge conflicts

* comment out code in validator.go

* remove operator id from signer

* rename

* more changes

* more changes

* Deprecate ShareSigner, KeyManager and DKGSigner

* runner roles

* use operator ID in messages again

* fix preconsensus justifications

* cluster runner finds validators

* use committee to verify partial sig

* renaming, some helpers added, adopted to work with ssv.RoleCluster

* added missing .QBFTController to access the share. Added primitive getValPubKeyByValIdx impl

* Implemented valid test for runners/new_duty

* added decided.go tests

* rename cluster to committee

* add GetOperatorSigner

* fix runner signatures

* add operator signer to validator registration

* Decode CD for BeaconVote

* delete legacy runners

* rename files

* fixed most of the /runners/newduty/ tests. #384

* stop duties

* stop duties

* cutoff round

* fix newduty/test.go

* added changes to post_invalid_decided.go

* fixed some compilation errors

* fix committee_runner broadcasting

* fix committee_runner broadcasting

* value check

* New message structures with RSA signature (#382)

* Extend SignedSSVMessage to multiple signers and add FullData

* Update tests and utils to multiple signers change

* Deprecate SignedMessage and use SignedSSVMessage

* Deprecate SignedMessage in testingutil

* Deprecate SignedMessage in tests

* Generate JSON tests

* Deprecate SignedPartialSignature to use PartialSignatureMessages

* Deprecate SignedPartialSignature in testingutils

* Deprecate SignedPartialSignature in tests

* Fix lint issues. Add change to msg validation

* Generate JSON tests

* Apply renaming suggestions

* Generate JSON tests

* Deprecate ShareSigner, KeyManager and DKGSigner

* Fix merge issues

* use OPERATORID

Co-authored-by: Matus Kysel <[email protected]>

* use struct map

* delete unused getters

---------

Co-authored-by: Gal Rogozinski <[email protected]>
Co-authored-by: Matus Kysel <[email protected]>

* add comments

* no need for comment actually

* validations for post consensus msg

* work with beaconVote and consensus_data in seperate

* delete unneccessary fields

* fic errors

* Fix StartDuty

* fixed circular dependencies

* partially fixed /ssv

* fix testingutil

* fix types

* removed partial quorum & fixed qbft tests

* fixed run_test.go

* Fix msg processing spectest in ssv

* fixed valcheck/test.go

* Fix ssv runner tests

* fixed lint errors

* Implement panics in runners

* Fix type tests; Delete old attestation and sync committee CD tests

* Fix qbft test specs and roots

* Generate JSON tests

* Solve some errors in ssv tests (fix unknown validator check, add validator index field, fix cgo issue, fix nil pointer issues)

* Add custom json marshal for runner state. Fix typo that broke tests

* Fix typos, implementation and testing utils

* Fix ssv test issues. Fix consensus data fields

* Fix typo. Comment old attestation valcheck tests

* Generate JSON tests. Removed unused functions for lint

* minor runner fixes

* Add custom encoding for start duty test (to deal with the duty interface)

* fixed linter error + commented all non-working tests

* Re-enable all tests and generate JSON

* Refactor testing duties

* Consensus not started and decided tests

* Add tests: duplciate duty, finished, first height, not decided

* Add tests: post (future, invalid, wrong) decided

* Make validator receive Duty to start duty (and not BeaconDuty)

* Make MsgProcessingSpecTest handle duty interface. Add valid consensus msg test

* Fix CommitteeRunner type assertion

* Fix sync committee post-consensus signed object

* Add consensus valid decided test

* Generate JSON tests

* Add tests: valid decided 7, 10, 13

* Fix expected root and object calculation. Test: post finish attestation

* Add consensus tests: post finish, post decided, past msg and invalid signature

* Add tests: invalid decided, future msg, future decided and future decided no instance

* Generate JSON tests

* Add post consensus tests: valid, unknown signer, unordered roots

* Deprecate DomainCommittee. Add test: too many roots

* Add post consensus tests: quorum and too few roots

* Add post consensus tests: pre decided, post quorum, post finish, no running duty, nil msg

* Add post consensus tests: invalid msg (slot, msg, operator sig), invalid then quorum, invalid quorum then valid quorum

* Add post consensus tests: invalid (msg sig, root, value, beacon sig), incosistent signer, duplicate msg (diff root, diff root then quorum)

* Generate JSON tests

* Fix lint (unreachable code)

* Add new post-consensus test: wrong validator index

* rename bloxapp->ssvlabs

* solve more conflicts

* generate ssz

* more bloxapp->ssvlabs

* fix error

* remove double line

* fix test

* generate jsons

* fix qbft roots and generate jsons

* add TODO

* review comments rename sender

* better comment

* fix typo

* change int to round

* functions not in use

* clusterID -> committee ID

* mistmatch typo

* rename in generate.go

* commit suspicious files

* PR comments

* use encoder interface

* Alan Domain (#394)

* Add Alan Domain

* add to mainnet forks

* Fix value check (#396)

* use ValidaotrPK

* update value_check.go

* fix error

* fix tests

* add attestation_slashable check to post_consensus

* fix signature

* fix committee_runner.go

* add test stubs

* fix all tests

* nolint

* new tests.json

* fix slashable.go

* make value_check fail if there's a majority of slashable attestations

* add committeeIndex

* check only in consensus data

* delete unneeded test

* fix -1

* use same committeeIndex

* Fix role mapping in MapDutyToRunnerRole (#397)

* Fix role mapping in MapDutyToRunnerRole

* Replace types.MapDutyToRunnerRole(data.Duty.Type) with data.Duty.RunnerRole()

* Convert unit test for MapDutyToRunnerRole into duty spec tests

* Cluster consensus tests (#391)

* Define wrong beacon vote in testingutils

* Add validator pubkeys in testingutils

* Add tests: start duties (attestation, sync committee, mixed, non duties)

* Add tests: maximum possible duties, valid CD, wrong CD, decided

* Generate JSON tests

* Add testing utils for 500 validators shares

* Add testing util for committee runner with multiple shares

* Allow PartialSignatureMessages to have at most 1000 signature messages

* Add post consensus message for decided test with 500 validators

* Generate JSON tests

* Fix lint

* Apply suggestions

* Fix CommitteeMsgID to use ClusterID

* Make MsgProcessingSpecTest use Committee object for CommitteeRunner instead of Validator

* Add validation and nil check for Committee

* Adjust tests errors. Add happy flow test

* Generate JSON tests

* Introduces spec test for Committee. Refactor msg and beacon root comparison

* Refactor TestingShare

* CommitteeRunnerWithShareMap and BaseCommittee testing utils

* Add share to Committee

* Add MultiTest for Committee

* Change committee tests directory and spec type

* Generate JSON tests

* Refactor test to encompass multiple number of validators in one test file

* Fix committee runner: track submitted duties, validators for sync committee, beacon object for sync committee

* Add test: partially invalid quorum (bad root) then valid quorum

* Generate JSON tests

* Change CommitteeRunner to check validity of reconstructed signature for all duties

* Add test: partially invalid quorum (bad beacon sig) then valid quorum

* Fix lint issue due to merge

* Add test: Happy flow for the committee spec test

* Fix CommitteeRunner: return BeaconObject based on validator and root

* Add test: mixed committees

* Testing util: add slot to post consensus sync committee message

* Fix Committee: Track highest duty slot for a general duty type

* Add test: past msg. Fix committee spec test

* Change CommitteeRunner: Drop slot from submitted duties map and reset it upon new duty

* Apply suggestions

* Fix lint issues

* Remove deprecated syncMsg.ValidatorIndex fix

* Rename past msg test. Add stub tests

* Test: CommitteeRunner - Proposal with consensus data (#399)

* Refactor previous test names to use beacon vote

* Add test: proposal with consensus data

* Generate JSON tests

* Tests: Past msg for committee (#403)

* Add test: past msg for finished duty

* Add test: past msg for duty that does not exist

* Tests: BeaconVote encoding and value check tests (#402)

* Add encoding test

* Extend KeyManager testing util to store slashable data root per validator

* Extend value check test to allow using slashable root per validator

* Add tests: majority and minority slashable

* Add duty value check test cases for the committee role

* Apply suggestions

* zip json (#407)

* Tests: Cluster consensus - Several duties (#401)

* Refactor existing committee tests to the new committeesingleduty package

* Implement singleton pattern for TestingVerifier for speed-up

* Extend "compare output" functionality to handle msgs asynchronicity

* Use new network for each new committee runner; fix slot/height in some testingutil messages

* Add test: sequenced decided duties

* Add test: sequenced happy flow duties

* Fix: avoid concurrent read and writes

* Fix Committee: Add nil check to BeaconDuty

* Add test: shuffled decided duties

* Compare output messages in asynchornous order only for committee spec test (go back to original compare function)

* Reduce size of tests.json by removing big tests

* Add test: shuffled happy flow duties with the same validators

* Generate JSON tests

* Refactor input, output and beacon root to testing utils

* Refactor committee tests utils (input, output, beacon roots)

* Add test: shuffled happy flow duties with different validators

* Add test: failed duties then successful duties

* Improve test comment

* Enable test cases with 500 validators

* Add cache to TestingKeyManager to speed up tests

* add json.gz

---------

Co-authored-by: Gal Rogozinski <[email protected]>

* up go-eth2-client (#408)

* Added Committee Validation to Message (#395)

* rename clusterID to committeeID

* add missing validate message

* fix bad copy

* fix runner

* fix base runner

* fix getID for future decided no instance

* generate jsons

* fix lint

* add test

* generate jsons

* mov wrong_message_id.go

* add jsons

* generate json again

* non-empty messages

* Revert "rename clusterID to committeeID"

This reverts commit 7272f3d.

* fix back to bad name

* regenerate jsons

* regenerate more jsons

* Cluster consensus fixes (#390)

* small fixes

* fix errors

* add comment

* delete expected error from tests

* add error and fix test

* add expected error

* add more expected error

* fix committee_runner.go and tests

* restore_pastmsg

* Remove test cases with 500 validators (#409)

Co-authored-by: Gal Rogozinski <[email protected]>

* Validate empty duties (#410)

* validate beacon duties are not empty

* add no duty test

* fix comment and don't use multispectest

* Allow committee duties to run in parallel (#412)

* delete filter

* add slashing protection for attestations

* working version of test

* add comment

* add to all tests

* remove isStopped

* fix ssz encoding

* add jsons

* key manager clone

* remove expected error from test

* fix shuffled haapy_flow_duties

* generate jsons

* properly generate, marshal and unmarshal json

* Refactor TestingKeyManager to hold an immutable structure (TestingKeyStorage) that holds the keys

* Remove double-check to solve race condition

* Fix race condition in singleton double-check

* Remove extra newline

---------

Co-authored-by: MatheusFranco99 <[email protected]>

* Fix DomainType in CommitteeRunner (#414)

* Fix DomainType used in MsgID

* Remove TODO text

* Fix race condition in testing verifier

* Use sync.Once for singleton constructor

* Remove unnecessary lock usage in creation

* Fix/api (#416)

* It could be that roots will be missing.. we still want to proceed

* make GetAttestations parameters optional

* Fix runner state in MessageProcessingSpecTest (#413)

* Fix runner's empty state in tests

* Generate JSON tests

* Revert to use always test.Runner for state. Use test.Runner in CreateRunnerFn

* Refactor BaseCommitteeWithRunnerSample to BaseCommitteeWithCreatorFieldsFromRunner

* Fix quorum (#417)

* change position of variable so name will make sense

* new way to get quorum

* return uint64 for ssz

* make ssz

* fix errors

* add operator test and delete unneccessary share test

* delete share tests

* change all tests

* generate jsons

* fix test

* remove quorum from runner

* add threshold to newduty test

* generate jsons

* generate more jsons

* fix json

* fix proposal and prepare

* fix roundchange and commit

* fix rest of tests

* fix types

* more jsons

* Rename structures (#420)

* Rename Operator->CommitteeMember and CommitteeMember->Operator

* Remove fixed post root strings

* Generate JSON tests

* Generate SSV JSON tests

* Align structures' comments

* Remove old comment

* Rename qbft.Controller.Share to CommitteeMember

* Rename qbft.State.Share to CommitteeMember

* Generate JSON tests. Fix BaseRunner's Share's JSON mapping

* remove TODOs

* Remove needless constructor (#424)

* refactor function

* remove needless constructor

* refactor signing

* Alan - New message sizes (#398)

* use domain from controller (#425)

* BeaconNode: Submit multiple attestation duties (#428)

* Update BN interface to submit multiple attestations

* Adjust CommitteeRunner to submit multiple attestations at once

* Generate JSON tests

* Apply suggestions

* Change Spec.MD (#426)

* use committee mapping

* remove all sync protocols

* rename BeaconDuty -> ValidatorDuty

* delete unused function

* ConsensusData update (#431)

* Change BeaconVote location

* Rename ConsensusData to ValidatorConsensusData

* Propagate ConsensusData renaming to ValidatorConsensusData

* Propagate renaming to testingutils and maxmsgsize tests

* Rename ConsensusDataTest to ValidatorConsensusDataTest

* Propagate renaming to ssv tests

* Rename directory from consensusdata to validatorconsensusdata

* Generate JSON tests

* rename argument in NewMsgID function

* Move json utils to a testutils file (#432)

* Move all qbft encoding, decoding and root methods to a separate json_testutils file

* Move all ssv encoding, decoding and root methods to a separate json_testutils file

* add comment

* use encoder interface (#438)

* Remove convenience functions (#435)

* Remove CreateValidatorConsensusData convenience function

* Remove GetOperatorIDs function from SignedSSVMessage

* Remove SSVMessageToSignedSSVMessage convenience function

* Remove PartialSignatureMessagesToSignedSSVMessage convenience function

* Remove NewBeaconVote convenience function

* Calculate CommitteeID when creating message IDs (#433)

* add DomainType to CommitteeMember

* give domain value in tests and fix generate

* generate files

* Use PEM exclusively (#430)

* use pem

* generate jsons

* update ssz size

* update ssz size

* Delete preconsensus justifications (#436)

* add DomainType to CommitteeMember

* give domain value in tests and fix generate

* generte files

* delete preconsensus justifications

* remove justifications from consensus_data.go

* remove justifications from tests

* one more fix

* generate files

* fix lint

* fix message size

* fix encoding

* correct comment

* generate files

* fix size again

* generate files

* Update ssv/committee_runner.go

Co-authored-by: rehs0y <[email protected]>

* Add ProcessingMessage structure to QBFT (#440)

* Add ProcessingMessage structure

* Use ProcessingMessage in MsgContainer and State

* Use ProcessingMessage in qbft Instance and associated functions

* Use ProcessingMessage in qbft controller

* Update qbft tests with ProcessingMessage

* Update ssv tests with ProcessingMessage

* Use ProcessingMessage in p2p msg validation

* Generate JSON tests

* Use ProcessingMessage validation (unify validations)

* Adjust test error string

* Remove ProcessingMessage from ssz generation

* Remove unnecessary decoding check

* Use GetShare to avoid duplicated code (#443)

* Use GetShare to avoid duplicated code

* Use GetShare to avoid duplicated code

* Refactor PartialSigContainer.HasSigner: avoid duplication code and rename (#444)

* Use GetSignature in HasSigner to avoid duplicated code

* Rename HasSinger to HasSignature since we're looking for a signature

* Fix RunnerRole argument name (#445)

* Use naming in complex nested map (#446)

* Use naming to improve readability of nested map

* Add comment to better explain nested map

* Apply suggestion

* remove ECRecover

* Complete SignedSSVMessage tests (#441)

* Add SignedSSVMessage missing tests

* Rename file according to test name

* Add missing SignedSSVMessages tests in qbft

* Add missing SignedSSVMessages tests in ssv postconsensus

* Add missing SignedSSVMessages tests in ssv preconsensus

* Generate JSON tests

* Remove SignedSSVMessage tests from QBFT/messages

* Add SignedSSVMessage validation tests in SSV/Runner/Consensus

* Generate JSON tests

* Generate JSON tests

* CommitteeRunner: allow signatures of unknown validators (#442)

* Do validator index validation, in psig messages, for validator duties only

* Drop expected error (unknown validator index) for committee runners

* Add quorum of invalid validator index test to trigger "could not find validators for root"

* Allow unsyced validators set: use "continue" if a validator is not found for a root in CommitteeRunner

* Test quorum for unknown validator index and a known one (tests the continue command)

* Generate JSON tests

* Apply suggestion

* Remove unknown validator edge case error

* Remove deprecated error in tests. Make explicit the ValidatorIndex associated with the submitted beacon root.

* Take RSA Signer and Verification out of configuration (#447)

* make operator signer concrete type

* add RSA verifier

* move verify code

* use signer and verifier

* more fixes

* fix tests

* fix config

* more fixes

* fix qbft tool

* sign correctly

* generate-jsons

* remove testing verifier

* generate jsons

* omit json

* omit operator signer from json

* fix jsons

* Cleanup (#450)

* remove empty files

* remove unused crypto functions

* move deposit data file to testutils

* Remove leftover: HighestDutySlotMap in CommitteeAlias (#456)

* Remove deprecated HighestDutySlotMap field from CommitteeAlias

* Generate JSON tests

* TestingKeyManager: Slashing by Slot (#449)

* Use slots instead of data root to do slashing check

* Adjust ValCheck SpecTest to use slashable slots

* Adjust test cases

* Add test case for a valid BeaconVote with a slot that is different than the slashable slot

* Fix ValueCheck in testing runners (#457)

* add share pubkey to proposer check in tests

* add share pubkey to runner in testutils

* fix test runner to use correct km in valcheck

* Change baseRunnerWithShareMap to use ValueCheck with the same KeyManager

* Remove extra unnecessary value check

* Revert "Remove extra unnecessary value check"

This reverts commit 4027756.

* Drop extra redundant slashing check

* Fix slashingRoot added for concurrent slashing decideds check

* Align new error in test

* Remove unused functions

---------

Co-authored-by: Gal Rogozinski <[email protected]>

* remove comment

* add comment

* moved decided value to runner

* Simplify comparison methods (#461)

* Fix CompareSignedSSVMessageOutputMessages. Refactor and simplify comparison methods

* Generate JSON tests

* Refactor to remove duplicated code

* update ssz

* make generate-ssz

* use global cutoff time of 12

---------

Co-authored-by: Lior Rutenberg <[email protected]>
Co-authored-by: MatheusFranco99 <[email protected]>
Co-authored-by: Anton Korpusenko <[email protected]>
Co-authored-by: Matus Kysel <[email protected]>
Co-authored-by: Nikita Kryuchkov <[email protected]>
Co-authored-by: rehs0y <[email protected]>
* Filter shares for slot `CommitteeRunner` based on validators that have duty for that slot.

* Filter duty and create share map according to owned validators

* Add test: start duty with no shares for duty's validators

* Add test: happy flow for committee with fraction of duty's validators

* Generate JSON tests

* Apply suggestions

---------

Co-authored-by: MatheusFranco99 <[email protected]>
* Update go1.20 to go1.22

* Update go.sum with mod tidy
* Update dependencies

* Fix lint issue

* Generate JSON tests to trigger actions

* Update fastssz

* Generate JSON tests and align ssz error

* Revert go-eth2-client version change

* Revert fastssz upgrade

* Generate SSZ and JSON tests
* Solve potential file inclusion via variable

* Fix file permission (0644 to 0600)

* Add nosec comment for PRNG (pseudo-random number generator) used for testing

* Fix lint issue on nil check in []byte type

* Update permission from 0444 to 0600

* Update 0444 to 0400
* Remove nolint comment and export timeout variables

* Drop unnecessary nolint

* Add comment

* Fix lint issue
* Add share length validation in runner construction

* Align to error handling in runners constructions

* Add validation to committee runner

* Add runner construction tests

* Refactor runner construction in testingutil to deal with creation errors

* Generate JSON tests

* Fix lint issue

* Fix comments
* Remove redundant validation

* Align error string
* Sort signers in decided message

* Add test for sorted signers in decided msg

* Generate JSON tests

* Fix lint issue
* Stop processing consensus messages after instance is decided

* Align error in qbft tests

* Align errors in ssv tests

* Generate JSON tests

* Fix lint issue
* Remove leftover err check

* Align argument variable name to type
* Implement secure key storage using PKCS8

* Fix lint issue

* Switch back PKCS8 to PKCS1
* Remove DKG signature type

* Remove DKG msg type

* Remove DKGOperators field from TestKeySet

* Remove unused ecdsaKeys field from TestingKeyStorage

* Remove unused "ecdsaSKFromHex" function

* Generate JSON tests
* Add github action and makefile command

* Fix issues in round robin proposer function

* Fix bad PutUint32 in GetCommitteeID

* Fix issue with HasQuorum and HasPartialQuorum

* Add role sanitization in GetRoleType and NewMessageType

* Add sanitization to BeaconNetwork methods

* Add sanitization in testingutils

* Add sanitization to height usage in test files

* Fix uint64 conversion in runner/postconsensus/valid_msg test

* Sanitize ValidatorIndex conversion

* Update action name

* Fix tests to use valid RunnerRoles

* Generate SSZ

* Generate JSON tests

* Revert the change on GetCommitteeID

* Add nosec G115 to GetCommitteeID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.