Commit graph

1401 commits

Author SHA1 Message Date
Byron Hambly
12dbf6cb9d Merge f6fdedf850 into merged_master (Bitcoin PR bitcoin/bitcoin#25648) 2024-10-24 20:20:13 +02:00
Byron Hambly
35cc1e213b Merge b1c8ea45c9 into merged_master (Bitcoin PR bitcoin/bitcoin#25683) 2024-10-24 12:20:41 +02:00
Byron Hambly
da5b3cf786 Merge 9ba73758c9 into merged_master (Bitcoin PR bitcoin/bitcoin#24697)
Also removes the redundant redeclaration of CheckMinimalPush from
interpreter.h that was moved to script.h in f4e289f384
2024-10-20 20:19:04 +02:00
Byron Hambly
299207b5d6 Merge 2bdce7f7ad into merged_master (Bitcoin PR bitcoin/bitcoin#25514)
Note I did manually run the trim headers functional test successfully on
this commit, since it touched some of trim headers code.
2024-10-17 10:44:56 +02:00
James Dorfman
3e5580265d Merge 8efa73e7ce into merged_master (Bitcoin PR bitcoin/bitcoin#25557) 2024-10-16 06:40:15 +00:00
James Dorfman
6e9f70937f Merge 87d012324a into merged_master (Bitcoin PR bitcoin/bitcoin#25454) 2024-10-09 18:16:23 +00:00
James Dorfman
61b0543ba7 Merge cdcc74bbcc into merged_master (Elements PR #1270) 2024-09-23 16:51:13 +00:00
James Dorfman
17851700b4 Merge e4e201dfd9 into merged_master (Bitcoin PR bitcoin/bitcoin#25290) 2024-09-19 18:56:19 +00:00
James Dorfman
438cb545b7 Merge 2364d17a31 into merged_master (Bitcoin PR bitcoin/bitcoin#25480) 2024-09-19 15:22:38 +00:00
James Dorfman
88a98fd4b3 Merge 2fe27029f5 into merged_master (Bitcoin PR bitcoin/bitcoin#25404) 2024-09-17 18:36:02 +00:00
James Dorfman
fb17f731bd Merge 50a3921c96 into merged_master (Bitcoin PR bitcoin/bitcoin#25144) 2024-09-16 06:44:24 +00:00
James Dorfman
1c386ceb80 Merge e05564d706 into merged_master (Bitcoin PR bitcoin/bitcoin#25446) 2024-09-16 05:06:26 +00:00
James Dorfman
fe8d041f9f Merge 489b587669 into merged_master (Bitcoin PR bitcoin/bitcoin#25215) 2024-09-10 20:19:35 +00:00
James Dorfman
115b62e5ec Merge ede9089096 into merged_master (Bitcoin PR bitcoin/bitcoin#25156) 2024-09-10 19:08:58 +00:00
James Dorfman
c472e94b84 Merge 8f3ab9a1b1 into merged_master (Bitcoin PR bitcoin/bitcoin#24931) 2024-09-09 21:13:17 +00:00
James Dorfman
caa3ef8844 Merge 2ab4a80480 into merged_master (Bitcoin PR bitcoin/bitcoin#25254)
This commit moved DEFAULT_MIN_RELAY_TX_FEE to a different file.
Please confirm that the new value is equal to the old one.
2024-09-09 18:21:18 +00:00
James Dorfman
033f17b1df Merge 00ce8543f1 into merged_master (Bitcoin PR bitcoin/bitcoin#24171)
Please review the changes to src/net_processing.cpp carefully, I'm not sure
if I adapted new IBD logic to work properly for elements.
2024-09-09 16:33:14 +00:00
James Dorfman
1aff5fa9e9 Merge 5f65afff9c into merged_master (Bitcoin PR bitcoin/bitcoin#24178) 2024-09-06 18:21:45 +00:00
James Dorfman
9cb0f04edb Merge aac99faa66 into merged_master (Bitcoin PR bitcoin/bitcoin#25175) 2024-08-13 20:39:38 +00:00
James Dorfman
66bc45020f Merge 4d0c00dffd into merged_master (Bitcoin PR bitcoin/bitcoin#25168) 2024-08-13 20:10:21 +00:00
James Dorfman
0e02561a73 Merge fdb82a30be into merged_master (Bitcoin PR bitcoin/bitcoin#25147) 2024-08-13 05:07:06 +00:00
James Dorfman
cef04ed2a5 Merge 986bae8e72 into merged_master (Bitcoin PR bitcoin/bitcoin#22778) 2024-08-13 04:41:52 +00:00
James Dorfman
57c149aa06 Merge 0be1dc1f56 into merged_master (Bitcoin PR bitcoin/bitcoin#24062) 2024-08-12 04:44:23 +00:00
James Dorfman
09739a82e2 Merge aa3200d896 into merged_master (Bitcoin PR bitcoin/bitcoin#25109) 2024-08-12 03:41:59 +00:00
James Dorfman
ab65a98a04 Merge dc0ee57373 into merged_master (Bitcoin PR bitcoin/bitcoin#20799) 2024-08-12 03:28:06 +00:00
James Dorfman
5854eae590 Merge 25dd4d8513 into merged_master (Bitcoin PR bitcoin/bitcoin#24595) 2024-08-12 02:29:42 +00:00
James Dorfman
7effbfd139 Merge a2a8e919ee into merged_master (Bitcoin PR bitcoin/bitcoin#24925) 2024-08-09 21:08:52 +00:00
James Dorfman
56ea06cc37 Merge 5d53cf3878 into merged_master (Bitcoin PR bitcoin/bitcoin#24543) 2024-08-08 19:37:59 +00:00
James Dorfman
e7759695ba Merge f0a834e2f1 into merged_master (Bitcoin PR bitcoin/bitcoin#18642) 2024-08-06 18:37:18 +00:00
James Dorfman
f86857195f Merge 43bb106613 into merged_master (Bitcoin PR bitcoin/bitcoin#24213) 2024-08-01 20:20:30 +00:00
James Dorfman
d4aa6eba2f Merge dbdc83ae01 into merged_master (Bitcoin PR bitcoin/bitcoin#24909) 2024-08-01 18:03:20 +00:00
James Dorfman
b3a377c2d0 Merge 0da559e02e into merged_master (Bitcoin PR bitcoin/bitcoin#24661) 2024-07-08 15:17:32 +00:00
stickies-v
260f8da71a
refactor: remove warnings globals 2024-06-13 11:20:49 +01:00
James Dorfman
9c1d4cc8ff Merge a4d7ac7bbe into merged_master (Elements PR #1317) 2024-05-24 16:13:46 +00:00
James Dorfman
e860ace1e4 Merge f089a0802c into merged_master (Bitcoin PR bitcoin/bitcoin#24692) 2024-05-23 23:51:34 +00:00
Pablo Greco
6367320f70 Restore NODE_NETWORK functionality with trim_headers 2024-05-21 05:34:30 +00:00
Ryan Ofsky
33303b2b29
Merge bitcoin/bitcoin#30000: p2p: index TxOrphanage by wtxid, allow entries with same txid
0fb17bf61a [log] updates in TxOrphanage (glozow)
b16da7eda7 [functional test] attackers sending mutated orphans (glozow)
6675f6428d [unit test] TxOrphanage handling of same-txid-different-witness txns (glozow)
8923edfc1f [p2p] allow entries with the same txid in TxOrphanage (glozow)
c31f148166 [refactor] TxOrphanage::EraseTx by wtxid (glozow)
efcc593017 [refactor] TxOrphanage::HaveTx only by wtxid (glozow)
7e475b9648 [p2p] don't query orphanage by txid (glozow)

Pull request description:

  Part of #27463 in the "make orphan handling more robust" section.

  Currently the main map in `TxOrphanage` is indexed by txid; we do not allow 2 transactions with the same txid into TxOrphanage. This means that if we receive a transaction and want to store it in orphanage, we'll fail to do so if a same-txid-different-witness version of the tx already exists in the orphanage. The existing orphanage entry can stay until it expires 20 minutes later, or until we find that it is invalid.

  This means an attacker can try to block/delay us accepting an orphan transaction by sending a mutated version of the child ahead of time. See included test.

  Prior to #28970, we don't rely on the orphanage for anything and it would be relatively difficult to guess what transaction will go to a node's orphanage. After the parent(s) are accepted, if anybody sends us the correct transaction, we'll end up accepting it. However, this is a bit more painful for 1p1c: it's easier for an attacker to tell when a tx is going to hit a node's orphanage, and we need to store the correct orphan + receive the parent before we'll consider the package. If we start out with a bad orphan, we can't evict it until we receive the parent + try the 1p1c, and then we'll need to download the real child, put it in orphanage, download the parent again, and then retry 1p1c.

ACKs for top commit:
  AngusP:
    ACK 0fb17bf61a
  itornaza:
    trACK 0fb17bf61a
  instagibbs:
    ACK 0fb17bf61a
  theStack:
    ACK 0fb17bf61a
  sr-gi:
    crACK [0fb17bf](https://github.com/bitcoin/bitcoin/pull/30000/commits/0fb17bf61a40b73a2b81a18e70b3de180c917f22)
  stickies-v:
    ACK 0fb17bf61a

Tree-SHA512: edcbac7287c628bc27036920c2d4e4f63ec65087fbac1de9319c4f541515d669fc4e5fdc30c8b9a248b720da42b89153d388e91c7bf5caf4bc5b3b931ded1f59
2024-05-15 09:56:17 -04:00
Ava Chow
f5fc3190fb
Merge bitcoin/bitcoin#29086: refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition
cc67d33fda refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition (Luke Dashjr)

Pull request description:

  Instead of duplicating mempool options two places, just include the Options struct directly on the CTxMemPool

ACKs for top commit:
  achow101:
    ACK cc67d33fda
  kristapsk:
    cr utACK cc67d33fda
  jonatack:
    ACK cc67d33fda

Tree-SHA512: 9deb5ea6f85eeb1c7e04536cded65303b0ec459936a97e4f257aff2c50b0984a4ddbf69a4651f48455b9c80200a1fd24e9c74926874fdd9be436bbbe406251ce
2024-05-14 20:00:34 -04:00
Byron Hambly
c85f0d4fda
discount: implement net processing 2024-05-14 19:03:36 +02:00
glozow
8923edfc1f [p2p] allow entries with the same txid in TxOrphanage
Index by wtxid instead of txid to allow entries with the same txid but
different witnesses in orphanage. This prevents an attacker from
blocking a transaction from entering the orphanage by sending a mutated
version of it.
2024-05-14 10:32:28 +01:00
glozow
c31f148166 [refactor] TxOrphanage::EraseTx by wtxid
No behavior change right now, as transactions in the orphanage are
unique by txid. This makes the next commit easier to review.
2024-05-14 10:32:28 +01:00
glozow
efcc593017 [refactor] TxOrphanage::HaveTx only by wtxid 2024-05-14 10:32:27 +01:00
glozow
7e475b9648 [p2p] don't query orphanage by txid 2024-05-14 10:31:56 +01:00
Ava Chow
012e540ace
Merge bitcoin/bitcoin#29122: test: adds outbound eviction functional tests, updates comment in ConsiderEviction
d53d848347 test: adds outbound eviction tests for non outbound-full-relay peers (Sergi Delgado Segura)
a8d9a0edc7 test: adds outbound eviction functional tests, updates comment in ConsiderEviction (Sergi Delgado Segura)

Pull request description:

  ## Motivation

  While checking the outbound eviction code I realized a case was not considered within the comments, which in turn made me realize we had no functional tests for the outbound eviction case (when I went to check/add the test case).

  This PR updates the aforementioned comment and adds functional tests to cover the outbound eviction logic, in addition to the existing unit tests found at `src/test/denialofservice_tests.cpp`.

ACKs for top commit:
  davidgumberg:
    reACK d53d848347
  tdb3:
    Re ACK for d53d848347
  achow101:
    ACK d53d848347
  cbergqvist:
    ACK d53d848347

Tree-SHA512: 633b84bb1229fe21e2f650c1beada33ca7f190b64eafd64df2266516d21175e5d652e019ff7114f00cb8bd19f5817dc19e65adf75767a88e24dc0842ce40c63e
2024-05-09 16:20:43 -04:00
Luke Dashjr
cc67d33fda refactor: Simply include CTxMemPool::Options in CTxMemPool directly rather than duplicating definition 2024-05-06 20:34:10 +00:00
Andrew Toth
75d27fefc7
net: reduce LOCK(cs_main) scope in ProcessGetBlockData
This also changes behavior if ReadBlockFromDisk or
ReadRawBlockFromDisk fails. Previously, the node would crash
due to an assert. This has been replaced with logging the error,
disconnecting the peer, and returning early.
2024-05-04 15:38:39 -04:00
Andrew Toth
613a45cd4b
net: reduce LOCK(cs_main) scope in GETBLOCKTXN
Also adds a static assertion that MAX_BLOCKTXN_DEPTH <= MIN_BLOCKS_TO_KEEP
2024-05-04 15:33:36 -04:00
Ava Chow
f5b6f621ff
Merge bitcoin/bitcoin#30024: doc: replace remaining "520" magic nums with MAX_SCRIPT_ELEMENT_SIZE
ffc674595c Replace remaining "520" magic numbers with MAX_SCRIPT_ELEMENT_SIZE (Jon Atack)

Pull request description:

  Noticed these while reviewing BIPs yesterday.

  It would be clearer and more future-proof to refer to their constant name.

ACKs for top commit:
  instagibbs:
    ACK ffc674595c
  sipa:
    ACK ffc674595c
  achow101:
    ACK ffc674595c
  glozow:
    ACK ffc674595c, agree it's clearer for these comments to refer to the greppable name of the limit rather than the number

Tree-SHA512: 462afc1c64543877ac58cb3acdb01d42c6d08abfb362802f29f3482d75401a2a8adadbc2facd222a9a9fefcaab6854865ea400f50ad60bec17831d29f7798afe
2024-05-03 12:36:56 -04:00
Jon Atack
ffc674595c Replace remaining "520" magic numbers with MAX_SCRIPT_ELEMENT_SIZE 2024-05-02 13:16:40 -06:00
glozow
6119f76ef7 Process every MempoolAcceptResult regardless of PackageValidationResult 2024-05-01 13:48:03 +01:00