You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optional products currently perform work directly in synchronous block apply: txindex ingestion, BIP157/158 filters, mempool eviction, coinstats updates, and ZMQ publication. Electrum depends on txindex storage; Utreexo has a separate state model; the BIP300/301 enforcer consumes post-apply interfaces. Each new product requirement can therefore add locks, persistence ordering, and reorg handling to consensus-critical code.
Goal
Keep full-node chainstate transitions authoritative and small, while non-consensus derived state becomes independently recoverable consumers of one durable, ordered chain-event boundary.
The default full-node path must not wait for, trust, or become unavailable because a derived consumer is slow, disabled, failed, or rebuilding.
Requirements
Authoritative core
The core apply/disconnect path owns consensus validation, default full-UTXO mutation, required body/undo persistence, the authoritative applied tip, and durable emission of ordered state-transition records. Optional indexes, Electrum serving, external notifications, and experimental Utreexo state are not consensus prerequisites.
Durable event contract
Define a versioned, ordered record containing at least:
ConnectedBlock: height, hash, parent hash, body locator, and data needed for derived state.
DisconnectedBlock: height, hash, prior/replacement context, and a durable undo/body locator as needed.
A monotonic event cursor independent of the ZMQ transport sequence.
Schema/version and retention guarantees.
The contract must allow a consumer to restart from a stored cursor without relying on best-effort ZMQ. It may be an append-only log or an authoritative-storage journal with equivalent replay guarantees.
Mempool acceptance/removal should later use the same abstraction, but must not block the block-event boundary.
Consumer lifecycle
Every optional consumer owns:
an independent durable cursor expressed as event sequence plus height/hash;
state: disabled, building, caught-up, paused, failed, or stale;
backfill from a named active-chain anchor;
idempotent connect/disconnect processing;
interruption/event-retention/reorg recovery; and
an explicit query-readiness contract.
A consumer failure must not invalidate chainstate. Its API becomes unavailable or explicitly partial until it catches up.
Ordering, reorgs, and external notifications
Events reflect only committed authoritative transitions.
Reorgs preserve tip-first disconnect then replacement-branch connect ordering.
Consumer backfill first establishes a cursor/subscription, scans its historical anchor, then drains subsequent events.
Required body, undo, and event retention must be reconciled with pruning and each consumer's rebuild procedure.
ZMQ remains a low-latency best-effort projection of committed events, not a recovery log.
The BIP300/301 enforcer remains an external sidecar and must not hold core apply locks or gate ordinary Bitcoin block application.
Migration plan
Specify and test the connect/disconnect event, cursor, and recovery contract.
Problem
Optional products currently perform work directly in synchronous block apply: txindex ingestion, BIP157/158 filters, mempool eviction, coinstats updates, and ZMQ publication. Electrum depends on txindex storage; Utreexo has a separate state model; the BIP300/301 enforcer consumes post-apply interfaces. Each new product requirement can therefore add locks, persistence ordering, and reorg handling to consensus-critical code.
Goal
Keep full-node chainstate transitions authoritative and small, while non-consensus derived state becomes independently recoverable consumers of one durable, ordered chain-event boundary.
The default full-node path must not wait for, trust, or become unavailable because a derived consumer is slow, disabled, failed, or rebuilding.
Requirements
Authoritative core
The core apply/disconnect path owns consensus validation, default full-UTXO mutation, required body/undo persistence, the authoritative applied tip, and durable emission of ordered state-transition records. Optional indexes, Electrum serving, external notifications, and experimental Utreexo state are not consensus prerequisites.
Durable event contract
Define a versioned, ordered record containing at least:
The contract must allow a consumer to restart from a stored cursor without relying on best-effort ZMQ. It may be an append-only log or an authoritative-storage journal with equivalent replay guarantees.
Mempool acceptance/removal should later use the same abstraction, but must not block the block-event boundary.
Consumer lifecycle
Every optional consumer owns:
A consumer failure must not invalidate chainstate. Its API becomes unavailable or explicitly partial until it catches up.
Ordering, reorgs, and external notifications
Migration plan
Acceptance criteria
Related issues
Non-goals