Fix registered CL8Y balances reading as 0 after snapshot #20

Merged
PlasticDigits merged 2 commits from fix/9-registered-balance-zero into main 2026-08-29 15:01:55 +00:00
PlasticDigits commented 2026-08-29 14:46:07 +00:00 (Migrated from gitlab.com)

Summary

  • Default GET /v1/balances for a registered wallet now evaluates at max(indexer tip, registered_at_height) on Terra and BSC (OV-B1). That is the live-QA failure on vote.cl8y.com: a just-registered holder with thousands of CL8Y saw ledger 0 while last_indexed_* was still 0 or behind the live snapshot (L6).
  • Unregistered / pending wallets still return "0" with registered: false / pending: true. The dApp no longer presents that as a live chain holding. Register polls until voting_registrations exists instead of treating POST ok as Registered.
  • Propose freeze clamps only the proposer's chain clock (Terra height is never applied to the BSC block freeze). Explicit ?height= below register still returns 0 (L6 preserved). Restricted role still cannot INSERT ingest tables.

Related to #9. Does not close #9: live LCD equality on vote.cl8y.com and BSC O7 still need a human wallet.

Test plan

  • cargo test --workspace --lib
  • LEDGER_TEST_DATABASE_URL=postgres://voting:voting@127.0.0.1:5433/voting cargo test --workspace --tests
  • cd frontend && npm test && npm run test:e2e
  • Staging: registered Terra holder with ≥1000 pinned CW20 CL8Y — LCD Balance ≈ voting_registrations.initial_balance ≈ default GET /v1/balances (non-zero on list + /vote/new)
  • Staging: unregistered connected wallet does not show “Connected · 0 CL8Y”
  • Staging: Register shows Registering… until the ledger row exists, then the snapshot amount
  • Staging: explicit GET /v1/balances/:addr?height= below registered_at_height is still 0
  • Staging: BSC analogue (last_indexed_bsc_block vs registered_at_height)
  • Staging: ledger GET /health caught_up / advancing terra_height after register
  • Confirm CL8Y_TOKEN_ADDRESS on Coolify is hpax3 (CL8Y-cb ticker is that contract unless proven otherwise)
## Summary - Default `GET /v1/balances` for a registered wallet now evaluates at `max(indexer tip, registered_at_height)` on **Terra and BSC** (OV-B1). That is the live-QA failure on `vote.cl8y.com`: a just-registered holder with thousands of CL8Y saw ledger `0` while `last_indexed_*` was still `0` or behind the live snapshot (L6). - Unregistered / pending wallets still return `"0"` with `registered: false` / `pending: true`. The dApp no longer presents that as a live chain holding. Register polls until `voting_registrations` exists instead of treating POST `ok` as Registered. - Propose freeze clamps only the proposer's chain clock (Terra height is never applied to the BSC block freeze). Explicit `?height=` below register still returns 0 (L6 preserved). Restricted role still cannot `INSERT` ingest tables. Related to #9. Does **not** close #9: live LCD equality on `vote.cl8y.com` and BSC O7 still need a human wallet. ## Test plan - [ ] `cargo test --workspace --lib` - [ ] `LEDGER_TEST_DATABASE_URL=postgres://voting:voting@127.0.0.1:5433/voting cargo test --workspace --tests` - [ ] `cd frontend && npm test && npm run test:e2e` - [ ] Staging: registered Terra holder with ≥1000 pinned CW20 CL8Y — LCD `Balance` ≈ `voting_registrations.initial_balance` ≈ default `GET /v1/balances` (non-zero on list + `/vote/new`) - [ ] Staging: unregistered connected wallet does not show “Connected · 0 CL8Y” - [ ] Staging: Register shows Registering… until the ledger row exists, then the snapshot amount - [ ] Staging: explicit `GET /v1/balances/:addr?height=` below `registered_at_height` is still `0` - [ ] Staging: BSC analogue (`last_indexed_bsc_block` vs `registered_at_height`) - [ ] Staging: ledger `GET /health` `caught_up` / advancing `terra_height` after register - [ ] Confirm `CL8Y_TOKEN_ADDRESS` on Coolify is hpax3 (CL8Y-cb ticker is that contract unless proven otherwise)
PlasticDigits commented 2026-08-29 14:46:21 +00:00 (Migrated from gitlab.com)

mentioned in issue #9

mentioned in issue #9
PlasticDigits commented 2026-08-29 15:01:50 +00:00 (Migrated from gitlab.com)

added 3 commits

  • 6619254b...e2e941e9 - 2 commits from branch main
  • b33da5ed - Merge origin/main into fix/9-registered-balance-zero

Compare with previous version

added 3 commits <ul><li>6619254b...e2e941e9 - 2 commits from branch <code>main</code></li><li>b33da5ed - Merge origin/main into fix/9-registered-balance-zero</li></ul> [Compare with previous version](/PlasticDigits/voting/-/merge_requests/3/diffs?diff_id=1992167619&start_sha=6619254b8a7a63997265c9f77dba9460df01e73d)
PlasticDigits commented 2026-08-29 15:01:56 +00:00 (Migrated from gitlab.com)

mentioned in commit 4f18713f5e

mentioned in commit 4f18713f5e6f3efe41051510f6e7ba71ca217208
PlasticDigits (Migrated from gitlab.com) merged commit 4f18713f5e into main 2026-08-29 15:01:56 +00:00
PlasticDigits commented 2026-08-29 15:02:44 +00:00 (Migrated from gitlab.com)

mentioned in issue #7

mentioned in issue #7
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/voting!20
No description provided.