Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: bitcoin#18044, #18244, #19569, #19670, #19710, #19730, #19818 #5828

Merged
merged 7 commits into from
Jan 23, 2024

Conversation

knst
Copy link
Collaborator

@knst knst commented Jan 17, 2024

Issue being fixed or feature implemented

Just regular bitcoin backports, mostly from v21

What was done?

How Has This Been Tested?

Run unit/functional tests

note for reviewers:

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 20.1 milestone Jan 17, 2024
@knst knst marked this pull request as draft January 17, 2024 08:07
@knst knst changed the title backport: bitcoin#18044, #18244, #19405, #19552, #19569, #19670, #19710, #19730, #19731, #19818 backport: bitcoin#18044, #18244, #19552, #19569, #19670, #19710, #19730, #19731, #19818 Jan 17, 2024
@knst knst marked this pull request as ready for review January 18, 2024 16:16
@knst knst changed the title backport: bitcoin#18044, #18244, #19552, #19569, #19670, #19710, #19730, #19731, #19818 backport: bitcoin#18044, #18244, #19552, #19569, #19670, #19710, #19730, #19818 Jan 18, 2024
src/net_processing.cpp Outdated Show resolved Hide resolved
test/functional/test_framework/messages.py Outdated Show resolved Hide resolved
test/functional/test_framework/test_framework.py Outdated Show resolved Hide resolved
@thephez thephez added the RPC Some notable changes to RPC params/behaviour/descriptions label Jan 22, 2024
@knst knst changed the title backport: bitcoin#18044, #18244, #19552, #19569, #19670, #19710, #19730, #19818 backport: bitcoin#18044, #18244, #19569, #19670, #19710, #19730, #19818 Jan 22, 2024
@knst knst force-pushed the bp-v21-p13 branch 2 times, most recently from 7ed162b to ca32862 Compare January 22, 2024 20:09
@knst
Copy link
Collaborator Author

knst commented Jan 22, 2024

@knst knst force-pushed the bp-v21-p13 branch from fdf8df0 to 007da48

rebase to tip of develop and drop 19552

@knst knst force-pushed the bp-v21-p13 branch from 007da48 to 7ed162b
@knst knst force-pushed the bp-v21-p13 branch from 7ed162b to ca32862

address review comments

@knst knst requested a review from UdjinM6 January 22, 2024 20:11
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for merging via merge commit

knst and others added 7 commits January 22, 2024 19:44
This backport is marked as full, not partial, but it has only refactorings
and non-witness related changes.

Included commits are:
 - test: Update test framework p2p protocol version to 70016
 - Rename AddInventoryKnown() to AddKnownTx()
 - Add support for tx-relay via wtxid

    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.

 - Just pass a hash to AddInventoryKnown

    Since it's only used for transactions, there's no need to pass in an inv type.

 - Add wtxid to mempool unbroadcast tracking
10b7a6d refactor: make txmempool interface use GenTxid (Pieter Wuille)
5c124e1 refactor: make FindTxForGetData use GenTxid (Pieter Wuille)
a2bfac8 refactor: use GenTxid in tx request functions (Pieter Wuille)
e65d115 test: request parents of orphan from wtxid relay peer (Anthony Towns)
900d7f6 p2p: enable fetching of orphans from wtxid peers (Pieter Wuille)
9efd86a refactor: add GenTxid (=txid or wtxid) type and use it for tx request logic (Pieter Wuille)
d362f19 doc: list support for BIP 339 in doc/bips.md (Pieter Wuille)

Pull request description:

  This is based on bitcoin#18044 (comment).

  A new type `GenTxid` is added to protocol.h, which represents a tagged txid-or-wtxid. The tx request logic is updated to use these instead of uint256s, permitting per-announcement distinguishing of txid/wtxid (instead of assuming that everything we want to request from a wtxid peer is wtx). Then the restriction of orphan-parent requesting to non-wtxid peers is lifted.

  Also document BIP339 in doc/bips.md.

ACKs for top commit:
  jnewbery:
    Code review ACK 10b7a6d
  jonatack:
    ACK 10b7a6d
  ajtowns:
    ACK 10b7a6d -- code review. Using gtxid to replace the is_txid_or_wtxid flag for the mempool functions is nice.
  naumenkogs:
    utACK 10b7a6d

Tree-SHA512: d518d13ffd71f8d2b3c175dc905362a7259689e6022a97a0b4f14f1f9fdd87475cf5af70cb12338d1e5d31b52c12e4faaea436114056a2ae9669cb506240758b
fa330ec test: Remove confusing and broken use of wait_until global (MarcoFalke)
fa6583c ci: Set increased --timeout-factor by default (MarcoFalke)

