Commit graph

34124 commits

Author SHA1 Message Date
MacroFake
0be1dc1f56
Merge bitcoin/bitcoin#24062: refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex
83003ffe04 refactor: replace RecursiveMutex `m_most_recent_block_mutex` with Mutex (Sebastian Falbesoner)
8edd0d31ac refactor: reduce scope of lock `m_most_recent_block_mutex` (Sebastian Falbesoner)

Pull request description:

  This PR is related to #19303 and gets rid of the RecursiveMutex `m_most_recent_block_mutex`. All of the critical sections (5 in total) only directly access the guarded elements, i.e. it is not possible that within one section another one is called, and we can use a regular Mutex:

  b019cdc036/src/net_processing.cpp (L1650-L1655)

  b019cdc036/src/net_processing.cpp (L1861-L1865)

  b019cdc036/src/net_processing.cpp (L3149-L3152)

  b019cdc036/src/net_processing.cpp (L3201-L3206)

  b019cdc036/src/net_processing.cpp (L4763-L4769)

  The scope of the last critical section is reduced in the first commit, in order to avoid calling the non-trivial method `CConnman::PushMessage` while the lock is held.

ACKs for top commit:
  furszy:
    Code ACK 83003ffe with a small comment.
  hebasto:
    ACK 83003ffe04
  w0xlt:
    ACK 83003ffe04

Tree-SHA512: 3df290cafd2f6c4d40afb9f14e822a77d9c1828e66f5e2233f3ac1deccc2b0a8290bc5fb8eb992f49d39e887b50bc0e9aad63e05db2d870791a8d409fb95695f
2022-05-17 08:44:09 +02:00
MacroFake
8270740bef
Merge bitcoin/bitcoin#25114: rpc: remove deprecated "softforks" field from getblockchaininfo
a01b92ad86 doc: add release notes about removal of the `deprecatedrpc=softforks` flag (Sebastian Falbesoner)
8c5533c7a9 rpc: remove deprecated "softforks" field from getblockchaininfo (Sebastian Falbesoner)

Pull request description:

  Information on soft fork status has been moved from the `getblockchaininfo` RPC to the `getdeploymentinfo` RPC in #23508. The "softfork" result in `getblockchaininfo` was still available for 23.0 with the `-deprecatedrpc=softforks` configuration option, but this can be fully removed now for the next release (24.0).

ACKs for top commit:
  shaavan:
    ACK a01b92ad86
  ajtowns:
    ACK a01b92ad86

Tree-SHA512: 692d9d02fdf0b3c18376644a85b24b57efebf612738084c01ef47d47e41861e773688613a808e81f10ab6eec340de00eef96987a1e34d612aaf7f0a0b134d89e
2022-05-17 08:25:25 +02:00
Andrew Chow
91a42d63ef
Merge bitcoin/bitcoin#25019: parse external signer master fp as bytes in ExternalSigner::SignTransaction
2a22f034ca parsing external signer master fingerprint string as bytes instead of caring for lower/upper case in ExternalSigner::SignTransaction (avirgovi)

Pull request description:

  Some external signers scripts may provide master fingerprint in uppercase format. In that case core will fail with `Signer fingerprint 00000000 does not match any of the inputs` as it only works with lowercase format. Even if the fingerprints match, yet one is lowercase the other uppercase.

  ExternalSigner::SignTransaction is the only place where it is needed IMO, as changing it in other places may break the communication with the external signer (i.e. enumerating with lowercase may not find the device).

ACKs for top commit:
  achow101:
    ACK 2a22f034ca
  theStack:
    Code-review ACK 2a22f034ca
  Sjors:
    utACK 2a22f034ca

Tree-SHA512: f3d84b83fb0b5e06c405eaf9bf20a2fa864bf4172fd4de113b80b9b9a525a76f2f8cf63031b480358b3a7666023a2aef131fb89ff50448c66df3ed541da10f99
2022-05-16 15:57:07 -04:00
Andrew Chow
98f4db3305
Merge bitcoin/bitcoin#25088: Wallet: Ensure m_attaching_chain is set before registering for signals
ba10b90915 Wallet: Ensure m_attaching_chain is set before registering for signals (Luke Dashjr)

Pull request description:

  Avoids a race where chainStateFlushed could be called before rescanning began, yet rescan gets interrupted or fails

  Followup for #24984 avoiding a race between registering and setting the flag.

ACKs for top commit:
  mzumsande:
    Code Review ACK ba10b90915
  achow101:
    ACK ba10b90915

Tree-SHA512: 1d2fa2db189d3e87f2d0863cf2ab62166094436483f0da16760b1083a4743bf08e476a3277e0d36564213d65dd6f0a1fc16a4bf68d3338c991a14d1de9fc0fee
2022-05-16 15:29:40 -04:00
Hennadii Stepanov
a55db4ea1c
Add more proper thread safety annotations 2022-05-16 20:51:40 +02:00
Hennadii Stepanov
8cfe93e3fc
Add proper thread safety annotation to CWallet::GetTxConflicts() 2022-05-16 20:51:39 +02:00
Hennadii Stepanov
ca446f2c59
Add proper thread safety annotation to CachedTxGetAvailableCredit() 2022-05-16 20:51:39 +02:00
Andrew Chow
187504b038
Merge bitcoin/bitcoin#23662: rpc: improve getreceivedby{address,label} performance
f336ff7f21 rpc: avoid expensive `IsMine` calls in `GetReceived` tally (Sebastian Falbesoner)
a7b65af2a4 rpc: avoid scriptPubKey<->CTxDestination conversions in `GetReceived` tally (Sebastian Falbesoner)

