Introduced in ca10a03addf70421893791c2c499e82fc494d60b then erroneously removed in 8d8099e97ab8af2126f6fbd223fbd82c52f2e85e. The restored line is how we are checking that the node will still re-request a specific txid given a witness-related failure.
Restore test case for p2p transaction blinding #19649
pull instagibbs wants to merge 2 commits into bitcoin:master from instagibbs:p2p_segwit_reject changing 1 files +11 −1-
instagibbs commented at 1:03 AM on August 3, 2020: member
- fanquake added the label Tests on Aug 3, 2020
-
0fea6ede1b
Restore test case for p2p transaction blinding
Introduced in ca10a03addf70421893791c2c499e82fc494d60b then erroneously removed in 8d8099e97ab8af2126f6fbd223fbd82c52f2e85e. The restored line is how we are checking that the node will still re-request a specific txid given a witness-related failure.
- instagibbs force-pushed on Aug 3, 2020
-
ajtowns commented at 1:54 AM on August 3, 2020: member
ACK 0fea6ede1b46f5137e8ea0fbacce169d97e4a5ee
However, while we're at it, maybe also check that announcing the stuffed tx3 via wtxid does blind the node to the wtxid? I don't think
test_wtxid_relaydoes that already, and it should be easy to do it here:--- a/test/functional/p2p_segwit.py +++ b/test/functional/p2p_segwit.py @@ -174,6 +174,9 @@ class TestP2PConn(P2PInterface): self.last_wtxidrelay.append(message) def announce_tx_and_wait_for_getdata(self, tx, timeout=60, success=True, use_wtxid=False): + if success: + # sanity check + assert (self.wtxidrelay and use_wtxid) or (not self.wtxidrelay and not use_wtxid) with mininode_lock: self.last_message.pop("getdata", None) if use_wtxid: @@ -259,6 +262,8 @@ class SegWitTest(BitcoinTestFramework): self.old_node = self.nodes[0].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK) # self.std_node is for testing node1 (fRequireStandard=true) self.std_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK | NODE_WITNESS) + # self.std_wtx_node is for testing node1 with wtxid relay + self.std_wtx_node = self.nodes[1].add_p2p_connection(TestP2PConn(wtxidrelay=True), services=NODE_NETWORK | NODE_WITNESS) assert self.test_node.nServices & NODE_WITNESS != 0 @@ -1320,10 +1325,13 @@ class SegWitTest(BitcoinTestFramework): tx3.rehash() # Node will not be blinded to the transaction, requesting it any number of times - # since it is being announced via txid relay. + # if it is being announced via txid relay. + # Node will be blinded to the transaction via wtxid, however. self.std_node.announce_tx_and_wait_for_getdata(tx3) + self.std_wtx_node.announce_tx_and_wait_for_getdata(tx3, use_wtxid=True) test_transaction_acceptance(self.nodes[1], self.std_node, tx3, True, False, 'tx-size') self.std_node.announce_tx_and_wait_for_getdata(tx3) + self.std_wtx_node.announce_tx_and_wait_for_getdata(tx3, use_wtxid=True, success=False) # Remove witness stuffing, instead add extra witness push on stack tx3.vout[0] = CTxOut(tx2.vout[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])) -
566aada386
Test that wtxid relay peers add wtxid to reject filter
h/t Anthony Towns
-
instagibbs commented at 3:38 AM on August 3, 2020: member
@ajtowns looks good, may as well get this in now, confirmed it's not already(intentionally) tested for
-
instagibbs commented at 7:09 PM on August 3, 2020: member
@sdaftuar you may be interested
-
laanwj commented at 1:47 PM on August 5, 2020: member
Concept ACK, thanks for paying attention here.
-
fjahr commented at 2:51 PM on August 6, 2020: member
tACK 566aada386e181c2ff40ef18ee660a819f485415
- laanwj merged this on Aug 9, 2020
- laanwj closed this on Aug 9, 2020
- sidhujag referenced this in commit 8d30d93ed3 on Aug 9, 2020
-
in test/functional/p2p_segwit.py:1334 in 566aada386
1330 | + # Node will be blinded to the transaction via wtxid, however. 1331 | self.std_node.announce_tx_and_wait_for_getdata(tx3) 1332 | + self.std_wtx_node.announce_tx_and_wait_for_getdata(tx3, use_wtxid=True) 1333 | test_transaction_acceptance(self.nodes[1], self.std_node, tx3, True, False, 'tx-size') 1334 | + self.std_node.announce_tx_and_wait_for_getdata(tx3) 1335 | + self.std_wtx_node.announce_tx_and_wait_for_getdata(tx3, use_wtxid=True, success=False)
DrahtBot locked this on Aug 16, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 18:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 18:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me