Skip to content

Zift batch 5: unpublished value_pools_daily (node pool balances, NSM) - #228

Merged
Kenbak merged 1 commit into
mainfrom
new/zift-nu7-accounting
Nov 2, 2026
Merged

Kenbak merged 1 commit into
mainfrom
new/zift-nu7-accounting

Conversation

@Kenbak

@Kenbak Kenbak commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Adds an unpublished research dataset, value_pools_daily. Each completed UTC date gets one row: the node's own getblockchaininfo value pools at the highest observed canonical block of that date. Runbook: server/deploy/ask-analytics/value-pools.md (rollback first). Nothing is applied to any host by this PR.

Columns: date, height, hash, observed_blocks, day_blocks, transparent, sprout, sapling, orchard, ironwood, lockbox, nsm, chain_supply (zatoshi stocks).

Source: the indexer's insert-only node_accounting_observations (from 2026-09-28, ~1,150 rows/day). It is replicated with reviewed columns only; subsidy (funding-stream addresses), upgrades, source and poll_interval_ms stay private.

Findings that shaped it (read-only, mainnet, 2026-11-02)

  • Supply name: the node's circulating_supply_zat equals the sum of all pools including the lockbox, and matches supply_daily.chain_supply at all 35 day-end blocks. It is published as chain_supply, so it can't be confused with supply_daily.circulating_supply, which excludes the lockbox.
  • Orphans: 109 observations are of orphaned blocks. The view joins (height, hash) to canonical blocks, so they never appear.
  • Coverage: every day so far has a few unobserved blocks (183 in 35 days). observed_blocks and day_blocks expose this.
  • Relation to daily: daily (indexer-maintained shielded balances) differs slightly from the node's figures. The guidance says which to use and to name the source.
  • Speed: the view over the mainnet tables returns 35 dates in 0.53 s.

Privacy: these are chain-wide totals, one row per date, so they can't link shielded activity. turnstile_daily and the other excluded tables stay unpublished.

Lessons from batch 4 applied

  • The reader grant is its own file (value-pools-grant-v1.sql), applied only after the worker that lists the view. The test asserts that value-pools-v1.sql never touches ask_public_reader.
  • The runbook includes the recovery repin (17 relations) and the reader_view_drift check.

Tests

  • Unit (catalogue = view columns, guarded migrations, column lists, admission rule): ask-research-value-pools.test.js.
  • PG view: canonical day ends, orphan exclusion, NULL for unmonitored pools, coverage gating.
  • Logical replication end to end: ask-logical-sync.test.js.
  • Eval case value_pools_end_2026_10 stays pending until publish.
  • Locally: 1,283 API tests and the Python alert tests pass. The PG tests run in CI only.

🤖 Generated with Claude Code

Daily node-reported value-pool balances (transparent, Sprout, Sapling,
Orchard, Ironwood, lockbox), the NSM balance and chain supply at the highest
observed canonical block of each completed UTC date, from the indexer's
insert-only getblockchaininfo observations (from 2026-09-28).

Store and mainnet migrations with rollbacks, a separate reader grant applied
only after the worker that lists the view, admission readiness, catalogue
entry (published:false), guidance, example, eval case, tests and runbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zecblock Ready Ready Preview Nov 2, 2026 10:02pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
zecblock-crosslink Ignored Ignored Nov 2, 2026 10:02pm UTC
zecblock-testnet Ignored Ignored Nov 2, 2026 10:02pm UTC

Request Review

@Kenbak
Kenbak merged commit 627bd87 into main Nov 2, 2026
30 checks passed
@Kenbak
Kenbak deleted the new/zift-nu7-accounting branch November 2, 2026 22:15

This branch was successfully deployed

1 active deployment
Preview – zecblock — 6031d37b Deployed Nov 2, 2026 by vercel[bot]
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