Commit Graph
72 Commits
Author SHA1 Message Date
dergoegge 9143b6988b [doc] Add post branch-off note about fuzz input pruning 2023-05-04 19:39:57 +02:00
dergoegge 3fa4c54ac5 [net processing] Pass TxRelay to FindTxForGetData instead of Peer 2023-03-31 13:19:20 +02:00
dergoegge c85ee76a36 [net processin] Don't take cs_main in FindTxForGetData
Taking cs_main is no longer necessary since we moved
`m_recently_announced_invs` to `Peer` and `mapRelay` is actually only
accessed from the message processing thread.
2023-03-31 13:18:39 +02:00
dergoegge 3a060ae7b6 scripted-diff: Rename nUnconnectingHeaders and fPreferHeaders
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren nUnconnectingHeaders     m_num_unconnecting_headers_msgs
ren fPreferHeaders           m_prefers_headers
ren MAX_UNCONNECTING_HEADERS MAX_NUM_UNCONNECTING_HEADERS_MSGS

-END VERIFY SCRIPT-
2023-03-30 14:56:34 +02:00
dergoegge 279c53d7e4 [net processing] Move m_recently_announced_invs from CNodeState to Peer 2023-03-30 14:56:19 +02:00
dergoegge 938a8e2566 [net processing] Annotate m_recently_announced_invs as guarded by g_msgproc_mutex 2023-03-30 14:56:19 +02:00
dergoegge 8a2cb1f749 [net processing] Move fPreferHeaders from CNodeState to Peer 2023-03-30 14:56:19 +02:00
dergoegge 3605011e79 [net processing] Annotate fPreferHeaders as guarded by g_msgproc_mutex 2023-03-30 14:56:19 +02:00
dergoegge 4b84e502f5 [net processing] Move m_headers_sync_timeout from CNodeState to Peer 2023-03-30 14:56:19 +02:00
dergoegge 689b747fc3 [net processing] Annotate m_headers_sync_timeout as guarded by g_msgproc_mutex 2023-03-30 14:56:19 +02:00
dergoegge d8c0d1c345 [net processing] Move nUnconnectingHeaders from CNodeState to Peer 2023-03-30 14:56:17 +02:00
dergoegge 5f80d8d1ee [net processing] Annotate nUnconnectingHeaders as guarded by g_msgproc_mutex 2023-03-30 14:55:28 +02:00
dergoegge 1d87137227 [validation] Annotate ChainstateManager::m_best_header as guarded by cs_main 2023-03-30 14:55:28 +02:00
dergoegge cd0c8eeb09 [net] Pass nRecvFloodSize to CNode 2023-03-27 16:00:02 +02:00
dergoegge 860402ef2e [net] Remove trivial GetConnectionType() getter 2023-03-27 16:00:02 +02:00
dergoegge b5a85b365a [net] Delete CNetMessage copy constructor/assignment op 2023-03-27 16:00:01 +02:00
dergoegge 3566aa7d49 [net] Remove CNode friends
Both `CConnman` and `ConnmanTestMsg` no longer access private members of
`CNode`, we can therefore remove the friend relationship.
2023-03-22 13:18:57 +01:00
dergoegge 3eac5e7cd1 [net] Add CNode helper for send byte accounting 2023-03-22 13:18:57 +01:00
dergoegge 60441a3432 scripted-diff: [net] Rename CNode process queue members
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren cs_vProcessMsg    m_msg_process_queue_mutex
ren vProcessMsg       m_msg_process_queue
ren nProcessQueueSize m_msg_process_queue_size

