Skip to content

Conversation

@winder
Copy link
Contributor

@winder winder commented Oct 13, 2021

Summary

Start moving partkeys away from the old file format.

Test Plan

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2021

Codecov Report

Merging #3052 (67974ec) into feature/partkey (5cb3b00) will increase coverage by 0.01%.
The diff coverage is 84.21%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/partkey    #3052      +/-   ##
===================================================
+ Coverage            43.96%   43.97%   +0.01%     
===================================================
  Files                  394      394              
  Lines                87467    87511      +44     
===================================================
+ Hits                 38451    38486      +35     
- Misses               42928    42934       +6     
- Partials              6088     6091       +3     
Impacted Files Coverage Δ
data/accountManager.go 0.00% <0.00%> (ø)
node/node.go 24.22% <0.00%> (-0.12%) ⬇️
data/account/participationRegistry.go 81.77% <92.15%> (+1.12%) ⬆️
data/account/participation.go 42.00% <100.00%> (+1.00%) ⬆️
ledger/blockqueue.go 81.03% <0.00%> (-4.03%) ⬇️
cmd/tealdbg/debugger.go 72.86% <0.00%> (-1.01%) ⬇️
ledger/acctupdates.go 66.44% <0.00%> (ø)
network/wsNetwork.go 63.14% <0.00%> (+0.18%) ⬆️
catchup/peerSelector.go 100.00% <0.00%> (+1.04%) ⬆️

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 5cb3b00...67974ec. Read the comment docs.

@winder winder force-pushed the will/install-secrets branch from 17c719b to f4cfae1 Compare October 18, 2021 13:39
@winder winder marked this pull request as ready for review October 19, 2021 19:23

// update cache.
// TODO: simplify to re-initializing with initializeCache()?
db.cache[id] = ParticipationRecord{
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks an awful lot like .Duplicate() ?
(and also things should only be assigned if the source was not nil)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I didn't see a good way to reuse it.

record.LastValid,
record.KeyDilution)
record.KeyDilution,
rawVRF)
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that you're storing nil value directly into the database here. This isn't strictly wrong - but it might require you to work abit harder on the query side ( i.e. sql.NullString ). Please make sure you have at least a single unit test to verify the correctness of this 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.

It turns out you don't need special handling here because the type is []byte, not string. So nil checking is done in the normal way by looking at len(vrf) and len(voting).

There is a unit test called TestParticipation_EmptyBlobs that is supposed to cover that case. I just used the debugger to double check and can confirm that the query returns nil when scanning results and it is handled as expected.

@winder winder merged commit 9fbca06 into algorand:feature/partkey Oct 22, 2021
@winder winder deleted the will/install-secrets branch October 22, 2021 17:19
@winder winder linked an issue Oct 25, 2021 that may be closed by this pull request
@winder winder self-assigned this Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store participation keys in partkey.sqlite

4 participants