Skip to content

chore: refactor node#57

Closed
jcabrero wants to merge 2 commits intomainfrom
chore/refactor_node
Closed

chore: refactor node#57
jcabrero wants to merge 2 commits intomainfrom
chore/refactor_node

Conversation

@jcabrero
Copy link
Member

Inspired by @mfontanini PR for the keeper, created this to simplify the structure of the blacklight-node and make it more readable.

  • It replaces tokio::Notify with a tokio_utils::cancellation_signal that should tell the node to interrupt the listening task. In this case it was working because there is always a listening for cancellation event and only once concurrent tokio::select! waiting for the cancellation signa. It would have worked with notify_once but I believe it is more solid using a cancellation signal in case the node was ever doing more than one listening event in parallel.
  • I created a supervisor module which runs the main loop and is in charge of client reconnections in case of failures.
  • It has some functions to listen for events, and to process htxs. The rest of the functionality remains in the same places.

@jcabrero jcabrero changed the title chore: refactor keeper chore: refactor node Jan 29, 2026
@jcabrero jcabrero marked this pull request as draft January 29, 2026 11:34
Base automatically changed from chore/refactor-keeper to main January 29, 2026 15:46
@jcabrero jcabrero closed this Feb 5, 2026
@jcabrero jcabrero deleted the chore/refactor_node branch February 5, 2026 10:36
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.

1 participant