Pull request description:

  The RPC calls `getreceivedbyaddress`/`getreceivedbylabel` both use the internal helper function `GetReceived` which was introduced in PR #17579 to deduplicate tallying code. For every wallet-related transaction output, the following unnecessary operations are currently performed in the tally loop, leading to a quite bad performance (as reported in #23645):
  - converting from CScript -> TxDestination (`ExtractDestination(...)`), converting from TxDestination -> CScript (`CWallet::IsMine(const CTxDestination& dest)`); this can be avoided by directly using output scripts in the search set instead of addresses (first commit)
  - checking if the iterated output script belongs to the wallet by calling `IsMine`; this can be avoided by only adding addresses to the search set which fulfil `IsMine` in the first place (second commit)

  ### Benchmark results
  The functional test [wallet_pr23662.py](https://github.com/theStack/bitcoin/blob/pr23662_benchmarks/test/functional/wallet_pr23662.py) (not part of this PR) creates transactions with 15000 different addresses:
  - 5000 outputs (500 txs with 10 outputs each) with label set, IsMine set (received)
  - 5000 outputs (500 txs with 10 outputs each) with label set, IsMine not set (sent)
  - 5000 outputs (500 txs with 10 outputs each) without label set, IsMine not set (sent)

  Then, the time is measured for calling `getreceivedbyaddress` and `getreceivedbylabel`, the latter with two variants. Results on my machine:

  | branch             | `getreceivedbyaddress` (single) | `getreceivedbylabel` (single) | `getreceivedbylabel` (10000) |
  |--------------------|---------------------------------|-------------------------------|------------------------------|
  | master             |             406.13ms            |          425.33ms             |          446.58ms            |
  | PR (first commit)  |             367.18ms            |          365.81ms             |          426.33ms            |
  | PR (second commit) |               3.96ms            |            4.83ms             |          339.69ms            |

  Fixes #23645.

ACKs for top commit:
  achow101:
    ACK f336ff7f21
  w0xlt:
    ACK f336ff7f21
  furszy:
    Code ACK f336ff7f

Tree-SHA512: 9cbf402b9e269713bd3feda9e31719d9dca8a0dfd526de12fd3d561711589195d0c50143432c65dae279c4eab90a4fc3f99e29fbc0452fefe05113e92d129b8f
2022-05-16 14:35:42 -04:00
Sebastian Falbesoner
4c5ceb040c wallet: CreateTransaction(): return out-params as (optional) struct 2022-05-16 17:46:34 +02:00
Sebastian Falbesoner
c9fdaa5e3a wallet: CreateTransactionInternal(): return out-params as (optional) struct 2022-05-16 17:37:10 +02:00
MacroFake
07cb4dee5d
Merge bitcoin/bitcoin#24962: prevector: enforce is_trivially_copyable_v
11e7908484 prevector: only allow trivially copyable types (Martin Leitner-Ankerl)

Pull request description:

  prevector uses `memmove` to move around data, that means it can only be used with types that are trivially copyable. That implies that the types are trivially destructible, thus the checks for `is_trivially_destructible` are not needed.

ACKs for top commit:
  w0xlt:
    ACK 11e7908484
  MarcoFalke:
    review ACK 11e7908484 🏯
  ajtowns:
    ACK 11e7908484 -- code review only

Tree-SHA512: cbb4d8bfa095100677874b552d92c324c7d6354fcf7adab2ed52f57bd1793762871798b5288064ed1af2d2903a0ec9dbfec48d99955fc428f18cc28d6840dccc
2022-05-16 16:25:47 +02:00
fanquake
6b87fa540c
Merge bitcoin/bitcoin#25125: test: Slim down versionbits_tests.cpp
fae3200bbf test: Slim down versionbits_tests.cpp (MacroFake)

Pull request description:

  Seems confusing to spin up a full chainman that isn't even used.

  Fix that by only spinning up logging. Also, remove the chainman include and comment.

ACKs for top commit:
  fanquake:
    ACK fae3200bbf

Tree-SHA512: 35261e9116c0c276f807453db3d635d83916ec2ffd99cf5641f8732736a30a542213096dcec550ef4522d97b3cafe384fdc6068138bc0b577c66fa61256719f8
2022-05-16 14:29:18 +01:00
Sebastian Falbesoner
83003ffe04 refactor: replace RecursiveMutex m_most_recent_block_mutex with Mutex
In each of the critical sections, only the the guarded variables are
accessed, without any chance that within one section another one is
called.  Hence, we can use an ordinary Mutex instead of RecursiveMutex.
2022-05-16 15:26:39 +02:00
fanquake
b019cdc036
Merge bitcoin/bitcoin#25095: rpc: Fix implicit-integer-sign-change in gettxout
fa347a9066 rpc: Fix implicit-integer-sign-change in gettxout (MacroFake)

Pull request description:

ACKs for top commit:
  theStack:
    Code-review ACK fa347a9066

Tree-SHA512: 2a1128f714119b6b6cfeb20ee59c4f46404d5a83942253c73de64b0289a7d41e4437cf77d19b1cf623e2dd15fbaa1ec7acd03cc5d6dde41b3c7d06a082073ea1
2022-05-16 14:26:38 +01:00
Sebastian Falbesoner
8edd0d31ac refactor: reduce scope of lock m_most_recent_block_mutex
This avoids calling the non-trivial method
`CConnman::PushMessage` within the critical section.
2022-05-16 15:26:37 +02:00
MacroFake
aa3200d896
Merge bitcoin/bitcoin#25109: Strengthen AssertLockNotHeld assertions
436ce0233c sync.h: strengthen AssertLockNotHeld assertion (Anthony Towns)
7d73f58e9c Increase threadsafety annotation coverage (Anthony Towns)

Pull request description:

  This changes `AssertLockNotHeld` so that it is annotated with the negative capability for the mutex it refers to. clang applies negative capabilities recursively, so this helps avoid forgetting to annotate functions.

  Note that this can't reasonably be used for globals, because clang would require every function to be annotated with `EXCLUSIVE_LOCKS_REQUIRED(!g_mutex)` for each global mutex. At present, the only global mutexes that use `AssertLockNotHeld` are `RecursiveMutex` so we treat that as an exception in order to avoid having to add an excessive number of negative annotations.

ACKs for top commit:
  vasild:
    ACK 436ce0233c
  MarcoFalke:
    review ACK 436ce0233c 🌺

Tree-SHA512: 5f16d098790a36b5277324d5ee89cdc87033c19b11c7943c2f630a41c2e3998eb39d356a763e857f4d8fefb6c0c02291f720bb6769bcbdf5e2cd765bf266ab8c
2022-05-16 14:18:08 +02:00
fanquake
dc0ee57373
Merge bitcoin/bitcoin#20799: net processing: Only support version 2 compact blocks
a50e34c367 [net processing] Remove redundant nodestate->m_sendcmpct check in MaybeSetPeerAsAnnouncingHeaderAndIDs() (John Newbery)
bb985a7b6a [net processing] Only relay blocks by cmpctblock and cache for fast relay if segwit is enabled (John Newbery)
3b6bfbce38 [net processing] Rename CNodeState compact block members (John Newbery)
d0e9774174 [net processing] Tidy up `sendcmpct` processing (John Newbery)
30c3a01874 [net processing] fPreferHeaderAndIDs implies fProvidesHeaderAndIDs (John Newbery)
b486f72176 [net processing] Remove fWantsCmpctWitness (John Newbery)
a45d53cab5 [net processing] Remove fSupportsDesiredCmpctVersion (John Newbery)
25edb2b7bd [net processing] Simplify `sendcmpct` processing (John Newbery)
42882fc8fc [net processing] Only accept `sendcmpct` with version=2 (John Newbery)
16730b64bb [net processing] Only advertise support for version 2 compact blocks (John Newbery)
cba909eaf9 [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 a50e34c367 - Only changes since my last review were a rebase and some nits.
  MarcoFalke:
    re-ACK a50e34c367 after rebase 👓

Tree-SHA512: 8ad73acaa374d56ee9f28ca0a9d64b8630793d22fc8c942a1ee15551d4d80f76f3ba937682f85f22ec8ca82efae98a92de75a7e2f5a97499d8f9c7e4f2833c86
2022-05-16 12:41:09 +01:00
MacroFake
1511c9efb4
Merge bitcoin/bitcoin#24640: Bugfix: RPC/blockchain: Correct description of getblockchaininfo's pruneheight result
06822f8654 Bugfix: RPC/blockchain: Correct description of getblockchaininfo's pruneheight result (Luke Dashjr)

Pull request description:

  It is possible that lower blocks are complete due to being stored in the same file as blocks not yet eligible for pruning.

  Not really satisfied with this new description, so suggestions for better phasing welcome :)

  (Split out of #24629)

ACKs for top commit:
  theStack:
    Code-review ACK 06822f8654

Tree-SHA512: 755a5a40d065ad77f4ac2c19c0b3502eceb3162034823ee7ce1668100d97e8a2bfb822ac381feb7afd13e653cd08a81d5fa505575531757457d6d22c909a6510
2022-05-16 11:00:35 +02:00
MacroFake
195df1eb88
Merge bitcoin/bitcoin#25067: validationinterface: make MainSignalsInstance() a class, drop unused forward declarations
ca1ac1f0e0 scripted-diff: Rename MainSignalsInstance() class to MainSignalsImpl() (Jon Atack)
2aaec2352d refactor: remove unused forward declarations in validationinterface.h (Jon Atack)
23854f8402 refactor: make MainSignalsInstance() a class (Jon Atack)

Pull request description:

  Make MainSignalsInstance a class, rename it to MainSignalsImpl, use Doxygen documentation for it, and remove no longer used forward declarations in src/validationinterface.h.

  ----

  MainSignalsInstance was created in 3a19fed9db and originally was a collection of boost::signals methods moved to validationinterface.cpp, in order to no longer need to include boost/signals in validationinterface.h.

  MainSignalsInstance then evolved in d6815a2313 to become class-like:

  - [C.8: Use class rather than struct if any member is non-public](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-class)

   - [C.2: Use class if the class has an invariant; use struct if the data members can vary independently](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c2-use-class-if-the-class-has-an-invariant-use-struct-if-the-data-members-can-vary-independently)

  - A class has the advantage of default private access, as opposed to public for a struct.

ACKs for top commit:
  furszy:
    Code ACK ca1ac1f
  promag:
    Code review ACK ca1ac1f0e0.
  danielabrozzoni:
    Code review ACK ca1ac1f0e0

Tree-SHA512: 25f85e2b582fe8c269e6cf384a4aa29350b97ea6477edf3c63591e4f68a97364f7fb2fc4ad2764f61ff86b27353e31d2f12eed7a23368a247e4cf271c7e133ea
2022-05-16 10:49:44 +02:00
MacroFake
bc2eee7267
Merge bitcoin/bitcoin#25092: doc: various developer notes updates
654284209f Add clang lifetimebound section to developer notes (Jon Atack)
e66b321fd1 Add C++ functions and methods section to developer notes (Jon Atack)
5fca70f5b1 Link in developer notes style to internal interface exception (Jon Atack)
fc4cb857cc Prefer Python for scripts in developer notes (Jon Atack)
370120ec2f Remove obsolete BDB ENABLE_WALLET section in developer notes (Jon Atack)

Pull request description:

  A few updates noticed while working on a lifetimebound section.

  - Remove obsolete BDB ENABLE_WALLET section (only one file, src/wallet/bdb.h, still has a `db_cxx.h` BDB header)
  - Prefer Python for scripts in developer notes (and a few miscellaneous touch-ups)
  - In the code style section, add a link to the internal interface exception so that people are aware of it
  - Add a "C++ functions and methods" section
  - Add a Clang `lifetimebound` attribute section

ACKs for top commit:
  laanwj:
    ACK 654284209f
  jarolrod:
    code review ACK 654284209f

Tree-SHA512: d2ae335cac899451d5c7bdc8e94fd82053a5f44ac1ba444bdde71abaaa24a519713c1078f3a8f07ec8466b181788a613fd3c68061e54b3fdc8cd6f3e3f9791ec
2022-05-16 10:38:30 +02:00
John Newbery
a50e34c367 [net processing] Remove redundant nodestate->m_sendcmpct check in MaybeSetPeerAsAnnouncingHeaderAndIDs() 2022-05-15 16:22:26 -04:00
John Newbery
bb985a7b6a [net processing] Only relay blocks by cmpctblock and cache for fast relay if segwit is enabled
This introduces an early exit in PeerManagerImpl::NewPoWValidBlock() if
segwit has not been activated for the block. This means that we won't cache the
block/compact block for fast relay and won't relay the cmpctblock
immediately to peers that have requested hb compact blocks. This is fine
because any block where segwit is not yet activated is buried deep in
the chain, and so compact block relay will not be effective.

It's ok not to cache the block/compact block for fast relay for the same
reason - the block must be very deeply buried in the block chain.

ProcessBlockAvailability() also won't get called for all nodes. This is
also fine, since that function only updates hashLastUnknownBlock
and pindexBestKnownBlock, and is called early in every SendMessages()
call.
2022-05-15 16:22:23 -04:00
John Newbery
3b6bfbce38 [net processing] Rename CNodeState compact block members
fPreferHeaderAndIDs -> m_requested_hb_cmpctblocks
fProvidesHeaderAndIDs -> m_provides_cmpctblocks
2022-05-15 16:15:17 -04:00
John Newbery
d0e9774174 [net processing] Tidy up sendcmpct processing
- use better local variable names
- drop unnecessary if statements
2022-05-15 16:13:31 -04:00
John Newbery
30c3a01874 [net processing] fPreferHeaderAndIDs implies fProvidesHeaderAndIDs
Remove all if(fProvidesHeaderAndIDs) conditionals inside
if(fPreferHeaderAndIDs) conditionals.
2022-05-15 16:13:31 -04:00
John Newbery
b486f72176 [net processing] Remove fWantsCmpctWitness
It is now completely redundant with fProvidesHeadersAndIDs.
2022-05-15 16:13:31 -04:00
John Newbery
a45d53cab5 [net processing] Remove fSupportsDesiredCmpctVersion
It is now completely redundant with fProvidesHeadersAndIDs.
2022-05-15 16:13:29 -04:00
John Newbery
25edb2b7bd [net processing] Simplify sendcmpct processing
nCMPCTBLOCKVersion must always be 2 when processing.
2022-05-15 15:37:56 -04:00
John Newbery
42882fc8fc [net processing] Only accept sendcmpct with version=2
Subsequent commits will remove support for other versions of compact blocks.

Add a test that a received `sendcmpct` message with version = 1 is
ignored.
2022-05-15 15:37:56 -04:00
John Newbery
16730b64bb [net processing] Only advertise support for version 2 compact blocks
Subsequent commits will remove support.
2022-05-15 15:37:56 -04:00
John Newbery
cba909eaf9 [net] Stop testing version 1 compact blocks.
Support for version 1 is removed in the following commits.
2022-05-15 15:37:56 -04:00
MacroFake
b74a6dde8c
Merge bitcoin/bitcoin#25123: test: Fix race condition in index prune test
4faa550072 test: Fix race condition in index pruning test (Fabian Jahr)

Pull request description:

  Fixes #25031

  The `feature_index_prune.py` test seems to be racy because connections are reestablished after restarts and the blocks are synced via the `sync_blocks` function. The `sync_blocks` function has a sanity check at the beginning to check that all nodes in the set have at least one established connection and that is not always the case.

  As a solution nodes are not connected via the `-connect` parameter on start but instead via the `connect_nodes` helper.

Top commit has no ACKs.

Tree-SHA512: f88377715f455f1620725fe8ebd6b486fa0209660b193bf68d1ce1452e2086ac5d169d8ca4c2b61443566232e96fb9c6386ee482bc546cce38078d72e7c3c29f
2022-05-15 09:19:43 +02:00
Fabian Jahr
4faa550072
test: Fix race condition in index pruning test
Nodes are restarted and reconnected as part of the test. Afterwards
`sync_blocks` is called immediately on the nodes. `sync_blocks`
first checks that all the included nodes have at least one
connection. Since adding a connection is usually happening in a
thread, sometimes nodes could run into this check before the
connection was fully established so that it would fail the entire
test.

This fix uses the `connect_nodes` helper to make the connection the
nodes. `connect_nodes` has a wait for the connection built into it.
2022-05-14 17:33:41 +02:00
amadeuszpawlik
ada8358ef5 Sanitize port in addpeeraddress()
- Ensures port sanitization in `addpeeraddress()`
- Adds test to check for invalid port values
2022-05-14 10:22:16 +02:00
Sebastian Falbesoner
5dc6d92077 test: make BIP157 messages default-constructible (MESSAGEMAP compatibility)
In order to deserialize received or read messages via lookup in
MESSAGEMAP (e.g.: `t = MESSAGEMAP[msgtype]()`), the messages must have a
default constructor, i.e. there needs to be the possibility to
initialize them with zero arguments.
2022-05-13 13:53:25 +02:00
MacroFake
fae3200bbf
test: Slim down versionbits_tests.cpp 2022-05-13 13:39:16 +02:00
Sebastian Falbesoner
71e4cfefe7 test: p2p: add missing BIP157 message types to MESSAGEMAP 2022-05-13 13:37:46 +02:00
Sebastian Falbesoner
a01b92ad86 doc: add release notes about removal of the deprecatedrpc=softforks flag 2022-05-13 11:44:30 +02:00
Sebastian Falbesoner
8c5533c7a9 rpc: remove deprecated "softforks" field from getblockchaininfo 2022-05-13 11:44:28 +02:00
MacroFake
fa347a9066
rpc: Fix implicit-integer-sign-change in gettxout 2022-05-13 11:39:48 +02:00
fanquake
225e5b57b2
Merge bitcoin/bitcoin#25113: Bump univalue subtree
f403531f97 Squashed 'src/univalue/' changes from a44caf65fe..6c19d050a9 (MacroFake)

Pull request description:

  Only change is some header-shuffling and adding `getInt`.

ACKs for top commit:
  fanquake:
    ACK fac2c796cb

Tree-SHA512: 8bdf7d88ce06f0851f99f30c30fc926a13b79ae72bcebd5e170ed0e1d882b184d9279f96488e234fbe560036e31cb180aa1e5666aebd9833b9a119c6b214fa30
2022-05-13 10:36:05 +01:00
MacroFake
faac67cab0
test: Fix intermittent race in p2p_unrequested_blocks.py 2022-05-13 09:15:12 +02:00
MacroFake
25dd4d8513
Merge bitcoin/bitcoin#24595: deploymentstatus: move g_versionbitscache global to ChainstateManager
bb5c24b120 validation: move g_versionbitscache into ChainstateManager (Anthony Towns)
eca22c726a test/versionbits: make versionbitscache a parameter (Anthony Towns)
d603f1d8a7 deploymentstatus: make versionbitscache a parameter (Anthony Towns)
78adef1753 refactor: use chainman instead of chainParams for DeploymentActive* (Anthony Towns)
deffe0df6c deploymentstatus: allow chainman in place of consensusParams (Anthony Towns)
eaa2e3f25c validation: move UpdateUncommittedBlockStructures and GenerateCoinbaseCommitment into ChainstateManager (Anthony Towns)
5c67e84d37 validation: replace ::Params() calls with chainstate/chainman member (Anthony Towns)
38860f93b6 validation: remove redundant CChainParams params from ChainstateManager methods (Anthony Towns)
69675ea4e7 validation: add CChainParams to ChainstateManager (Anthony Towns)

Pull request description:

  Gives `ChainstateManager` a reference to the `CChainParams` its working on, and simplifies some of the functions that would otherwise take that as a parameter. Removes the `g_versionbitscache` global by moving it into `ChainstateManager`.

ACKs for top commit:
  dongcarl:
    reACK bb5c24b120
  MarcoFalke:
    review ACK bb5c24b120 📙

Tree-SHA512: 3fa74905e5df561e3e74bb0b8fce6085c5311e6633e7d74c0fb0c82a907f5bbb1fd4ebc5d11d4f0b1c019bb51eabb9f6e4bcc4652a696d36a5878c807b85f121
2022-05-13 09:00:21 +02:00
MacroFake
1d5325a8f9
Merge bitcoin/bitcoin#25117: test: Check msg type in msg capture is followed by zeros
faa5a7a573 test: Check msg type in msg capture is followed by zeros (MacroFake)

Pull request description:

  Checking that they are not printable is an odd (and wrong) way to check that all chars are zero.

ACKs for top commit:
  theStack:
    Code-review ACK faa5a7a573

Tree-SHA512: 63e001bd25298dcf47606f8ab11ddfb704ca963304149b0f6e188eb7dcf45c41f92d39f26bda32bceb03384720c9bdddb2673dba513cd9242dc9663d498b3f29
2022-05-13 07:49:22 +02:00
MacroFake
b3f0a34389
Merge bitcoin/bitcoin#25119: net, refactor: move StartExtraBlockRelayPeers() from header to implementation
51ec96b904 refactor: move StartExtraBlockRelayPeers from header to implementation (Jon Atack)

Pull request description:

  where all the other logging actions in src/net.{h,cpp} are located.

  StartExtraBlockRelayPeers() does not appear to be a hotspot that needs to be inlined for performance, as it is called from CheckForStaleTipAndEvictPeers(), called in turn from StartScheduledTasks() with a scheduleEvery delta of 45 seconds, called at the end of AppInitMain() on bitcoind startup.

  This allows dropping `#include <logging.h>` from net.h, which can improve compile time/speed. Currently, none of the other includes in net.h use logging.h, except src/sync.h if DEBUG_LOCKCONTENTION is defined.

ACKs for top commit:
  LarryRuane:
    ACK 51ec96b904
  theStack:
    ACK 51ec96b904

Tree-SHA512: 69b2c09163c48bfcb43355af0aa52ee7dd81efc755a7aa6a10f5e400b5e14109484437960a62a1cfac2524c2cfae981fee082846b19526b540ef5b86be97f0fe
2022-05-13 07:47:45 +02:00
MacroFake
fe1fcdc629
Merge bitcoin/bitcoin#25121: test: compare /mempool/info response with getmempoolinfo RPC
1df42bc262 test: compare `/mempool/info` response with `getmempoolinfo` RPC (brunoerg)

Pull request description:

  This PRs compares `/mempool/info` REST response with `getmempoolinfo` RPC in `interface_rest.py`.
  Similar to #24936 and #24797.

ACKs for top commit:
  theStack:
    ACK 1df42bc262

Tree-SHA512: 2de36d70fa61612e7976f875e55f98e78b1cdb909b48cff18e6a70c55eda34b799e210bcd55361ea947388b7778d867290a73be4f799bb36afd65423ad49c487
2022-05-13 07:29:15 +02:00
brunoerg
1df42bc262 test: compare /mempool/info response with getmempoolinfo RPC 2022-05-12 17:49:50 -03:00
fanquake
2709ffb9da
Merge bitcoin/bitcoin#25115: scripted-diff: replace non-standard fixed width integer types (u_int... -> uint...)
672d49c863 scripted-diff: replace non-standard fixed width integer types (`u_int`...` -> `uint`...) (Sebastian Falbesoner)

Pull request description:

  Fixed width integer types prefixed with `u_int` are not part of C++ (see https://en.cppreference.com/w/cpp/types/integer), so it's better to avoid and replace them with their standard-conforming counterparts. (For those interested in history, according to one theory those u_int... types have been introduced by BSD: https://stackoverflow.com/a/5163960, http://lists.freedesktop.org/archives/release-wranglers/2004-August/000923.html).

ACKs for top commit:
  laanwj:
    Code review ACK 672d49c863
  fanquake:
    ACK 672d49c863

Tree-SHA512: 68134a0adca0d5c87a7432367cb493491a67288d69a174be2181f8e26efa968d966b9eb1cde94813942405063ee3be2a3437cf2aa5f71375f59205cbdbf501bb
2022-05-12 21:08:02 +01:00
Jon Atack
51ec96b904 refactor: move StartExtraBlockRelayPeers from header to implementation
where all the other logging actions in src/net.{h,cpp} are located.

StartExtraBlockRelayPeers() does not appear to be a hotspot that needs to be
inlined for performance, as it is called from CheckForStaleTipAndEvictPeers(),
called in turn from StartScheduledTasks() with a scheduleEvery delta of 45
seconds, called at the end of AppInitMain() on bitcoind startup.

This allows dropping `#include <logging.h>` from net.h, which can improve
compile time/speed. Currently, none of the other includes in net.h use
logging.h, except src/sync.h if DEBUG_LOCKCONTENTION is defined.
2022-05-12 17:41:32 +02:00
MacroFake
faa5a7a573
test: Check msg type in msg capture is followed by zeros 2022-05-12 17:07:35 +02:00