-
Notifications
You must be signed in to change notification settings - Fork 262
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
Concurrent calls return Scale codec error: No such variant in enum Phase
#186
Comments
Possibly an issue in the |
Some relevant logs:
The event record it fails to decode appears to be |
cc @niklasad1 |
At first I thought the issue was due to the missing |
It indeed sounds like a The client(s) that you clone is that In addition, is it possible for you to fetch the log from the node that produced the block i.e., so we could diff the block/extrinsics from both client and server side in order to determine what's the underlying issue is? |
I was able to reproduce the issue here: https://gitlab.com/gregdhill/jsonrpsee-test See the README for setup instructions. |
Ok, thanks for the info. I could reproduce it, there's quite some queries and subscriptions that occur there. I'll let you know when I figure out what's going on. |
So, I actually managed to debug this: From wireshark I could capture that the following {"jsonrpc":"2.0","method":"state_storage","params":{"result":{"block":"0x159f94d7b0b0343b5c904e8f54c30f839068af7ebd2b309ba94e0c8e409a9899","changes":[["0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7","0x0c00000000000000482d7c0900000000020000000100000000010300035884723300000000000000000200000000010300035884723300000000000000"]]},"subscription":"a5PSaZKb3Df7CTmk"}}~º{"jsonrpc":"2.0","method":"author_extrinsicUpdate","params":{"result":{"inBlock":"0x159f94d7b0b0343b5c904e8f54c30f839068af7ebd2b309ba94e0c8e409a9899"},"subscription":"KVuXpY7bTO597oLy"}} Then
FWIW, you still get an error when only using one substrate_subxt::Client: //cc @ascjones I don't know really what's going here but sounds like a node/subxt-runtime issue to me, but maybe you do? :) |
Thanks for the investigation @niklasad1, I'll take a look |
Is it possible that there is a bug in the encoding / decoding? I can see in the prior iteration of the decode_events loop (before failing to decode |
@ascjones I think I see the problem. The library tries to decode a |
Awesome thanks @gregdhill! |
When two clients concurrently call the same RPC function, they both return
XtError(Codec(Error("No such variant in enum Phase")))
. I'm able to reliably reproduce this with the code below. Thedo_accept_replace
function just calls an RPC function and prints the return value. When I uncomment the delay, both of these functions behave correctly.Versions from Cargo.toml:
The text was updated successfully, but these errors were encountered: