Skip to content

rpc/mcp: propagate eth_syncing errors in network status - #25451

Merged
AskAlexSharov merged 1 commit into
erigontech:mainfrom
Osraka:osraka/mcp-network-status-sync-error
Oct 30, 2026
Merged

AskAlexSharov merged 1 commit into
erigontech:mainfrom
Osraka:osraka/mcp-network-status-sync-error

Conversation

@Osraka

@Osraka Osraka commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

erigon://network/status currently ignores an eth_syncing RPC error and serializes the default syncing: false. That makes an unavailable sync status look like a fully synced node.

Return the RPC error with its method name instead. Successful false and progress-object responses are unchanged. This does not change how the other fields handle partial data.

Verification

  • Added TestResourceNetworkStatusDoesNotClaimSyncedOnRPCFailure; it failed on unmodified main and passes with this change.
  • go test ./rpc/mcp -count=1
  • make lint
  • make erigon integration

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

No active review issues are reported for the change to surface eth_syncing failures rather than a misleading synced status.

No open issues 🎉

What changed in this PR

This PR prevents the MCP network-status resource from reporting syncing: false when the eth_syncing RPC fails. Successful responses and partial-data handling for other fields remain unchanged.

Changes:

  • Return eth_syncing errors with the method name while preserving the underlying error.
  • Add a regression test that checks an RPC failure returns an error and no resource contents.
File Description
rpc/​mcp/​resources.go Propagates eth_syncing errors from the network-status handler.
rpc/​mcp/​resources_test.go Tests that an RPC failure cannot produce a misleading synced status.

Review effort: Balanced

@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Oct 30, 2026
Merged via the queue into erigontech:main with commit 37031dd Oct 30, 2026
133 checks passed
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.

3 participants