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

server: Expose the subscription ID #900

Merged
merged 4 commits into from
Oct 13, 2022
Merged

server: Expose the subscription ID #900

merged 4 commits into from
Oct 13, 2022

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Oct 12, 2022

The subscription ID on the server side is required by the new RPC Spec,
specifically by the archive class of methods.

The subscription ID generated from the chainHead_unstable_follow is passed to
the other archive methods (ie chainHead_unstable_body). The server needs to
keep track of this ID for validity purposes.

This PR exposes the subscription ID via the SubscriptionSink::accept.
The accept method marks the point of sending the ID to the client.
Although the subscription ID exists on the server side prior to this call,
this information is unusable if it cannot be propagated to the client.

This adds a change to the main SubscriptionSink API without breaking
the current behavior of SubscriptionSink::pipe_from_stream.
If the server is interested in the subscription ID, it can simply call the
accept prior to pipe_from_stream.

This is part of the paritytech/substrate#12071.

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv requested a review from a team as a code owner October 12, 2022 15:32
@lexnv lexnv changed the title Lexnv/expose subid server: Expose the subscription ID Oct 12, 2022
@lexnv lexnv self-assigned this Oct 12, 2022
@jsdw jsdw requested a review from a team October 12, 2022 16:52
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv merged commit d390823 into master Oct 13, 2022
@lexnv lexnv deleted the lexnv/expose_subid branch October 13, 2022 09:50
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.

None yet

3 participants