Gas: add register/deregister gas limits for /tiers (FT-3/FT-4) #913
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!913
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-384-fee-discount-gas-limits"
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
Fixes GitLab #384:
/tiersRegister and Deregister execute messages were missing fromgetGasLimitForTx()and fell through toBASE_GAS_LIMIT(200k). Tier-1 register consumes ~204–209k gas on LocalTerra, so the wallet reported “Transaction needed more gas than estimated.” CLI succeeded because it uses--gas auto --gas-adjustment 1.3.The dApp intentionally does not LCD-simulate execute gas before broadcast (extensions may rewrite fees; see
terraClassicFeeEstimate.ts). Per-message fallback constants are the canonical envelope — this MR adds measured fallbacks:REGISTER_FEE_DISCOUNT_GAS_LIMIT= 300k (measured ~204–209k)DEREGISTER_FEE_DISCOUNT_GAS_LIMIT= 250k (measured ~128–161k)Includes unit tests,
make verify-issue-384, and doc cross-links indocs/frontend.md,skills/AGENTS_TERRACLASSIC_GAS.md, andskills/AGENTS_FEE_DISCOUNT_TIERS.md.Acceptance checklist
registermaps to dedicated gas constant (300k) ingetGasLimitForTxmake verify-issue-384step [1] + unit testsderegistermaps to dedicated gas constant (250k)make verify-issue-384step [1] + unit testsmake verify-issue-384step [2]–[4] (register 209016 < 300k; deregister 128363 < 250k)e2e/fee-tier-tx.spec.ts— Deregister + Active visible after Register click (strict-mode.or()assertion flake in existing test; tx succeeded)make verify-issue-384on-chain deregister + priormake verify-issue-383FT-4 CLIdocs/frontend.md,skills/AGENTS_*,docs/reference/fee-discount-tiers.mdThird-party verification
http://127.0.0.1:5173/tierswith Keplr or Simulated Wallet.Follow-ups
e2e/fee-tier-tx.spec.tssuccess assertion uses.or(Deregister).or(Active)and hits Playwright strict-mode when both match; narrow togetByRole('button', { name: 'Deregister' })in a small follow-up.Security review — MR !913
Commit reviewed:
700e8a04e549c699a5ce80f942844746669d526bScope:
frontend-dapp/src/services/terraclassic/terraGas.ts(REGISTER_FEE_DISCOUNT_GAS_LIMIT/DEREGISTER_FEE_DISCOUNT_GAS_LIMIT+getGasLimitForTxbranches), unit tests,scripts/qa/verify-issue-384.sh, docs/Makefile targets.Method: Diff review; traced
getGasLimitForTx→estimateTerraClassicFeeForMsg→broadcastTerraExecuteContracts; confirmedregister/deregisterexecute payloads are only built infeeDiscount.tsagainstFEE_DISCOUNT_CONTRACT_ADDRESS; checked smart-contractExecuteMsgsurface for key collisions.Outcome:
FINDINGS: 0medium+Notes (informational, below reporting threshold):
register/deregisterkey dispatch ingetGasLimitForTxfollows the existing per-message-shape pattern; only the fee-discount contract exposes those execute variants in this repo. No attacker-controlled path supplies arbitrary execute shapes through the dApp UI.BASE_GAS_LIMITfallback), fixing underestimation / broadcast failure — not an authz or fund-loss vector.Inline threads: none (no medium+ findings).
mentioned in commit
45e5e25509