Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Incorrect subscription id #2661

Closed
RexCloud opened this issue Nov 2, 2023 · 4 comments
Closed

Incorrect subscription id #2661

RexCloud opened this issue Nov 2, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@RexCloud
Copy link

RexCloud commented Nov 2, 2023

Description
SubscriptionStream from eth_subscribe to Alchemy RPC will have incorrect subscription id
Incorrect subscription id makes unsubscribing impossible

I tried this code:

let mut stream = provider_ws_alchemy.subscribe_blocks().await.unwrap();

println!("{}", stream.id);

// eth_subscribe response: {"id":0,"result":"0xf13f7073ddef66a8c1b0c9c9f0e543c3","jsonrpc":"2.0"}

I expected to see this happen: 0xf13f7073ddef66a8c1b0c9c9f0e543c3 or U256 representation

Instead, this happened: 0

@RexCloud RexCloud added the bug Something isn't working label Nov 2, 2023
@mattsse
Copy link
Collaborator

mattsse commented Nov 2, 2023

what's incorrect here exactly?
you get the identifier of the subscription as the result, no?

@RexCloud
Copy link
Author

RexCloud commented Nov 2, 2023

what's incorrect here exactly? you get the identifier of the subscription as the result, no?

I get the identifier, but it's from "id" key of response, not from "result" key

@mattsse
Copy link
Collaborator

mattsse commented Nov 2, 2023

id corresponds to the request id of the eth_subscription request, the subscription id is the result

@mattsse mattsse closed this as completed Nov 2, 2023
@RexCloud
Copy link
Author

id corresponds to the request id of the eth_subscription request, the subscription id is the result

Please, take a look at this: #2669

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants