Label: complexity: high
Points: 200
Description
The current failover logic tries endpoints in a fixed order without logging why each failed. This issue adds a FallbackChain that tries a sequence of RPC endpoints, logs each failure with reason, and returns the first successful result.
Technical Context
Involves a new src/fallbackChain.ts. FallbackChain accepts an ordered array of RPC URLs. For each request, try URLs in order. On failure, log { url, error, attemptMs } and try next. On all failures, throw a FallbackExhaustedError containing all attempt logs. Export FallbackChain and FallbackExhaustedError.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
The current failover logic tries endpoints in a fixed order without logging why each failed. This issue adds a
FallbackChainthat tries a sequence of RPC endpoints, logs each failure with reason, and returns the first successful result.Technical Context
Involves a new
src/fallbackChain.ts.FallbackChainaccepts an ordered array of RPC URLs. For each request, try URLs in order. On failure, log{ url, error, attemptMs }and try next. On all failures, throw aFallbackExhaustedErrorcontaining all attempt logs. ExportFallbackChainandFallbackExhaustedError.Acceptance Criteria
FallbackChainclass exported fromsrc/index.tsFallbackExhaustedErrorthrown with all attempt logs when all failanytypes