Skip to content

Fully retire D1 for chain data — delete tables, prune logic, ingest endpoints, and the D1 fallback (gated on #4771) #4772

Description

@JSONbored

Context

The end state for metagraphed-health D1, per ADR 0014 and the #2108 infra epic, is full retirement for chain data -- D1 was always meant to be a temporary hot cache during the Postgres cutover, not a permanent architecture. Tonight's work (#2112, #4746/#4750) got blocks/extrinsics/account_events flipped to Postgres-primary, and #4771 (once built) will do the same for the metagraph/neuron pipeline. This issue tracks the actual deletion once every dependency clears -- it is explicitly a "once X, Y, Z are true" issue, not startable yet.

D1 hosts tables in genuinely different categories, and this issue is scoped ONLY to the chain-data ones -- the health/registry-monitoring tables (surface_checks, surface_status, surface_uptime_daily, rpc_proxy_events) are unrelated to chain data and are explicitly NOT part of D1 retirement; they're registry/health-prober telemetry with their own, already-working retention and no relationship to the Postgres cutover. Do not delete them under this issue.

Similarly, account_events_daily and subnet_snapshots are explicitly, deliberately retained indefinitely per their own migration comments (migrations/0009_account_events.sql:33-35, migrations/0002_analytics.sql:9-10) -- low-volume, long-term-by-design tables, not a capacity risk at any realistic timescale (~2GB/decade and ~4MB/decade respectively at current growth). These are NOT part of D1 retirement either; do not touch them under this issue.

Requirements

Deliverables

  • A single, well-tested PR (or a small tightly-sequenced set) deleting the schema, prune logic, ingest endpoints, and fallback code identified above.
  • Deletion of the now-unused scripts/docs/workflows/Ansible role.
  • An updated ADR reflecting the actual end state.
  • Confirmation that account_events_daily, subnet_snapshots, and the health/registry-monitoring tables remain untouched and D1 continues to exist for exactly those, by design.

Expected outcomes

  • metagraphed-health D1 shrinks to just its intentionally-D1-native tables (health/registry monitoring + the two deliberately-indefinite rollups).
  • No dead code paths remain referencing the retired tables.
  • The block explorer's chain-data serving is 100% Postgres, with no D1 fallback remaining for blocks/extrinsics/account_events/neurons/neuron_daily.

Links/resources

Priority

Medium -- not startable until #4771 lands, and not urgent in itself (D1's chain-data tables are now correctly bounded and shrinking, not an active risk). This is the clean final step of a project already well underway, tracked now so it isn't forgotten once the real blocker (#4771) clears.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions