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

Fix: Re-subscribe to chain updates on reconnection #5794

Merged
merged 1 commit into from
May 28, 2024

Conversation

F-OBrien
Copy link
Contributor

Prevents issues with bad transaction signatures after chain updates following a temporary disconnect.

Long-standing API connections can experience temporary disconnects, e.g. throwing API-WS: disconnected from wss://localhost:9944/: 1006:: Abnormal Closure due to a network connection issue. Upon disconnect, the provider unsubscribes from updates to the runtime version. However, upon reconnection, the subscription is not recreated.

Currently due to the lack of resubscription transactions submitted following a prior disconnect and chain upgrade will result in bad transaction signatures due to an incorrect spec version, requiring the service to be restarted to resolve.

@TarikGul
Copy link
Member

TarikGul commented Mar 4, 2024

Very odd that the CI tried to run the merge bot even though it wasn't triggered...

That being said will review this PR shortly.

This prevents issues with bad transaction signatures after chain updates following a temporary disconnect.
@F-OBrien
Copy link
Contributor Author

@TarikGul I've rebased the commit. Let me know if you've any questions on it.

@TarikGul TarikGul self-requested a review March 22, 2024 14:47
@F-OBrien
Copy link
Contributor Author

@TarikGul just following up on this again.

@TarikGul
Copy link
Member

@F-OBrien Thanks for pinging me again. I promise to have it fully reviewed this week. There are a few side affects I wanted to look into, but I promise to prioritize this :)

@TarikGul
Copy link
Member

Im mostly confident to merge this, I am just running this against some benchmarks for historical blocks, to ensure this doesn't create a regression.

@TarikGul
Copy link
Member

Tested it pretty thoroughly locally myself. LGTM, thanks for the patience, and the PR!

@TarikGul TarikGul merged commit d28d2b5 into polkadot-js:master May 28, 2024
4 checks passed
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants