Skip to content

[DRAFT] ingest: full-history ingestion for cold + hot stores (#765)#779

Draft
chowbao wants to merge 1 commit into
fh-764-viewsfrom
fh-765-ingest
Draft

[DRAFT] ingest: full-history ingestion for cold + hot stores (#765)#779
chowbao wants to merge 1 commit into
fh-764-viewsfrom
fh-765-ingest

Conversation

@chowbao

@chowbao chowbao commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Implements #765 — the full-history ingestion path. Code at cmd/stellar-rpc/internal/fullhistory/ingest/.

Draft / stacked on the #764 views PR (fh-764-views). GitHub shows only the ingest delta; both retarget to feature/full-history as their parents land. Bundles the txhash cold-store extraction (a #765 dependency).

Design (matches the issue)

  • Interfaces (published, view-based): HotIngester{Ingest(ctx, xdr.LedgerCloseMetaView)}, ColdIngester{Ingest, Finalize, Close}.
  • Six ingesters — ledger/events/txhash × hot/cold — deriving per-LCM shapes via the XDR view extractors: events, tx-hashes, tx-details, tx-pages from LedgerCloseMetaView #764 view extractors. Ledger stores []byte(lcm) verbatim.
  • Ownership: hot ingesters receive a long-lived store via DI (daemon owns lifecycle); cold ingesters open their own per-chunk writer (Finalize commits, Close drops partials).
  • Per-tier services: HotService (per-LCM parallel fan-out, waits-all), ColdService (sequential + Finalize), config-driven data-type selection.
  • Metrics: MetricSink interface + PrometheusSink (daemon convention). Per-ingester (hot per-ledger, cold per-chunk: latency/items/errors) + aggregate per-tier wall-clock — emitted on success and failure paths.
  • Sources: extensible ChunkSourceNewPackSource / NewGCSSource / NewS3Source / NewDataStoreSource (GCS/S3/FS unify via the SDK datastore; new backends implement one interface).

Notes

  • Decode is zero-copy view path (no parsed/passphrase path); borrowed-buffer safety verified under -race.
  • V0 ledgers ingest as zero events (no contract events pre-Soroban).
  • Daemon startup wiring of the Prometheus sink + the txhash cold MPHF index build are documented follow-ups.

Test plan

  • go test ./cmd/stellar-rpc/internal/fullhistory/ingest/ ./cmd/stellar-rpc/internal/fullhistory/pkg/stores/txhash/ (incl. -race)
  • per-ingester readback, service fan-out + subset configs, cold success/failure metric emission, Prometheus sink smoke

View-based ingestion pipeline at internal/fullhistory/ingest:
- HotIngester / ColdIngester interfaces over xdr.LedgerCloseMetaView.
- Six ingesters (ledger/events/txhash x hot/cold) using the #764 view
  extractors; hot stores injected (daemon-owned), cold writers per-chunk.
- Per-tier HotService (parallel per-LCM fan-out) / ColdService
  (sequential + Finalize), config-driven data-type selection.
- MetricSink interface + Prometheus implementation (daemon convention);
  per-ingester + aggregate signals, emitted on success and failure paths.
- ChunkSource abstraction: pack / GCS / S3 / any datastore, extensible.

Hardening: drain validates per-ledger LedgerSequence; txhash cold .bin
published atomically (tmp+rename); concurrency-safe txhash cold reader;
failure-path + .bin-content tests.

Bundles the txhash cold-store extraction (a #765 dependency).
Closes #765.
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