Arena buys API: full BuyItem log identity parity (#283) #410
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!410
Loading…
Reference in a new issue
No description provided.
Delete branch "cursor/arena-buys-parity-283-7d54"
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
Closes the HTTP/frontend gap left after #282 by exposing
new_deadline,buy_index,log_index, andblock_timestamponGET /v1/arena/buys, matching persistedidx_arena_buyrows (onchainBuylog projection only — no client recomputation).arena_buysSELECT/JSON inapi_arena.rs(sameEXTRACT(EPOCH …)::textpattern as vault-funding / donate-pools).ArenaBuyItem+mapArenaBuyToBuyItemso live-buy React keys, buy detail, and protocol audit rows receive real values instead of stubs.integration_stage2buy smoke +verify-wallet-profile-anvil.shDB/API parity for all four fields.INV-INDEXER-283-ARENA-BUYS-PARITY, indexer design, arena-views, guardrails + play skill cross-links.Related: #282 (prerequisite
actual_seconds_added), #258 (wallet profile / buy detail UX).Acceptance checklist
GET /v1/arena/buysincludesnew_deadline,buy_index,log_index,block_timestampcd indexer && cargo test --test integration_stage2idx_arena_buyfortx_hash/log_indexexport PATH="$HOME/.foundry/bin:$PATH" && source /usr/local/cargo/env 2>/dev/null; bash scripts/verify-wallet-profile-anvil.shfetchArenaBuysAsBuyItemssurfaces all four onBuyItemcd frontend && npm run typecheck && npm test -- indexerApitx_hash+log_indexkeys (mapper no longer forces0)mapArenaBuyToBuyItem+indexerApi.test.tsnew_deadlinewhen presentUnixTimestampDisplaypath inArenaBuyModals.tsx(manual QA below)bash scripts/verify-wallet-profile-anvil.sh(Foundry + Cargo ≥ 1.85 + Postgres on:5433)docs/testing/invariants-and-business-logic.md,docs/indexer/design.md,.cursor/skills/yieldomega-guardrails/SKILL.mdBlockers: none.
Third-party verification
Manual (optional): start full stack, open
/arena, open buy detail from live buys — New deadline should show real unix time (not0).Notes
block_timestampJSON uses PostgresEXTRACT(EPOCH FROM timestamptz)::text(may include a.000000suffix); API and DB comparisons use the same projection.changed the description
marked this merge request as ready
Security review
Commit reviewed:
11f72eb04238bc6cb5d84238dbbfc3c1023c48edScope: Arena buys API parity (#283) — expose
new_deadline,buy_index,log_index, andblock_timestamponGET /v1/arena/buys; frontendArenaBuyItem/mapArenaBuyToBuyItemmapping; integration + verify script parity assertions; docs/invariants.Outcome:
FINDINGS: 0medium+Inline threads: none (no findings to anchor)
Summary
Reviewed added/modified code paths for injection, authn/authz, XSS, and information-disclosure risks:
api_arena.rs): New columns are selected fromidx_arena_buyvia the existing parameterized query (LIMIT/OFFSETbound as$1/$2). No attacker-controlled input reaches SQL. Endpoint remains an unauthenticated public read API; added fields are onchainBuylog projections already persisted at ingest.indexerApi.ts): Mapper passes through numeric/string fields from indexer JSON intoBuyItem. UI rendering paths (ArenaBuyModals,formatBuyAge,UnixTimestampDisplay) gate display with digit-only /BigIntvalidation; React text rendering avoids HTML injection.verify-wallet-profile-anvil.sh):parity_fielduses interpolatedBUY_TXin localpsqlcalls; value is Anvilcast sendoutput (hex tx hash), dev-only hermetic smoke — not production attack surface.Security review: no medium+ findings on this diff.
mentioned in commit
6d520e7a98