Repository navigation
Conversation
…MW#1695) Without a node connection the shader never starts: ShadersManager waits for a synced wallet (DoInSyncedWallet) that never comes, so invoke_contract never answered, and later calls either queued behind it (default API) or failed with "Previous shader call is still in progress" (v6.0). Check the node connection before queueing the call and answer ContractError "No connection to the node". Without a nodeNetwork (e.g. wasm) nothing changes. wallet_test: TestInvokeContractNoNodeConnection (fails without the fix).
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix:
invoke_contractanswers immediately with-32019 "No connection to the node"when wallet-api has no node connection, instead of never answering and blocking later calls.Why: the shader only starts once the wallet is synced (
Wallet::DoInSyncedWallet). Without a node that never happens, so the request never completes. Later calls then queue behind it (default API), or fail with "Previous shader call is still in progress" (v6.0). Neither handler (v6.0, v6.1) checked the connection.How to see the bug (master, no node needed)
Improvement
{"error":{"code":-32019,"data":"No connection to the node",…}}immediatelyHow:
V6Apikeeps thenodeNetworkand checks it in bothinvoke_contracthandlers before anything is queued, so no busy state is left behind. Without anodeNetwork(e.g. wasm), nothing changes. It reusesContractError, so there are no new error codes.Testing: the table above (master vs this branch). New
TestInvokeContractNoNodeConnectioninwallet_test(an offline wallet with a realShadersManager: each call must throwContractErrorand leave the manager not busy). Without the fix it fails 2 checks; with it, it passes. Fork CI (running): https://github.com/vsnation/beam/actions/runs/37479393148Fixes #1695