aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_segwit.py
AgeCommit message (Collapse)Author
2020-11-16Revert "Merge #19606: Backport wtxid relay to v0.20"MarcoFalke
This reverts commit a339289c2ef9caffa1195436695a13f6e48e1bbc, reversing changes made to b9ac31f2d29ae3e79c0f0cde5bab2d7213e6da51.
2020-09-24test: Use wtxid relay generally in functional testsFabian Jahr
2020-09-24test: Add tests for wtxid tx relay in segwit testFabian Jahr
Also cleans up some doublicate lines in the rest of the test. co-authored-by: Anthony Towns <aj@erisian.com.au>
2020-09-24Add support for tx-relay via wtxidSuhas Daftuar
This adds a field to CNodeState that tracks whether to relay transactions with that peer via wtxid, instead of txid. As of this commit the field will always be false, but in a later commit we will add a way to negotiate turning this on via p2p messages exchanged with the peer.
2020-08-07test addition of unknown segwit spends to txid reject filterGregory Sanders
Github-Pull: #19620 Rebased-From: 9f88ded82b2898ca63d44c08072f1ba52f0e18d7
2020-04-03test: remaining replacements of (send_message+sync_with_ping) with send_and_pingSebastian Falbesoner
2020-04-01test: replace (send_message + sync_with_ping) with send_and_pingJon Atack
2020-03-12Merge #18213: test: Fix race in p2p_segwitMarcoFalke
fa2cf85e6f366d62ebf173bf0bd51af45806afe1 test: Fix race in p2p_segwit (MarcoFalke) Pull request description: Fixes #11696 Top commit has no ACKs. Tree-SHA512: 09de07ea26236547586f5c373a0df2b68d84af5cfa8f40bd2ca9f951fc083c5f4b8a472a60668d99118bbd9f3942ec3d6a34f05944d47345acca41c95475bb27
2020-02-28test: Fix race in p2p_segwitMarcoFalke
Co-Authored-By: Suhas Daftuar <sdaftuar@gmail.com>
2020-02-26test: Reduce unneeded whitelist permissions in testsMarcoFalke
2020-01-23test: Make msg_tx a witness txMarcoFalke
2019-12-06tests: Mark functional tests not supporting bitcoin-cli (--usecli) as suchpracticalswift
2019-11-11test: Use proper MAX_SCRIPT_ELEMENT_SIZEHennadii Stepanov
2019-10-14[test] rename SegwitVersion1SignatureHash()John Newbery
The function implementing segwit v0 signature hash was originally named SegwitVersion1SignatureHash() (presumably before segwit v0 was named segwit v0). Rename it to SegwitV0SignatureHash(). Also rename SignatureHash() to LegacySignatureHash() for disambiguation.
2019-08-14[Consensus] Bury segwit deploymentJohn Newbery
Hardcode segwit deployment height to 481824 for mainnet.
2019-06-21test: Require standard txs in regtestMarcoFalke
2019-06-17Merge #15982: tests: Make msg_block a witness blockMarcoFalke
fa1d766717 tests: Make msg_block a witness block (MarcoFalke) fa52eb55c9 test: Remove True argument to CBlock::serialize (MarcoFalke) Pull request description: Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (#15664), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. ACKs for commit fa1d76: laanwj: code-review ACK fa1d7667173eeae363d3729e3fc654057335cb44 Tree-SHA512: 2c550646f99c9ca86a223ca988c61a730f5e6646807adeaa7174fb2424a32cea3fef8bcd3e0b12e162e7ff192877d0c02fd0654df6ee1a9b821b065707c2dcbc
2019-05-14Disallow extended encoding for non-witness transactions (take 3)MarcoFalke
2019-05-08tests: Make msg_block a witness blockMarcoFalke
This diff has been generated with the following script, but is better reviewed without looking at the script. # -BEGIN VERIFY SCRIPT- echo "Use msg_witness_block everywhere, except for tests that require msg_block" # This could be a separate commit, but it is combined with the # following scripts to reduce the overall diff sed -i -e 's/msg_block/msg_witness_block/g' ./test/functional/{feature_assumevalid,feature_cltv,feature_dersig,feature_versionbits_warning,p2p_fingerprint,p2p_sendheaders,p2p_unrequested_blocks,example_test,rpc_blockchain}.py echo "Rename msg_block to msg_no_witness_block" # Rename msg_block to msg_no_witness_block in all tests (not the # framework) sed -i -e 's/msg_block/msg_no_witness_block/g' $(git grep -l msg_block ./test/functional/*.py) # Derive msg_no_witness_block from msg_block # Make msg_block a witness block in messages.py patch -p1 --fuzz 0 << EOF diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 00190e4cbd..e454ed5987 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -1133 +1133 @@ class msg_block: - return self.block.serialize(with_witness=False) + return self.block.serialize() @@ -1155 +1155 @@ class msg_generic: -class msg_witness_block(msg_block): +class msg_no_witness_block(msg_block): @@ -1158,2 +1158 @@ class msg_witness_block(msg_block): - r = self.block.serialize() - return r + return self.block.serialize(with_witness=False) @@ -1445 +1444 @@ class msg_blocktxn: - r += self.block_transactions.serialize(with_witness=False) + r += self.block_transactions.serialize() @@ -1452 +1451 @@ class msg_blocktxn: -class msg_witness_blocktxn(msg_blocktxn): +class msg_no_witness_blocktxn(msg_blocktxn): @@ -1456,3 +1455 @@ class msg_witness_blocktxn(msg_blocktxn): - r = b"" - r += self.block_transactions.serialize() - return r + return self.block_transactions.serialize(with_witness=False) EOF # Conclude rename of msg_block to msg_no_witness_block sed -i -e 's/msg_witness_block/msg_block/g' $(git grep -l msg_witness_block) # -END VERIFY SCRIPT-
2019-05-08test: Remove True argument to CBlock::serializeMarcoFalke
Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (#15664, c459c5f), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. This diff has been created with a script, but is better reviewed without a scripted diff. sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
2019-04-27Merge #15846: [POLICY] Make sending to future native witness outputs standardMeshCollider
c634b1e20 [POLICY] Make sending to future native witness outputs standard (Pieter Wuille) Pull request description: As discussed in the April 18 2019 IRC meeting. This makes sending to future Segwit versions via native outputs (bech32) standard for relay, mempool acceptance, and mining. The reasons are: * This may interfere with smooth adoption of future segwit versions, if they're defined (by the sender wallet/node). * It violates BIP173 ("Version 0 witness addresses are always 42 or 62 characters, but implementations MUST allow the use of any version."), though admittedly this code was written before BIP173. * It doesn't protect much, as P2SH-embedded segwit cannot be filtered in this way. * As a general policy, the sender shouldn't care what the receiver likes his outputs to be. Note that _spending_ such outputs (including P2SH-embedded ones) remains nonstandard, as that is actually required for softfork safety. ACKs for commit c634b1: MarcoFalke: utACK c634b1e2076d8e15a8284638475e26c691d4e100 harding: Tested ACK c634b1e2076d8e15a8284638475e26c691d4e100 meshcollider: utACK https://github.com/bitcoin/bitcoin/pull/15846/commits/c634b1e2076d8e15a8284638475e26c691d4e100 Tree-SHA512: e37168a1be9f445a04d4280593f0a92bdae33eee00ecd803d5eb16acb5c9cfc0f1f0a1dfbd5a0cc73da2c9928ec11cbdac7911513a78f85b789ae0d00e1b5962
2019-04-25Add test for superfluous witness record in deserializationGregory Sanders
2019-04-18[POLICY] Make sending to future native witness outputs standardPieter Wuille
2019-04-18Pure python ECPieter Wuille
This removes the dependency on OpenSSL for the interaction tests, by providing a pure-Python toy implementation of secp256k1.
2019-04-09test: Remove unused importsMarcoFalke
2019-04-09scripted-diff: use self.sync_* methodsMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g' $(git grep -l 'sync_blocks(self.nodes)' ./test/functional/*.py) sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py) sed -i -e 's/ sync_blocks(/ self.sync_blocks(/g' $(git grep -l sync_blocks ./test/functional/*.py) sed -i -e 's/ sync_mempools(/ self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py) -END VERIFY SCRIPT-
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Remove brackets after assertMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test) -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Use py3.5 bytes::hex() methodMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str) export RE_B_0="[^()]*" # match no bracket export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one () export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (()) export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)') sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str) export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share') sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh -END VERIFY SCRIPT-
2019-01-22Default -whitelistforcerelay to offSuhas Daftuar
2018-12-10[mining] segwit option must be set in GBTJohn Newbery
Calling getblocktemplate without the segwit rule specified is most likely a client error, since it results in lower fees for the miner. Prevent this client error by failing getblocktemplate if called without the segwit rule specified.
2018-09-26Check for specific tx acceptance failures based on script signatureJustin Turner Arthur
2018-09-23Fix for incorrect version attr set on functional test segwit block.Justin Turner Arthur
2018-09-23test: Fix broken segwit testpracticalswift
2018-09-13Merge #14180: qa: Run all tests even if wallet is not compiledWladimir J. van der Laan
fac95398366f644911b58f1605e6bc37fb76782d qa: Run all tests even if wallet is not compiled (MarcoFalke) faa669cbcd1fc799517b523b0f850e01b11bf40a qa: Premine to deterministic address with -disablewallet (MarcoFalke) Pull request description: Currently the test_runner would exit if the wallet was not compiled into the Bitcoin Core executable. However, a lot of the tests run without the wallet just fine and there is no need to globally require the wallet to run the tests. Tree-SHA512: 63177260aa29126fd20f0be217a82b10b62288ab846f96f1cbcc3bd2c52702437703475d91eae3f8d821a3149fc62b725a4c5b2a7b3657b67ffcbc81532a03bb
2018-09-10qa: Run all tests even if wallet is not compiledMarcoFalke
2018-09-08Merge #14119: qa: Read reject reasons from debug log, not p2p messagesWladimir J. van der Laan
fac3e22b18cd29053bc17065fd75db7b84ba6f40 qa: Read reject reasons from debug log, not p2p messages (MarcoFalke) Pull request description: For local testing we don't need to rely on p2p messages just to assert a reject reason. Replace reading p2p messages with reading from the debug log file. Tree-SHA512: fa59598ecf5e00cfb420ef1892d90aa415501fd882e1c608894dc577b0d00e93a442326d3a9167fef77d26aafbe345b730b49109982ccad68a5942384564a90b
2018-09-04Fix typos reported by codespellpracticalswift
2018-08-31qa: Read reject reasons from debug log, not p2p messagesMarcoFalke
2018-08-29qa: Use named args in some testsMarcoFalke
2018-08-29scripted-diff: Pass node into p2p_segwit acceptance testsMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/(test_witness_block|test_transaction_acceptance)\((self\.nodes\[.\])\.rpc/\1(\2/g' test/functional/p2p_segwit.py -END VERIFY SCRIPT-
2018-08-09Merge #13916: qa: wait_for_verack by defaultMarcoFalke
fa5587fe71 qa: wait_for_verack by default (MarcoFalke) Pull request description: This removes the need to do so manually every time a connection is added. Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
2018-08-08qa: wait_for_verack by defaultMarcoFalke
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-17Merge #13638: tests: Use MAX_SCRIPT_ELEMENT_SIZE from script.pyWladimir J. van der Laan
b9f4b211df24fed85dddbe69355648b57fd331ac tests: Use MAX_SCRIPT_ELEMENT_SIZE from script.py (Daniel Kraft) Pull request description: `p2p_segwit.py` and `test_framework/script.py` both define a constant for `MAX_SCRIPT_ELEMENT_SIZE` (=520 bytes), which is redundant. This change uses the constant defined in the `script.py` module for `p2p_segwit.py`. Tree-SHA512: 2bc295ff26d9b052d4e05b85c27e748175884d6689a92c19337fc4db8bf439e3abe3edc91af1aaf46d8dc42ed96a85ad17110546d2274a0d9cda3abd6b878a31
2018-07-13qa: Fix some TODOs in p2p_segwitMarcoFalke
2018-07-11tests: Use MAX_SCRIPT_ELEMENT_SIZE from script.pyDaniel Kraft
p2p_segwit.py and test_framework/script.py both define a constant for MAX_SCRIPT_ELEMENT_SIZE (=520 bytes), which is redundant. This change uses the constant defined in the script.py module for p2p_segwit.py.
2018-06-29[tests] p2p_segwit: sync_blocks in subtest wrapper.John Newbery
2018-06-29[tests] p2p_segwit: remove unnecessary arguments from subtests.John Newbery
2018-06-29[tests] p2p_segwit: log and assert segwit status in subtest wrapper.John Newbery