Skip to content
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

SRI Integration Test: Message Synchronization Primitives #1122

Closed
2 tasks
Tracked by #1120
plebhash opened this issue Aug 19, 2024 · 1 comment · Fixed by #1066
Closed
2 tasks
Tracked by #1120

SRI Integration Test: Message Synchronization Primitives #1122

plebhash opened this issue Aug 19, 2024 · 1 comment · Fixed by #1066
Assignees
Labels
ci/cd CI/CD integration-tests tracker Help us track a group of related issues
Milestone

Comments

@plebhash
Copy link
Collaborator

plebhash commented Aug 19, 2024

The third stage of #1120, blocked by #1093 + #1119

Consists of the following goals:

  • Ability to declare specific SV2 messages and turn them into frames.
  • Ability to assert some tested role is receiving some specific message/frame at some specific stage of the test execution flow.
  • Ability to assert some tested role is sending some specific message/frame at some specific stage of the test execution flow.
  • Ability to mock roles. We must be able to easily deploy a TCP socket that is able to act as a server/upstream (by listening for connections), or as a client/downstream (by attempting connections) while injecting specific messages/frames at some specific stage of the test execution flow.

As a starting point, the following integration test could be used to drive initial development of these message synchronization primitives:

  1. Start a regtest TP process (with 16 premined blocks).
  2. Start a Pool that connects to TP.
  3. Assert that Pool sends a SetupConnection with flag 2 (Template Distribution Protocol) to TP.
  4. Assert that Pool receives a SetupConnection.Success with flag 2 back from TP.
  5. Assert that Pool sends a CoinbaseOutputDataSize to TP.
  6. Start a mock for a Downstream Proxy(JDC/MiningProxy) that connects to Pool.
  7. Mock Proxy sends a SetupConnection with flag 0 (Mining Protocol) to Pool.
  8. Assert that Pool sends a SetupConnection.Success with flag 0 back to Mock Proxy.

Please note that step 4 is asserting Pool received a message, but it is not asserting that TP sent a message. This framework cannot have access to the TP internal behavior, since it is just a bitcoind process operating in regtest mode.

In order to internally assert TP behavior, more extensive work will be required. While maybe desirable, this work should for some future scope and is not relevant right now, mainly due to the complexity that cross-language barriers (Rust vs C++) will introduce.


The following resources can be used as references for inspiration on coding patterns:


@plebhash
Copy link
Collaborator Author

  • Ability to mock roles. We must be able to easily deploy a TCP socket that is able to act as a server/upstream (by listening for connections), or as a client/downstream (by attempting connections) while injecting specific messages/frames at some specific stage of the test execution flow.

this goal was disputed by @jbesraa and requires further discussion

@plebhash plebhash changed the title SRI Integration Test: Message Syncrhonization Primitives SRI Integration Test: Message Synchronization Primitives Aug 19, 2024
@plebhash plebhash added the tracker Help us track a group of related issues label Sep 23, 2024
@plebhash plebhash added this to the 1.1.0 milestone Sep 23, 2024
@plebhash plebhash linked a pull request Sep 23, 2024 that will close this issue
@plebhash plebhash moved this from Todo 📝 to In Progress 🏗️ in SV2 Roadmap 🛣️ Sep 23, 2024
@GitGab19 GitGab19 moved this from In Progress 🏗️ to Ready For Review 🔍 in SV2 Roadmap 🛣️ Oct 11, 2024
@github-project-automation github-project-automation bot moved this from Ready For Review 🔍 to Done ✅ in SV2 Roadmap 🛣️ Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd CI/CD integration-tests tracker Help us track a group of related issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants