-
Notifications
You must be signed in to change notification settings - Fork 217
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
Re-organize network endpoints #2059
Conversation
letmaik/network-rpcs@17506 aka 20210113.43 vs master ewma over 50 builds from 16916 to 17498 |
{ | ||
struct NodeInfo | ||
{ | ||
NodeId node_id; | ||
NodeStatus status; | ||
std::string host; |
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.
Why not use NodeInfoNetwork
here directly? Some fields (e.g. public port) are missing for example.
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.
Ah, checked the implementation of the endpoints that populate this struct and we do return the public port. In fact, we'd report the public and private RPC interfaces. Is this expected? If my understand is correct, one seems interesting for operators (currently rpc_host
and rpc_port
) while the public interface is mostly for users/members?
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 used a new type to provide a boundary between internal and public interface, since we don't want to break the latter even if the internal one changes.
And yes, returning the public and private addresses is expected, this was an ask from @lynshi and I don't see any harm in it either way.
We should discuss naming, rpc_* doesn't seem like a great choice.
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.
These could be exposed as private_host/port
perhaps?
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.
local
would preferable to private
, these are the local interfaces the nodes were told to bind to on startup. Whether they differ from public
depends on whether there is some routing/NATing going on, but they aren't really private
, at least not in way that compares to other things being private in CCF.
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.
What about nodehost
/nodeport
? Does it make sense to expose that as well?
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.
@letmaik These are only used for node-to-node communications and aren't exposed to clients directly so my hunch is that they shouldn't be exposed directly here.
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.
OK, I renamed it to local_*
github pages build fails with:
@eddyashton Any idea? The schema seems valid according to https://apitools.dev/swagger-parser/online/ |
@letmaik I agree this looks like valid OpenAPI. We run the generated API documents through a validator in the e2e tests, and that seems happy, and SwaggerHub is also happy with |
Yes, you're right. Looks like a bug in the library unfortunately. It's the only enum query parameter we have so far. And |
Although it would be fine to add https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values |
Can you raise an issue on the library? As a workaround for now, I think we can just add a |
I'll add your proposed fix to json.h. |
Fixes #1954.