fix(indexer): isolate rejection caches and bound pair discovery (#1394) #1405
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cl8y-dex-terraclassic!1405
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-1394-pair-discovery"
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?
Foreign swap-event rejections could suppress legitimate pairs in independent LCD/factory contexts, and cache lookups scanned up to 10,000 entries. Pair discovery now owns rejection and admission state inside each LCD client, with isolated factory budgets and bounded targeted lookup/FIFO eviction. Client clones share state; rebuilding the client starts a fresh namespace.
The cache retains at most 16 factories × 512 entries (8,192 total), with a fixed one-hour TTL. Each factory admits a burst of 32 discoveries, replenishes eight per second, and permits four in flight. Known pairs bypass discovery; temporary admission pressure waits and rechecks the DB. Canonical Terra Bech32 validation and 64 KiB discovery response limits reject pollution before expensive work. Only deterministic contract/provenance rejection is cached, cached reasons remain distinct, and fixed outcome counters are exposed and logged in aggregate.
Closes #1394.
Completed issue criteria
Verification
make verify-issue-1394on tested revisiond5ee494c9f0db4ec295d6c8b4ebb06e2e993f160: 23 checks passed, zero failed, zero skipped. Final documentation commit adds only the receipt.A post-commit retest found an overly short recovery timeout in a new fixture. Its failed receipt is retained in the results; the fixture was corrected and the complete verifier passed twice afterward, including the exact tested revision above.
Agent review and scope
Invariants: PD1394-1–10. Agent instructions: review checklist and skip policy. UTC timestamps, exact commands, benchmark measurements, completed criteria and failed attempts: accepted receipts. These documents crosslink AGENTS, indexer invariants, testing and the implementation.
Agents should run every available checklist item first. Unavailable checks may be marked SKIP with a concrete reason/evidence and left unchecked while reporting PASS with explicit skips; executed failures remain FAIL until corrected and retested. The verifier supports an explicit unavailable-Postgres reason.
Production deployment/flood, remote chain attestation, device/wallet QA and crash durability remain unverified and are outside this source-fix acceptance. Configured LCD failover endpoints must serve the same chain. The getter retains its existing warning/soft-skip policy for transient discovery failures; later events retry without poisoned evidence, but replay of an already soft-skipped event is not added.