Reject malformed indexer event amounts without corrupting accounting #1406
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!1406
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-1395-strict-event-amounts"
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?
Malformed LCD amounts previously became valid zero or permissive decimal values, corrupting swap, fee and position accounting. This PR rejects the complete affected action before mutation using typed missing/invalid/overflow errors, while retaining genuine zero, optional absence, authenticated emitters, valid siblings and replay identities.
Shared raw/price parsing covers swaps, liquidity, lifecycle records, hooks and pinned wrap/window fees. Columnar records remain aligned, action scanning tracks emitters forward, and rejection diagnostics contain only bounded static metadata. Precision-preserving migrations cover raw sums, fees, parked escrow and P&L; raw aggregate clipping is removed, derived storage overflow is checked, and reorg cleanup includes orphan protocol fees.
Fixes #1395.
Validation:
make verify-issue-1395passed with 490 library tests twice, nine new Postgres scenarios twice, and 95 related tests. All 58 forward migrations, updated #1277 statics, documentation checks and normal commit hooks passed. Fixtures are synthetic; no production deployment or historical repair is claimed.Agent reproduction: configure isolated Postgres in
indexer/.env, record revision/UTC, runmake verify-issue-1395, and inspect the assertions in the review checklist. Agents may mark unavailable items SKIP with concrete reasons while reporting overall PASS for completed checks; executed failures require fixes and retests. Receipt, invariants, and third-party agent playbook are crosslinked.Existing LP/hook keys still coalesce repeated same-action occurrences within a transaction; this separate limitation is documented. Original authenticated input is needed before repairing legacy coerced rows.