fix(swarm): sync ROUTER_SWAP_OPS_MIN_GAS_PER_HOP to 950k (#353) #952
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!952
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/353-swarm-gas-hop-sync"
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?
Caught during the
8c56f4b8backend re-baseline (#337). #353 bumpedROUTER_SWAP_OPS_MIN_GAS_PER_HOP900k -> 950k on the frontend (2-hop router floor 1.81M -> 1.91M), but the swarm copy atpackages/localnet-trading-swarm/src/gas.ts:29stayed at 900k despite its// Keep in sync with ROUTER_SWAP_OPS_MIN_GAS_PER_HOP (#353)comment.Effect: the swarm's
gasLimitForRouterExecuteSwapOperations2-hop floor is 1.80M (2 x 900k) vs the observed ~1.81M gas_used on 2-hop router swaps — i.e. the swarm can under-budget a 2-hop and OOG, the exact failure #353 fixed on the dapp.This one-line bump brings it in line. Only this constant drifted —
ROUTER_SINGLE_HOP_GAS_LIMIT(1.4M),SWAP_GAS_SAFETY_MARGIN(10k), andEXECUTE_SWAP_OPS_MIN_GAS_PER_HOP(661k) all still match constants.ts. Constant-only, no logic change.mentioned in issue #337
Security review — MR !952
Commit reviewed:
1b3f6474284a2ca7d45c97d7**83259c164a9a06dScope: Single-line constant sync in
packages/localnet-trading-swarm/src/gas.ts—ROUTER_SWAP_OPS_MIN_GAS_PER_HOP900k → 950k to matchfrontend-dapp/src/utils/constants.ts(#353).Outcome:
FINDINGS: 0medium+Summary
Reviewed the diff and traced
ROUTER_SWAP_OPS_MIN_GAS_PER_HOPthroughgasLimitForRouterExecuteSwapOperations→gasLimitForSwapOperationsMsg→getGasLimitForExecuteMsg→broadcast.tsfee estimation. No prior security-review threads on this MR.This change raises the per-hop gas floor for multi-hop router
execute_swap_operationsestimates. It does not alter control flow, message parsing, auth, or on-chain contract logic. Attacker-controlled input does not reach this constant; the swarm derives hop count from its own constructed execute payloads.Why no findings:
gas_used × gas_price.Security review: no medium+ findings on this diff.
Inline threads: none (no findings).
Correction: commit reviewed is
1b3f6474284a2ca7d45c97d7c83259c164a9a06d(typo in prior note).mentioned in commit
767dcd1e1dmentioned in merge request !953