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

testutil/validatormock: implement #187

Merged
merged 2 commits into from
Mar 7, 2022
Merged

testutil/validatormock: implement #187

merged 2 commits into from
Mar 7, 2022

Conversation

corverroos
Copy link
Contributor

To test signature aggregation, we need to create signatures. This add a validator client mock that performs attestations, including signatures as per spec. This will be used to test the SigAgg component.

category: testing
ticket: #184

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@f0bc829). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage        ?   52.61%           
=======================================
  Files           ?       43           
  Lines           ?     2693           
  Branches        ?        0           
=======================================
  Hits            ?     1417           
  Misses          ?     1123           
  Partials        ?      153           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0bc829...4714c70. Read the comment docs.

Comment on lines +87 to +88
aggBits := bitfield.NewBitlist(duty.CommitteeLength)
aggBits.SetBitAt(duty.ValidatorCommitteeIndex, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dB2510 here you can see that validator client includes duty.CommitteeLength and duty.ValidatorCommitteeIndex in the signed attestation. That is what we extract in the validatorapi to identify the DV the ParSignedData belongs to.

Copy link
Contributor

@dB2510 dB2510 Mar 7, 2022

Choose a reason for hiding this comment

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

yeah got it! now dots are connecting :')

Copy link
Contributor

@dB2510 dB2510 left a comment

Choose a reason for hiding this comment

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

Looks great! 🚀

eth2client.AttestationDataProvider
eth2client.AttesterDutiesProvider
eth2client.AttestationsSubmitter
eth2client.SlotsPerEpochProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

alphabetical order maybe here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

// Signature stub function
signFunc := func(ctx context.Context, key eth2p0.BLSPubKey, _ eth2p0.SigningData) (eth2p0.BLSSignature, error) {
var sig eth2p0.BLSSignature
copy(sig[:], key[:])
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do actual signature using kryptology?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This make it easy to see which pubkey signed in the testdata.

@corverroos corverroos merged commit 518a573 into main Mar 7, 2022
@corverroos corverroos deleted the corver/validatormock branch March 7, 2022 11:20
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.

None yet

2 participants