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

feat: add sync rpc client pool to wallet connectivity #3199

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Aug 16, 2021

Description

  • add sync pool and obtain_base_node_sync_rpc_client
  • add get_header to base node rpc

Motivation and Context

Useful in #3191

How Has This Been Tested?

Existing unit tests

Checklist:

  • I'm merging against the development branch.
  • I have squashed my commits into a single commit.

@sdbondi sdbondi force-pushed the wallet-connectivity-add-pool-for-sync branch 4 times, most recently from 2dac222 to 4cd68f2 Compare August 17, 2021 05:10
- add sync pool and `obtain_base_node_sync_rpc_client`
- add `get_header` to base node rpc
@sdbondi sdbondi force-pushed the wallet-connectivity-add-pool-for-sync branch from 4cd68f2 to d7e7be0 Compare August 17, 2021 05:23
Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there, looks good, but I have one concern, noted below.

self.base_node_wallet_rpc_client_pool = Some(pool);
self.pools = Some(ClientPoolContainer {
base_node_sync_rpc_client: conn.create_rpc_client_pool(self.config.base_node_rpc_pool_size),
base_node_wallet_rpc_client: conn.create_rpc_client_pool(self.config.base_node_rpc_pool_size),
Copy link
Contributor

@hansieodendaal hansieodendaal Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base_node_wallet_rpc_client should have its own pool size configuration setting and not reuse the one from base_node_sync_rpc_client. Both pool size values should be present in the config.toml configuration file for case by case tuning. A busy console wallet needs to carry out much more than base_node_rpc_pool_size: 10, conversations in parallel, specifically where the base_node_wallet_rpc_client is concerned, if it is going to be used for the transaction monitoring protocols.

@@ -68,7 +69,7 @@ impl WalletConnectivityHandle {
/// node/nodes. It will be block until this is happens. The ONLY other time it will return is if the node is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// node/nodes. It will be block until this is happens. The ONLY other time it will return is if the node is
/// node/nodes. It will be blocked until this is happening. The ONLY other time it will return is if the node is

/// Obtain a BaseNodeSyncRpcClient.
///
/// This can be relied on to obtain a pooled BaseNodeSyncRpcClient rpc session from a currently selected base
/// node/nodes. It will be block until this is happens. The ONLY other time it will return is if the node is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// node/nodes. It will be block until this is happens. The ONLY other time it will return is if the node is
/// node/nodes. It will be blocked until this is happening. The ONLY other time it will return is if the node is

/// node/nodes. It will be block until this is happens. The ONLY other time it will return is if the node is
/// shutting down, where it will return None. Use this function whenever no work can be done without a
/// BaseNodeSyncRpcClient RPC session.
pub async fn obtain_base_node_sync_rpc_client(&mut self) -> Option<RpcClientLease<BaseNodeSyncRpcClient>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where will this be used in the wallet? Is it for get_chain_metadata?

@stringhandler stringhandler merged commit 305aeda into tari-project:development Aug 17, 2021
@sdbondi sdbondi deleted the wallet-connectivity-add-pool-for-sync branch August 18, 2021 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants