Skip to content

refactor(ntx-builder): replace dataless Notify with per-account watch#2301

Open
SantiagoPittella wants to merge 3 commits into
nextfrom
santiagopittella-replace-notify-with-watch
Open

refactor(ntx-builder): replace dataless Notify with per-account watch#2301
SantiagoPittella wants to merge 3 commits into
nextfrom
santiagopittella-replace-notify-with-watch

Conversation

@SantiagoPittella

@SantiagoPittella SantiagoPittella commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #2259

Summary

Replaces the dataless Notify the ntx-builder coordinator used to wake account actors with a per-account watch::channel<AccountView> that carries the committed-block state to each actor directly.

Why:

  • On every committed block the coordinator woke every active actor without carrying data, so each actor then re-checked "what happened" from SQLite.

How:

  • The coordinator pushes a AccountView { chain_tip, last_committed_tx, notes_seen } per account via a watch channel. Fields are cumulative, so an actor that slept through several blocks reads one summarised view and answers everything in memory.
  • Inclusion detection becomes just an in-memory compare and removes the per-block account_last_tx query.
  • available_notes now also returns next_retry_block. Actors schedule a single re-check instead of polling each block.
  • The idle-timeout shutdown race is handled by a biased select! + an authoritative account_has_pending_notes recheck on reap, replacing the old Notify-permit trick.

Changelog

[[entry]]
scope = "ntx-builder"
impact = "changed"
description = "Drive account actors from a per-account watch<AccountView> instead of a dataless Notify, eliminating per-block DB polling for landing checks and note availability."

@SantiagoPittella SantiagoPittella force-pushed the santiagopittella-replace-notify-with-watch branch from 1976ec1 to 70a3d2d Compare June 30, 2026 21:04
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.

Ntx Builder: replace dataless Notify

1 participant