Pull request description:

  Assuming that tests don't have a logic error or race, setting a high timeout should not cause any issues. The tests will still pass just as fast in the fastest case, but it allows for some buffer in case of slow disks or otherwise starved ci machines.

  Fixes bitcoin#19729

ACKs for top commit:
  hebasto:
    ACK fa330ec, I have reviewed the code, and it looks OK, I agree it can be merged.

Tree-SHA512: 3da80ee008c7b08bab5fdaf7804d57c79d6fed49a7d37b9c54fc89756659fcb9981fd10afc4d07bd90d93c1699fd410a0110a3cd34d016873759d114ce3cd82d
…ases the variance of result values

3edc4e3 bench: Prevent thread oversubscription (Hennadii Stepanov)
ce3e6a7 bench: Allow skip benchmark (Hennadii Stepanov)

Pull request description:

  Split out from bitcoin#18710.

  Some results (borrowed from bitcoin#18710):
  ![89121718-a3329800-d4c1-11ea-8bd1-66da20619696](https://user-images.githubusercontent.com/32963518/90146614-ecb89800-dd89-11ea-80fe-bac0e46e735e.png)

ACKs for top commit:
  fjahr:
    Code review ACK 3edc4e3

Tree-SHA512: df7413ec9ea326564a8e8de54752c9d1444ff7de34edb03e1e0c2120fc333e4640767fdbe3e87eab6a7b389a4863c02e22ad2ae0dbf139fad6a9b85e00f563b4
…bt also lock manually selected coins

6d1f513 [rpc] fundrawtransaction, walletcreatefundedpsbt lock manually selected coins (Sjors Provoost)

Pull request description:

  When using `fundrawtransaction` and `walletcreatefundedpsbt` with `lockUnspents`, it would only lock automatically selected coins, not manually selected coins. That doesn't make much sense to me if the goal is to prevent accidentally double-spending yourself before you broadcast a transaction.

  Note that when  creating a transaction, manually selected coins are automatic "unlocked" (or more accurately: the lock is ignored). Earlier versions of this PR introduced an error when a locked coin is manually selected, but this idea was abandoned after some discussion. An application that uses this RPC should either rely on automatic coin selection (with `lockUnspents`) or handle lock concurrency itself with manual coin selection. In particular it needs to make sure to avoid/pause calls with automatic coin selection between calling `lockunspent` and the subsequent spending RPC.

  See bitcoin#7518 for historical background.

ACKs for top commit:
  meshcollider:
    Code review ACK 6d1f513
  fjahr:
    Code review ACK 6d1f513

Tree-SHA512: 8773c788d92f2656952e1beac147ba9956b8c5132d474e0880e4c89ff53642928b4cbfcd1cb3d17798b9284f02618a8830c93a9f7a4733e5bded96adff1d5d4d
…m eviction

752e6ad Protect localhost and block-relay-only peers from eviction (Suhas Daftuar)

Pull request description:

  Onion peers are disadvantaged under our eviction criteria, so prevent eventual
  eviction of them in the presence of contention for inbound slots by reserving
  some slots for localhost peers (sorted by longest uptime).

  Block-relay-only connections exist as a protection against eclipse attacks, by
  creating a path for block propagation that may be unknown to adversaries.
  Protect against inbound peer connection slot attacks from disconnecting such
  peers by attempting to protect up to 8 peers that are not relaying transactions
  but have provided us with blocks.

  Thanks to gmaxwell for suggesting these strategies.

ACKs for top commit:
  laanwj:
    Code review ACK 752e6ad

Tree-SHA512: dbf089c77c1f747aa1dbbbc2e9c2799c628028b0918d0c336d8d0e5338acedd573b530eb3b689c7f603a17221e557268a9f5c3f585f204bfb12e5d2e76de39a3
…`, fix UBSan warning

7984c39 test framework: serialize/deserialize inv type as unsigned int (Jon Atack)
407175e p2p: change CInv::type from int to uint32_t (Jon Atack)

Pull request description:

  Fixes UBSan implicit-integer-sign-change issue per bitcoin#19610 (comment).

  Credit to Crypt-iQ for finding and reporting the issue and to vasild for the original review suggestion in bitcoin#19590 (review).

  Closes bitcoin#19678.

ACKs for top commit:
  laanwj:
    ACK 7984c39
  MarcoFalke:
    ACK 7984c39 🌻
  vasild:
    ACK 7984c39

Tree-SHA512: 59f3a75f40ce066ca6f0bb1927197254238302b4073af1574bdbfe6ed580876437be804be4e47d51467d604f0d9e3a5875159f7f2edbb2351fdb2bb9465100b5
@PastaPastaPasta PastaPastaPasta merged commit be750ef into dashpay:develop Jan 23, 2024
4 of 5 checks passed
@knst knst deleted the bp-v21-p13 branch January 23, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants