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

Refactor: Improve reliability of peerd connections #792

Merged

Conversation

TheCharlatan
Copy link
Member

@TheCharlatan TheCharlatan commented Nov 28, 2022

This includes:

  • Tracking the swapd connection status
  • Unique peerd Id's
  • Taker reconnects on checkpoint restore
  • Reporting back on initial connect failure

TheCharlatan and others added 30 commits November 14, 2022 23:15
This allows us to consistently inform the user on the connection status
of the swap.

Peerd now emits Disconnected and Reconnected requests to farcasterd,
which in turn can route them on to swapd.
The connect command now allows a user to manually trigger a connect for
a restored swap that was previously unable to connect.
was calling colorize func, not swap_id itself
Handle Connect msg properly for running and restoring swapd

Peerd: Add a Pong to our own hacky handshake

Peerd: Only insert protocol messages to unchecked_msg_cache
Farcaster: Correct handling of restoring tsm connection
Ensure ConnectSuccess message is only expected for Taker swaps

Handle new and failed connections in a coherent manner

Trigger peerd termination externally, not internally
log swapids if awaiting connection
Peerd: Emit Reconnected only after checking cached messages

Do not reconnect as a listener-spawned peerd
@TheCharlatan TheCharlatan added refactor farcaster.dev testing Currently apply (or to be applied) on farcaster.dev backend reliability Feature increasing the reliability of the service labels Nov 28, 2022
@TheCharlatan TheCharlatan changed the title Peerd connect treatment rebase Refactor: Improve reliability of peerd connections Nov 28, 2022
Copy link
Member

@h4sh3d h4sh3d left a comment

Choose a reason for hiding this comment

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

Currently testing swaps against fc.dev. This is my first round of review.

I can see this in my logs, not sure what triggers it and if it is related to this work or not:

[2022-11-29T10:18:23Z WARN  farcaster_node::swapd::swap_state] Not on RefundSig state

This is happening as Bob.

src/event.rs Outdated Show resolved Hide resolved
src/farcasterd/runtime.rs Outdated Show resolved Hide resolved
src/farcasterd/trade_state_machine.rs Outdated Show resolved Hide resolved
src/grpcd/runtime.rs Outdated Show resolved Hide resolved
@TheCharlatan
Copy link
Member Author

I can see this in my logs, not sure what triggers it and if it is related to this work or not:

[2022-11-29T10:18:23Z WARN  farcaster_node::swapd::swap_state] Not on RefundSig state

This is happening as Bob.

This is unrelated, it's also logged on main.

Copy link
Member

@h4sh3d h4sh3d left a comment

Choose a reason for hiding this comment

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

Last round, mostly minor comments, feel free to discard the ones that you consider not important.

src/farcasterd/runtime.rs Outdated Show resolved Hide resolved
src/farcasterd/runtime.rs Outdated Show resolved Hide resolved
src/farcasterd/trade_state_machine.rs Outdated Show resolved Hide resolved
src/farcasterd/trade_state_machine.rs Outdated Show resolved Hide resolved
src/swapd/runtime.rs Show resolved Hide resolved
src/swapd/runtime.rs Outdated Show resolved Hide resolved
src/swapd/runtime.rs Outdated Show resolved Hide resolved
src/swapd/runtime.rs Outdated Show resolved Hide resolved
src/farcasterd/trade_state_machine.rs Outdated Show resolved Hide resolved
src/peerd/runtime.rs Outdated Show resolved Hide resolved
@h4sh3d h4sh3d merged commit 5d8a61f into farcaster-project:main Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
farcaster.dev testing Currently apply (or to be applied) on farcaster.dev backend refactor reliability Feature increasing the reliability of the service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants