-
Notifications
You must be signed in to change notification settings - Fork 257
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
Multiple threads using the same client, transaction outdated #1886
Comments
Hey hey, if you are using the default settings of It's likely that the RPC layer is slower then constructing extrinsic that causes that I guess..
I think this is the easiest to solution to this issue is ☝️ and just keep track of your nonce with a However, you may have already come up with a better solution by now. |
Hey @niklasad1, thanks for your inputs. The main drawback of having it in the shared state was that if an extrinsic fail, all of them later would fail too, as the sequence needs to be continuous. We ended up:
|
Context
We're building a system parachain for data storage and heavily utilizing subxt.
We have a off-chain service, which is running a pipeline and RPC at the same time.
Pipeline periodically performs a operation on-chain (and waits for finalization), and RPC as well.
We just put a OnlineClient behind an and are using it in multiple places (threads).
E.g:
Problem
There is a moment, where pipeline (1.) waits for the extrinsic to be finalized and RPC (2.) wants to submit the extrinsic, using the same client.
It ends up being an error:
I think this is because, while we waiting for the extrinsic to be finalized, the Account Nonce is the same for both of the calls. The second call tries to override it (has a lower priority and it fails)
Discussion
Potential solutions from our side are:
However, I wanna discuss this with you guys. Is this the right approach? Should we handle it on our side, should the client be resilient on its own for this kind of behaviours?
Looking for your feedback, thanks!
P.S couldn't find the better title, feel free to change it to something more fitting.
The text was updated successfully, but these errors were encountered: