api
api copied to clipboard
Fix: Re-subscribe to chain updates on reconnection
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.
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.
@TarikGul I've rebased the commit. Let me know if you've any questions on it.
@TarikGul just following up on this again.
@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 :)
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.
Tested it pretty thoroughly locally myself. LGTM, thanks for the patience, and the PR!
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.