Skip to content
John Newbery edited this page May 19, 2022 · 14 revisions

policy: Move global package limits to struct in policy/settings

validation/net processing: remove the BlockChecked validation interface method

Replace it with BlockFailedValidation().

The only reason we need a BlockChecked with successful validation is for choosing high-bandwidth compact block providers. We could easily do that in the UpdatedBlockTip() callback.

Also see 2021-07-hb-in-block-connected

net processing: Tidy up transaction processing

Extract functionality into ProcessTx() and tidy up.

validation: Remove ConnectTrace and PerBlockConnectTrace

See https://github.com/bitcoin/bitcoin/pull/17562 and https://github.com/bitcoin/bitcoin/pull/18685

consensus: Don't add spent coins to the cache

Make a generic templated GenericSaltedSipHasher

Make AddrInfo::GetTriedBucket(), AddrInfo::GetNewBucket() and AddrInfo::GetBucketPosition() members of AddrManImpl()

Currently, we call AddrInfo::GetTriedBucket()|GetNewBucket()|GetBucketPosition() and pass in addrman's key and asmap. Instead, those functions should be members of AddrManImpl, and take a const AddrInfo& as a parameter. We could also make GetTriedBucket() and GetNewBucket() return a std::pair of (bucket, position), since both pieces of data are always required.

Requires quite a lot of updates to the tests.

  • commit (requires significant rebase since it was implemented before addrman used a pimpl)

Remove the cached local start height from net processing

Rename uint256 to b256

uint256 isn't really an int, it's a binary blob. Rename it to b256 to make that more obvious. Then rename arith_uint256 to uint256.

See https://github.com/bitcoin/bitcoin/blob/6d859cbd794a36ed1c0c72324a4ec54d029b3d3b/src/uint256.h#L120-L122.

Only disconnect nodes through a public Disconnect() method on CNode

Also make fDisconnect private. This ensures that disconnections are always logged.

Tidy up the NetEventsInterface public methods

Improve txorphanage tests

Add unit tests for PeerManagerImpl

Use a dispatch table to process messages in net_processing

Move CNodeStats and PeerStats into their own header file

Start using m_mutex_message_handling for net_processing data

Based on https://github.com/bitcoin/bitcoin/pull/21527

Collect all addr relay state into a data structure

  • version 1
  • version 2. This leaves m_wants_addrv2 inside the Peer struct since peers may send sendaddrv2 even if they dont participate in address relay.