Extend arena activity API with state transition events (#345) #516
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!516
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-345-activity-transitions"
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
Extends
GET /v1/arena/activitywith five state-transition event kinds already persisted by the indexer but previously omitted from the unified feed (#345):level_up—idx_arena_level_up(bp_delta= new level)cred_claim—idx_play_cred_claim(amount_doub_wad= CRED wad,seconds_delta= epoch)podium_epoch—idx_arena_podium_epoch(actor= 1st place,target= epoch,amount_doub_wad= pool_paid,seconds_delta= category)epoch_started—idx_arena_last_buy_epoch_started(actor= zero address for global events,bp_delta= epoch,seconds_delta= deadline)feature_unlocked—idx_arena_feature_unlocked(bp_delta= feature level)Schema version bumped to 2.19.0. Frontend
ArenaActivityKindunion updated for TypeScript consumers; celebration/toast UI wiring remains a follow-up.Acceptance checklist
cd indexer && YIELDOMEGA_PG_TEST_URL=postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer_test cargo test postgres_stage2_persist_all_events_and_rollback_afterintegration_stage2.rs::api_activity_cursor_smoke(same test run)kindvaluesdocs/indexer/design.md,INV-INDEXER-345-ACTIVITY-TRANSITIONSindocs/testing/invariants-and-business-logic.mdapi_arena.rsuses existing$1/$2/$3bindscd indexer && cargo clippy --all-targets -- -D warnings && cargo testcd frontend && npm run typecheck && npm run lint && npm testVerification checklist (third parties)
bash scripts/bootstrap-cloud-postgres-native.shexport YIELDOMEGA_PG_TEST_URL=postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer_test && cd indexer && cargo test postgres_stage2_persist_all_events_and_rollback_afterbash scripts/verify-wallet-profile-anvil.shcurl -sf 'http://127.0.0.1:3100/v1/arena/activity?limit=25' | jq '.items[].kind' | sort -ushould include transition kinds after scripted level-up / roll / claim txs.Test plan
Security review
Commit reviewed:
22b102f63c840238441ebe259b4b7086ed257289Scope:
GET /v1/arena/activity— five newUNION ALLbranches (level_up,cred_claim,podium_epoch,epoch_started,feature_unlocked); schema bump to 2.19.0; additiveArenaActivityKindTypeScript union; integration tests.Outcome: FINDINGS: 0 medium+
Method
Traced attacker-controlled inputs (
limit,offset,cursor) througharena_activity→ListPageParams/BlockLogCursor::decode→ parameterizedsqlx::querybinds ($1–$3). Reviewed new SQL fragments inACTIVITY_UNION_SQL(static constant; no string interpolation of user input). Checked frontend consumption (ArenaLiveBuysActivitySection,AddressInline) for XSS sinks. No smart-contract or auth-layer changes in this diff.Areas reviewed (no issues)
i64/i32and bound;ACTIVITY_UNION_SQLis compile-time constantAddressInline; nodangerouslySetInnerHTMLlimitclamped 1–200; five additional union arms follow existing patternInline threads
None — no medium+ findings to annotate on the diff.
Security review: no medium+ findings on this diff.
mentioned in commit
5507efc596