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

Add unstable JSON-RPC function that exports recent networking events #72

Open
tomaka opened this issue Feb 9, 2023 · 6 comments · May be fixed by #1599
Open

Add unstable JSON-RPC function that exports recent networking events #72

tomaka opened this issue Feb 9, 2023 · 6 comments · May be fixed by #1599

Comments

@tomaka
Copy link
Contributor

tomaka commented Feb 9, 2023

paritytech/smoldot#2245

@tomaka tomaka changed the title Add unstable JSONRPC function that exports recent networking events Add unstable JSON-RPC function that exports recent networking events Mar 29, 2023
@tomaka
Copy link
Contributor Author

tomaka commented Aug 14, 2023

This function should be added as a PR to https://github.com/paritytech/json-rpc-interface-spec/

@tomaka
Copy link
Contributor Author

tomaka commented Sep 12, 2023

@tomaka
Copy link
Contributor Author

tomaka commented Jan 21, 2024

We need to add a few events in established.rs:

  • When a notifications out request has successfully negotiated the substream.
  • When a request has successfully negotiated the substream.
  • When we open or close a ping substream.
  • When the remote opens or closes a ping substream.

All the JSON-RPC events can then be derived from this.

Then, the events service.rs need to be updated as well. This part is unfortunately not completely clear to me.

@tomaka
Copy link
Contributor Author

tomaka commented Jan 22, 2024

When a notifications out request has successfully negotiated the substream.
When a request has successfully negotiated the substream.

Actually, we can just pretend that the substream has opened when we start the opening, so there's no need for these two events.

@tomaka
Copy link
Contributor Author

tomaka commented Jan 22, 2024

Then, the events service.rs need to be updated as well. This part is unfortunately not completely clear to me.

The solution (which I feel stupid for not thinking of earlier) is to provide an OpaqueEvent which can be turned into either a LowLevelEvent or an optional HighLevelEvent.

@tomaka tomaka linked a pull request Jan 23, 2024 that will close this issue
@tomaka
Copy link
Contributor Author

tomaka commented Jan 24, 2024

A big difficulty, which I didn't anticipate, is that the connections that the network service opens do not target a chain in particular, but the JSON-RPC function does target a specific chain.

This means that we have to somehow report to the API user only connections that we think might belong to a specific chain. Reporting only some connections might be misleading? Maybe we should report all connections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant