Skip to content
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

Extend API for multismesher node #302

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Jan 31, 2024

For multi-smeshing support the API has to be updated such that the node can report events correctly to clients about which Identity started / finished post and which Identities are managed by the node.

I updated all types and endpoints in a backwards compatible way and marked outdated APIs as depreciated.

cc @brusherru

@fasmat fasmat force-pushed the update-api-multi-smesher branch from bf720ce to 2d68224 Compare January 31, 2024 15:03
@brusherru
Copy link
Member

"Multi-smeshing" is the same as running a node with multiple post services?

As for Node events, it is clear that I can just display a smesher id.

But I'm not sure should Smapp display more than one smesher id on the smesher screen 🤔
Or I can just keep using deprecated API in Smapp, and this new feature will be used in a newer Node Manager app 🤔
What do you think?

Copy link
Member

@brusherru brusherru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fasmat
Copy link
Member Author

fasmat commented Jan 31, 2024

"Multi-smeshing" is the same as running a node with multiple post services?

Yes

As for Node events, it is clear that I can just display a smesher id.

But I'm not sure should Smapp display more than one smesher id on the smesher screen 🤔
Or I can just keep using deprecated API in Smapp, and this new feature will be used in a newer Node Manager app 🤔
What do you think?

The deprecated API will always return 00..00 as smesher ID. In the case where the node runs in supervised mode (what we are currently doing) the new API will return an array with only one SmesherID, but as soon as multiple post services are connected to the node it will return an array with all those IDs.

That's why I deprecated the old call, it doesn't make sense in this case to just return one - which one?

@brusherru
Copy link
Member

Okay, that makes sense.

I just thought that Smapp also displays some other stuff (for example a size of PoST, location, etc) and when we have a list of Smesher IDs it will be not clear which one corresponds to this data...
And I see that there are some options:

  • a). do not display the rest data if there is more than one SmehserID
  • b). have an additional API endpoint which will return details per SmesherID, e.g.
    SmesherDataRequest(SmesherID) -> SmesherDataResponse {
      dir: string;
      num_units: u64;
      ...
     }
    

But anyway, as for now — I will just display a list of Smesher IDs ;)

@fasmat
Copy link
Member Author

fasmat commented Jan 31, 2024

Right now the data you are referring to is provided via the PostSetupStatus endpoint. In the supervised setup (i.e. only one post service that is managed by the node itself) it will continue to work as it did before.

In a multi-smeshing setup that endpoint won't return anything as the node does not have this information. Instead the post services could be queried for that info.

cc @poszu

@brusherru
Copy link
Member

Okay, got it

@poszu
Copy link
Contributor

poszu commented Feb 1, 2024

@mafa

The deprecated API will always return 00..00 as smesher ID.

I think it would be better to return an "Unimplemented" status (perhaps with a message informing to switch to the new API) instead. It would become obvious that this API is no longer available and the user should switch to the new one. Otherwise, it might get overlooked and various tools will show 00000... without their authors realizing that this API is no longer working as expected.

@fasmat
Copy link
Member Author

fasmat commented Feb 1, 2024

@poszu I changed the handler to return code.Unimplemented when calling the deprecated function.

@fasmat fasmat merged commit 6c0185b into master Feb 1, 2024
1 check passed
@fasmat fasmat deleted the update-api-multi-smesher branch February 1, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants