aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util.cpp
AgeCommit message (Collapse)Author
2022-02-27fuzz: FuzzedFileProvider::write should not return negative valueeugene
Doing so can lead to a glibc crash. Also the manpage for fopencookie warns against this: https://man7.org/linux/man-pages/man3/fopencookie.3.html
2022-01-26Extract CTxIn::MAX_SEQUENCE_NONFINAL constantMarcoFalke
2022-01-10fuzz: Limit fuzzed time to years 2000-2100MarcoFalke
2022-01-05Merge bitcoin/bitcoin#21879: refactor: wrap accept() and extend usage of SockW. J. van der Laan
6bf6e9fd9dece67878595a5f3361851c25833c49 net: change CreateNodeFromAcceptedSocket() to take Sock (Vasil Dimov) 9e3cbfca7c9efa620c0cce73503772805cc1fa82 net: use Sock in CConnman::ListenSocket (Vasil Dimov) f8bd13f85ae5404adef23a52719d804a5c36b1e8 net: add new method Sock::Accept() that wraps accept() (Vasil Dimov) Pull request description: _This is a piece of https://github.com/bitcoin/bitcoin/pull/21878, chopped off to ease review._ Introduce an `accept(2)` wrapper `Sock::Accept()` and extend the usage of `Sock` in `CConnman::ListenSocket` and `CreateNodeFromAcceptedSocket()`. ACKs for top commit: laanwj: Code review ACK 6bf6e9fd9dece67878595a5f3361851c25833c49 jamesob: ACK 6bf6e9fd9dece67878595a5f3361851c25833c49 ([`jamesob/ackr/21879.2.vasild.wrap_accept_and_extend_u`](https://github.com/jamesob/bitcoin/tree/ackr/21879.2.vasild.wrap_accept_and_extend_u)) jonatack: ACK 6bf6e9fd9dece67878595a5f3361851c25833c49 per `git range-diff ea989de 976f6e8 6bf6e9f` -- only change since my last review was `s/listen_socket.socket/listen_socket.sock->Get()/` in `src/net.cpp: CConnman::SocketHandlerListening()` -- re-read the code changes, rebase/debug build/ran units following my previous full review (https://github.com/bitcoin/bitcoin/pull/21879#pullrequestreview-761251278) w0xlt: tACK 6bf6e9f Tree-SHA512: dc6d1acc4f255f1f7e8cf6dd74e97975cf3d5959e9fc2e689f74812ac3526d5ee8b6a32eca605925d10a4f7b6ff1ce5e900344311e587d19786b48c54d021b64
2021-12-17Move AdditionOverflow to util, Add CheckedAdd with unit testsMarcoFalke
2021-12-01net: add new method Sock::Accept() that wraps accept()Vasil Dimov
This will help to increase `Sock` usage and make more code mockable.
2021-12-01fuzz: Rework FillNodeMarcoFalke
2021-12-01refactor: Set fSuccessfullyConnected in FillNodeMarcoFalke
Also, pass ConnmanTestMsg& and PeerManager& (needed for later commits).
2021-11-01fuzz: Rework ConsumeScriptMarcoFalke
This should make it easier for the fuzz engine to explore multisig code paths. See discussion in https://github.com/bitcoin/bitcoin/issues/23105 The downside is that all fuzz inputs that use ConsumeScript are now invalidated and need to be re-generated. Another downside may be that most multisig scripts from ConsumeScript are using likely not fully valid pubkeys.
2021-09-30[MOVEONLY] consensus: move amount.h into consensusfanquake
Move amount.h to consensus/amount.h. Renames, adds missing and removes uneeded includes.
2021-07-14Move implementations of non-template fuzz helpersSriram
Moved implementations of `ConsumeTxMemPoolEntry`, `ContainsSpentInput`, `ConsumeNetAddr`, and the methods(open, read, write, seek, close) of FuzzedFileProvider from test/fuzz/util.h to test/fuzz/util.cpp.
2021-07-04fuzz: Improve ConsumeTxDestinationMarcoFalke
* Assert when a type is missing * Add missing WitnessV1Taproot * Limit WitnessUnknown to version [2, 16], to avoid abiguity * Limit WitnessUnknown to size [2, 40], to avoid invalid sizes
2021-07-04fuzz: Move ConsumeTxDestination to cpp fileMarcoFalke
Moving the implementation out of the header will reduce compile time
2021-05-09fuzz: Avoid excessively large min fee rate in tx_poolMarcoFalke
2021-05-06Merge bitcoin/bitcoin#21798: fuzz: Create a block template in tx_pool targetsMarcoFalke
fa03d0acd6bd8bb6d3d5227512f042ff537ad993 fuzz: Create a block template in tx_pool targets (MarcoFalke) fa61ce5cf5c1d73d352173806571bcd7799ed2ee fuzz: Limit mocktime to MTP in tx_pool targets (MarcoFalke) fab646b8ea293bb2b03707c6ef6790982625e492 fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding a maximum size (MarcoFalke) fae2c8bc54e6c0fe69a82bd1b232c52edd1acd34 fuzz: Allow to pass min/max to ConsumeTime (MarcoFalke) Pull request description: Relatively simple check to ensure a block can always be created from the mempool ACKs for top commit: practicalswift: Tested ACK fa03d0acd6bd8bb6d3d5227512f042ff537ad993 Tree-SHA512: e613376ccc88591cbe594db14ea21ebc9b2b191f6325b3aa4ee0cd379695352ad3b480e286134ef6ee30f043d486cf9792a1bc7e44445c41045ac8c3b931c7ff
2021-05-04refactor: Replace &foo[0] with foo.data()MarcoFalke
2021-04-28fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding ↵MarcoFalke
a maximum size This is technically a breaking change. This allows the fuzz engine to pick the right size, also larger sizes, if needed.
2021-04-28fuzz: Allow to pass min/max to ConsumeTimeMarcoFalke
2021-04-15fuzz: use ConsumeBool() instead of !ConsumeBool()Vasil Dimov
The former is shorter and ends up with a "random" bool anyway.
2021-04-15fuzz: split FuzzedSock interface and implementationVasil Dimov
Move the `FuzzedSock`'s implementation from `src/test/fuzz/util.h` to `src/test/fuzz/util.cpp`. A separate interface and implementation make the code more readable for consumers who don't need to (better not) know the implementation details.
2021-04-15fuzz: make FuzzedSock::Wait() sometimes simulate an occurred eventVasil Dimov
2021-04-15fuzz: set errno from FuzzedSock::Wait() if it simulates a failureVasil Dimov
2021-04-15style: remove extra white spaceVasil Dimov
2021-04-06fuzz: Fix uninitialized read in testMarcoFalke
2021-03-30fuzz: [refactor] Use ConsumeScript in signature_checker fuzz targetMarcoFalke
2021-03-18fuzz: Add tx_pool fuzz targetsMarcoFalke
2021-01-23fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSIONMarcoFalke
2021-01-23fuzz: move-only FillNode implementation to cpp fileMarcoFalke
This allows to modify the implementation without having to recompile all fuzz targets. Can be reviewed with --color-moved=dimmed-zebra