-END VERIFY SCRIPT-
2023-03-22 13:18:56 +01:00
dergoegge 6693c499f7 [net] Make cs_vProcessMsg a non-recursive mutex 2023-03-22 13:18:32 +01:00
dergoegge 23d9352654 [net] Make CNode msg process queue members private
Now that all access to the process queue members is handled by methods
of `CNode` we can make these members private.
2023-03-22 13:18:32 +01:00
dergoegge 897e342d6e [net] Encapsulate CNode message polling 2023-03-22 13:18:30 +01:00
dergoegge cc5cdf8776 [net] Deduplicate marking received message for processing 2023-03-19 14:34:37 +01:00
dergoegge ad44aa5c64 [net] Add connection type getter to CNode 2023-03-19 14:34:36 +01:00
dergoegge 55c4795c57 [net processing] Use TxRelay::m_relay_txs over CNode::m_relays_txs 2023-03-16 18:23:49 +01:00
dergoegge 05eeba2c5f [test] Add manual prune startup test case 2023-03-13 13:10:11 +01:00
dergoegge 4517419628 [util] Avoid integer overflow in CheckDiskSpace 2023-03-10 15:50:26 +01:00
dergoegge a1c36275b5 [fuzz] Assert that omitting missing transactions always fails block reconstruction 2023-01-23 17:29:41 +01:00
dergoegge a8ac61ab5e [fuzz] Add PartiallyDownloadedBlock target 2023-01-23 17:29:41 +01:00
dergoegge 42bd4c7468 [block encodings] Avoid fuzz blocking asserts in PartiallyDownloadedBlock 2023-01-23 17:18:35 +01:00
dergoegge 1429f83770 [block encodings] Make CheckBlock mockable for PartiallyDownloadedBlock 2023-01-23 17:18:35 +01:00
dergoegge 9ab62d71fb [fuzz] Actually use mocked mempool in tx_pool target 2023-01-20 12:15:01 +01:00
dergoegge 3153e7d779 [fuzz] Add HeadersSyncState target 2022-12-12 21:06:04 +00:00
dergoegge 53552affca [headerssync] Make m_commit_offset protected 2022-12-12 21:06:04 +00:00
dergoegge 58c2bbdb55 [fuzz] Enable erlay in process_message(s) targets 2022-12-12 11:19:02 +00:00
dergoegge 8f2dac5409 [test] Add p2p_tx_privacy.py 2022-11-30 16:36:16 +00:00
dergoegge ce63fca13e [net processing] Assume that TxRelay::m_tx_inventory_to_send is empty pre-verack
This commit documents our assumption about
TxRelay::m_tx_inventory_to_send being empty prior to version handshake
completion.

The added Assume acts as testing oracle for our fuzzing tests to
potentially detect if the assumption is violated.
2022-11-30 12:22:05 +00:00
dergoegge 845e3a34c4 [net processing] Ensure transaction announcements are only queued for fully connected peers 2022-11-29 13:54:50 +00:00
dergoegge 0eeb9b0442 [fuzz] Move ConsumeNetAddr to fuzz/util/net.h 2022-11-17 14:52:45 +00:00
dergoegge 291c8697d4 [fuzz] Make ConsumeNetAddr produce valid onion addresses 2022-11-17 14:52:45 +00:00
dergoegge c9ba3f836e [netaddress] Make OnionToString public 2022-11-17 14:52:45 +00:00
dergoegge 784b023191 [net processing] Simplify use of IsContinuationOfLowWorkHeadersSync in TryLowWorkHeaderSync
`m_headers_sync` is already reset in IsContinuationOfLowWorkHeadersSync
if there is a failure, so there is no need to also reset in
TryLowWorkHeaderSync.
2022-10-26 11:12:03 +01:00
dergoegge e891aabf5a [net processing] Fixup TryLowWorkHeadersSync comment 2022-10-24 22:05:59 +01:00
dergoegge 7ad15d1100 [net processing] Handle IsContinuationOfLowWorkHeadersSync return value correctly when new headers sync is started 2022-10-21 11:05:34 +01:00
dergoegge 5961f8eea1 [net] Return CService from GetLocalAddrForPeer and GetLocalAddress 2022-07-14 15:24:00 +02:00
dergoegge 0101d2bc3c [net] Move eviction logic to its own file 2022-07-06 18:13:54 +02:00
dergoegge a3c2707039 [net] Add connection type to NodeEvictionCandidate 2022-07-04 14:58:43 +02:00
dergoegge 42aa5d5b62 [net] Add NoBan status to NodeEvictionCandidate 2022-07-04 14:57:49 +02:00
dergoegge e7a9133766 [net processing] Set CNode::m_relays_txs=true when receiving BIP37 filters
This line was accidentally removed in #22778.
2022-06-22 11:03:35 +02:00
dergoegge ea54ba2f42 [test] Fix port collisions caused by p2p_getaddr_caching.py 2022-06-08 21:00:45 +02:00
dergoegge f9682e75ac [test_framework] Set PortSeed.n directly after initialising params
This allows us to use `p2p_port()` with `set_test_params()`.
2022-06-08 21:00:18 +02:00
dergoegge 292828cd77 [test] Test addr cache for multiple onion binds 2022-06-02 19:14:17 +02:00
dergoegge 3382905bef [net] Seed addr cache randomizer with port from binding address 2022-06-02 19:03:54 +02:00
dergoegge f10e80b6e4 [net] Use ConnectedThroughNetwork() instead of GetNetwork() to seed addr cache randomizer 2022-05-09 16:18:22 +02:00
dergoegge 778343a379 scripted-diff: Rename PeerManagerImpl members
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); }

