fix(swap): sign gas from one LCD simulate at 1.2× #1361
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!1361
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1360-swap-auto-gas"
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
Closes #1360.
Retail two-hop swaps were signing a static
gas_wantedof 1,910,000 and getting included withcode11 around 1,937,97x gas used. Swap-shaped executes now LCD-simulate once and signceil(gas_used × 1.2)inulunawhen thatgas_usedis between 100,000 and 15,000,000. Anything else (timeout, bad HTTP, zero, negative, or the 147,000,000 Station figure) signs the existing global per-hop envelope. The CL8Y → UST1 3,000,000 pair floor is no longer a fee input.Acceptance
gas_used1,937,976 signsgas_wanted2,325,572 inuluna. The same multiplier applies for every CW20 address.gas_used0,-1, and 147,000,000 fall back to 1,910,000 for two hops. 147,000,000 is not multiplied by 1.2. Values under 100,000 also fall back.ceil(sim × 1.2), not 3,000,000. A failed simulate of that route uses 1,910,000. A failed wrap + one hop uses 1,800,000. No pair-address function picks the number.broadcastTxonce. An includedcode11 does not broadcast again.recoveringorconfirming, and that control only edits the pay field.gasWanted: 1910000, gasUsed: 1937976does not say “try again” or “vary slightly”. The sentence is a constant.gas_usedvalues. They do not embed a trader address.Not done here
make verify-issue-1360skips it untilVERIFY1360_SIMULATE_ADDRESSis set. The script does not broadcast.gas_used < gas_wanted, on-screen Network fee matches the wallet). The issue leaves that as a later wallet check.Test plan
make verify-issue-1360make verify-issue-1328make measure-issue-1360with a funded simulate accountDocs
skills/AGENTS_SWAP_AUTO_GAS.mdandskills/AGENTS_TERRACLASSIC_GAS.mdKnown residual, accepted in the issue: if simulate fails, two-hop CL8Y routes still sign 1,910,000. Station WalletConnect atomic post remains G-AUTO-8.