Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Jun 20, 2024

Based on #29346. Followed by Sjors#50. Parent PR #29432.

Introduces Sv2Transport::Transport which is very similar to V2Transport.

This shoehorns Sv2NetMsg into a CSerializedNetMsg in SetMessageToSend, and into a CNetMessage in GetReceivedMessage.

See discussion in #30209.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 20, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31045 (ci: Add missing -DWERROR=ON to test-each-commit by maflcko)
  • #30988 (Split CConnman by vasild)
  • #30595 (kernel: Introduce initial C header API by TheCharlatan)
  • #29415 (Broadcast own transactions only via short-lived Tor or I2P connections by vasild)
  • #28792 (Embed default ASMap as binary dump header file by fjahr)

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.

@Sjors
Copy link
Member Author

Sjors commented Jun 20, 2024

Would it make sense to add a libbitcoin_net library? Either at the same level as libbitcoin_common or on top of it. I could see how other node implementations could benefit from that, but it's also a way to limit libbitcoin_common in size. Afaik only libbitcoin_node needs networking (and zmq?), and a future libbitcoin_sv2, and maybe libbitcoin_rpc.

@Sjors Sjors force-pushed the 2024/06/sv2_transport branch from d78b16e to d787c61 Compare June 20, 2024 16:05
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.

Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.

Leave a comment here, if you need help tracking down a confusing failure.

Debug: https://github.com/bitcoin/bitcoin/runs/26477378291

@Sjors
Copy link
Member Author

Sjors commented Jun 21, 2024

It compiles and the tests run, but it's not pretty.

The conversion between Sv2NetMsg and CSerializedNetMsg / CNetMessage is done in 7d93767, which is a bit of a hack at the moment.

I also haven't put much thought into Sv2NetMsg ever since I took over #27854, so perhaps this design can be improved as well.

@Sjors Sjors force-pushed the 2024/06/sv2_transport branch 2 times, most recently from d4ecab9 to 697aa7d Compare June 21, 2024 13:24
@sipa
Copy link
Member

sipa commented Jun 21, 2024

I only had a very brief look, but my guess would be that it would be easier if Sv2NetMsg did not contain an Sv2NetHeader, and just stored type and message. The Sv2 Transport would then construct the header at submitting or sending time instead. This means Sv2NetMsg would be more of a dumb container for what higher-level code cares about, while the protocol details would be more abstracted away in the Transport.

@Sjors Sjors force-pushed the 2024/06/sv2_transport branch from 697aa7d to e108385 Compare June 21, 2024 15:44
@Sjors
Copy link
Member Author

Sjors commented Jun 21, 2024

@sipa done and managed to clean up sv2_messages.h a bit in the process.

#include <string>
#include <util/check.h>

namespace node {
Copy link
Member Author

Choose a reason for hiding this comment

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

639be6d: this namespace is outdated, since this isn't part of the node anymore.

@Sjors Sjors force-pushed the 2024/06/sv2_transport branch from e108385 to 2f673b5 Compare June 21, 2024 16:20
@Sjors Sjors force-pushed the 2024/06/sv2_transport branch from 2f673b5 to cb40e0b Compare June 21, 2024 18:14
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.

Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.

Leave a comment here, if you need help tracking down a confusing failure.

Debug: https://github.com/bitcoin/bitcoin/runs/26526802432

@Sjors Sjors force-pushed the 2024/06/sv2_transport branch from cb40e0b to b0802dc Compare June 24, 2024 11:50
@Sjors Sjors force-pushed the 2024/06/sv2_transport branch 2 times, most recently from 03557a0 to 6691069 Compare June 25, 2024 10:14
@Sjors Sjors mentioned this pull request Jun 25, 2024
2 tasks
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Debug: https://github.com/bitcoin/bitcoin/runs/30422811066

Hints

Make sure to run all tests locally, according to the documentation.

The failure may happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@Sjors
Copy link
Member Author

Sjors commented Sep 20, 2024

Each of these CI failures seem spurious, some sort of timeout after many hours. However there's real failures in the followup PR. Going to rebase this to avoid confusion.

Sjors and others added 8 commits October 4, 2024 12:09
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 avoids a circular dependency between bitcoin-sv2 and bitcoin-node.
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
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 8, 2024

🐙 This pull request conflicts with the target branch and needs rebase.

@Sjors Sjors mentioned this pull request Oct 16, 2024
1 task
@Sjors
Copy link
Member Author

Sjors commented Oct 16, 2024

I moved this to Sjors#67 so we can focus on building an interface for external applications to use, and getting multiprocess in a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants