What
The admin endpoint and cron job may submit duplicate Stellar transactions if retries trigger or the endpoint is called multiple times quickly. There is no deduplication mechanism.
Why
Duplicate transactions waste XLM on fees and may cause unexpected on-chain state changes.
Scope
- Generate a unique idempotency key per score update
- Store recent keys in memory with TTL
- Reject duplicate submissions within the TTL window
- Make the TTL configurable
Acceptance Criteria
Technical Context
src/lib/registry.ts:18-41 — updateImpactScore function
src/routes/admin.ts:41-53 — admin loop
src/index.ts:29-38 — cron loop
- Key formula:
score:${projectId}:${hourSeed}
What
The admin endpoint and cron job may submit duplicate Stellar transactions if retries trigger or the endpoint is called multiple times quickly. There is no deduplication mechanism.
Why
Duplicate transactions waste XLM on fees and may cause unexpected on-chain state changes.
Scope
Acceptance Criteria
updateImpactScorecall generates a unique keyIDEMPOTENCY_TTL_MSare rejectedTechnical Context
src/lib/registry.ts:18-41—updateImpactScorefunctionsrc/routes/admin.ts:41-53— admin loopsrc/index.ts:29-38— cron loopscore:${projectId}:${hourSeed}