Deploy/migrate #529: pair wasm human-scale limit price band (columbus-5) #532
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#532
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Why this issue exists
#529 is the code fix (human-scale
[1e-9, 1e9]band). Limits on UST1/USTR stay impossible on columbus-5 until every live pair that should accept mixed-decimal limits is migrated to the new pair wasm, factorypair_code_idis updated, and the dApp that scales human→raw is shipped.Code MR: !1060 (
feat/529-limit-price-decimals-normalized, SHA91d90ddbat open).Playbook:
skills/AGENTS_LIMIT_PRICE_DECIMALS.md(L529-1–L529-5). Runbook:docs/runbooks/wasm-admin-migration.md. Trace template:docs/templates/deploy-trace.md(also comment on #391).Blocker before store/migrate
Pair
CONTRACT_VERSIONin !1060 is still1.12.0. Live pairs from #514 / fee-treasury rotate are already 1.12.0.cw2::ensure_from_older_versionrejects same-version migrate.Must bump pair to
1.13.0(or next unused) on the same MR or a tiny follow-up beforewasm store+wasm migrate. Factory-only store/migrate is not enough and does not need a version bump for this fix (validation lives on pair).What changes on-chain (and what does not)
UpdateConfig { pair_code_id }so new pairs instantiate the new codeMigrate {}is empty. C14: preserve book, fees, escrow, treasuriespricestays raw (L529-5)New pairs after factory
pair_code_idupdate get the new wasm automatically. Live UST1/USTR must be pair-migrated or it keeps the raw[1e-9, 1e9]reject.Permissions
make build-optimized+wasm storecl8ydeploy(permissionless store)wasm migrateeach pairterra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7UpdateConfig { pair_code_id }governance)Host helper:
scripts/multisig-2of3-host-tx.sh wasm migrate "$PAIR" <code_id> '{}'Do not use
cl8ydeployfor migrate. Bareterraddefaults--nodeto localhost — use columbus-5 RPC (https://terra-classic-rpc.publicnode.com:443) as indocs/runbooks/rotate-fee-treasury.md.Script pattern
Use the #514 pair-loop pattern, not #518.
scripts/upgrade-514-limit-discount.sh— stores pair wasm andwasm migrates each factory-registered pair. Copy/adapt (pair-only; skip fee-discount).scripts/upgrade-518-lp-symbol.sh— stores factory+pair but does not migrate existing pairs (instantiate-only). Wrong for #529.Factory
pairsquery is paginated (limit60). Confirm all addresses, including UST1/USTR, before signing.Last known columbus-5 IDs (re-query before store)
As of 2026-08-15 fee-treasury rotate: pair code 11577, factory code 11578,
pair_code_id11577. Do not assume these are still current — query factoryconfigand each paircontract_infoimmediately before store.Factory (soft-launch):
terra1ejpgvv7g3hj0u6fpcnxhflqp84g0w3cnaskqkg5733ygwlmf963sfchseaFrontend coupling (order matters)
On-chain
pricestays raw token1 units / token0 units. After migrate, a 6/18 pair accepts raw~7.9e13and rejects human79(human-scale79 × 10^(6−18) = 7.9e-11is below1e-9).scaleHumanLimitPriceForChain)79)Ship frontend with or immediately after pair migrate. Indexer LCD/book strings stay raw; UI converts with
scaleRawLimitPriceForDisplay.Recommended sequence
CONTRACT_VERSION1.13.0.make build-optimizedonly (not debug wasm). Record SHA +smartcontracts/artifacts/wasm-checksums.txt.make verify-issue-529andmake verify-issue-467;make test-contracts/ pairmigration_testsif not already on the MR.wasm storepair artifact → newcode_id.wasm migrateevery registered pair with'{}'.UpdateConfig { pair_code_id: <new> }(leave other config fields unset).dex.cl8y.com).Post-migrate smoke
Invalid hybrid parameters).7.9e13.Decimal::raw(1)(#467 / L529-3).make verify-issue-529/make verify-issue-467.Rollback
Prior pair
code_id(last known 11577) remains on-chain if store succeeded. Admin must still be the 2-of-3. Migrate back to the previous code ID if the new wasm misbehaves. Pause pairs if needed:docs/runbooks/rollback-decision.md,skills/AGENTS_WASM_MIGRATION_ROLLBACK.md.Same-version migrate cannot be used as a no-op; rolling back also requires the older
CONTRACT_VERSIONon that wasm (already true for 1.12.0 code 11577).Out of scope (do not block this migrate)
price_humanfieldWalletIndexerHistoryPanelfill-price scalelimitLadderDepthstill comparing unscaled bookprice(deep ladder on 6/18 can mis-measure)Acceptance
pair_code_idpoints at the new codemarked as related to #529
mentioned in issue #529
deploy confirmed