-
Notifications
You must be signed in to change notification settings - Fork 35.9k
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
signet: fixing mining for OP_TRUE challenge #29032
base: master
Are you sure you want to change the base?
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. |
My own goal with this is to test Stratum v2 stuff, e.g. #28983. It's nice to have a test network with difficulty adjustment. Regular testnet difficulty is too high for my humble S9 (let alone a CPU miner) to win blocks. Using real mining equipment as opposed to a CPU miner is useful, because of the many quirks real devices have (e.g. version bit grinding). Afaik there's no good emulator. Although I won't actually need this mining script to test local pool software, I patched it anyway to serve as a reference to compare the pool software against. cc @ajtowns, @kallewoof |
This looks reasonable to me, although I'm not super familiar with all the code being changed. |
5ecf439
to
3488f3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Code looks good, I'm still to test it.
BIP325 mentions the following rule:
Such a signet can be created using e.g.
-signetchallenge=51
(OP_TRUE
). Howevercontrib/signet/miner
can't handle this, as it fails withPSBT signing failed
.This PR improves the miner by skipping the PSBT for known trivial scripts (just
OP_TRUE
for now). This also avoids appending the 4 byte signet header to the witness commitment, as allowed by the above rule.