Skip to content

Deprecate AbstractRpcService and RpcServiceRequestable#8475

Merged
mcmire merged 3 commits intomainfrom
deprecate-abstract-rpc-service
Apr 15, 2026
Merged

Deprecate AbstractRpcService and RpcServiceRequestable#8475
mcmire merged 3 commits intomainfrom
deprecate-abstract-rpc-service

Conversation

@mcmire
Copy link
Copy Markdown
Contributor

@mcmire mcmire commented Apr 15, 2026

Explanation

In the past, AbstractRpcService and RpcServiceRequestable were added so that we could express that the fetch and Infura middleware supported either an RpcService or RpcServiceChain. However, since then, these middleware have been changed so that they do not care about a complete RPC service-like interface, just the request method. Hence, it is no longer necessary for the two interfaces to exist.

In fact, the existence of these interfaces create impediments for development. RpcService is not public itself, but AbstractRpcService and RpcServiceRequestable are. So each time we make incompatible changes to RpcService we have to remember to keep AbstractRpcService and RpcServiceRequestable updated as well, and this results in more major releases for network-controller than we would like.

To address these issues, we update RpcService so that it no longer implements AbstractRpcService, and we deprecate both interfaces so that we do not have to update them whenever we make changes to RpcService or RpcServiceChain. We will remove both interfaces in a future major version.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Public TypeScript surface changes deprecate exported RPC service interfaces and stop RpcService from implementing them, which may affect downstream typing even though runtime behavior is unchanged.

Overview
Marks the exported AbstractRpcService and RpcServiceRequestable types as deprecated (with guidance to accept narrower “RPC-like” shapes), and records this deprecation in the network-controller changelog.

Updates RpcService to no longer implement AbstractRpcService and replaces interface-derived listener typings/return types with explicit ServicePolicy-based types from ./shared, removing the cockatiel IDisposable dependency.

Reviewed by Cursor Bugbot for commit 609adf8. Bugbot is set up for automated code reviews on this repo. Configure here.

In the past, `AbstractRpcService` and `RpcServiceRequestable` were added
so that the fetch and Infura middleware could take either an
`RpcService` or `RpcServiceChain`. However, since then, these middleware
have been changed so that they do not care about a _complete_
RpcService-like interface, just the `request` method. Hence, it is no
longer necessary for the two interfaces to exist.

We will remove both interfaces in a future major version. For now, we
release `RpcService` from implementing `AbstractRpcService`, and we
deprecate both interfaces so that we do not have to update them
whenever we make changes to `RpcService` or `RpcServiceChain`.
@mcmire mcmire force-pushed the deprecate-abstract-rpc-service branch from 2addeae to 289df24 Compare April 15, 2026 18:18
@mcmire mcmire marked this pull request as ready for review April 15, 2026 18:25
@mcmire mcmire requested review from a team as code owners April 15, 2026 18:25
cryptodev-2s
cryptodev-2s previously approved these changes Apr 15, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bfcb0bc. Configure here.

Comment thread packages/network-controller/src/rpc-service/rpc-service.ts
@mcmire mcmire added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit cf23863 Apr 15, 2026
666 of 683 checks passed
@mcmire mcmire deleted the deprecate-abstract-rpc-service branch April 15, 2026 19:14
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