Expand description
Overlay Services Engine — the core orchestrator.
Receives transactions (submit), answers queries (lookup), manages advertisements, and coordinates GASP sync. All storage, topic management, and lookup service operations go through trait interfaces.
Ported from ~/bsv/overlay-services/src/Engine.ts (1,337 lines).
Structs§
- Cursor
Move - One peer’s persisted
last_interactioncursor movingfrom->toin a sync (TopicSyncResult::cursor_moves). - Door
Budget - The DOOR’s static work bound (bsv-low W-A gate MED-1, 2026-09-09). Bitcoin script has no loops: every opcode runs at most once, so an input’s work is bounded BEFORE execution by its opcode census times the interpreter’s element limit (the stack memory limit bounds every element, and every CAT / NUM2BIN / SPLIT result with it) plus its signature checks times the transaction’s own size or a floor, whichever is more (a BIP-143 preimage hashes the prevouts and the outputs; the EC verification costs the same whatever the transaction weighs). The estimate is computed from the bytes; nothing executes past the budget, and a budget breach is the DOOR’s verdict (inconclusive: the network judges), never the interpreter’s.
- Dropped
Deferral - A deferred graph’s record deleted without converging (bsv-low #555,
TopicSyncResult::dropped_graphs). - Engine
- The Overlay Services Engine.
- Engine
Config - Configuration for constructing the Engine.
- GASP
Sync Result - Result of a GASP sync operation.
- Mutation
Fault - One Phase-3 write — or the validation read it depends on — that FAILED during a submit (S2 queue-durable admission, bsv-low 2026-08-29).
- Mutation
Report - What Phase 3 actually landed for a submit — the durability report.
- Proof
Completion Summary - Summary of an
Engine::complete_missing_proofspass. - Renotify
Report - bsv-low PLAN-PRE-LOOP4 §H4 (2026-09-06): what
Engine::renotify_admitteddid. - Sync
Advertisements Report - Outcome of one
Engine::sync_advertisementsrun (bsv-low #320 defect 3a). - Topic
Sync Result - Sync result for a single topic.
- Walk
Could NotRun - A submit whose own script walk COULD NOT RUN within the engine’s
DoorBudget(bsv-low #592, the owner’s ruling 3a of 2026-10-10). Shaped likeEngineError::ScriptWalkOverBudget. UnderWalkBreachPolicy::NotNowit is carried byEngineError::WalkCouldNotRun(not now); underWalkBreachPolicy::NetworkAcceptedthe submit went on as underHistoricalTxNoSpvand this says so on itsMutationReport. The reference (Engine.submit,tx.verify) has no budget; this is the platform’s addition, on the door’s lineage (D8). - Walk
Stats - What the walk did (the door’s cost instrument, since
Date.now()is frozen during synchronous work on Workers and cannot time it).
Enums§
- Door
Limb - Which limb of the
DoorBudgeta walk went past. - Engine
Error - History
Selector - Controls how much spend history to include in lookup responses.
- Walk
Breach Policy - What a submit does when its own script walk could not run within the
engine’s
DoorBudget(bsv-low #592; the E592 lens fold, H1, the owner’s ruling 3a read with the lens): a breach is NEVER an admission without the network’s word on record. - Walk
Limb - Which limb of the
DoorBudgeta submit’s own walk went past (bsv-low #592): theDoorLimbof the door’s error, with the interpreter’s own memory limit told apart from the static work estimate.
Type Aliases§
- Landing
Guard - The caller’s admission predicate over a carried predecessor the door is
about to land:
(predecessor txid, topic). SeeEngine::set_landing_guard. - Landing
Guard Future - The answer of a
LandingGuard:Oklets the body land,Errsays why it may not (the topic waits). - Sleep
Factory - Platform sleep factory (bsv-low#302): milliseconds → a future that
resolves after that delay. The Cloudflare crate passes its
sleep_ms; tests passready(())(instant deadline) orpending()(no deadline) to drive the race deterministically. - Sleep
Future - Boxed platform sleep future (bsv-low#302). Not
Send— the engine runs single-threaded on wasm (Workers) and under#[tokio::test]locally.