aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/process_message.cpp
Commit message (Collapse)AuthorAgeFilesLines
* test: Mock IBD in net_processing fuzzersMarcoFalke2020-11-071-1/+6
|
* p2p: Unify Send and Receive protocol versionsHennadii Stepanov2020-09-071-1/+1
| | | | There is no change in behavior on the P2P network.
* scripted-diff: [net processing] Rename PeerLogicValidation to PeerManagerJohn Newbery2020-09-071-2/+2
| | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/PeerLogicValidation/PeerManager/g' $(git grep -l PeerLogicValidation ./src ./test) sed -i 's/peer_logic/peerman/g' $(git grep -l peer_logic ./src ./test) -END VERIFY SCRIPT- PeerLogicValidation was originally net_processing's implementation to the validation interface. It has since grown to contain much of net_processing's logic. Therefore rename it to reflect its responsibilities. Suggested in https://github.com/bitcoin/bitcoin/pull/10756#pullrequestreview-53892618.
* [net_processing] Pass chainparams to PeerLogicValidation constructorJohn Newbery2020-09-071-2/+1
| | | | | | | Keep a references to chainparams, rather than calling the global Params() function every time it's needed. This is fine, since globalChainParams does not get updated once it's been set, and it's available at the point of constructing the PeerLogicValidation object.
* scripted-diff: Rename `OUTBOUND` ConnectionType to `OUTBOUND_FULL_RELAY`Amiti Uttarwar2020-09-021-1/+1
| | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/OUTBOUND, /OUTBOUND_FULL_RELAY, /g' src/net.h sed -i 's/ConnectionType::OUTBOUND/ConnectionType::OUTBOUND_FULL_RELAY/g' src/test/net_tests.cpp src/test/fuzz/process_message.cpp src/test/fuzz/process_messages.cpp src/net.cpp src/test/denialofservice_tests.cpp src/net.h src/test/fuzz/net.cpp -END VERIFY SCRIPT-
* [net_processing] Move ProcessMessage to PeerLogicValidationJohn Newbery2020-08-211-16/+3
|
* [net/refactor] Add block relay only connections to ConnectionType enumAmiti Uttarwar2020-08-071-1/+1
|
* [net/refactor] Introduce an enum to distinguish type of connectionAmiti Uttarwar2020-08-071-1/+1
| | | | - extract inbound & outbound types
* refactor: replace CConnman pointers by references in net_processing.cppSebastian Falbesoner2020-07-141-2/+2
|
* net: Use mockable time for ping/pong, add testsMarcoFalke2020-06-191-2/+2
|
* net: Remove dead logging codeMarcoFalke2020-06-161-2/+15
| | | | | fRet is never false, so the dead code can be removed and the return type can be made void
* Merge #19053: refactor: replace CNode pointers by references within ↵MarcoFalke2020-06-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net_processing.{h,cpp} 8b3136bd307123a255b9166aa42a497a44bcce70 refactor: replace CNode pointers by references within net_processing.{h,cpp} (Sebastian Falbesoner) Pull request description: This PR is inspired by a [recent code review comment](https://github.com/bitcoin/bitcoin/pull/19010#discussion_r426954791) on a PR that introduced new functions to the net_processing module. The point of the discussion was basically that whenever we pass something not by value (in the concrete example it was about `CNode*` and `CConnman*`) we should either use * a pointer (```CType*```) with null pointer check or * a reference (```CType&```) To keep things simple, this PR for a first approach * only tackles `CNode*` pointers * only within the net_processing module, i.e. no changes that would need adaption in other modules * keeps the names of the variables as they are I'm aware that PRs like this are kind of a PITA to review, but I think the code quality would increase if we get rid of pointers without nullptr check -- bloating up the code by adding all the missing checks would be the worse alternative, in my opinion. Possible follow-up PRs, in case this is received well: * replace CNode pointers by references for net module * replace CConnman pointers by references for net_processing module * ... ACKs for top commit: MarcoFalke: ACK 8b3136bd307123a255b9166aa42a497a44bcce70 🔻 practicalswift: ACK 8b3136bd307123a255b9166aa42a497a44bcce70 Tree-SHA512: 15b6a569ecdcb39341002b9f4e09b38ed4df077e3a3a50dfb1b72d98bdc9f9769c7c504f106456aa7748af8591af7bb836b72d46086df715ab116e4ac3224b3b
| * refactor: replace CNode pointers by references within net_processing.{h,cpp}Sebastian Falbesoner2020-06-021-2/+2
| |
* | Merge #18875: fuzz: Stop nodes in process_message* fuzzersMarcoFalke2020-06-031-1/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fab860aed4878b831dae463e1ee68029b66210f5 fuzz: Stop nodes in process_message* fuzzers (MarcoFalke) 6666c828e072a5e99ea0c16394ca3e5b9de07409 fuzz: Give CNode ownership to ConnmanTestMsg in process_message fuzz harness (MarcoFalke) Pull request description: Background is that I saw an integer overflow in net_processing ``` #30629113 REDUCE cov: 25793 ft: 142917 corp: 3421/2417Kb lim: 4096 exec/s: 89 rss: 614Mb L: 1719/4096 MS: 1 EraseBytes- net_processing.cpp:977:25: runtime error: signed integer overflow: 2147483624 + 100 cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior net_processing.cpp:977:25 in net_processing.cpp:985:9: runtime error: signed integer overflow: -2147483572 - 100 cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior net_processing.cpp:985:9 in ``` Telling from the line numbers, it looks like `nMisbehavior` wrapped around. Fix that by calling `StopNodes` after each exec, which should clear the node state and thus `nMisbehavior`. ACKs for top commit: practicalswift: ACK fab860aed4878b831dae463e1ee68029b66210f5 Tree-SHA512: 891c081d5843565d891aec028b6c27ef3fa39bc40ae78238e81d8f784b4d4b49cb870998574725a5159dd03aeeb2e0b9bc3d3bb51d57d1231ef42e3394b2d639
| * fuzz: Stop nodes in process_message* fuzzersMarcoFalke2020-05-121-0/+2
| |
| * fuzz: Give CNode ownership to ConnmanTestMsg in process_message fuzz harnessMarcoFalke2020-05-111-1/+4
| |
* | net: Pass chainman into PeerLogicValidationMarcoFalke2020-05-211-2/+2
|/
* fuzz: Remove enumeration of expected deserialization exceptions in ↵practicalswift2020-04-241-23/+1
| | | | ProcessMessage(...) fuzzer
* fuzz: Disable debug log fileMarcoFalke2020-04-151-2/+7
|
* scripted-diff: Replace strCommand with msg_typeMarcoFalke2020-04-061-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/\<strCommand\>/msg_type/g' ./src/net_processing.cpp ./src/test/fuzz/process_message.cpp -END VERIFY SCRIPT-
* refactor: Remove mempool global from netMarcoFalke2020-03-121-2/+2
| | | | | | This refactor does two things: * Pass mempool in to PeerLogicValidation * Pass m_mempool around where needed
* tests: Add fuzzing harness for ProcessMessage(...)practicalswift2020-03-111-0/+98