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

Move domainType from CommitteeMember and Share to Network #494

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from

Conversation

alan-ssvlabs
Copy link

domainType was stored in CommitteeMember and Share, this PR creates a config for the ssv package and stores domainType in config. Config is stored in BaseRunner, as all runners should have the same domainType.

Json files are regenerated and modified as a result of the change of CommitteeMember, Share, and BaseRunner structures.

Copy link
Contributor

@MatheusFranco99 MatheusFranco99 left a comment

Choose a reason for hiding this comment

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

Good work! Just some questions

qbft/state.go Outdated Show resolved Hide resolved
types/testingutils/runner.go Outdated Show resolved Hide resolved
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.

It seems that moving this to Config is somewhat incorrect. This is because Config in our case is a qbft config, and shouldn't be used as part of SSV.

Imo it is better to move this to be something returned by the Network interface (in types.go). This is because Network is an interface that is used by both the ssv and qbft modules.

@moshe-blox and @MatheusFranco99... wdyt?

I also take this opportunity to note that changing DomainType dynamically (due to forks or network switch) isn't covered by the spec. The spec should always assumes a node running on a specific network for a specific fork.

@MatheusFranco99
Copy link
Contributor

@GalRogozinski
It seems fine for me to put DomainType into Network.

@alan-ssvlabs alan-ssvlabs changed the title Move domainType from CommitteeMember and Share to Config Move domainType from CommitteeMember and Share to Network Sep 4, 2024
@alan-ssvlabs
Copy link
Author

@GalRogozinski @MatheusFranco99 Now domainType is in Network instead of config, I think it is indeed a better place for it. Please check, thank you!

y0sher and others added 12 commits September 12, 2024 14:40
* 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 <48058141+MatheusFranco99@users.noreply.github.com>
* 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
@GalRogozinski
Copy link
Contributor

Fixes #439

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.

lgtm, it's about time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants