feat: wallet connectivity service #3159
Merged
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.
Description
Adds a service responsible for wallet connectivity. This service
is responsible for and abstracts any complexity in the management of
the base node connections and RPC session management.
This PR makes use of this service in the base node montoring service but
does not "plumb" the WalletConenctivityService into the protocols. This
is left as a TODO, but we should expect this to remove many lines of
code and greaty simplify these protocols by removing the budren of
connection management in the various wallet components.
A number of simplifications on the peer connection and substream code,
debatably reducing places that bugs could hide.
Motivation and Context
Follow on from #3152, making use of the pool in the wallet base node monitoring. The rest of the protocols should follow.
How Has This Been Tested?
Extensive service unit tests
Existing tests pass
Washing machine test on local wallet, with the broadcast protocol modified to use the wallet connectivity
Base node RPC sessions max out at 10 each (2 wallets connected to same base node) even when pushing through 426 transactions.
Manually tested wallet connectivity states (Connecting -> Online | Connecting -> Offline | Connecting -> Online -> Offline -> Connecting -> Online)
Checklist:
development
branch.