-
Notifications
You must be signed in to change notification settings - Fork 36.4k
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
Stratum v2 Template Provider (take 3) #29432
Commits on Sep 27, 2024
-
net: reduce CAddress usage to CService or CNetAddr
* `CConnman::CalculateKeyedNetGroup()` needs `CNetAddr`, not `CAddress`, thus change its argument. * Both callers of `CConnman::CreateNodeFromAcceptedSocket()` create a dummy `CAddress` from `CService`, so use `CService` instead.
Configuration menu - View commit details
-
Copy full SHA for 1bfc1ca - Browse repository at this point
Copy the full SHA 1bfc1caView commit details -
net: split CConnman::BindListenPort() off CConnman
Introduce a new low-level socket managing class `SockMan` and move the `CConnman::BindListenPort()` method to it. Also, separate the listening socket from the permissions - they were coupled in `struct ListenSocket`, but the socket is protocol agnostic, whereas the permissions are specific to the application of the Bitcoin P2P protocol.
Configuration menu - View commit details
-
Copy full SHA for 41c87dd - Browse repository at this point
Copy the full SHA 41c87ddView commit details -
style: modernize the style of SockMan::BindListenPort()
It was copied verbatim from `CConnman::BindListenPort()` in the previous commit. Modernize its variables and style and log the error messages from the caller.
Configuration menu - View commit details
-
Copy full SHA for b5362b7 - Browse repository at this point
Copy the full SHA b5362b7View commit details -
net: split CConnman::AcceptConnection() off CConnman
Move the `CConnman::AcceptConnection()` method to `SockMan` and split parts of it: * the flip-to-CJDNS part: to just after the `AcceptConnection()` call * the permissions part: at the start of `CreateNodeFromAcceptedSocket()`
Configuration menu - View commit details
-
Copy full SHA for 708398c - Browse repository at this point
Copy the full SHA 708398cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0398a8a - Browse repository at this point
Copy the full SHA 0398a8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d4920f - Browse repository at this point
Copy the full SHA 5d4920fView commit details -
net: move CConnman-specific parts away from ThreadI2PAcceptIncoming()
CConnman-specific or in other words, Bitcoin P2P specific. Now the `ThreadI2PAcceptIncoming()` method is protocol agnostic and can be moved to `SockMan`.
Configuration menu - View commit details
-
Copy full SHA for 1898277 - Browse repository at this point
Copy the full SHA 1898277View commit details -
Configuration menu - View commit details
-
Copy full SHA for b94f9d3 - Browse repository at this point
Copy the full SHA b94f9d3View commit details -
net: index nodes in CConnman by id
Change `CConnman::m_nodes` from `std::vector<CNode*>` to `std::unordered_map<NodeId, CNode*>` because interaction between `CConnman` and `SockMan` is going to be based on `NodeId` and finding a node by its id would better be fast. As a nice side effect the existent search-by-id operations in `CConnman::AttemptToEvictConnection()`, `CConnman::DisconnectNode()` and `CConnman::ForNode()` now become `O(1)` (were `O(number of nodes)`), as well as the erase in `CConnman::DisconnectNodes()`.
Configuration menu - View commit details
-
Copy full SHA for b96beb2 - Browse repository at this point
Copy the full SHA b96beb2View commit details -
net: isolate P2P specifics from GenerateWaitSockets()
Move the parts of `CConnman::GenerateWaitSockets()` that are specific to the Bitcoin-P2P protocol to dedicated methods: `ShouldTryToSend()` and `ShouldTryToRecv()`. This brings us one step closer to moving `GenerateWaitSockets()` to the protocol agnostic `SockMan` (which would call `ShouldTry...()` from `CConnman`).
Configuration menu - View commit details
-
Copy full SHA for bb5b91d - Browse repository at this point
Copy the full SHA bb5b91dView commit details -
net: isolate P2P specifics from SocketHandlerConnected() and ThreadSo…
…cketHandler() Move some parts of `CConnman::SocketHandlerConnected()` and `CConnman::ThreadSocketHandler()` that are specific to the Bitcoin-P2P protocol to dedicated methods: `EventIOLoopCompletedForNode()` and `EventIOLoopCompletedForAllPeers()`. This brings us one step closer to moving `SocketHandlerConnected()` and `ThreadSocketHandler()` to the protocol agnostic `SockMan` (which would call `EventIOLoopCompleted...()` from `CConnman`).
Configuration menu - View commit details
-
Copy full SHA for 50cb524 - Browse repository at this point
Copy the full SHA 50cb524View commit details -
net: isolate all remaining P2P specifics from SocketHandlerConnected()
Introduce 4 new methods for the interaction between `CConnman` and `SockMan`: * `EventReadyToSend()`: called when there is readiness to send and do the actual sending of data. * `EventGotData()`, `EventGotEOF()`, `EventGotPermanentReadError()`: called when the corresponing recv events occur. These methods contain logic that is specific to the Bitcoin-P2P protocol and move it away from `CConnman::SocketHandlerConnected()` which will become a protocol agnostic method of `SockMan`. Also, move the counting of sent bytes to `CConnman::SocketSendData()` - both callers of that method called `RecordBytesSent()` just after the call, so move it from the callers to inside `CConnman::SocketSendData()`.
Configuration menu - View commit details
-
Copy full SHA for 96974ff - Browse repository at this point
Copy the full SHA 96974ffView commit details -
net: split CConnman::ConnectNode()
Move the protocol agnostic parts of `CConnman::ConnectNode()` into `SockMan::ConnectAndMakeNodeId()` and leave the Bitcoin-P2P specific stuff in `CConnman::ConnectNode()`. Move the protocol agnostic `CConnman::m_unused_i2p_sessions`, its mutex and `MAX_UNUSED_I2P_SESSIONS_SIZE` to `SockMan`. Move `GetBindAddress()` from `net.cpp` to `sockman.cpp`.
Configuration menu - View commit details
-
Copy full SHA for 3bb0145 - Browse repository at this point
Copy the full SHA 3bb0145View commit details -
net: tweak EventNewConnectionAccepted()
Move `MaybeFlipIPv6toCJDNS()`, which is Bitcoin P2P specific from the callers of `CConnman::EventNewConnectionAccepted()` to inside that method. Move the IsSelectable check, the `TCP_NODELAY` option set and the generation of new node id out of `CConnman::EventNewConnectionAccepted()` because those are protocol agnostic. Move those to a new method `SockMan::NewSockAccepted()` which is called instead of `CConnman::EventNewConnectionAccepted()`.
Configuration menu - View commit details
-
Copy full SHA for 9d1b352 - Browse repository at this point
Copy the full SHA 9d1b352View commit details -
net: move sockets from CNode to SockMan
Move `CNode::m_sock` and `CNode::m_i2p_sam_session` to `SockMan::m_connected`. Also move all the code that handles sockets to `SockMan`. `CNode::CloseSocketDisconnect()` becomes `CConnman::MarkAsDisconnectAndCloseConnection()`. `CConnman::SocketSendData()` is renamed to `CConnman::SendMessagesAsBytes()` and its sockets-touching bits are moved to `SockMan::SendBytes()`. `CConnman::GenerateWaitSockets()` goes to `SockMan::GenerateWaitSockets()`. `CConnman::ThreadSocketHandler()` and `CConnman::SocketHandler()` are combined into `SockMan::ThreadSocketHandler()`. `CConnman::SocketHandlerConnected()` goes to `SockMan::SocketHandlerConnected()`. `CConnman::SocketHandlerListening()` goes to `SockMan::SocketHandlerListening()`.
Configuration menu - View commit details
-
Copy full SHA for c133a63 - Browse repository at this point
Copy the full SHA c133a63View commit details -
net: move-only: improve encapsulation of SockMan
`SockMan` members `AcceptConnection()` `NewSockAccepted()` `GetNewNodeId()` `m_i2p_sam_session` `m_listen private` are now used only by `SockMan`, thus make them private.
Configuration menu - View commit details
-
Copy full SHA for 70c2f13 - Browse repository at this point
Copy the full SHA 70c2f13View commit details
Commits on Oct 16, 2024
-
ci: skip Github CI on branch pushes for forks
Similar to e9bfbb5 for Cirrus, but not opt-in, because Github CI lacks custom variables.
Configuration menu - View commit details
-
Copy full SHA for 42ffbfe - Browse repository at this point
Copy the full SHA 42ffbfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b84e85 - Browse repository at this point
Copy the full SHA 1b84e85View commit details -
Configuration menu - View commit details
-
Copy full SHA for e6b22e0 - Browse repository at this point
Copy the full SHA e6b22e0View commit details -
Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 04396cb - Browse repository at this point
Copy the full SHA 04396cbView commit details -
Add sv2 message CoinbaseOutputDataSize
This commit adds the simplest stratum v2 message. The remaining messages are introduced in later commits. Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9ba1a18 - Browse repository at this point
Copy the full SHA 9ba1a18View commit details -
Move CNetMessage and Transport headers to common
This avoids a circular dependency between bitcoin-sv2 and bitcoin-node.
Configuration menu - View commit details
-
Copy full SHA for 362d3d1 - Browse repository at this point
Copy the full SHA 362d3d1View commit details -
Convert between Sv2NetMsg and CSerializedNetMsg
This allows us to subclass Transport.
Configuration menu - View commit details
-
Copy full SHA for 666b3bc - Browse repository at this point
Copy the full SHA 666b3bcView commit details -
Implemented starting from a copy of V2Transport and the V2TransportTester, modifying it to fit Stratum v2 and Noise Protocol requirements. Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com> Co-Authored-By: Fi3
Configuration menu - View commit details
-
Copy full SHA for 5880322 - Browse repository at this point
Copy the full SHA 5880322View commit details -
Add sv2 SETUP_CONNECTION messages
Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for c211a16 - Browse repository at this point
Copy the full SHA c211a16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 818e124 - Browse repository at this point
Copy the full SHA 818e124View commit details -
test: move the implementation of StaticContentsSock to .cpp
Move the implementation (method definitions) from `test/util/net.h` to `test/util/net.cpp` to make the header easier to follow.
Configuration menu - View commit details
-
Copy full SHA for c085339 - Browse repository at this point
Copy the full SHA c085339View commit details -
test: put the generic parts from StaticContentsSock into a separate c…
…lass This allows reusing them in other mocked implementations.
Configuration menu - View commit details
-
Copy full SHA for ae25a75 - Browse repository at this point
Copy the full SHA ae25a75View commit details -
test: add a mocked Sock that allows inspecting what has been Send() t…
…o it And also allows gradually providing the data to be returned by `Recv()` and sending and receiving net messages (`CNetMessage`).
Configuration menu - View commit details
-
Copy full SHA for e7733c0 - Browse repository at this point
Copy the full SHA e7733c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ee662c - Browse repository at this point
Copy the full SHA 9ee662cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 558c9e0 - Browse repository at this point
Copy the full SHA 558c9e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 28d0915 - Browse repository at this point
Copy the full SHA 28d0915View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1f543b - Browse repository at this point
Copy the full SHA a1f543bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e8d8aea - Browse repository at this point
Copy the full SHA e8d8aeaView commit details -
Stratum v2 template provider scaffold
The template provider will listen for a Job Declarator client. It can establish a connection and detect various protocol errors. Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com> Co-Authored-By: Fi3
Configuration menu - View commit details
-
Copy full SHA for f6d8a2a - Browse repository at this point
Copy the full SHA f6d8a2aView commit details -
Chainparams: add default sv2 port
Co-authored-by: Christopher Coverdale <chris.coverdale24@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9b54e1f - Browse repository at this point
Copy the full SHA 9b54e1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 16c3a72 - Browse repository at this point
Copy the full SHA 16c3a72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10e74c6 - Browse repository at this point
Copy the full SHA 10e74c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e319553 - Browse repository at this point
Copy the full SHA e319553View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ae2642 - Browse repository at this point
Copy the full SHA 7ae2642View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ca2589 - Browse repository at this point
Copy the full SHA 5ca2589View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a4a2c7 - Browse repository at this point
Copy the full SHA 1a4a2c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e0a0a8 - Browse repository at this point
Copy the full SHA 7e0a0a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b095ea5 - Browse repository at this point
Copy the full SHA b095ea5View commit details -
CKey: add Serialize and Unserialize
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
Configuration menu - View commit details
-
Copy full SHA for 312db28 - Browse repository at this point
Copy the full SHA 312db28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f3f814 - Browse repository at this point
Copy the full SHA 7f3f814View commit details -
fixme: prevent crash after new block is found
This doesn't solve the underlying problem.
Configuration menu - View commit details
-
Copy full SHA for a360af6 - Browse repository at this point
Copy the full SHA a360af6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b38df20 - Browse repository at this point
Copy the full SHA b38df20View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad72c0e - Browse repository at this point
Copy the full SHA ad72c0eView commit details