Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

state machine, transitions and events #1061

Closed
@pgte

Description

@pgte
  • Version: 0.26.0
  • Platform: All
  • Subsystem: core, repo, init, swarm, bitswap, libp2p, perhaps others..

Type:

Enhancement

Severity:

Medium

Description:

Initialisation and stopping an IPFS node envolves many states and transitions that are hard to handle, can fail and have many corner cases.

Currently, initialisation states and their transitions are verified and managed explicitly at code level. From my experience, this almost invariantly conducts to bugs and weirdness in app start code.

Instead, a finite state machine that contains all the main, intermediary and error states should be well defined and documented.

The initialisation code should be driven by state transitions, and not the other way around (like it is now). This will avoid double user actions, like starting or stopping the node twice concurrently, or trying to stop after stopped, etc.


IMO, special attention should be given so that the implementation:

  • is consistent: for instance, even if repo initialisation is not required, a initialised or equivalent transition event should be fired.
  • Some operations should be idempotent: starting a node that is started or is starting should not lead to an error, much less triggering the startup procedure again.
  • Any Irrecoverable error in initialisation should lead to an dead-end "error" state.

Metadata

Metadata

Assignees

Labels

P1High: Likely tackled by core team if no one steps upexp/wizardExtensive knowledge (implications, ramifications) requiredhelp wantedSeeking public contribution on this issuestatus/readyReady to be worked

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions