feat: RPC provider pool with health/failover/replay-pin and --plan dry-run - #1
Closed
Hovibby wants to merge 1 commit into
Closed
feat: RPC provider pool with health/failover/replay-pin and --plan dry-run#1Hovibby wants to merge 1 commit into
Hovibby wants to merge 1 commit into
Conversation
…y-run Feature A - RPC provider pool (internal/rpc) - Add ProviderPool with ordered endpoint selection, per-endpoint health state (Healthy/Degraded/Down), configurable failure thresholds and recovery interval - Per-request context deadlines applied independently per attempt so a slow provider does not consume the parent deadline - Classify retryable errors (429, 5xx, transport timeouts, connection resets) vs non-retryable (4xx) - non-retryable errors return immediately without consuming further provider attempts - AttemptDiagnostics records every endpoint tried, latency, HTTP status, and retryability; exposed via Client.PoolDiagnostics() and printed to stdout when failover occurred during debug - Replay pinning: WithReplayPinProvider(url) locks the pool to one endpoint and disables silent switching; failure returns an explicit error mentioning replay pinning - wired to --pin-endpoint in debug cmd - New builder options: WithPoolConfig, WithMaxRetries, WithRequestDeadline, WithReplayPinProvider - SimulateTransaction and GetHealth route through pool when configured; legacy selector path retained as fallback - 11 tests: timeout failover, rate-limit retryable, all-providers-fail, non-retryable no-duplicate, pinned success/fail, state transitions, diagnostics formatting, context cancellation, live HTTP servers Feature B - Execution plan model and --plan dry-run (internal/plan) - ExecutionPlan model: NetworkRequests, Files, Simulator, Signing, Outputs, PinnedProvider, Notes - RenderText() deterministic human-readable output with dry-run disclaimer; RenderJSON() stable JSON output - redactURL strips token/key/secret query params from endpoint URLs - redactKeyIdentifier redacts raw hex private keys (>=64 chars) and PEM blocks; passes through safe labels (PKCS11 CKA_LABEL, KMS ARN) - Builder helpers: BuildDebugPlan, BuildAuditPlan, BuildExportPlan, BuildSessionSavePlan - use same resolved config as execution - --plan flag added to: debug, audit:sign, export, session save - Plans built after validation but before all side effects; no network calls, signing, simulator invocations, or file writes performed - session.DefaultDBPath() added (no side effects, safe for plan use) - 17 tests: determinism, redaction cases, JSON schema validation, pinned provider in output, builder helpers, dry-run disclaimer
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.
closes pugsley76#518
closes pugsley76#515
Summary
Two features implemented per spec.
Feature A — RPC Provider Pool
Feature B — --plan dry-run