fix(frontend): raise ADD_LIQUIDITY_GAS_LIMIT above measured provide_liquidity gas #843

Merged
Brouie merged 1 commit from qa/addliq-gas-limit into main 2026-06-09 07:05:30 +00:00
Brouie commented 2026-06-09 02:16:00 +00:00 (Migrated from gitlab.com)

Finding (during #337 local QA pass)

Add-liquidity fails from the dapp with "Transaction needed more gas than estimated" on every attempt. provide_liquidity returns the fixed ADD_LIQUIDITY_GAS_LIMIT = 500000, but the real cost is higher.

Measured on a localnet EMBER/CORAL pair (terrad, --gas auto):

op gas_used dapp limit result
provide_liquidity 507,509 500,000 OOG
withdraw_liquidity 544,545 600,000 ok

The limit is fixed (not simulated), and block variance is far below the ~7.5k shortfall, so the "try again" hint can't recover it — add-liquidity is effectively unusable from the UI. Contract path itself is fine (provide_liquidity, transfer_from x2, mint, code 0).

Fix

Raise ADD_LIQUIDITY_GAS_LIMIT 500000 -> 650000 (~28% over measured, in line with the headroom REMOVE already carries). transactions.test.ts assertion updated. REMOVE (600k) and CREATE_PAIR (800k) left as-is.

Same gas-underestimate family as #343 (different path — no native/unwrap here). Found verifying #337 (PL-00-02).

## Finding (during #337 local QA pass) Add-liquidity fails from the dapp with **"Transaction needed more gas than estimated"** on every attempt. `provide_liquidity` returns the fixed `ADD_LIQUIDITY_GAS_LIMIT = 500000`, but the real cost is higher. Measured on a localnet EMBER/CORAL pair (terrad, `--gas auto`): | op | gas_used | dapp limit | result | |----|----------|-----------|--------| | `provide_liquidity` | **507,509** | 500,000 | **OOG** | | `withdraw_liquidity` | 544,545 | 600,000 | ok | The limit is fixed (not simulated), and block variance is far below the ~7.5k shortfall, so the "try again" hint can't recover it — add-liquidity is effectively unusable from the UI. Contract path itself is fine (`provide_liquidity, transfer_from x2, mint`, code 0). ## Fix Raise `ADD_LIQUIDITY_GAS_LIMIT` 500000 -> 650000 (~28% over measured, in line with the headroom REMOVE already carries). `transactions.test.ts` assertion updated. REMOVE (600k) and CREATE_PAIR (800k) left as-is. Same gas-underestimate family as #343 (different path — no native/unwrap here). Found verifying #337 (PL-00-02).
Brouie commented 2026-06-09 02:17:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
Brouie commented 2026-06-09 03:12:43 +00:00 (Migrated from gitlab.com)

mentioned in issue #345

mentioned in issue #345
PlasticDigits commented 2026-06-09 07:05:30 +00:00 (Migrated from gitlab.com)

mentioned in commit 71cbddbee5

mentioned in commit 71cbddbee596f96dc155e761f665b81e843d3426
PlasticDigits (Migrated from gitlab.com) merged commit 71cbddbee5 into main 2026-06-09 07:05:30 +00:00
Brouie commented 2026-06-11 03:26:05 +00:00 (Migrated from gitlab.com)

mentioned in issue #353

mentioned in issue #353
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!843
No description provided.