fix(frontend): humanize post-sign fee guard errors for users (#371) #884
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!884
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/371-insufficient-gas-user-copy"
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 #371: when the post-sign fee/gas guard blocks a transaction (e.g. Keplr returns a very low gas limit), the UI no longer shows developer diagnostics (GitLab issue refs,
uluna/gas values,npm ciCLI hints, Station-specific steps).EXTENSION_SIGNED_FEE_UNDERSHOOT_USER_MESSAGEretail copy inextensionSignedFeeGuard.tstryHumanizeTerraTxMessagemaps guard failures to that message (was passthrough)broadcastTerraExecuteContractsno longer bypasses humanization for guard errors; full diagnostics remain inconsole.errordocs/frontend.md,AGENTS_FRONTEND_USER_ERRORS.md,AGENTS_TERRACLASSIC_GAS.md)Acceptance checklist
bash scripts/with-node.sh --cwd frontend-dapp -- npm run test:unit -- src/utils/__tests__/humanizeTerraTxError.test.ts src/utils/__tests__/humanizeUserFacingError.test.tsterraBroadcast.test.tsguard casehumanizeTerraTxError.test.tsextension signed fee undershoot casesrc/services/terraclassic/__tests__/terraBroadcast.test.tsterraBroadcast.tslogs raw error viaconsole.errorbeforehandleBroadcastErrorThird-party verification
fix/371-insufficient-gas-user-copymake setup-cloud-localterra && make dev, connect Keplr, set very low gas in Keplr advanced settings, submit swap — alert should read: "Transaction fee mismatch. Please reconnect your wallet and try again. If the problem persists, contact support." (no#127,uluna, ornpm ci).Blockers
Related: #371 (issue stays open until merge).
changed the description
changed the description
Security review — MR !884
Commit reviewed:
b63edb011c77d3727672826b8b7ce8aaa2fb8f1bScope: Error-humanization path for post-sign fee/gas guard failures (
extensionSignedFeeGuard.ts,humanizeTerraTxError.ts,terraBroadcast.ts) plus tests and agent/docs updates.Method: Traced attacker-controlled inputs (wallet extension throws, LCD
rawLog, indexer transport strings) throughhandleBroadcastError→tryHumanizeTerraTxMessage→humanizeUserFacingError→TxResultAlert(React text node, nodangerouslySetInnerHTML). Verified fee-guard enforcement remains in the cosmes patch /extensionSignedFeeGuard.ts(unchanged); this MR only alters UI copy routing.Outcome:
FINDINGS: 0medium+Notes:
uluna/gas values, CLI hints) with static retail copy — reduces information disclosure to end users; full throws still logged viaconsole.errorinterraBroadcast.ts.EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIXis preceded by higher-priority classifiers (Unauthorized, blacklist, paused, etc.); no authz or guard-bypass regression identified.Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
added 55 commits
mainb066bdb3- Merge branch 'main' into fix/371-insufficient-gas-user-copyCompare with previous version
Resolved merge conflicts with
main:terraBroadcast.ts: kept main's broadcast-recovery imports (pollTxUntilRecoveryDeadline, split sign/broadcast helpers) while preserving #371 behavior — fee-guard errors still flow throughhandleBroadcastError/tryHumanizeTerraTxMessage(removed the oldEXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIXbypass from main).AGENTS_TERRACLASSIC_GAS.md: combined main's cosmes patch SHA-256 guard (#367) with #371's retail user-message note forextensionSignedFeeGuard.ts.Unit tests for humanization +
terraBroadcastpass locally (47 tests).changed the description
Security review — MR !884
Commit reviewed:
b066bdb3307d7fdd10a7052752d6bda447d30c2aScope: Error-humanization path for post-sign fee/gas guard failures (
extensionSignedFeeGuard.ts,humanizeTerraTxError.ts,terraBroadcast.ts) plus unit tests and agent/docs updates. Merge frommainpreserved broadcast-recovery plumbing; this diff only removes the fee-guard humanization bypass and routes guard throws to static retail copy.Method: Traced attacker-controlled inputs (malicious/compromised wallet extension throws, LCD
rawLog, indexer transport strings) throughhandleBroadcastError→tryHumanizeTerraTxMessage→humanizeUserFacingError/toastErrorMessage→TxResultAlert(React text node; nodangerouslySetInnerHTML). Confirmed post-sign fee/gas enforcement remains in the cosmes patch /extensionSignedFeeGuard.ts(guard logic unchanged). Verified prefix classification is preceded by higher-priority on-chain classifiers (Unauthorized, blacklist, paused, spread, etc.).Outcome:
FINDINGS: 0medium+Notes:
uluna/gas, CLI hints) while retaining full diagnostics inconsole.error— security-positive for retail users.inner.includes(EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX)only swaps display copy; it does not weaken signing, broadcast, or recovery controls. A crafted LCD/rawLogcontaining the fixed prefix could mis-label an unrelated failure as “fee mismatch” (UX only; no fund-loss path).Inline threads: none (no medium+ findings).
Security review: no medium+ findings on this diff.
mentioned in commit
809d2b9842