Skip to content

fix: noble client init failure must not block trading - #2112

Open
yasyzb wants to merge 1 commit into
dydxprotocol:mainfrom
yasyzb:fix/noble-client-init-error-blocks-trading
Open

fix: noble client init failure must not block trading#2112
yasyzb wants to merge 1 commit into
dydxprotocol:mainfrom
yasyzb:fix/noble-client-init-error-blocks-trading

Conversation

@yasyzb

@yasyzb yasyzb commented Jun 6, 2026

Copy link
Copy Markdown

Problem

When the nobleValidator endpoint is empty or unreachable (common in local dev environments that don't configure Noble cross-chain support), the noble StargateClient initialization throws an error.

Previously, this error set errorInitializing: true in Redux state, which propagated through the following chain:

errorInitializing: true
→ selectClientInitializationError → true
→ getConnectionError → CHAIN_DISRUPTION
→ tradingUnavailable → true
→ place-order button permanently disabled

This means any developer running a local dYdX environment without a Noble validator configured cannot place any orders, even though Noble is only needed for cross-chain IBC transfers — not core perpetuals trading.

Root Cause

In compositeClientManager.ts, the noble client onError handler sets errorInitializing: true, which is the same flag used to signal that the composite client (the core trading client) has failed. Noble failure is incorrectly treated as a fatal initialization error.

Fix

  1. Skip StargateClient.connect() when nobleValidator URL is empty/falsy, rather than passing an empty string which causes an immediate connection error.
  2. Remove errorInitializing: true from the noble client onError handler. Noble client failure now only sets nobleClientReady: false, which correctly disables cross-chain transfer UI without affecting trading.

Impact

  • Fixes place-order button being permanently disabled in local dev environments without Noble configured.
  • No impact on production/testnet environments where Noble is properly configured.
  • Cross-chain transfer features continue to be gated by nobleClientReady.

@yasyzb
yasyzb requested a review from a team as a code owner June 6, 2026 15:04
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@yasyzb is attempting to deploy a commit to the dYdX Trading Team on Vercel.

A member of the Team first needs to authorize it.

@yasyzb
yasyzb force-pushed the fix/noble-client-init-error-blocks-trading branch from 06dbc73 to e0dd69b Compare June 6, 2026 15:05
The noble (IBC cross-chain) client is optional and is only required for
cross-chain deposit/withdrawal transfers. However, when the nobleValidator
endpoint is empty or unreachable (e.g. in local dev environments), the
client initialization throws an error, which previously set
`errorInitializing: true` in Redux state.

This flag propagated through the following chain:
  errorInitializing: true
  → selectClientInitializationError: true
  → getConnectionError returns CHAIN_DISRUPTION
  → tradingUnavailable: true
  → place-order button permanently disabled

Fix:
1. Skip StargateClient.connect() when nobleValidator URL is empty/falsy.
2. Remove `errorInitializing: true` from the noble client onError handler.
   Noble is not a prerequisite for core perpetuals trading; its failure
   should only mark `nobleClientReady: false`.
@yasyzb
yasyzb force-pushed the fix/noble-client-init-error-blocks-trading branch from e0dd69b to c5fcf3d Compare June 6, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant