Skip to content

Stratum v2 Template Provider common functionality #49

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

Open
wants to merge 9 commits into
base: 2024/06/sv2_connection
Choose a base branch
from

Conversation

Sjors
Copy link
Owner

@Sjors Sjors commented Jul 19, 2024

@Sjors
Copy link
Owner Author

Sjors commented Aug 13, 2024

Updated to the latest interface changes proposed in bitcoin#30409 and #53.

@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from b549fd6 to 22d033c Compare August 13, 2024 17:14
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch 2 times, most recently from 491755c to 16d2381 Compare August 13, 2024 18:07
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch 3 times, most recently from 4f957ee to b69544c Compare August 29, 2024 11:49
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch 2 times, most recently from ca73422 to 4fa25e0 Compare August 29, 2024 11:59
@Sjors
Copy link
Owner Author

Sjors commented Aug 29, 2024

Rebased for CMake

@Sjors
Copy link
Owner Author

Sjors commented Aug 30, 2024

One test still seems brittle:

src/test/sv2_template_provider_tests.cpp(256): fatal error: in "sv2_template_provider_tests/client_tests": critical check tester.GetBlockTemplateCount() == 3 has failed [2 != 3]

@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from b69544c to 1ca68d2 Compare September 5, 2024 12:57
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 1f720ff to 1912743 Compare September 5, 2024 15:56
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 1ca68d2 to b578e0a Compare September 10, 2024 14:54
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch 2 times, most recently from 598f08a to 436dc4d Compare September 11, 2024 05:39
@Sjors
Copy link
Owner Author

Sjors commented Sep 11, 2024

Moved TemplateProvider from node to common so that in #48 bitcoin-mine does not depend on bitcoin-node.

@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 436dc4d to 46fa8f1 Compare September 11, 2024 06:37
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from b578e0a to 489c9fb Compare September 19, 2024 15:02
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch 2 times, most recently from 7db898e to 765af74 Compare September 19, 2024 16:13
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 802ffdc to 6a29c1d Compare March 20, 2025 16:31
@Sjors
Copy link
Owner Author

Sjors commented Mar 20, 2025

Occasional failing on CentOS probably means the tests need to be made more robust. https://cirrus-ci.com/task/5262823086882816

@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 185eb09 to 1a0f0f3 Compare April 8, 2025 17:49
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 6a29c1d to b2f6576 Compare April 8, 2025 18:28
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch 2 times, most recently from 5692ffa to 7d5d5ad Compare April 15, 2025 13:21
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from b2f6576 to 134d8b3 Compare April 15, 2025 13:32
@Sjors
Copy link
Owner Author

Sjors commented Apr 15, 2025

Rebased after bitcoin#31785 landed, which completes the interface changes needed for the Template Provider. Dropped the use of waitTipChanged() on startup and added a shutdown check in ThreadSv2ClientHandler().

@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 7d5d5ad to de05710 Compare June 16, 2025 08:20
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 134d8b3 to 59f376b Compare June 16, 2025 08:23
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from de05710 to 21324f0 Compare July 8, 2025 12:40
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 59f376b to d4d57bc Compare July 8, 2025 12:40
@Sjors
Copy link
Owner Author

Sjors commented Jul 8, 2025

CI fails because since bitcoin#29307 we have to fclose files. I'll update 9e6d5d6 to do that.

@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch 2 times, most recently from b4abce4 to 6fda8e0 Compare July 9, 2025 06:55
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 21324f0 to b62f820 Compare July 9, 2025 08:11
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 6fda8e0 to 5ff8c44 Compare July 9, 2025 08:14
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from b62f820 to 5a6d2b3 Compare July 9, 2025 08:47
Sjors and others added 9 commits July 9, 2025 12:05
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 <[email protected]>
Co-Authored-By: Fi3
Co-authored-by: Christopher Coverdale <[email protected]>
Incrementally update the template.
On by default.

Allow Stratum v2 miners to opt out, pending more discussion on the BIP.
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 5ff8c44 to 29a9c8c Compare July 9, 2025 10:06
@Sjors
Copy link
Owner Author

Sjors commented Jul 14, 2025

Note to self for the next update, apply:

diff --git a/src/sv2/template_provider.cpp b/src/sv2/template_provider.cpp
index a4331c6cb3..d83b86be69 100644
--- a/src/sv2/template_provider.cpp
+++ b/src/sv2/template_provider.cpp
@@ -66,7 +66,7 @@ Sv2TemplateProvider::Sv2TemplateProvider(interfaces::Mining& mining) : m_mining{
     version_pubkey_bytes[1] = 0;
     m_authority_pubkey = XOnlyPubKey(authority_key.GetPubKey());
     std::copy(m_authority_pubkey.begin(), m_authority_pubkey.end(), version_pubkey_bytes.begin() + 2);
-    LogInfo("Template Provider authority key: %s\n", EncodeBase58Check(version_pubkey_bytes));
+    LogPrintLevel(BCLog::SV2, BCLog::Level::Info, "Template Provider authority key: %s\n", EncodeBase58Check(version_pubkey_bytes));
     LogTrace(BCLog::SV2, "Authority key: %s\n", HexStr(m_authority_pubkey));

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

Successfully merging this pull request may close these issues.

1 participant