-
Notifications
You must be signed in to change notification settings - Fork 493
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
Integrate State Proof keys #2990
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2990 +/- ##
==========================================
+ Coverage 47.74% 48.06% +0.31%
==========================================
Files 370 381 +11
Lines 60262 62061 +1799
==========================================
+ Hits 28774 29829 +1055
- Misses 28180 28815 +635
- Partials 3308 3417 +109
Continue to review full report at Codecov.
|
data/account/participation.go
Outdated
@@ -121,6 +130,11 @@ func (part Participation) GenerateRegistrationTransaction(fee basics.MicroAlgos, | |||
SelectionPK: part.VRF.PK, | |||
}, | |||
} | |||
if cert := part.BlockProofSigner(); cert != nil { | |||
if cparams.EnableBlockProofKeyregCheck { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens when !cparams.EnableBlockProofKeyregCheck and cert != nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing I guess. The BlockProof key will not be registered in the transaction since it's not yet supported on this protocol version.
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
// Confirm that we got the same root hash | ||
if len(pl) != 1 { | ||
return nil, fmt.Errorf("internal error: partial layer produced %d hashes", len(pl)) | ||
return nil, fmt.Errorf("internal error: partial Layer produced %d hashes", len(pl)) | ||
} | ||
|
||
if validateProof { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateProof is a constant set as false at line 135, when will this block if executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be executed when the feature is enabled. This should definitely change though, you are right.
Probably the a global configuration value needs to replace it, or perhaps some flag from the protocol params.
Will check on that.
gen/walletData.go
Outdated
@@ -28,7 +28,7 @@ import ( | |||
// instance (because we have no ctors...) | |||
var DefaultGenesis = GenesisData{ | |||
FirstPartKeyRound: 0, | |||
LastPartKeyRound: 3000000, | |||
LastPartKeyRound: 3000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary for testing reasons (3,000,000 fails in the CICD tests and it seems excessive).
@@ -48,26 +47,29 @@ func (v *Verifier) Verify(c *Cert) error { | |||
return fmt.Errorf("cert signed weight %d <= proven weight %d", c.SignedWeight, v.ProvenWeight) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a unit test for this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be in the future (when the compactcert feature is ready to be released), but as for now it is tested by compactcert.TestWorkerAllSigs()
and compactcert.TestWorkerPartialSigs()
.
ledger/compactcert.go
Outdated
SecKQ: proto.CompactCertSecKQ, | ||
Msg: hdr, | ||
ProvenWeight: provenWeight, | ||
SigRound: hdr.Round, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the sigRound param changed? Does it impact the existing implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in the old implementation the voting key was used to sign the compact cert (and the commitment was to the next round key , since the ephemeral voting key is disposed after use). Now we use completely different keys and scheme so this hack is no longer needed.
04dd916
to
c96eb57
Compare
…orand/go-algorand into feature/dilithium-scheme-integration
0d35440
to
bd7fcc8
Compare
…gression ## Summary My previous PR was causing a minor regression. Thanks to @jannotti comment, I think that I was able to fix the regression, and added a proper testing for that. ## Test Plan New benchmark result ( no inner method anymore ) ``` goos: darwin goarch: amd64 pkg: github.com/algorand/go-algorand/data/bookkeeping cpu: Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz BenchmarkTxnMerkleToRaw/copy-8 1000000000 1.129 ns/op 0 B/op 0 allocs/op BenchmarkTxnMerkleToRaw/append-8 243079730 4.886 ns/op 0 B/op 0 allocs/op PASS ok github.com/algorand/go-algorand/data/bookkeeping 3.183s ```
Co-authored-by: Will Winder <[email protected]>
## Summary Instead of performing a check in `SignerContext.GetVerifier`, I've added a unit test to verify that the output of the merklearray root has the same length as the Verifier object. ## Test Plan Unit test.
Summary
This PR adds the support for the State Proof Keys.
Test Plan
Unit tests added.