6f136cd3914b001752cce02adde00fccaed0ad48 tests: drop expect_disconnect behaviour for tx relay (Anthony Towns)
be0857745a5a0154d89a2aa9ddaa2a84e912598a validation: only check input scripts once (Anthony Towns)
65bcbbc538234957b1f7f76b2f21ad7c138efb87 net_processing: drop MaybePunishNodeForTx (Anthony Towns)
f24291bd96f92ecc0fc04317fd93747eeb2d557a qa: unit test sighash caching (Antoine Poinsot)
73d3ab8fc93119f14f72a6c5f3cdd9eedcb36a20 qa: simple differential fuzzing for sighash with/without caching (Antoine Poinsot)
ddfb9150b80c0c692c06b91cefa988c7773b15ff script: (optimization) introduce sighash midstate caching (Pieter Wuille)
354d46bc10c61c45140be7a425c5c29fed934d32 script: (refactor) prepare for introducing sighash midstate cache (Pieter Wuille)
5a0506eea03e423121dd2112c2ba5fb4320022e3 tests: add sighash caching tests to feature_taproot (Pieter Wuille)
020ed613bed1148888692cb37e3522202bfca44e validation: detect witness stripping without re-running Script checks (Antoine Poinsot)
56626300b80dced9e111a39d5c560b0b81276cb8 policy: introduce a helper to detect whether a transaction spends Segwit outputs (Antoine Poinsot)
97088fa75aa0af5355587ce3522320f459e35204 qa: test witness stripping in p2p_segwit (Antoine Poinsot)
Pull request description:
ACKs for top commit:
sipa:
Code review ACK 6f136cd3914b001752cce02adde00fccaed0ad48
glozow:
ACK 6f136cd3914b001752cce02adde00fccaed0ad48, looks correct
darosior:
ACK 6f136cd3914b001752cce02adde00fccaed0ad48
Tree-SHA512: 445d770ae10bf1c4766810f945a8e5d83bfa0869d346b0f93c237b91101c9af45d6c935414e79ebf5e0c7089599a9a5a96cff82d9703b1d9573ce9deb21971fd
Various test vectors
mainnet_alt.json
For easier testing the difficulty is maximally increased in the first (and only) retarget period, by producing blocks approximately 2 minutes apart.
The alternate mainnet chain was generated as follows:
- use faketime to set node clock to 2 minutes after genesis block
- mine a block using a CPU miner such as https://github.com/pooler/cpuminer
- restart node with a faketime 2 minutes later
for i in {1..2016}
do
t=$(( 1231006505 + $i * 120 ))
faketime "`date -d @$t +'%Y-%m-%d %H:%M:%S'`" \
bitcoind -connect=0 -nocheckpoints -stopatheight=$i
done
The CPU miner is kept running as follows:
./minerd -u ... -p ... -o http://127.0.0.1:8332 --no-stratum \
--coinbase-addr 1NQpH6Nf8QtR2HphLRcvuVqfhXBXsiWn8r \
--algo sha256d --no-longpoll --scantime 3 --retry-pause 1
The payout address is derived from first BIP32 test vector master key:
pkh(xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi/44h/0h/0h/<0;1>/*)#fkjtr0yn
It uses pkh() because tr() outputs at low heights are not spendable (unexpected-witness).
This makes each block deterministic except for its timestamp and nonce, which
are stored in mainnet_alt.json and used to reconstruct the chain without
having to redo the proof-of-work.
The timestamp was not kept constant because at difficulty 1 it's not sufficient to only grind the nonce. Grinding the extra_nonce or version field instead would have required additional (stratum) software. It would also make it more complicated to reconstruct the blocks in this test.
The getblocktemplate RPC code needs to be patched to ignore not being connected
to any peers, and to ignore the IBD status check.
On macOS use faketime "@$t" instead.