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

tbls: revert changes to TSS struct #149

Merged
merged 2 commits into from
Mar 1, 2022
Merged

tbls: revert changes to TSS struct #149

merged 2 commits into from
Mar 1, 2022

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented Feb 28, 2022

Reverts #136 by decoupling the dependency on TSS struct from scheduler, rather provide public keys directly.

category: refactor
ticket: #145

Threshold int
// Threshold returns the minimum number of partial signatures required to aggregate the threshold signature.
func (t TSS) Threshold() int {
return len(t.verifier.Commitments)
}

func NewTSS(verifier *share.FeldmanVerifier, numShares int) (TSS, error) {
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 think it is good to still calculate the public key on construction:

  • Then we fail fast if we cannot calculate it, instead of later.
  • Reduces error handling in general.

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #149   +/-   ##
=======================================
  Coverage        ?   54.55%           
=======================================
  Files           ?       30           
  Lines           ?     1976           
  Branches        ?        0           
=======================================
  Hits            ?     1078           
  Misses          ?      792           
  Partials        ?      106           

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 c1d0f18...1f93dc2. Read the comment docs.

Comment on lines 40 to +46
type TSS struct {
Verifier *share.FeldmanVerifier
NumShares int
verifier *share.FeldmanVerifier
numShares int

// PublicKey and Threshold are inferred from verifier commitments in NewTSS.
// publicKey inferred from verifier commitments in NewTSS.
publicKey *bls_sig.PublicKey
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactoring to private fields, with getter methods. To make it explicit that you should use NewTSS for constructing.

Adds unit tests to the scheduler package.

Also adds some helper test utils:
 - app/golden: for golden file testing
 - beaconmock: beacon client mock
 
category: testing
ticket: #145
@corverroos corverroos merged commit 8e6da1e into main Mar 1, 2022
@corverroos corverroos deleted the corver/reverttbls branch March 1, 2022 12:35
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

1 participant