-
Notifications
You must be signed in to change notification settings - Fork 215
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
node-split poc: move IdentityStates to separate package, add metadata for identity states #6510
base: node-split-poc
Are you sure you want to change the base?
Conversation
…tity states. Adjust to latest api changes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## node-split-poc #6510 +/- ##
================================================
- Coverage 77.3% 77.2% -0.2%
================================================
Files 341 342 +1
Lines 45737 45822 +85
================================================
+ Hits 35378 35385 +7
- Misses 8246 8324 +78
Partials 2113 2113 ☔ View full report in Codecov by Sentry. |
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 find this approach quite error prone. Nothing guarantees that any State
sets the corresponding metadata. Also metadata might be stored that isn't even applicable to the given state.
This could probably be improved by the use of generics, where State
is a generic type and RetryingState
, PoetRegisteredState
etc. are the corresponding specific types.
Then the big conditional checks in the api
package might also be avoidable.
} | ||
|
||
//nolint:lll | ||
func (s *StateStorage) AllEligibilities() map[types.NodeID]map[types.EpochID]map[types.LayerID][]types.VotingEligibility { |
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: EpochID
can be derived from LayerID
so this could probably be simplified to
func (s *StateStorage) AllEligibilities() map[types.NodeID]map[types.EpochID]map[types.LayerID][]types.VotingEligibility { | |
func (s *StateStorage) AllEligibilities() map[types.NodeID]map[types.LayerID][]types.VotingEligibility { |
Description
Closes #6509
identity
.Integration of
identity
package:activation/activation.go
: Added import foridentity
package and updatedidentitiesStates
initialization to useidentity.NewIdentityStateStorage()
. [1] [2]activation/interface.go
: UpdatedSet
method inIdentityStates
interface to useidentity.State
andidentity.StateInfoMetadata
. [1] [2]activation/mocks.go
: Updated mock methods forIdentityStates
to useidentity.State
andidentity.StateInfoMetadata
. [1] [2] [3]activation/nipost.go
: UpdatedidentityStates
initialization and refactoredSet
method calls to use the newidentity
package structures. [1] [2] [3] [4] [5] [6]Refactoring identity state handling:
activation/activation.go
: RefactoredSet
method calls to useidentity.State
and appropriate metadata. [1] [2] [3] [4] [5] [6]activation/nipost.go
: ModifiedgetBestProof
method to return an additionalpoetUrl
parameter and updated related method calls. [1] [2] [3] [4]Updates to gRPC server:
api/grpcserver/v2alpha1/interface.go
: UpdatedidentityState
interface to useidentity.StateInfo
. [1] [2]api/grpcserver/v2alpha1/mocks.go
: Updated mock methods foridentityState
to useidentity.StateInfo
. [1] [2] [3]api/grpcserver/v2alpha1/smeshing_identities.go
: Added import foridentity
package.