Indexer zeros claimable_cred after CredClaimed despite residual pendingCred (migrateLastBuyEpochToPodium) #368

Closed
opened 2026-07-09 06:48:28 +00:00 by PlasticDigits · 3 comments
PlasticDigits commented 2026-07-09 06:48:28 +00:00 (Migrated from gitlab.com)

Summary

Wallet 0xA5F424182E8E94c328EC6441ebf508e1cb48f8bA cannot claim CRED for ended Last Buy epoch 0 via the play UI while lastBuyEpoch == 1.

Evidence (MegaETH 4326 · indexer.yieldomega.com)

  • On-chain pendingCred(wallet, 0) ≈ 2828.69 CRED (weight + first-buy bonus still set).
  • eth_call claimCred(0) from the wallet succeeds.
  • Indexer GET /v1/arena/wallet/.../stats returns claimable_cred_epoch: "0" but claimable_cred: "0" because any idx_play_cred_claim row for epoch 0 forced pending to zero.
  • Prior claim: tx 0x27f8c3c92ceb5bce5d63520b39e78ed7a5ece4e74d571fecfe9d2b3acba05368 (epoch 0, ~1865 CRED) before migrateLastBuyEpochToPodium (tx 0x75b885888ce062bb824ca851d572736d433210ad544e918b8ddf8ad1676f4162, aligned lastBuyEpoch 13→0 and consolidated drift balances into epoch 0, including this wallet).

Root cause

arena_wallet_stats treated “claimed once” as “nothing left”, and SQL buy reconstruction cannot see remapped epochCharmWad / epochFixedCredBonus after migration. Frontend Claim CRED is gated on indexer claimable_cred > 0 (INV-FRONTEND-301 indexer-first).

Fix

Prefer live TimeArena.pendingCred for claimable_cred / pending_cred_accrual (schema ≥ 2.26.0). INV-INDEXER-CRED-PENDING-ONCHAIN.

Workaround (until indexer redeploy)

Call claimCred(0) on TimeArena 0xba39cea0e5ef6808d8cb926c722877480049e0ee directly (wallet already has residual pending).

Verify

  • Redeploy indexer → wallet stats claimable_cred ≈ on-chain pendingCred.
  • cargo clippy --all-targets -- -D warnings · cargo test in indexer/.
## Summary Wallet `0xA5F424182E8E94c328EC6441ebf508e1cb48f8bA` cannot claim CRED for ended Last Buy epoch 0 via the play UI while `lastBuyEpoch == 1`. ## Evidence (MegaETH 4326 · indexer.yieldomega.com) - On-chain `pendingCred(wallet, 0)` ≈ **2828.69 CRED** (weight + first-buy bonus still set). - `eth_call claimCred(0)` from the wallet **succeeds**. - Indexer `GET /v1/arena/wallet/.../stats` returns `claimable_cred_epoch: "0"` but **`claimable_cred: "0"`** because any `idx_play_cred_claim` row for epoch 0 forced pending to zero. - Prior claim: tx `0x27f8c3c92ceb5bce5d63520b39e78ed7a5ece4e74d571fecfe9d2b3acba05368` (epoch 0, ~1865 CRED) **before** `migrateLastBuyEpochToPodium` (tx `0x75b885888ce062bb824ca851d572736d433210ad544e918b8ddf8ad1676f4162`, aligned `lastBuyEpoch` 13→0 and consolidated drift balances into epoch 0, including this wallet). ## Root cause `arena_wallet_stats` treated “claimed once” as “nothing left”, and SQL buy reconstruction cannot see remapped `epochCharmWad` / `epochFixedCredBonus` after migration. Frontend Claim CRED is gated on indexer `claimable_cred > 0` (`INV-FRONTEND-301` indexer-first). ## Fix Prefer live `TimeArena.pendingCred` for `claimable_cred` / `pending_cred_accrual` (schema ≥ 2.26.0). **`INV-INDEXER-CRED-PENDING-ONCHAIN`**. ## Workaround (until indexer redeploy) Call `claimCred(0)` on TimeArena `0xba39cea0e5ef6808d8cb926c722877480049e0ee` directly (wallet already has residual pending). ## Verify - Redeploy indexer → wallet stats `claimable_cred` ≈ on-chain `pendingCred`. - `cargo clippy --all-targets -- -D warnings` · `cargo test` in `indexer/`.
PlasticDigits commented 2026-07-09 06:56:45 +00:00 (Migrated from gitlab.com)

mentioned in commit 0c44894e14

mentioned in commit 0c44894e14620ff2cd5821ede826ada96dda333f
PlasticDigits commented 2026-07-09 06:57:49 +00:00 (Migrated from gitlab.com)

mentioned in merge request !539

mentioned in merge request !539
PlasticDigits commented 2026-07-09 07:22:38 +00:00 (Migrated from gitlab.com)

mentioned in commit 54fdfac458

mentioned in commit 54fdfac458a43d703eee7a053678fa6cda79b79c
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-07-09 07:22:39 +00:00
Sign in to join this conversation.
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/yieldomega#368
No description provided.