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

New message structures with RSA signature #382

Merged
merged 19 commits into from
Apr 18, 2024

Conversation

MatheusFranco99
Copy link
Contributor

Overview

This PR implements ssvlabs/SIPs#45. It deprecates qbft.SignesMessage and types.SignedPartialSignatureMessage.

Changes

  • Extend types.SignedSSVMessage to include a buffer of signatures to encompass decided messages.
  • Include FullData in types.SignedSSVMessage.
  • Deprecate qbft.SignesMessage and types.SignedPartialSignatureMessage.
  • Change QBFT to process types.SignedSSVMessage.
  • Now, for PreConsensus and PostConsensus, the Runner accepts types.PartialSignatureMessages.
  • Change PreConsensusJustification to hold types.PartialSignatureMessages.

qbft/messages.go Outdated
@@ -108,6 +75,12 @@ func (msg *Message) Decode(data []byte) error {
return msg.UnmarshalSSZ(data)
}

func GetMessageFromBytes(data []byte) (*Message, error) {
Copy link
Contributor

@moshe-blox moshe-blox Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to rename to DecodeMessage or MessageFromBytes and move right below the struct definition since it's a constructor (not significant, just to conform to Go standards)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, better. Thanks!

Comment on lines 133 to 134
Signature [][]byte `ssz-max:"13,256"` // Created by the operators' key
OperatorID []OperatorID `ssz-max:"13"`
Copy link
Contributor

@moshe-blox moshe-blox Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's plural, i'd rename to Signatures and Signers or Operators

although we might consider dropping decideds in which case let's wait with this refactor if its not super quick?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename now to make this PR makes sense
when we have a PR to drop decided we can rename again...

Unless we are sure @moshe-blox that we want to drop decided messages in this fork

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to remind everyone. In the last discussion the options were: Decided messages should either become post-consensus justifications, or be emitted upon an RC messages, or be dropped entirely.

But this has nothing to do with this PR. We can rename in the meanwhile...

Copy link
Contributor

@moshe-blox moshe-blox Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we are sure @moshe-blox that we want to drop decided messages in this fork

it's yet to be decided (🤦‍♂️)

it's your call, but i think it's a quick rename (with IDE) and can be quickly undone if needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the renaming and it's easy to do. Updating it

Comment on lines +3 to +4
//go:generate rm -f ./messages_encoding.go
//go:generate go run github.com/ferranbt/fastssz/sszgen --path messages.go --include ./types.go,../types/signer.go,../types/operator.go --exclude-objs OperatorID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers. We now take the hashing fix that we dropped in #362

Copy link
Contributor

@moshe-blox moshe-blox Apr 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GalRogozinski thanks for noting

@y0sher @lior-blox if you can recall, this is the fastssz bug that broke our backwards compatibility last time, we need to consider how this impacts fork support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break all our message encoding, we'll probably need to use both versions for forking :/

Comment on lines +171 to +175
// - OperatorID must have at least one element
// - Any OperatorID must not be 0
// - The number of signatures and OperatorIDs must be the same
// - Any signature must not have length 0
// - SSVMessage must not be nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

@GalRogozinski GalRogozinski requested a review from y0sher April 14, 2024 14:15
}
}

// AllMessaged returns all messages
func (c *MsgContainer) AllMessaged() []*SignedMessage {
ret := make([]*SignedMessage, 0)
func (c *MsgContainer) AllMessaged() []*types.SignedSSVMessage {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR, but if we already changed this line we can finally fix this typo 😅 (AllMessages)

Copy link
Contributor Author

@MatheusFranco99 MatheusFranco99 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, definitely 😅

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In signer.go can ShareSigner and then in turn KeyManager be deleted so only BeaconSigner is left?

It is fine to delete DKSSigner in the process...

@GalRogozinski
Copy link
Contributor

@MatheusFranco99 conflicts occurred due to #381
I am merging changes from main to alan

return errors.New("no signers")
}
// Check unique signers
signed := make(map[OperatorID]bool)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map[OperatorID]struct{} would be better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noting that from spec perspective we just need to make it readable and we less care about optimized memory allocation.

I guess your way is also readable and since you guys tend to copy-paste from spec I changed.

types/messages.go Outdated Show resolved Hide resolved
OutputMessages: []*qbft.SignedMessage{
testingutils.TestingPrepareMessageWithRound(ks10.Shares[1], types.OperatorID(1), 3),
OutputMessages: []*types.SignedSSVMessage{
testingutils.TestingPrepareMessageWithRound(ks.OperatorKeys[1], types.OperatorID(1), 3),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously this was a different key that is not part of the original set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True!
But reading through the test it seems @MatheusFranco99 was correct with this change...
The reason it passed before is because the tests don't verify sigs, they only compare signing roots

@@ -28,7 +28,12 @@ func (i *Instance) uponPrepare(signedPrepare *SignedMessage, prepareMsgContainer
return nil // no quorum yet
}

proposedRoot := i.State.ProposalAcceptedForCurrentRound.Message.Root
proposalMsgAccepted, err := DecodeMessage(i.State.ProposalAcceptedForCurrentRound.SSVMessage.Data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticied that we are decoding the message multiple times around the code, maybe its worth to consider some approach where we decode once and pass the decoded message as well to functions to reduce the amount of calls to decode..

}

// GetSignature returns the signature of the OperatorID over Data
func (msg *SignedSSVMessage) GetSignature() [256]byte {
return msg.Signature
func (msg *SignedSSVMessage) GetSignature() [][]byte {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name is now tricky imo should be called GetSignatures

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice we don't even call this method along another one so I am simply deleting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah... not sure if we do it now

Comment on lines +261 to +267
found := false
for _, id2 := range ids {
if id == id2 {
found = true
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably used slices.Contains

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok @MatheusFranco99
I think I found some bugs here:

  1. Your comment talks about equality: // MatchedSigners returns true if the provided signer ids are equal to GetOperatorIDs() without order significance. To check equality you need to do two way containment test, not one (maybe there is a util function). But I think the bug is in the comment and not in the logic.
  2. I think you wanted to do a one way containment test, but I think it should be the other way? That is because from func (c *MsgContainer) AddFirstMsgForSignerAndRound I understand we need to check whether all ids are included in msg?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MatheusFranco99 pointed out that this is the same logic as before

So opened #387
Later we inspect and fix in a separate PR

Copy link
Contributor

@y0sher y0sher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented some minor changes, approving in case you want to take them on another PR.

GalRogozinski and others added 3 commits April 18, 2024 11:19
Co-authored-by: Matus Kysel <MatusKysel@users.noreply.github.com>
@GalRogozinski GalRogozinski merged commit 5e65f4d into ssvlabs:alan Apr 18, 2024
2 checks passed
@GalRogozinski GalRogozinski deleted the msg_structures_rsa branch April 18, 2024 13:58
MatheusFranco99 added a commit that referenced this pull request Jun 25, 2024
GalRogozinski added a commit that referenced this pull request Jul 14, 2024
* 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 <MatusKysel@users.noreply.github.com>

* use struct map

* delete unused getters

---------

Co-authored-by: Gal Rogozinski <galrogogit@gmail.com>
Co-authored-by: Matus Kysel <MatusKysel@users.noreply.github.com>

* 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 <galrogogit@gmail.com>

* 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 <galrogogit@gmail.com>

* 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 <48058141+MatheusFranco99@users.noreply.github.com>

* 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 <lyosher@gmail.com>

* 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 <galrogogit@gmail.com>

* 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 <liorr@blox.io>
Co-authored-by: MatheusFranco99 <48058141+MatheusFranco99@users.noreply.github.com>
Co-authored-by: Anton Korpusenko <antokorp@gmail.com>
Co-authored-by: Matus Kysel <MatusKysel@users.noreply.github.com>
Co-authored-by: Nikita Kryuchkov <nkryuchkov10@gmail.com>
Co-authored-by: rehs0y <lyosher@gmail.com>
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.

5 participants