fanquake dc0ee57373
Merge bitcoin/bitcoin#20799: net processing: Only support version 2 compact blocks
a50e34c367608fcec9697893981bfa294a7c08d1 [net processing] Remove redundant nodestate->m_sendcmpct check in MaybeSetPeerAsAnnouncingHeaderAndIDs() (John Newbery)
bb985a7b6abee503852c61eec74ca3a29f582815 [net processing] Only relay blocks by cmpctblock and cache for fast relay if segwit is enabled (John Newbery)
3b6bfbce386f61dcbb366f08cfff55c3882f429c [net processing] Rename CNodeState compact block members (John Newbery)
d0e97741748aaaad2a89ca42e4898e7f01308b35 [net processing] Tidy up `sendcmpct` processing (John Newbery)
30c3a01874cf51d987a0ae2bb699bf50d82768ff [net processing] fPreferHeaderAndIDs implies fProvidesHeaderAndIDs (John Newbery)
b486f721767d07c1e2eaf8deaf96b732b0a858dd [net processing] Remove fWantsCmpctWitness (John Newbery)
a45d53cab556505048c387429fd07188e4c40c3d [net processing] Remove fSupportsDesiredCmpctVersion (John Newbery)
25edb2b7bd4c41156fba09d0033a978e362435af [net processing] Simplify `sendcmpct` processing (John Newbery)
42882fc8fc2ef5c58eb963f7f1e852dd43de6c65 [net processing] Only accept `sendcmpct` with version=2 (John Newbery)
16730b64bb4a11995d792f626c8a63318e5eaeeb [net processing] Only advertise support for version 2 compact blocks (John Newbery)
cba909eaf938a775a9bd2dd994d06aba175e8713 [net] Stop testing version 1 compact blocks. (John Newbery)

Pull request description:

  Compact blocks are used for efficient relay of blocks, either through High Bandwidth or Low Bandwidth mode. See [BIP 152](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki) for full details.

  For compact block relay to work, the receiver must have a mempool containing transactions which are likely to be included in the block. The receiver uses these transactions to reconstruct the block from the short transaction ids included in the `cmpctblock` message. Compact blocks are therefore only useful for relaying blocks at or near the tip of the block chain. For older blocks, the recipient won't have the transactions in their mempool and so would need to request them using a `getblocktxn` message. In such cases, just requesting the full block is more efficient.

  BIP 152 supports two versions: version 1 (without witnesses) and version 2 (with witnesses). Version 2 is required to reconstruct segwit blocks. Segwit was activated in August 2017, and providing non-witness blocks to peers is no longer useful. Since the witnesses are not included, the peer would not be able to fully validate all the consensus rules on the provided block.

  Therefore, stop supporting version 1 compact blocks. Ignore `sendcmpct` messages with version=1, and don't advertise support by sending `sendcmpct` with version=1. Only send `sendcmpct` to peers with `NODE_WITNESS`. Respond to all requests for compact blocks or blocktxns with witness-serialized blocks and transactions.

ACKs for top commit:
  dergoegge:
    ACK a50e34c367608fcec9697893981bfa294a7c08d1 - Only changes since my last review were a rebase and some nits.
  MarcoFalke:
    re-ACK a50e34c367608fcec9697893981bfa294a7c08d after rebase 👓

Tree-SHA512: 8ad73acaa374d56ee9f28ca0a9d64b8630793d22fc8c942a1ee15551d4d80f76f3ba937682f85f22ec8ca82efae98a92de75a7e2f5a97499d8f9c7e4f2833c86
2022-05-16 12:41:09 +01:00
2022-05-06 10:00:47 +02:00
2021-09-07 06:12:53 +03:00
2022-04-11 10:34:30 +01:00
2022-01-03 04:48:41 +08:00
2021-09-09 19:53:12 +05:30
2022-05-05 08:44:08 -05:00

Bitcoin Core integration/staging tree

https://bitcoincore.org

For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.

What is Bitcoin Core?

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.

Further information about Bitcoin Core is available in the doc folder.

License

Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. Tags are created regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

Description
Bitcoin Core integration/staging tree
Readme 2.2 GiB
Languages
C++ 64.4%
Python 19.7%
C 12.1%
CMake 1.2%
Shell 0.9%
Other 1.6%