feat(bridge): emit SwapBridge failure_phase, error_code, and hash presence - #9949
Open
Battambang wants to merge 7 commits into
Open
feat(bridge): emit SwapBridge failure_phase, error_code, and hash presence#9949Battambang wants to merge 7 commits into
Battambang wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0ac995f. Configure here.
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…classifiers Add FailurePhase and SwapBridgeErrorCode plus helpers so a follow-up emit can classify failures from the code path and hash presence, without parsing error_message. No Mixpanel payloads change in this commit.
…ields Quote fetch is pre-tx, so the changelog should not list source_hash_present or destination_hash_present on Quotes Error.
…sence Wire Quotes Error, submit Failed, EVM Failed, poll Failed, Submitted, and Completed to the classifiers from #9947. Mixpanel can now split quote vs broadcast vs source vs dest vs poll without parsing error_message.
…ed hash presence Promote broadcast, poll, or unknown to source_execution when history already has a source hash, so Mixpanel does not report a pre-broadcast failure after a source hash exists.
Battambang
force-pushed
the
feat/WPN-1877-emit-failure-telemetry
branch
from
August 26, 2026 12:21
70a6371 to
18c3a0d
Compare
Quote fetch is pre-tx, so the emit changelog should not list source_hash_present or destination_hash_present on Quotes Error.
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Stacked on #9947 (schema + classifiers only). This PR emits the new Mixpanel fields so Failed is no longer a blended “on-chain” rate.
failure_phase=quote,error_codefrom the thrown valueexecuteSubmitStrategy)broadcast, hashesfalsebroadcastorsource_executionfrom source hashdestination_execution>source_execution>pollfalse(emit is still before submit strategy)Classification uses the code path and hash presence, never
error_message.bridge-status-controllerowns submit/poll/EVM emit;bridge-controllerowns Quotes Error and Failed property defaults.After #9947 merges, retarget this PR to
main.References
Checklist
Note
Low Risk
Changes are additive analytics properties on existing events; no transaction, auth, or submission logic is altered beyond what gets sent to metrics.
Overview
This PR turns on the SwapBridge failure telemetry fields introduced in #9947 by populating them on Unified SwapBridge analytics events, using code-path classifiers and tx hash presence—not
error_message.bridge-controllernow sendsfailure_phase=quoteand a classifiederror_codewhen quote fetch/stream fails, and applies defaults for Failed events from the client (failure_phase,error_code,source_hash_present,destination_hash_present). It exportspromoteFailurePhaseto bump phase when hashes imply execution progressed past broadcast/poll.bridge-status-controllersets both hash flags to false on Submitted (still emitted pre-submit). Completed gets hash flags from bridge history status. Failed merges submit/status telemetry: submit errors usegetSubmitFailureTelemetry; poll/history failures usegetStatusFailureTelemetrypluspromoteFailurePhasefor combined hash history. EVM failed-tx metrics ingetEVMTxPropertiesFromTransactionMetaadd hash presence and broadcast vssource_executionphase.Changelogs and test snapshots/assertions are updated for the new payload shape.
Reviewed by Cursor Bugbot for commit 264a606. Bugbot is set up for automated code reviews on this repo. Configure here.