archethic-node icon indicating copy to clipboard operation
archethic-node copied to clipboard

Reconnection backoff & heartbeat mechanism

Open bchamagne opened this issue 1 year ago • 1 comments

Description

  • Exponential backoff on reconnect (capped at 24 hours)
  • Wakeup when the other node connect to us
  • Heartbeat to automatically close "stale" connections

Fixes #1323

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested locally with multiple nodes and turning them on and off.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

bchamagne avatar Dec 11 '23 15:12 bchamagne

Do you think we should add a code_change to adapt the state, or prefer restarting the process ?

samuelmanzanera avatar Dec 14 '23 13:12 samuelmanzanera