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

Stratum v2 Template Provider common functionality #49

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

Conversation

@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 e59ea4f to 735e934 Compare November 25, 2024 13:30
@Sjors
Copy link
Owner Author

Sjors commented Nov 25, 2024

I got rid of the NewWorkSet struct and BuildNewWorkSet helper, moved some repeating code to SendWork.

I also noticed that with -DCMAKE_BUILD_TYPE=Debug the sv2_template_provider_tests run much faster than with the regular build.

@Sjors
Copy link
Owner Author

Sjors commented Dec 2, 2024

Included changes from #72 which fixes a crash and the test run at normal speed again.

@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from c413ad7 to 9cac0b8 Compare December 2, 2024 20:00
@Sjors
Copy link
Owner Author

Sjors commented Dec 2, 2024

@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 9cac0b8 to fd26e38 Compare December 16, 2024 04:41
@Sjors
Copy link
Owner Author

Sjors commented Dec 16, 2024

Included a fix for #74: https://github.com/Sjors/bitcoin/compare/9cac0b8d1e84aa86301fd1e7907aaeeaeb351600..fd26e38c2af8ce82a95971392e85d5d23d3fd828

Also updated the list of interface changes in the PR description.

@Sjors Sjors force-pushed the 2024/06/sv2_connection branch 2 times, most recently from ce785e2 to 4eb05e2 Compare December 19, 2024 02:14
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from fd26e38 to a2882d8 Compare December 19, 2024 02:26
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 4eb05e2 to 4ba3ba8 Compare December 19, 2024 03:05
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from a2882d8 to 51fdf1d Compare December 19, 2024 03:07
@Sjors Sjors force-pushed the 2024/06/sv2_connection branch from 4ba3ba8 to a3a7a46 Compare December 19, 2024 06:12
Sjors and others added 13 commits December 19, 2024 13:13
This change avoids ambiguity when no tip is connected and it is
compared to uint256::ZERO.
To avoid future code changes from reintroducing the ambiguity fixed
by the previous commit, mark m_tip_block private and Assume that
it's not set to uint256::ZERO.
Alternate calls between Chainman's ProcessNewBlock and submitSolution. The Chainman code path is used in production, so it's important to keep test coverage for it.

Use createNewBlock via the interface instead of using the BlockAssembler directly. The latter is always called via the interface in production code.
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]>
Determine future_template only once
@Sjors Sjors force-pushed the 2024/07/sv2-tp-common branch from 51fdf1d to 91ea715 Compare December 19, 2024 06:14
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