fix(indexer): prefer on-chain pendingCred for claimable CRED #368 #539
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega!539
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/368-claimable-cred-pending-onchain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
claimable_cred/pending_cred_accrualprefer liveTimeArena.pendingCredwhen RPC is configured (schema ≥ 2.26.0).idx_play_cred_claimhas a prior row for that epoch (residual aftermigrateLastBuyEpochToPodium).0xA5F4…f8bAthat still have on-chain pending after an earlier claim + epoch migration (#368).Test plan
cd indexer && cargo clippy --all-targets -- -D warningscd indexer && cargo test --lib arena_wallet_statsclaimable_cred≈ on-chainpendingCred(wallet, 0)for the reported walletCloses #368
Bugbot is not enabled for your account, so this pull request was not reviewed.
Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.
Security review — MR !539
Commit reviewed:
0c44894e14620ff2cd5821ede826ada96dda333fScope: Indexer wallet-stats overlay — prefer live
TimeArena.pendingCred(wallet, epoch)via configured RPC forclaimable_cred/pending_cred_accrual; remove SQLidx_play_cred_claimexistence gate that zeroed claimable after partial claims + epoch migration (#368).Method: Traced attacker-controlled inputs (
GET /v1/arena/wallet/{address}/statspath param) throughvalid_0x_address20→ ABI-encodedeth_callto operator-configuredtime_arena; compared on-chainpendingCred/claimCredsemantics; checked RPC wiring, fallback paths, and frontend claim gating.Outcome:
FINDINGS: 0medium+Inline threads: none (no medium+ issues on this diff)
Notes (informational, below reporting threshold)
valid_0x_address20, 400 on invalid) before RPC encoding; calldata uses fixed selector0x0152f65f(pendingCred(address,uint256)) with padded address + epoch — no injection surface.eth_calltarget and RPC URLs are operator-configured (address_registry,RPC_URL), not user-controlled — no SSRF from request parameters.claimable_cred(RPC outage → SQL fallback, or dishonest RPC) can at worst enable a revertedclaimCredtx; minting is enforced on-chain (claimCredzeroes weight/bonus,nonReentrant). No cross-wallet fund loss path identified.router_with_rate_limit/INDEXER_RATE_LIMIT_*) mitigates RPC amplification from wallet-stats polling; added load is two boundedeth_calls per stats request when RPC is configured.Label:
block:securitynot applied.mentioned in commit
54fdfac458