Skip to content

fix: label blockaid simulation reverts as likely to fail - #3089

Merged
JakeUrban merged 4 commits into
stellar:masterfrom
devodii:fix/blockaid-simulation-revert-label
Nov 13, 2026
Merged

JakeUrban merged 4 commits into
stellar:masterfrom
devodii:fix/blockaid-simulation-revert-label

Conversation

@devodii

@devodii devodii commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What

A transaction that Blockaid simulated as a revert, for example an insufficient balance, was labeled "This transaction was flagged as suspicious". The details sheet title stayed "Proceed with caution" and the only detail was the revert string, so a transaction that will fail read like a safety warning.

Fix

The security check now reads the verdict first. Malicious and Warning are unchanged. A simulation error with no Warning or Malicious verdict is labeled "This transaction is likely to fail". The details sheet title is "Likely to fail", and Confirm anyway is not treated as destructive when the only finding is a revert. Send and swap review uses the same label.

Tested

  • Unit tests cover the security level, banner copy, and sign screen.
  • yarn build:extension passes.
  • A stubbed sign request with a simulation error and a Benign verdict shows the new banner and details sheet.

Likely to fail banner

Likely to fail details

@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

👷 Deploy request for freighter-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1e9de9d

@devodii
devodii force-pushed the fix/blockaid-simulation-revert-label branch from 665726d to 60d2f87 Compare November 12, 2026 17:37
@JakeUrban
JakeUrban requested a balanced review from Copilot November 12, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The malicious-site banner can open details that show only “Likely to fail,” omitting the site risk because the site severity and warning reason are not forwarded.

1 open issue
What changed in this PR

This PR distinguishes transaction simulation failures from security risks in Freighter’s signing, send, and swap review flows.

Changes:

  • Adds a “likely to fail” classification while preserving higher-priority malicious and suspicious verdicts.
  • Updates banners, details-sheet copy, and confirmation styling for simulation-only failures.
  • Adds English and Portuguese strings and updates regression tests.
File Description
extension/​src/​popup/​views/​SignTransaction/​index.tsx Stops treating simulation errors alone as destructive confirmations.
extension/​src/​popup/​views/​__tests__/​SignTransaction.test.tsx Expects the new failure banner text.
extension/​src/​popup/​locales/​pt/​translation.json Adds Portuguese failure messages.
extension/​src/​popup/​locales/​en/​translation.json Adds English failure messages.
extension/​src/​popup/​helpers/​blockaid.ts Separates simulation failures from suspicious verdicts.
extension/​src/​popup/​helpers/​__tests__/​blockaid.test.tsx Tests failure classification and verdict precedence.
extension/​src/​popup/​constants/​blockaid.ts Adds and ranks LIKELY_TO_FAIL.
extension/​src/​popup/​constants/​__tests__/​blockaid.test.ts Tests the new severity ordering.
extension/​src/​popup/​components/​WarningMessages/​index.tsx Adds failure-specific details-sheet titles and subtitles.
extension/​src/​popup/​components/​InternalTransaction/​ReviewTransaction/​index.tsx Integrates failure warnings into send and swap review.
extension/​src/​popup/​components/​BlockaidBanner/​index.tsx Adds the shared “likely to fail” banner label.
extension/​src/​popup/​components/​BlockaidBanner/​__tests__/​BlockaidBanner.test.tsx Tests the failure banner label.

Review effort: Balanced

The sign-transaction details sheet only received the transaction scan, so a
benign-but-reverting transaction from a malicious site opened a "Likely to
fail" sheet that never mentioned the site risk the banner reported. Forward
the site severity and reason via extraSeverityLevel and extraWarnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8cp3zXi8eMsEZ4XmFe6K6

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the changes distinguishing simulation failures from security risks.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@JakeUrban
JakeUrban merged commit 1c30ec6 into stellar:master Nov 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants