Skip to content

Latest commit

Β 

History

History
85 lines (58 loc) Β· 6.37 KB

File metadata and controls

85 lines (58 loc) Β· 6.37 KB

Project Status

Real-time view of what's in this repo. Read this before chasing a doc link.

Phase: Phase 1 / Slice 1 complete. Production Go runtime (consumers, decoders, sidecar, reconciler) shipped and green. Slices 2–4 are next per ROADMAP.md.

Last updated: 2026-06-11 (Slice 1 done β€” phases A–G, exit criterion Β§15 met).

What exists today

Production Go runtime (Slice 1, main=226245e)

  • βœ… cmd/ps β€” single binary, cobra subcommands: fileplugin --bootstrap, consumer block, consumer supplier, sync-upgrades, reconciler, migrate, deregister-consumer, version, inspect cursors, inspect streams, doctor (indexer and fileplugin live-tail are deferred β€” see docs/TECH-DEBT.md)
  • βœ… internal/fileplugin β€” sidecar: reads FilePlugin output, fans out per-tx/event/KV to NATS (ADR-022), stamps Pocket-Block-Time header, publishes pokt.block.{H} envelope last as the per-height completeness fence
  • βœ… internal/consumer β€” generic BatchRuntime: buffers messages per height, flushes in one Postgres tx on the fence, ADR-024 triggers 1–3 (fence / size-5000 / time-5s valves), partial-flush via store.FlushOnly (no cursor advance), orphan eviction with seen-count protocol; ack-after-commit invariant intact
  • βœ… internal/consumer/block and internal/consumer/supplier β€” module consumers (full supplier lifecycle: MsgStakeSupplier, MsgUnstakeSupplier, 5 event types, Supplier/ServiceConfigUpdate KV across versions)
  • βœ… internal/decoders/ β€” 9 versioned decoder packages covering all 32 mainnet-applied protocol versions (shape-range strategy: v0_1_0, v0_1_8, v0_1_10, v0_1_20, v0_1_27, v0_1_28, v0_1_29, v0_1_30, v0_1_34)
  • βœ… internal/router β€” DB-driven heightβ†’decoder dispatch; NewStaticRouter for unit tests; TestDecoderForAllMainnetBoundaries pins all 32 boundaries
  • βœ… internal/store β€” pgx v5 + sqlc; ProcessHeight, FlushOnly, cursor, AND-seal, RequiredSet, IsSealed, FirstValidHeights
  • βœ… internal/reconciler β€” upgrades-table refresh loop (immediate first sync, pocketscribe_reconciler_syncs_total / sync_errors_total, signal-aware shutdown)
  • βœ… ps sync-upgrades β€” populates upgrades table from mainnet LCD (golden-tested)

Test suite

  • βœ… 27 spec test scenarios (Β§11.1) green β€” including valves + eviction end-to-end, sidecar 256KiB/1MiB caps, migrate-down round-trip, rollback after partial write, upgrade boundary v0_1_26β†’v0_1_27, partial simultaneous restart
  • βœ… ~80 fixture triplets β€” 9 fixture heights with multi-version golden blobs (real mainnet data: v0.1.0/8/10/20/27/28/29 eras; supplier activity confirmed at 7 heights)
  • βœ… make ci β€” vet + fmt-check + lint + lint-integration + test-race (fast, no containers)
  • βœ… make ci-full β€” ci + integration + coverage gate (100% decoders / β‰₯90% internal/, composition roots internal/app/* excluded)
  • βœ… .github/workflows/ci.yml β€” lint (both tag modes) + race + integration/coverage jobs

Skills + tooling pipeline

  • βœ… 4 Claude Code skills in .claude/skills/: generate-decoder, generate-migration-from-diff, verify-migrations, add-decoder-version
  • βœ… 41 schema migrations in schema/migrations/ β€” validated end-to-end via TimescaleDB+goose
  • βœ… 34 proto-shape snapshots in docs/research/.shapes/ β€” one per poktroll release v0.1.0 β†’ v0.1.34
  • βœ… Archeology run in archeology/ β€” 32 patched binaries (via Git LFS), scripts (with tip-mode orchestrator), 3 patches, and consolidated docs (README, FINDINGS, VERSIONS)

Documentation

  • βœ… CLAUDE.md, README.md, ROADMAP.md, STATUS.md, CONTRIBUTING.md
  • βœ… docs/architecture/ (12 documents)
  • βœ… docs/decisions/ β€” 28 ADRs (ADR-001 through ADR-028)
  • βœ… docs/research/ β€” investigations (poktroll-sync-from-genesis, poktroll-versions, etc.)

Config

  • βœ… configs/networks/ β€” mainnet.yaml, beta.yaml, localnet.yaml
  • βœ… configs/{dev,downstream,observability}/ β€” templates
  • βœ… buf.yaml, buf.gen.yaml, sqlc.yaml, go.mod (toolchain configs)
  • βœ… Makefile β€” ci, ci-full, coverage, test, test-race, test-integration, verify-migrations, and more

What does NOT exist yet (Slices 2–4)

  • ❌ Continuous aggregates + bucket sealing loop (ps sealing) β€” Slice 2
  • ❌ Hasura + PostgREST deployment + COMMENT ON pass β€” Slice 3
  • ❌ NATS WebSocket bridge (ps ws-bridge) + full reconciler entity drift β€” Slice 4
  • ❌ Production deploy manifests (helm/kustomize) β€” Phase 3; deploy/dev/ + Tiltfile cover the local kind stack today (postgres, NATS, migrate, sync-upgrades, consumers, era-replay sidecar)

Schema highlights (244 tables)

The schema generation skill produces:

  • Framework tables β€” decoder_version, block, processed_heights, consumer_consolidation, consumer_registry, aggregate_registry, bucket_seal, cagg_dirty_buckets, param_history, upgrades
  • Poktroll state entities β€” Supplier, Application, Gateway, Service, Session, Claim, Proof, SessionSMT, RelayMiningDifficulty, PendingApplicationTransfer + Morse migration accounts
  • Cosmos-sdk state entities β€” BaseAccount, ModuleAccount, Bank Metadata/Balance, Staking Validator/Delegation/Redelegation/Pool/HistoricalInfo, Distribution FeePool + per-validator rewards, Gov Proposal/Vote/Deposit, Upgrade Plan, Slashing ValidatorSigningInfo, Feegrant Grant
  • ~80 stateless event/msg hypertables β€” auto-included via FQN regex rules
  • Module Params β€” one stateful table per poktroll module + per cosmos module
  • Genesis state β€” one table per module (forensic record)

See ADR-028 for the design rationale.

Schema versioning across 33 poktroll versions

The skill generates additive only migrations (CREATE TABLE IF NOT EXISTS / ALTER ADD COLUMN IF NOT EXISTS). Total = 33 decoder migrations (one per version) covering both poktroll-owned and cosmos-sdk-owned shape changes.

Two cosmos-sdk versions are vendored (deduped):

  • cosmos-sdk v0.50.13 for poktroll v0.1.0 β†’ v0.1.11
  • cosmos-sdk v0.53.0 for poktroll v0.1.12 β†’ v0.1.33

The cosmos-sdk version is detected automatically from each poktroll release's go.mod.

Roadmap next steps

See ROADMAP.md. Slice 1 foundation is proven. Slice 2 (aggregates + sealing) is next.