Beast/optimize queries - #50
Conversation
n13
left a comment
There was a problem hiding this comment.
Reviewer model: GPT-6 Astra
Request changes: the new account queries break mainnet, and the daily-rollup filters miscount accounts in non-UTC timezones. Reviewed head 4610af400b10595f0842554f572240aa88c24cda against base 243f52a661a48a7fb96b1e4ba963c0c22c28c911.
-
[P1] Make the mainnet schema ready before activating the new queries. src/api/accounts.tsx:34–36 and 117–135: replaying the exact head queries against the configured default endpoint,
https://sqm.quantus.com/v1/graphql, returnsfield 'is_high_security' not found in type: 'account'forGetAccountsandfield 'date' not found in type: 'daily_active_account_bool_exp'forGetAccountsStats. Both base queries succeed against that endpoint; the head queries succeed on Planck. Shipping this frontend against the current mainnet API therefore replaces the account list and all three account-stat cards with errors. Deploy/backfill the required indexer fields and expose them through mainnet Hasura before enabling these queries there, or gate their activation by network readiness. -
[P2] Align the date bounds with the UTC rollup buckets. src/api/accounts.tsx:117–130: these predicates now compare UTC-midnight bucket dates with the browser-local bounds still constructed at lines 106–107. In Los Angeles on September 13, the lower bound is
2026-09-06T07:00:00Z, so the entire September 6 bucket is excluded, including transfers after that cutoff that the old query counted. Replaying both queries on Planck with identical Los Angeles bounds returned active/deposit counts of 39/309 before versus 38/303 after. Construct UTC calendar-day bounds for these rollups and add a regression check in a non-UTC timezone.
Validation: production build (vite build && tsc) passed; bun test passed all 24 tests; changed non-generated files passed Prettier; git diff --check passed. All eight account/miner generated query documents and lookup entries match their source. Live chain-wide and sampled single-miner summary totals matched aggregate reward counts on both mainnet and Planck. The checks above do not resolve the two findings.
I have deployed mainnet with new schema. |
n13
left a comment
There was a problem hiding this comment.
Reviewer model: GPT-6 Astra
Approve: both previous findings are resolved, and no blocking findings remain. Reviewed the full diff at b03135c49f91986a29f4063517f527f2ac3804f1 against 243f52a661a48a7fb96b1e4ba963c0c22c28c911.
- The current account-list and account-stat queries succeed against both configured endpoints, mainnet and Planck. With identical UTC bounds, the rollup and original transfer-based queries return matching active/deposited account counts: 1,848/3,076 on mainnet and 38/304 on Planck.
- The UTC date-range helper resolves the timezone finding; its Los Angeles regression test passes.
- Chain-wide and sampled single-miner reward totals match their aggregate reference counts on both networks. Focused React/Apollo checks confirm query selection, variables, and normalized totals when switching filters; pagination-hook checks confirm deep-link and page-size clamping.
Validation: production build (vite build && tsc) passed; bun test passed all 25 tests; changed non-generated files passed Prettier; git diff --check passed. All eight account/miner generated documents and lookup entries match their source queries. Both GitHub checks passed, and the PR head was rechecked before posting.
No description provided.