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: bug in wallet base node peer switching #3217

Merged
merged 3 commits into from
Aug 19, 2021

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Aug 19, 2021

Description

  • Connectivity retries connecting indefinitely, however previously if
    this continuously fails and the user updates their peer, the new peer will not be
    read until the previous peer was connected to. This PR fixes this.
  • Add protocl information to comms RPC logs
  • Cleanup peer state, making the wallet connectivity service the source
    of truth for the base node peer
  • Adds an Ack flag to RPC protocol, this is not currently used but
    could be implemented in the client side in future if required without
    breaking the network (server supports it, we may choose in future to implement a client keep alive should it be needed,
    current server side impl easy and zero cost).

Motivation and Context

Critical bug fix

How Has This Been Tested?

Switching the console wallet base node peer a number of times

Checklist:

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

@sdbondi sdbondi force-pushed the wallet-monitoring-fix branch from 0e0fc0e to 6da18e5 Compare August 19, 2021 12:58
- Connectivity retries connecting indefinitely, however previously if
  this continuously fails and the user updates their peer, the new peer will not be
  read until the previous peer was connected to. This PR fixes this.
- Add protocl information to comms RPC logs
- Cleanup peer state, making the wallet connectivity service the source
  of truth for the base node peer
- Adds an `Ack` flag to RPC protocol, this is not currently used but
  could be implemented in the client side in future if required without
  breaking the network (server supports it, client support may or may
  not be needed).
@sdbondi sdbondi force-pushed the wallet-monitoring-fix branch from 6da18e5 to 17e44aa Compare August 19, 2021 13:41
self.wallet_connectivity.set_base_node(peer.node_id.clone()).await?;

self.publish_event(BaseNodeEvent::BaseNodeStateChanged(new_state));
self.wallet_connectivity.set_base_node(peer.clone()).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like it should happen in the wallet container set_base_node_peer function where all the other wallet services have their set_base_node method called.

Copy link
Member Author

@sdbondi sdbondi Aug 19, 2021

Choose a reason for hiding this comment

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

Yeah agree, will require a bit more of a refactor (BaseNodeEvent::BaseNodePeerSet event needs to be moved around / base node service needs to monitor the change and emit the event), wanted to get this in quicker.

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR queued successfully. Your position in queue is: 2

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR is on top of the queue now

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR failed to merge with reason: Failed due to unknown reason
Additional debug info: Required status check "test" is in progress.

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR queued successfully. Your position in queue is: 5

@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR is on top of the queue now

@aviator-app aviator-app bot merged commit 878c317 into tari-project:development Aug 19, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Aug 19, 2021

PR queued successfully. Your position in queue is: 1

@sdbondi sdbondi deleted the wallet-monitoring-fix branch August 20, 2021 07:24
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