Skip to content

Conversation

@alan-ssvlabs
Copy link
Contributor

@alan-ssvlabs alan-ssvlabs commented Aug 27, 2024

Fixes #465, this PR removes getter functions that do not require computations.

y0sher and others added 16 commits July 22, 2024 16:23
* 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
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 job!

c.OperatorSigner = aux.OperatorSigner

return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

how come this is added here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Before, config was private (first letter lowercase), so it didn't appear in JSONs. With GetConfig being dropped and config$\to$Config switching to a public attribute, it started appearing in JSONs. However, it can't be unmarshalled due to its function types. So, it was necessary to hide the config in the custom marshalling.

Note: in tests, we fill the Config attribute with the default testing values.

Right @alan-ssvlabs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally correct, thanks Matheus

Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to add json:"-" next to config to make serialization ignore this field and remove the extra code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't know this can work, updated, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't know this can work, updated, thanks!

```go
func MsgID(msg) string {
return string(sha256(msg.GetData())[:20])
return string(sha256(msg.Data)[:20])
Copy link
Contributor

Choose a reason for hiding this comment

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

Good

@github-actions
Copy link

github-actions bot commented Aug 3, 2025

This pull request has been marked as stale due to 60 days of inactivity.

@github-actions github-actions bot added the stale label Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants