Skip to content

Beast/optimize queries - #50

Merged
dewabisma merged 4 commits into
mainfrom
beast/optimize-queries
Sep 14, 2026
Merged

dewabisma merged 4 commits into
mainfrom
beast/optimize-queries

Conversation

@dewabisma

Copy link
Copy Markdown
Collaborator

No description provided.

@dewabisma
dewabisma requested a review from n13 September 13, 2026 07:13

@n13 n13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. [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, returns field 'is_high_security' not found in type: 'account' for GetAccounts and field 'date' not found in type: 'daily_active_account_bool_exp' for GetAccountsStats. 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.

  2. [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.

@dewabisma

Copy link
Copy Markdown
Collaborator Author

[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, returns field 'is_high_security' not found in type: 'account' for GetAccounts and field 'date' not found in type: 'daily_active_account_bool_exp' for GetAccountsStats. 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.

I have deployed mainnet with new schema.

@dewabisma
dewabisma requested a review from n13 September 14, 2026 00:50

@n13 n13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dewabisma
dewabisma merged commit 1ab3c65 into main Sep 14, 2026
2 checks passed
@dewabisma
dewabisma deleted the beast/optimize-queries branch September 14, 2026 01:12
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.

2 participants