-
Notifications
You must be signed in to change notification settings - Fork 523
Move secrets to partkey registry #3052
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
Move secrets to partkey registry #3052
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
17c719b to
f4cfae1
Compare
|
|
||
| // update cache. | ||
| // TODO: simplify to re-initializing with initializeCache()? | ||
| db.cache[id] = ParticipationRecord{ |
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.
this looks an awful lot like .Duplicate() ?
(and also things should only be assigned if the source was not 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.
Yes, I didn't see a good way to reuse it.
| record.LastValid, | ||
| record.KeyDilution) | ||
| record.KeyDilution, | ||
| rawVRF) |
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.
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.
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 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.
Summary
Start moving partkeys away from the old file format.
Test Plan