-
Notifications
You must be signed in to change notification settings - Fork 214
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
[Merged by Bors] - GRPC service to retrieve state of post proving #5651
Conversation
Co-authored-by: Matthias Fasching <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5651 +/- ##
========================================
Coverage 79.7% 79.7%
========================================
Files 274 279 +5
Lines 27883 28259 +376
========================================
+ Hits 22228 22550 +322
- Misses 4108 4145 +37
- Partials 1547 1564 +17 ☔ View full report in Codecov by Sentry. |
@@ -1432,6 +1436,10 @@ func (app *App) grpcService(svc grpcserver.Service, lg log.Log) (grpcserver.Serv | |||
service := grpcserver.NewPostService(app.addLogger(PostServiceLogger, lg).Zap()) | |||
app.grpcServices[svc] = service | |||
return service, nil | |||
case grpcserver.PostInfo: | |||
service := grpcserver.NewPostInfoService(app.addLogger(PostInfoServiceLogger, lg).Zap(), app.atxBuilder) |
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.
Would it make sense to pass postStates
here instead of app.atxBuilder
?
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, but it would require making more code use the types.IdentityDescriptor
because the PostInfoService
needs to map types.IdentityDescriptor
-> types.PostState
(not types.NodeID
). I think about changing Nipostbuilder::Proof
to use it (instead of NodeID) so that it can log the name
too in post service not connected - waiting for reconnection {"service id": "5ea2c9975a185eeaa40bc9351297aa98c85952553f0fde4707ad783943c65e2e", "error": "post service not registered"}
in a follow up.
bors merge |
Co-authored-by: Matthias <[email protected]>
Build failed: |
bors merge |
Co-authored-by: Matthias <[email protected]>
bors cancel |
Canceled. |
bors merge |
Co-authored-by: Matthias <[email protected]>
Pull request successfully merged into develop. Build succeeded: |
Description
Added a new GRPC service that provides a way to get the state of POST proving for all registered identities.
Each identity starts as Idle and transitions to Proving when POST proving phase starts (when the post-service becomes required). This informs the operator that it is time to switch the post-service ON.
The state transitions back to Idle in one of two conditions:
The state does NOT transition from Proving to Idle when post proving fails because it might retry (and hence need the post-service again) and we don't want to confuse the operator with multiple state switches.
Test Plan
Added unit tests
TODO