ren mapNodeState                              m_node_states
ren cs_most_recent_block                      m_most_recent_block_mutex
ren most_recent_block                         m_most_recent_block
ren most_recent_compact_block                 m_most_recent_compact_block
ren most_recent_block_hash                    m_most_recent_block_hash
ren fWitnessesPresentInMostRecentCompactBlock m_most_recent_compact_block_has_witnesses
ren nPreferredDownload                        m_num_preferred_download_peers
ren nHighestFastAnnounce                       m_highest_fast_announce
-END VERIFY SCRIPT-
2022-04-26 11:12:56 +02:00
dergoegge 91c339243e [net processing] Move nHighestFastAnnounce into PeerManagerImpl 2022-04-26 11:12:05 +02:00
dergoegge e5d1831517 [netgroup] Use nStartByte as offset for the last byte of the group
Should we ever introduce a new address type that makes use of
`nStartByte` and adds fractional bytes to the group, then nStartByte
should be used as the offset for the last byte.
2022-04-25 15:09:14 +02:00
dergoegge 10b83e2aa3 [net processing] Move block cache state into PeerManagerImpl 2022-04-20 13:33:07 +02:00
dergoegge a4c55a93ef [net processing] Inline and simplify UpdatePreferredDownload
We inline `UpdatePreferredDownload` because it is only used in one
location during the version handshake. We simplify it by removing the
initial subtraction of `state->fPreferredDownload` from
`nPreferredDownload`. This is ok since the version handshake is only
called once per peer and `state->fPreferredDownload` will always be
false before the newly inlined code is called, making the subtraction a
noop.
2022-04-20 13:33:07 +02:00
dergoegge 490c08f96a [net processing] Move nPreferredDownload into PeerManagerImpl 2022-04-20 13:33:07 +02:00
dergoegge a292df283a [net processing] Move mapNodeState into PeerManagerImpl 2022-04-20 13:33:07 +02:00
dergoegge 37ecaf3e7a [net processing] Move CNodeState declaration above PeerManagerImpl 2022-04-20 13:33:07 +02:00
Niklas Gögge 4523d28b6b [test] compare filter and header with the result of the getblockfilter RPC 2021-12-22 20:49:47 +01:00
Niklas Gögge 3a2464f216 [rest] drop superfluous rpc serializations flags for block filters 2021-12-22 20:49:25 +01:00
Niklas Gögge 064abd14a5 [rest] add a more verbose error message for invalid header counts 2021-12-22 20:47:53 +01:00
Niklas Gögge 83b8f3a896 [refactor] various style fix-ups 2021-12-22 20:46:47 +01:00
Niklas Gögge 18c5b23a0f [test] Test that -blocksonly nodes still serve compact blocks. 2021-09-28 22:11:30 +02:00
Niklas GöggeandAmiti Uttarwar a79ad65fc2 [test] Test that getdata(CMPCT) is still sent on regular low bandwidth connections.
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2021-09-28 22:11:30 +02:00
Niklas GöggeandAmiti Uttarwar 5e231c116b [test] Test that -blocksonly nodes do not send getdata(CMPCT) on a low bandwidth connection.
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2021-09-28 22:11:30 +02:00
Niklas GöggeandAmiti Uttarwar 5bf6587457 [test] Test that -blocksonly nodes do not request high bandwidth mode.
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2021-09-28 22:11:30 +02:00
Niklas Gögge 0dc8bf5b92 [net processing] Dont request compact blocks in blocks-only mode 2021-09-28 22:11:30 +02:00
Niklas Gögge e95aaefe25 build: Avoid secp256k1.h include from system 2020-11-23 23:33:53 +01:00