Skip to content

test: Horizon history gap-injection chaos (#706) - #799

Open
jaymoneymanxl wants to merge 1 commit into
RevoraOrg:masterfrom
jaymoneymanxl:test/horizon-history-gap-chaos
Open

test: Horizon history gap-injection chaos (#706)#799
jaymoneymanxl wants to merge 1 commit into
RevoraOrg:masterfrom
jaymoneymanxl:test/horizon-history-gap-chaos

Conversation

@jaymoneymanxl

Copy link
Copy Markdown

Overview

This PR adds deterministic Horizon transaction-history gap-injection chaos proving the ingest layer detects paging-token gaps, emits a fatal ingest.cursor.paused audit, and halts cursor advancement rather than silently skipping records. Recovery via resumeFromCursor() is covered when gaps close.

Related Issue

Closes #706

Changes

🌀 Horizon history gap chaos

  • [MODIFY] src/services/horizonTransactionHistoryFetcher.ts
    • Gap halt emits ingest.cursor.paused with severity: fatal and alarm: horizon_history_gap.
    • Adds createHorizonHttpFetchPage() to wire the fetcher to a real Horizon HTTP endpoint from trusted config.
  • [MODIFY] src/__tests__/chaos/horizonGapChaos.test.ts — asserts fatal pause metadata + HTTP fetchPage wiring; multi-seed deterministic sweep.
  • [MODIFY] run-chaos-tests.shgap scenario for issue Stellar Horizon chaos: transaction-history gap injection and detection #706.
  • [MODIFY] docs/horizon-history-gap-chaos.md — security model, acceptance criteria, wiring guide.

Verification Results

npx jest src/__tests__/chaos/horizonGapChaos.test.ts --runInBand --forceExit
✅ 60/60 passed

./run-chaos-tests.sh gap
Acceptance Criteria Status
Chaos harness deterministic per seed seededRandom / buildDeterministicGaps
Gap detection emits ingest.cursor.paused ✅ fatal alert; cursor unchanged
No silent skip of records ✅ empty records on halt
Recovery when gaps close resumeFromCursor()
Multiple simultaneous gaps do not confuse cursor ✅ first gap only; cursor stays clean

Timeline

Deterministic per-seed chaos coverage proving the ingest layer detects
Horizon transaction-history paging-token gaps, emits a fatal
ingest.cursor.paused audit, and halts cursor advancement rather than
skipping records. Covers recovery via resumeFromCursor, multi-gap
cursor isolation, and createHorizonHttpFetchPage wiring.
@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@jaymoneymanxl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@jaymoneymanxl

Copy link
Copy Markdown
Author

@thlpkee20-wq done closes #706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stellar Horizon chaos: transaction-history gap injection and detection

1 participant