Expose indexer ingest lag on arena timer and podium APIs #344
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#344
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Parent
Transition Gap Analysis (#342) — P0 #2. Bundles H-I1 (lag visibility), M-I6.
Current codebase
chain_timer.rs/chain_timer_poll.rspoll latest RPC head via Multicall3 forGET /v1/arena/timersand podium reads — epochs/deadlines can advance before log ingest catches up.chain_pointeriningestion.rs./v1/arena/timersand/v1/podiumsexposeread_block_number(RPC head) but not how far ingest has caught up./v1/statusomitschain_pointer/last_indexed_at_msunless ops flag — clients cannot detect ingest lag.Why needed
After an epoch roll, the UI can show new epoch/deadlines from the head poller before
PodiumEpochRolled, live podium rows, or activity reflect the transition. Users need a subtle sync indicator and API consumers needindexed_through_blockto avoid misleading “final” displays.Constraints / guardrails
/v1/statusstay gated; arena endpoints are the primary consumer surface.Relevant files
indexer/src/chain_timer.rsindexer/src/chain_timer_poll.rsindexer/src/api_arena.rsindexer/src/api.rs(/v1/status)indexer/src/ingestion.rs(chain pointer)frontend/src/lib/indexerApi.ts(types)Recommended direction
indexed_head_block(orindexed_through_block) toGET /v1/arena/timersandGET /v1/podiumsby reading currentchain_pointeralongside head poller snapshot.chain_head_blockalias ifread_block_numbernaming is inconsistent.indexed_head_block < read_block_number.docs/architecture/data-flows.md.Acceptance criteria
indexerApi.ts.verify-podium-timers-anvil.sh,verify-podium-live-anvil.sh).Test plan
cd indexer && cargo clippy --all-targets -- -D warnings && cargo testintegration_stage2.rsor add unit test for API field when pointer < headbash scripts/verify-podium-timers-anvil.shcd frontend && npm run typecheckAttack / abuse test plan
chain_pointer.Verification criteria
curltimers response shows both RPC head and indexed-through blocks.mentioned in issue #342
mentioned in merge request !517
mentioned in commit
2b5d0240a5mentioned in merge request !519
Verification — #344 Expose indexer ingest lag on arena timer and podium APIs
Result: PASS (all acceptance criteria met on
main; no repo changes required).Acceptance criteria
indexed_through_blockanvil :8547+ indexer:3102):curl /v1/arena/timersand/v1/arena/podiumsboth returnread_block_number+indexed_through_block(e.g. both"12"at sync).x-schema-version: 2.20.0(≥ 2.19.0).integration_stage2.rs::api_arena_ingest_lag_fields_smoke— mocked headread_block_number=100,chain_pointer=50→ both/v1/arena/timersand/v1/arena/podiumsreturnindexed_through_block="50"; assertsindexed_through_block ≤ read_block_number.indexerApi.tscd frontend && npm run typecheck— exit 0.ArenaTimersResponseandArenaPodiumsResponseinclude optionalindexed_through_block.bash scripts/verify-podium-timers-anvil.sh— OK.bash scripts/verify-podium-live-anvil.sh— OK (read_block=25,live_rows=12).Test plan (issue body)
cd indexer && cargo clippy --all-targets -- -D warnings && cargo testDATABASE_POOL_MAXif set in env — otherwise unrelatedparses_and_clamps_highfails)bash scripts/verify-podium-timers-anvil.shcd frontend && npm run typecheckAttack / abuse checks
chain_pointerapi_arena_ingest_lag_fields_smokeassertsindexed_through_block ≤ read_block_number; field sourced from Postgreschain_pointerinapi_arena.rs::indexed_through_block.chain_pointeronly forward per block; reorg path resets viarollback_after(#351). No API path rewinds the field without a reorg.Docs / invariants
INV-INDEXER-344-INGEST-LAGdocumented indocs/testing/invariants-and-business-logic.md.docs/architecture/data-flows.md§ ingest lag vs head poller.indexed_through_block.Manual verification notes
curlon synced stack shows both block fields on timers and podiums./v1/statuscorrectly omitschain_pointerunless ops flag — arena endpoints are the consumer surface per issue constraints.