fix(pair): skip Observe extrapolate on unrepresentable Decimal ratio #1236
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!1236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue/1231"
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?
Summary
oracle_observe_singleforward-extrapolation now usesDecimal::checked_from_ratio(same operand order asoracle_update). Either overflow skips extrapolate and returns last stored cumulatives — same as the zero-reserve branch. No VM panic. No clamp toDecimal::MAX.#465skip is unchanged. Observeprice_times_dt/checked_addstay typedOracleerrors.#1224execute overflow is out of scope.oracle_overflow_tests(oracle_observe_overflow_tests). Docs/skill O1231-1–O1231-6. Wasm migrate is ops after merge.Fixes #1231
Acceptance
seconds_ago == 0/ target after last obs) does not panic; returns last cumulatives.oracle_updateextreme ratio stillOk/ skip (#465).dt > 0still advance cumulatives.extreme_ratio_degrades_gracefully_instead_of_panickingandnormal_ratio_still_records_observationstay green.price_a_cumulatives/price_b_cumulatives).Test plan
make verify-issue-1231(first pass + retest after grep/fmt)cargo test -p cl8y-dex-pair oracle_overflowcargo test -p cl8y-dex-pair oracle_observecargo test -p cl8y-dex-tests oracle -- --test-threads=1cargo clippy -- -D warningsinsmartcontractsmake test-contracts: cl8y-dex-tests 504 passed; one pre-existing factory cw2 version pin (1.10.0vs1.9.0) unrelated to this change.drain skip: hard-blocked (needs-human / high-risk / human topic); remaining continue
Self-review blocked (author). CODEOWNERS team request: PlasticDigits is the only maintainer. AC matches #1231.