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: connections can become stale when reconnecting #4310

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

msgmaxim
Copy link
Contributor

@msgmaxim msgmaxim commented Dec 5, 2023

Pull Request

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Previously in some cases it was possible for connections to never become "stale" (preventing reconnections when inactive). Specifically, when we fail to connect to a node due to some authentication error, this would result us reconnecting to the node manually (rather than this being done by zmq internally), but this also reset activity for that node to "now" on every restart, preventing us from detecting the connection as stale. I changed the code to carry over any previous activity state when reconnecting, so inactive connections should now always enter "stale" state.

Writing a proper unit test for this is a bit cumbersome and I'm not sure if worth it, but I have tested this manually by changing some parameters and observing logs that the bug was present initially and that the new code fixes the incorrect behaviour.

engine/src/p2p/core.rs Outdated Show resolved Hide resolved
@msgmaxim msgmaxim merged commit 6ac9885 into main Dec 14, 2023
40 checks passed
@msgmaxim msgmaxim deleted the fix/stale-when-reconnecting branch December 14, 2023 23:52
syan095 added a commit that referenced this pull request Dec 18, 2023
…-timeout

* origin/main:
  feat: end to end network upgrade github action (#4274)
  feat: spec_version of PR is greater than spec version of current release (#4355)
  feat: enforce version is greater than release version on PRs to main (#4351)
  fix: btc witnesser test failing sometimes (#4353)
  fix: connections can become stale when reconnecting (#4310)
  chore: add `chainflip-rpc-node` systemd file 🚀 (#4352)
  feat: API Bins check SC compatibility (#4342)
  chore: update runtime spec checks ⛓️ (#4349)
  feat: Add version cmd to all bins (#4343)
  fix: changelog check 🤫 (#4348)
  chore: update docker tags 🐳 (#4347)
  chore: add runtime version check 👀 (#4344)
  feat: shave fees on ingress (#4335)
  pick/persa fixes (#4329)
  feat: track btc fees on success (#4334)
  ensure we dont create BTC transaction outputs below the bitcoin dust limit (#4340)
  fix: sweeping before withdrawal (#4337)
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.

None yet

2 participants