Skip to content

Document and handle chain-reorg behavior for the indexer in INDEXER_INTEGRATION.md and src/starknet/agreement-index.tsΒ #181

Description

@Jagadeeshftw

πŸ“Œ Description

INDEXER_INTEGRATION.md documents how src/starknet/agreement-index.ts builds its index from chain events, but doesn't appear to describe what happens if a previously-indexed block is later reorged out β€” a real scenario on most chains, distinct from the ordinary cache-eviction concerns already tracked elsewhere.

🧩 Requirements and context

  • Document the current (or intended) reorg-handling behavior: does the indexer re-scan from a safe depth, or is there a known gap?
  • If there is a real gap, add a minimal safeguard (e.g. only treat blocks past a confirmation depth as final) in src/starknet/agreement-index.ts.
  • Add a test simulating a reorg (a block's events superseded by a competing block) and assert the index converges to the canonical state.

πŸ› οΈ Suggested execution

  1. Investigate current reorg behavior in src/starknet/agreement-index.ts and write up findings in INDEXER_INTEGRATION.md.
  2. If needed, add a confirmation-depth threshold before treating indexed data as final.
  3. Add a reorg-simulation test.

βœ… Acceptance criteria

  • INDEXER_INTEGRATION.md accurately describes reorg behavior/limitations.
  • A simulated reorg test passes against the documented/implemented behavior.

πŸ”’ Security notes

An unhandled reorg could let stale/superseded event data drive incorrect agreement state β€” treat this as a data-integrity issue, not just documentation.

πŸ“‹ Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueStellar WaveIssues in the Stellar wave programbackendBackend / API workdocumentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions