contrib: support injecting custom txs to signet miner#107
Open
theStack wants to merge 3 commits intobitcoin-inquisition:29.xfrom
Open
contrib: support injecting custom txs to signet miner#107theStack wants to merge 3 commits intobitcoin-inquisition:29.xfrom
theStack wants to merge 3 commits intobitcoin-inquisition:29.xfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a new command line option
--custom-txs-fileto the signet miner. When provided, the block template is overridden [1] with the txs in the pointed file before mining. It's a simple text format with one tx per line in hex, and optional comments starting with '#', e.g.:My motivation for doing this is trying to get a non-standard transaction mined on signet, and getting feedback by AJ that there is currently not even support in the signet miner for doing so. Can be tested with the following offband tx, which should be able to get mined (it's accepted by my mempool, if I start the node with
-acceptnonstdtxn=1):https://gist.githubusercontent.com/theStack/e99fb01144c6f83e4142ce7e2f070d55/raw/9facfe7890a0ec65cd75ff565169fd0dfb58f605/signet_offband_tx.txt 🤫 🤫
The functional test is a bit ugly, as >=100 (COINBASE_MATURITY) blocks have to be mined in order to get spendable UTXOs to create non-coinbase transactions in the first place. Maybe there is a way to speed that up in some way, feedback welcome.
[1] currently the existing txs are dropped; I suppose this could be smarter by keeping the template txs if there is enough block space left to fit the override txs