-
Notifications
You must be signed in to change notification settings - Fork 11
Stratum v2 connman #50
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
base: sv2-transport
Are you sure you want to change the base?
Conversation
@pinheadmz wrote in the original PR:
I plan to take a look at this. |
3cf779b
to
b549fd6
Compare
bdc8542
to
199234a
Compare
b549fd6
to
22d033c
Compare
199234a
to
922fd8a
Compare
22d033c
to
6b5ee20
Compare
CMake rebase. |
6b5ee20
to
4f957ee
Compare
922fd8a
to
50b6eb8
Compare
4f957ee
to
b69544c
Compare
50b6eb8
to
6a02367
Compare
b69544c
to
1ca68d2
Compare
6a02367
to
ce4269c
Compare
1ca68d2
to
b578e0a
Compare
8220337
to
5fca2c5
Compare
b578e0a
to
489c9fb
Compare
5fca2c5
to
dfb9a6d
Compare
489c9fb
to
a55fa83
Compare
Rebased to move everything into a |
Rebased after bitcoin#30205 landed. |
360aedd
to
49ea07a
Compare
49ea07a
to
ac05646
Compare
ac05646
to
185eb09
Compare
185eb09
to
1a0f0f3
Compare
5692ffa
to
7d5d5ad
Compare
Introduce a new low-level socket managing class `SockMan`. Unit-test it with a new class `SocketTestingSetup` which mocks `CreateSock()` and will enable mock client I/O in future commits. `SockMan` and `SocketTestingSetup` are designed to be generic and reusbale for higher-level network protocol implementation and testing. Co-authored-by: Vasil Dimov <[email protected]>
It was copied verbatim from `CConnman::BindListenPort()` in the previous commit. Modernize its variables and style and log the error messages from the caller. Also categorize the informative messages to the "net" category because they are quite specific to the networking layer. Co-authored-by: Vasil Dimov <[email protected]>
Co-authored-by: Vasil Dimov <[email protected]>
Co-authored-by: Vasil Dimov <[email protected]>
Socket handling methods are copied from CConnMan: `CConnman::GenerateWaitSockets()` goes to `SockMan::GenerateWaitSockets()`. `CConnman::ThreadSocketHandler()` and `CConnman::SocketHandler()` are combined into `SockMan::ThreadSocketHandler()`. `CConnman::SocketHandlerListening()` goes to `SockMan::SocketHandlerListening()`. Co-authored-by: Vasil Dimov <[email protected]>
`CConnman::SocketHandlerConnected()` copied to `SockMan::SocketHandlerConnected()`. Testing this requires adding a new feature to the SocketTestingSetup, inserting a "request" payload into the mock client that conencts to us. Co-authored-by: Vasil Dimov <[email protected]>
Sockets-touching bits from `CConnman::SocketSendData()` copied to `SockMan::SendBytes()`. Testing this requires adding a new feature to the SocketTestingSetup, returning the DynSock I/O pipes from the mock socket so the recevied data can be checked. Co-authored-by: Vasil Dimov <[email protected]>
Copy from some parts of `CConnman::SocketHandlerConnected()` and `CConnman::ThreadSocketHandler()` to: `EventIOLoopCompletedForOne(id)` and `EventIOLoopCompletedForAll()`. Co-authored-by: Vasil Dimov <[email protected]>
Co-Authored-By: Christopher Coverdale <[email protected]>
Co-Authored-By: Vasil Dimov <[email protected]>
7d5d5ad
to
de05710
Compare
I switched to @pinheadmz's lite version of SockMan for now: bitcoin#32747 |
Based on:
Followed by #49. Parent PR #68
This PR introduces
Sv2Connman
, a subclass ofSockMan
(bitcoin#30988). It uses theSv2Transport
introduced in bitcoin#30315 to enable incoming connections from other Stratum v2 roles.It's main target user is the Template Provider role introduced in #49.
There may be other Stratum v2 roles we want to support in the future.
Earlier version(s): bitcoin#30332
Note to self, to keep this rebased until bitcoin#30988 lands (1 merge commits and 3 normal commits):
This won't include changes in the original branches. To achieve that:
Note that this code will most likely not be upstreamed to Bitcoin Core, but instead used to create a standalone c++ application that connects to a running node via an IPC interface. See bitcoin#31098.