-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Stratum v2 connman #30332
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 connman #30332
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
5a5f754
to
89b876c
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
…t rpc bug fix a74b0f9 Have testBlockValidity hold cs_main instead of caller (Sjors Provoost) f6dc6db refactor: use CHECK_NONFATAL to avoid single-use symbol (Sjors Provoost) 5fb2b70 Drop unneeded lock from createNewBlock (Sjors Provoost) 75ce763 refactor: testBlockValidity make out argument last (Sjors Provoost) 83a9bef Add missing include for mining interface (Sjors Provoost) Pull request description: Followups from #30200 Fixes: - `std::unique_ptr` needs `#include <memory>` (noticed while working on #30332, which has fewer includes than its parent PR that I originally tested with) - Drop lock from createNewBlock that was spuriously added - Have testBlockValidity hold cs_main instead of caller (also fixes a race condition in test-only code) Refactor: - Use CHECK_NONFATAL to avoid single-use symbol (refactor) - move output argument `state` to the end of `testBlockValidity`, see #30200 (comment) ACKs for top commit: AngusP: Code Review ACK a74b0f9 itornaza: Tested ACK a74b0f9 ryanofsky: Code review ACK a74b0f9. Just new error string is added since last review, and a commit message was updated Tree-SHA512: 805e133bb59303fcee107d6f02b3e2761396c290efb731a85e6a29ae56b4b1b9cd28ada9629e979704dcfd98cf35034e7e6b618e29923049eb1eca2f65630e41
5dd22ee
to
b0b4851
Compare
b0b4851
to
10e8373
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
10e8373
to
45908be
Compare
1bef7f4
to
441b081
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
441b081
to
4cc9cfe
Compare
c1509ca
to
a3a0637
Compare
a3a0637
to
0459ea8
Compare
This seems like a lot of additional code that is very Sv2-specific. Is there no way to DRY a lot of this code up with connman itself? @pinheadmz may also have some thoughts here as I believe he's looking at replacing libevent with stuff that uses the common Core socket code anyway. |
Yes, I think the key is to make the copy-pasted parts of |
I am working on a libevent-replacing HTTP server using netbase primitives and yeah, I have some functions that look a lot like the sv2connamn in this branch. I think it would be cool if possible to abstract the mechanisms in |
0459ea8
to
04e89ba
Compare
Removed the accidentally included |
04e89ba
to
648f793
Compare
Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
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>
This allows us to subclass Transport.
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
Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
…lass This allows reusing them in other mocked implementations. Also move the implementation (method definitions) to `test/util/net.cpp` to make the header `test/util/net.h` easier to follow.
…o it And also allows gradually providing the data to be returned by `Recv()` and sending and receiving net messages (`CNetMessage`).
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
648f793
to
3cf779b
Compare
I moved this PR to my own fork at Sjors#50 to reduce CI load, which apparently was becoming too much: #30475 (comment) |
Some more machines were added a few weeks back to deal with increased overall activity, so I think the load should be handleable now, unless someone pushes to 10 different pull requests every 20 minutes in a loop. Looks like you fixed it in the meantime, but if CI load comes up again, you may create an issue so that it can be fixed. |
Based on #30315 and #30205, parent PR #29432.
This PR introduces
Sv2Connman
which is somewhat similar toCConnman
. It uses theSv2Transport
introduced in #30315 to enable incoming connections from other Stratum v2 roles.It's main target user is the Template Provider role introduced in #29432.
There may be other Stratum v2 roles we want to support in the future.
A remaining issue is that the code in
ThreadSv2Handler
reuses a lot of code fromCConnman::SocketHandlerConnected
. I'd like to find a way to extract this common functionality and put it somewhere else.TODO:
CConnman::SocketHandlerConnected
(partially) reusable