Skip to content

MP test#19

Open
leolambo wants to merge 17 commits into
masterfrom
multi-provider
Open

MP test#19
leolambo wants to merge 17 commits into
masterfrom
multi-provider

Conversation

@leolambo

Copy link
Copy Markdown
Owner

Description

Link to an issue if one exists and/or briefly describe what this PR does and why it's needed.

Changelog

  • Add bullet points summarizing your changes.

Testing Notes

Add any helpful notes for reviewers to test your code here.


Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.
  • I have added the appropriate package tag(s) (e.g. BWC if modifying the bitcore-wallet-client package, CLI if modifying the bitcore-cli package, etc.)
  • I have verified that this is not an existing PR (open or closed)

leolambo and others added 17 commits January 2, 2026 13:50
Implements the error class hierarchy used by external API adapters
(Moralis/Alchemy) to classify failures for circuit breaker and
failover decisions. Includes 7 AdapterError subclasses with
isBreakerable flags plus AllProvidersUnavailableError for orchestrator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…i-provider failover

Implements CircuitBreaker class with composite key (chain:network:provider),
configurable failure thresholds (consecutive + rate-based), timeout-driven
HALF_OPEN probing with in-flight permit tracking, and metrics reporting.
Includes 36 comprehensive unit tests covering all state transitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…fig config type

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vider

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… binary search block-by-date

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…th sequential failover

Implements the core orchestrator that wires adapters + circuit breakers + sequential
failover for multi-provider EVM transaction lookups, address streaming, and wallet
streaming. Key features:

- Per-network provider arrays with independent circuit breakers
- withBreakerAttempt helper guaranteeing permit release on any throw
- Preflight stream check buffering first item before committing to a provider
- Floor semantics enforcement via RPC for adapter block-by-date results
- Public getTransaction override letting AllProvidersUnavailableError and
  InvalidRequestError propagate for correct HTTP 503/400 mapping
- Provider ordering by priority ascending, then name lexicographically
- getBlockBeforeTime override using indexed API providers instead of Bitcoin collections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Registers MultiProviderEVMStateProvider as CSP with EVMRouter
and MoralisP2PWorker. Activated by setting module: './multiProvider'
in bitcore chain config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…error logging

Prevent API keys (e.g. Alchemy v2/v3 path keys, query param keys) from
appearing in error logs by redacting them before they are stored in
err.log objects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…idRequestError to 400 in routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…orts from alchemy tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vider

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace console.error with logger.error in orchestrator
- Document 503-over-404 edge case in _getTransaction
- Fix redactUrl to preserve version number in path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant