Skip to content

feat(minter): say which providers disagree in inconsistent RPC results - #268

Draft
mbjorkqvist wants to merge 1 commit into
mainfrom
mathias/DEFI-3031-log-inconsistent-rpc-results
Draft

mbjorkqvist wants to merge 1 commit into
mainfrom
mathias/DEFI-3031-log-inconsistent-rpc-results

Conversation

@mbjorkqvist

Copy link
Copy Markdown

When the SOL RPC providers disagree, the minter's logs only say "Inconsistent RPC results for ". During the recent ckETH withdrawal incident, knowing which provider failed and which ones still agreed was what identified the cause (a disabled API key, providers whose replicas could not agree, a provider with a shorter history). ckSOL could not tell that from its own logs.

The existing failure log lines now also say which providers returned the same answer and why the others failed, e.g.:

Failed to read nonce account … retrying next round: Inconsistent RPC results for getAccountInfo (answer 1: [AnkrMainnet, AlchemyMainnet]; answer 2: [DrpcMainnet]; error from HeliusMainnet: …)

No log line is added, so the /logs buffer does not fill up faster during an outage, and the answers themselves are not logged, which keeps the lines short. Providers are named by id only, never by a custom endpoint's URL or headers, and their errors are shortened.

The breakdown also appears in the TemporarilyUnavailable error that deposit_sol returns when the balance check is inconsistent.

DEFI-3031

🤖 Generated with Claude Code

When the SOL RPC providers do not agree, the minter only logged
"Inconsistent RPC results for <method>", which does not tell a provider
that fails apart from one that answers differently, e.g. one that is
behind or has a shorter transaction history.

The inconsistent-results errors of every RPC call now carry which
providers returned the same answer and why the others failed, so the
existing failure log lines include it without adding any log line.
Providers are named by id only, never by a custom endpoint's URL or
headers, and their errors are shortened.

DEFI-3031

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The diagnostics are consistently propagated, bounded, privacy-conscious, and adequately tested.

0 open findings

What changed in this PR

Adds provider-level diagnostics when Solana RPC responses disagree.

Changes:

  • Groups providers by matching answers and reports provider-specific errors.
  • Truncates errors and hides custom endpoint details.
  • Propagates diagnostics through RPC errors, logs, and deposit errors.
File Description
minter/​src/​rpc/​mod.rs Implements and propagates provider breakdowns.
minter/​src/​rpc/​tests.rs Tests grouping, truncation, privacy, and formatting.
minter/​src/​withdraw/​nonce/​mod.rs Updates inconsistent-result matching.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants