Support signet mining in scenarios #739
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The core change here is expanding
TestNode.generatetoaddress()to support signet mining. The whole script from the signet miner is copied and refactored incommander.py: get block template, create signet TXs, create PSBT, sign with wallet, complete block, etc and THEN, grind the PoW.Signet grinding goes a lot faster using
bitcoin-utilrather than single threaded python, so I addeed it to a v29 image and included it in a test. Commander can also fallback to python if bitcoin-util isnt present. But going forward i think we should install it in all images so that change has been made toimage-buildand the docker bake file as well.Using bitcoin-util inside the tank requires another k8s permission so the scenario must be run with
--admin, whichln_initis automatically.In summary:
A Warnet can run on Signet with lightning nodes and channels. Upon deployment, the ln_init scenario will generate all blocks necessary for the channels using the
bitcoin-utilgrinder for PoW. For now, the mining node in such a network must use the29.0-utiltag but starting with bitcoin core v30 our warnet images will include bitcoin-util by default