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

Fix encode bug+reduce type sized #3136

Conversation

id-ms
Copy link
Contributor

@id-ms id-ms commented Oct 25, 2021

Summary

Test Plan

@@ -307,20 +307,18 @@ func (stub *txGroupsEncodingStub) finishDeconstructTxnHeader() {

func (stub *txGroupsEncodingStub) deconstructKeyregTxnFields(i int, txn *transactions.SignedTxn) {
bitmaskLen := bytesNeededBitmask(int(stub.TotalTransactionsCount))
if !txn.Txn.VotePK.MsgIsZero() || !txn.Txn.SelectionPK.MsgIsZero() || txn.Txn.VoteKeyDilution != 0 {
if !txn.Txn.VotePK.MsgIsZero() || !txn.Txn.SelectionPK.MsgIsZero() || ((txn.Txn.StateProofPK.Root) != [merklekeystore.KeyStoreRootSize]byte{}) || txn.Txn.VoteKeyDilution != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that in this particular case, this one is safe during protocol upgrades, right ?

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 agree. this only checks that if some of the keys are not zeroed we need to allocate space

@id-ms id-ms force-pushed the fix-encode-bug+redue-type-sized branch from e471283 to c32ffff Compare October 25, 2021 14:12
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2021

Codecov Report

Merging #3136 (6ee1c12) into feature/dilithium-scheme-integration (a79c255) will increase coverage by 0.07%.
The diff coverage is 58.20%.

Impacted file tree graph

@@                           Coverage Diff                            @@
##           feature/dilithium-scheme-integration    #3136      +/-   ##
========================================================================
+ Coverage                                 43.51%   43.58%   +0.07%     
========================================================================
  Files                                       402      402              
  Lines                                     90345    90506     +161     
========================================================================
+ Hits                                      39315    39451     +136     
- Misses                                    44686    44715      +29     
+ Partials                                   6344     6340       -4     
Impacted Files Coverage Δ
crypto/digest.go 0.00% <ø> (ø)
protocol/codec_tester.go 0.00% <0.00%> (ø)
txnsync/encodedgroupstypes.go 100.00% <ø> (ø)
txnsync/msgp_gen.go 30.52% <ø> (+0.01%) ⬆️
crypto/msgp_gen.go 35.77% <35.29%> (-0.12%) ⬇️
crypto/merklekeystore/keystore.go 75.30% <50.00%> (ø)
crypto/merklekeystore/msgp_gen.go 49.72% <63.63%> (ø)
crypto/hashes.go 59.09% <100.00%> (ø)
crypto/invalidsigner.go 57.14% <100.00%> (ø)
crypto/sig_abstractions.go 67.50% <100.00%> (ø)
... and 16 more

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 a79c255...6ee1c12. Read the comment docs.

@algonautshant algonautshant self-requested a review October 25, 2021 15:28
@id-ms id-ms force-pushed the fix-encode-bug+redue-type-sized branch 6 times, most recently from 6a72fc7 to 969f334 Compare October 26, 2021 10:52
@id-ms id-ms force-pushed the fix-encode-bug+redue-type-sized branch 2 times, most recently from 8837d8c to 97195a8 Compare October 26, 2021 11:04
@id-ms id-ms force-pushed the fix-encode-bug+redue-type-sized branch from 97195a8 to 7ee0c1a Compare October 26, 2021 11:53
@id-ms id-ms changed the title Fix encode bug+redue type sized Fix encode bug+reduce type sized Oct 26, 2021
txnsync/txngroups_test.go Outdated Show resolved Hide resolved
txnsync/txngroups_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Looks good. I have a few comments and questions, but that can be done later.

Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Excellent. Thanks for the updates.

@id-ms id-ms merged commit 10ba9bf into algorand:feature/dilithium-scheme-integration Oct 26, 2021
@id-ms id-ms deleted the fix-encode-bug+redue-type-sized branch November 3, 2021 08:15
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.

4 participants