go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

Serve API to return poet registrations state

Open ConvallariaMaj opened this issue 1 year ago • 3 comments

Motivation

Smesher needs to understand situation with poet registrations (success, failed, residual, no registrations and etc.) Easiest way is providing API for that.

Description

Closes #6174

  • created smesher identity states
  • created new grpc service (SmeshingIdentitiesService) to serve new API
  • implemented logic to save failed registrations, retry to register in case if deadline for submit challenge is not passed, and update recording into db in case, if registrations were successful after another try
  • fixed tests
  • made some small refactoring

Connected PR: https://github.com/spacemeshos/api/pull/369

Test Plan

Unit tests

TODO

  • [x] Explain motivation or link existing issue(s)
  • [x] Test changes and document test plan
  • [x] Update documentation as needed
  • [x] Update changelog as needed

ConvallariaMaj avatar Aug 19 '24 00:08 ConvallariaMaj

@ConvallariaMaj could you execute

go get github.com/spacemeshos/api/release/go@499d12efc
go mod tidy

and commit the result? This will allow the PR to be built and doesn't pollute the PR view with errors that the code can't be built 🙂

fasmat avatar Aug 22 '24 12:08 fasmat

Codecov Report

Attention: Patch coverage is 69.56522% with 84 lines in your changes missing coverage. Please review.

Project coverage is 79.9%. Comparing base (c4e59b6) to head (0aa7d97). Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
activation/nipost.go 71.9% 19 Missing and 6 partials :warning:
activation/activation.go 29.4% 22 Missing and 2 partials :warning:
api/grpcserver/v2alpha1/smeshing_identities.go 81.1% 10 Missing and 3 partials :warning:
node/node.go 29.4% 11 Missing and 1 partial :warning:
activation/identity_states.go 84.4% 8 Missing and 1 partial :warning:
sql/localsql/nipost/poet_registration.go 85.7% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #6266     +/-   ##
=========================================
- Coverage     79.9%   79.9%   -0.1%     
=========================================
  Files          353     355      +2     
  Lines        46396   46614    +218     
=========================================
+ Hits         37103   37246    +143     
- Misses        7191    7255     +64     
- Partials      2102    2113     +11     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 01 '24 15:10 codecov[bot]

Some quite minor nits, otherwise looks good

ivan4th avatar Oct 02 '24 21:10 ivan4th

Note: this PR depends on https://github.com/spacemeshos/api/pull/369

jellonek avatar Nov 05 '24 16:11 jellonek

This PR was used as part of the work to create #6452.

kacpersaw avatar Nov 18 '24 13:11 kacpersaw