-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpcserver: decouple from server. #1730
Conversation
18bbd28
to
1ea0d0c
Compare
1ea0d0c
to
1806cb7
Compare
1806cb7
to
2bab1ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed about half of this so far. It's been faithful to my upstream PR up to the point I've reviewed. No additional comments yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to have been tested hardly at all as it crashes with a very simple startup with only the rpcserver enabled and nothing else.
I'm going to halt all review until it has.
7b46fa8
to
8c46a9b
Compare
8c46a9b
to
e1d9c6c
Compare
e1d9c6c
to
34ddf89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the first round of review. I still need to test all of the affected RPCs to be sure everything is still working properly, but aside from the inline comments, this looks pretty good overall.
This decouples the RPC server from the internal dcrd server to move closer to being able to split it out into a separate package. In order to accomplish this, it introduces an rpcserverConfig type and several new interfaces, named rpcserverPeer, rpcserverConnManager, and rpcserverBlockManager, which are necessary to break the direct dependencies on the main server and block manager instances. It also adds concrete implementations of the new interfaces and uses them to configure the RPC server. Ultimately, the RPC server should ideally be decoupled even more such that all of the types in the configuration struct use interfaces instead of the concrete types. Doing this would make the RPC server much easier to internally test since it would allow creating lightweight stubs for the various pieces.
34ddf89
to
59c9379
Compare
The following is a list of the affected RPCs and relevant additional paths tested:
|
Thanks for the detailed list, should be at it soon 👍 |
rpcs are looking good at my end as well. |
This pr depends on #1728 and is a port of btcd 981.
This decouples the RPC server from the internal dcrd server to move
closer to being able to split it out into a separate package.
In order to accomplish this, it introduces an rpcserverConfig type and
several new interfaces, named rpcserverPeer, rpcserverConnManager, and
rpcserverBlockManager, which are necessary to break the direct
dependencies on the main server and block manager instances.
It also adds concrete implementations of the new interfaces and uses
them to configure the RPC server.
Ultimately, the RPC server should ideally be decoupled even more such
that all of the types in the configuration struct use interfaces instead
of the concrete types. Doing this would make the RPC server much easier
to internally test since it would allow creating lightweight stubs for
the various pieces.