Skip to content

contrib: support injecting custom txs to signet miner#107

Open
theStack wants to merge 3 commits intobitcoin-inquisition:29.xfrom
theStack:signet-miner-txinject
Open

contrib: support injecting custom txs to signet miner#107
theStack wants to merge 3 commits intobitcoin-inquisition:29.xfrom
theStack:signet-miner-txinject

Conversation

@theStack
Copy link

This PR adds a new command line option --custom-txs-file to 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.:

# some comment
tx_hex1
# maybe some other comment ...
tx_hex2
tx_hex3
...

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

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