-
Notifications
You must be signed in to change notification settings - Fork 90
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
cluster/state: implement legacy lock mutation #2175
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #2175 +/- ##
==========================================
+ Coverage 53.45% 53.54% +0.09%
==========================================
Files 174 174
Lines 22987 23080 +93
==========================================
+ Hits 12287 12359 +72
- Misses 9232 9248 +16
- Partials 1468 1473 +5 ☔ View full report in Codecov by Sentry. |
cluster/state/helpers.go
Outdated
defer ssz.DefaultHasherPool.Put(hw) | ||
|
||
if err := hasher.HashTreeRootWith(hw); err != nil { | ||
return [32]byte{}, err |
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.
nit: needs errors.Wrap()
cluster/state/mutation.go
Outdated
) | ||
|
||
var mutationDefs = map[MutationType]struct { | ||
DataType any |
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 this DataType
is any?
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.
thanks, removed this field, not needed I think.
return resp, nil | ||
} | ||
|
||
// verifyEmptySig verifies that the signed mutation isn't signed. |
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.
nit
// verifyEmptySig verifies that the signed mutation isn't signed. | |
// verifyEmptySig returns an error if the signed mutation isn't signed. |
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.
your change flips the logic which isn't correct.
// Parent is the hash of the parent mutation. | ||
Parent [32]byte `ssz:"Bytes32"` | ||
// Type is the type of mutation. | ||
Type MutationType `ssz:"ByteList[64]"` // TODO(corver): Make this a numbered enum maybe (instead of a string)?. |
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.
yeah, numbered enum makes sense. What benefit does having string MutationType
provides?..
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.
string makes it human readable in the json, otherwise it will be a number in the json which means when a human looks at it, they will not know what mutation type they are looking at.
Implement the first skeleton and structure of the
LegacyLock
mutation. This is heavy based on previous PoC.This is the first of a series of PRs, next PRs will add tests and more logic.
category: feature
ticket: #1886