-
Notifications
You must be signed in to change notification settings - Fork 212
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
SmesherService.SmeshingStatus API Endpoint Proposal #3281
Comments
2 tasks
7 tasks
This was referenced Jul 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #3266
create new endpoint
SmesherService.SmeshingStatus
, which will serve info about epochsby default, endpoint should serve return a list of
SmeshingStatusResponse
, which contain info aboutcurrent
epoch,next
andnext after next
. Other epoch can be requested from query.Originally posted by brusherru June 19, 2022
Rationale
We want to make clear to Smeshers what is going on at every moment in the time:
Let's refresh our memory on how it works, assign some statuses to each "step" and clarify which additional data we may require.
Status: Not smeshing
Status: Generating PoS data
Status: Waiting for PoET challenge
Extra: estimated time / layer
Status: Generating Proof-of-Space
Extra: time estimation
Status: Waiting for the next epoch
Extra: time estimation
Status: Smeshing on epoch 23 (current)
Status: Smeshing on epoch 23 (current)
Here is a good illustration by @noamnelke:
We already had some related discussion, so you can check it out: spacemeshos/smapp#721
Problem
Some of the steps, mentioned above, take a long time.
Some of them may finish with failure, which means that time from the 2nd step to the 6th (getting rewards) may take much more time. So we need to notify Smesher about the current status.
We already have some API endpoints, but they have a narrow scope and do not cover all the steps from the list above:
SmesherService.IsSmeshing -> bool
— true if PoS creation complete and "ready to send ATXs". But actually, if the node does not sync, it is still true. So from my point of view, it seems almost useless (the same asPostSetupStatus === complete
). Fix me if I miss something.SmesherService.PostSetupStatus
— enum (not_started | in_progress | complete | error). Related only to the PoS creating process.So we need some API endpoints that will provide other statuses. Or, I think it will be much better, one API endpoint that will answer all these questions.
Proposal
Let's make a brand-new
SmesherService.SmeshingStatus
endpoint, that will return any of the statuses mentioned above with required extra data.Such a solution will encapsulate some logic on the Node side, like requesting/listening for ATXs, rewards, PoET, etc.
Actually, I've already created one issue for it some time ago: #3222
So I think it might be a nullary endpoint, which returns something like:
Multiple statuses at once
Actually, Smesher can have more than one status at a time, regarding different epochs.
For example:
Or even:
So probably this endpoint should return a list of
SmeshingStatusResponse
.But in this case, we have an open question, which epochs should be on the list. Putting all previous epochs is a bad idea.
Can we implement only streaming API endpoint, but with one requirement: can it send "current status" to the new client on connection?
What's next
Please, share your thoughts about the problem and my proposal.
If you found that such implementation will be complicated / not optimal / etc — tell us about it, please.
If I miss something — feel free to fix me. If you have other ideas — share them.
P.S.
We also had a discussion about API for retrieving ATXs. But from my point of view, it is not required for Smapp/Smrepl, in case all this "smeshing status logic" will be encapsulated on the Node side, as proposed above.
However, most likely we will require such an API for Explorer. And I think we should not make Smapp/Smrepl more complicated, and just put a link to explorer where it is needed (aka on Smesher screen).
So I propose to leave API for retrieving ATXs is out of scope, and open another discussion/issue in the context of Explorer.
cc: @oriya @lrettig @noamnelke @dshulyak @countvonzero
The text was updated successfully, but these errors were encountered: