feat(bridge): emit SwapBridge failure_phase, error_code, and hash presence - #9949
Open
Battambang wants to merge 5 commits into
Open
feat(bridge): emit SwapBridge failure_phase, error_code, and hash presence#9949Battambang wants to merge 5 commits into
Battambang wants to merge 5 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. |
Battambang
force-pushed
the
feat/WPN-1877-emit-failure-telemetry
branch
from
August 26, 2026 12:21
70a6371 to
18c3a0d
Compare
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. |
Battambang
force-pushed
the
feat/WPN-1877-emit-failure-telemetry
branch
from
August 27, 2026 15:41
264a606 to
e405382
Compare
…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.
Quote fetch is pre-tx, so the emit changelog should not list source_hash_present or destination_hash_present on Quotes Error.
Battambang
force-pushed
the
feat/WPN-1877-emit-failure-telemetry
branch
from
August 27, 2026 16:17
e405382 to
9fa5c93
Compare
… use Move failure classifiers above getEVMTxPropertiesFromTransactionMeta so ESLint no-use-before-define passes.
4 tasks
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. Every value comes from the code path and hash presence, never from
error_message.What each event emits
bridge-controllerfailure_phase=quote,error_codefromgetQuoteFetchErrorCode(error)executeSubmitStrategy)bridge-status-controllergetSubmitFailureTelemetry(error)→broadcast, both hash flagsfalsebridge-status-controllersource_executionwhen the tx has a hash, elsebroadcast;error_codeunknownwhen the tx carries an error, elsemissing_error_objectbridge-status-controllerdestination_execution>source_execution>poll, from history src/dest hashesbridge-status-controllerfalse(emit is still before the submit strategy)bridge-status-controllerAlso added
promoteFailurePhase(new inbridge-status-controller/src/utils/metrics.ts) reconciles the phase reported by the emitting path with the combined hash presence — history flags OR-ed with any caller-supplied flags. It upgrades todestination_executionon a dest hash and tosource_executionon a source hash, but only frombroadcast/poll/unknown, so a genuine no-hash broadcast failure is never reclassified aspoll.On Failed, a caller-supplied
failure_phasewins over the status-derived one, and itserror_codeis kept (defaulting tounknown); when the caller supplies no phase, both come fromgetStatusFailureTelemetry.Ownership
bridge-status-controllerowns submit, poll, and EVM emit.bridge-controllerowns Quotes Error and the Failed property defaults — when a client omits them, Failed falls back tofailure_phase=unknown,error_code=unknown, and both hash flagsfalse, so the properties are always present in the payload.After #9947 merges, retarget this PR to
main.References
Checklist
Note
Low Risk
Changes are additive Mixpanel/analytics properties only; swap/bridge submit and status behavior is unchanged.
Overview
This PR emits structured SwapBridge failure telemetry on Unified SwapBridge analytics events (stacked on schema/classifiers from #9947), so failures can be segmented by lifecycle phase instead of a single blended rate.
bridge-controlleraddsfailure_phaseanderror_codeon Quotes Error at quote-fetch failure time (phasequote, code fromgetQuoteFetchErrorCodeon the thrown value). Failed events routed through the controller now defaultfailure_phase,error_code, and both hash-presence flags when the client omits them.bridge-status-controllerwires submit, status, and EVM paths: Submitted always reports both hash flagsfalse(emit still precedes broadcast); Completed sets hash presence from bridge history; Failed merges submit catch telemetry (getSubmitFailureTelemetry), status poll telemetry (getStatusFailureTelemetry), EVM tx meta fields, andpromoteFailurePhaseso phase reflects combined source/dest hash presence without reclassifying no-hash broadcast failures as poll.Classification follows code paths and hash presence, not
error_message. Changelogs and test snapshots are updated accordingly.Reviewed by Cursor Bugbot for commit add0474. Bugbot is set up for automated code reviews on this repo. Configure here.