aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Do not use uppercase characters in source code filenamespracticalswift2018-05-231-385/+0
|
* Make it clear which functions that are intended to be translation unit localpracticalswift2018-05-031-3/+3
| | | | | Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* tests: Add missing locks to testspracticalswift2017-11-101-7/+37
| | | | | | Add missing locks to tests to satisfy lock requirements (such as EXCLUSIVE_LOCKS_REQUIRED(...) (Clang Thread Safety Analysis), AssertLockHeld(...) and implicit lock assumptions).
* Add unit test for stale tip checkingSuhas Daftuar2017-11-021-0/+85
|
* Add unit test for outbound peer evictionSuhas Daftuar2017-10-261-0/+55
|
* net: drop unused connman paramCory Fields2017-09-061-11/+11
| | | | The copy in PeerLogicValidation can be used instead.
* net: use an interface class rather than signals for message processingCory Fields2017-09-061-11/+11
| | | | | Drop boost signals in favor of a stateful class. This will allow the message processing loop to actually move to net_processing in a future step.
* net: pass CConnman via pointer rather than referenceCory Fields2017-09-061-11/+11
| | | | | | | There are a few too many edge-cases here to make this a scripted diff. The following commits will move a few functions into PeerLogicValidation, where the local connman instance can be used. This change prepares for that usage.
* scripted-diff: stop using the gArgs wrappersMarko Bencun2017-08-141-2/+2
| | | | | | | | They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
* Remove unused Boost includespracticalswift2017-06-091-2/+0
|
* Merge #10545: Use list initialization (C++11) for maps/vectors instead of ↵Wladimir J. van der Laan2017-06-081-1/+0
|\ | | | | | | | | | | | | | | boost::assign::map_list_of/list_of 3fb81a8 Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of (practicalswift) Tree-SHA512: 63a9ac9ec5799472943dce1cd92a4b14e7f1fe12758a5fc4b1efceaf2c85a4ba71dad5ccc50813527f18b192e7714c076e2478ecd6ca0d452b24e88416f872f7
| * Use list initialization (C++11) for maps/vectors instead of ↵practicalswift2017-06-061-1/+0
| | | | | | | | boost::assign::map_list_of/list_of
* | scripted-diff: Use new naming style for insecure_rand* functionsPieter Wuille2017-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp -END VERIFY SCRIPT-
* | scripted-diff: use insecure_rand256/randrange morePieter Wuille2017-06-051-2/+2
|/ | | | | | | | -BEGIN VERIFY SCRIPT- sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
* rpc: Add listen address to incoming connections in `getpeerinfo`Wladimir J. van der Laan2017-06-051-4/+4
| | | | | | | | | | | This adds the listening address on which incoming connections were received to the CNode and CNodeStats structures. The address is reported in `getpeerinfo`. This can be useful for distinguishing connections received on different listening ports (e.g. when using a different listening port for Tor hidden service connections) or different networks.
* [Trivial] Update comments referencing main.cppCryptAxe2017-02-161-1/+1
|
* net: Disallow sending messages until the version handshake is completeCory Fields2017-02-021-0/+4
| | | | This is a change in behavior, though it's much more sane now than before.
* Merge #9283: A few more CTransactionRef optimizationsWladimir J. van der Laan2017-01-041-12/+12
|\ | | | | | | | | | | | | 91335ba Remove unused MakeTransactionRef overloads (Pieter Wuille) 6713f0f Make FillBlock consume txn_available to avoid shared_ptr copies (Pieter Wuille) 62607d7 Convert COrphanTx to keep a CTransactionRef (Pieter Wuille) c44e4c4 Make AcceptToMemoryPool take CTransactionRef (Pieter Wuille)
| * Convert COrphanTx to keep a CTransactionRefPieter Wuille2016-12-211-12/+12
| |
* | Merge #9289: net: drop boost::thread_groupWladimir J. van der Laan2017-01-041-7/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 67ee4ec net: misc header cleanups (Cory Fields) 8b3159e net: make proxy receives interruptible (Cory Fields) 5cb0fce net: remove thread_interrupted catch (Cory Fields) d3d7056 net: make net processing interruptible (Cory Fields) 0985052 net: make net interruptible (Cory Fields) 799df91 net: add CThreadInterrupt and InterruptibleSleep (Cory Fields) 7325b15 net: a few small cleanups before replacing boost threads (Cory Fields)
| * | net: make net processing interruptibleCory Fields2017-01-031-7/+13
| | |
* | | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
|/ / | | | | | | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* | Add a ForceSetArg method for testingMatt Corallo2016-12-271-3/+3
| |
* | Un-expose mapArgs from utils.hMatt Corallo2016-12-241-0/+1
|/
* Remove mapOrphanTransactionsByPrev from DoS_testsPieter Wuille2016-12-051-2/+0
| | | | | | | | This is another violation of the one definition rule, as the type for mapOrphanTransactionsByPrev did not match the one in net_processing.cpp anymore. As it now depends on a custom Iterator, it seems too much hassle to correctly expose it to the tests. Instead, this commit just removes the one test it was referenced in.
* Align struct COrphan definitionPieter Wuille2016-12-051-0/+1
|
* Move network-msg-processing code out of main to its own fileMatt Corallo2016-12-021-1/+1
|
* net: handle version push in InitializeNodeCory Fields2016-11-031-4/+4
|
* connman is in charge of pushing messagesCory Fields2016-11-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The changes here are dense and subtle, but hopefully all is more explicit than before. - CConnman is now in charge of sending data rather than the nodes themselves. This is necessary because many decisions need to be made with all nodes in mind, and a model that requires the nodes calling up to their manager quickly turns to spaghetti. - The per-node-serializer (ssSend) has been replaced with a (quasi-)const send-version. Since the send version for serialization can only change once per connection, we now explicitly tag messages with INIT_PROTO_VERSION if they are sent before the handshake. With this done, there's no need to lock for access to nSendVersion. Also, a new stream is used for each message, so there's no need to lock during the serialization process. - This takes care of accounting for optimistic sends, so the nOptimisticBytesWritten hack can be removed. - -dropmessagestest and -fuzzmessagestest have not been preserved, as I suspect they haven't been used in years.
* net: Use deterministic randomness for CNode's nonce, and make it constCory Fields2016-10-311-4/+4
|
* Move static global randomizer seeds into CConnmanPieter Wuille2016-09-191-4/+4
|
* net: Pass best block known height into CConnmanCory Fields2016-09-081-4/+4
| | | | | | | | | | | | | | | | | | | | CConnman then passes the current best height into CNode at creation time. This way CConnman/CNode have no dependency on main for height, and the signals only move in one direction. This also helps to prevent identity leakage a tiny bit. Before this change, an attacker could theoretically make 2 connections on different interfaces. They would connect fully on one, and only establish the initial connection on the other. Once they receive a new block, they would relay it to your first connection, and immediately commence the version handshake on the second. Since the new block height is reflected immediately, they could attempt to learn whether the two connections were correlated. This is, of course, incredibly unlikely to work due to the small timings involved and receipt from other senders. But it doesn't hurt to lock-in nBestHeight at the time of connection, rather than letting the remote choose the time.
* net: move nLocalServices/nRelevantServices to CConnmanCory Fields2016-09-081-4/+4
| | | | | These are in-turn passed to CNode at connection time. This allows us to offer different services to different peers (or test the effects of doing so).
* net: move nLastNodeId to CConnmanCory Fields2016-09-081-4/+6
|
* net: move ban and addrman functions into CConnmanCory Fields2016-09-081-14/+14
|
* net: handle nodesignals in CConnmanCory Fields2016-09-081-0/+4
|
* net: Pass CConnman around as neededCory Fields2016-09-081-7/+7
|
* BIP143: Signing logicPieter Wuille2016-06-221-2/+2
|
* Merge #8179: Evict orphans which are included or precluded by accepted blocks.Wladimir J. van der Laan2016-06-201-1/+1
|\ | | | | | | | | | | | | | | 54326a6 Increase maximum orphan size to 100,000 bytes. (Gregory Maxwell) 8c99d1b Treat orphans as implicit inv for parents, discard when parents rejected. (Gregory Maxwell) 11cc143 Adds an expiration time for orphan tx. (Gregory Maxwell) db0ffe8 This eliminates the primary leak that causes the orphan map to always grow to its maximum size. (Gregory Maxwell) 1b0bcc5 Track orphan by prev COutPoint rather than prev hash (Pieter Wuille)
| * Increase maximum orphan size to 100,000 bytes.Gregory Maxwell2016-06-151-1/+1
| | | | | | | | | | Although this increases node memory usage in the worst case by perhaps 30MB, the current behavior causes severe issues with dependent tx relay.
* | Introduce enum ServiceFlags for service flagsPieter Wuille2016-06-131-4/+4
| |
* | Don't require services in -addnodePieter Wuille2016-06-131-4/+4
|/
* Merge pull request #7205Wladimir J. van der Laan2016-01-051-1/+1
|\ | | | | | | | | | | fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
* | Replace trickle nodes with per-node/message Poisson delaysPieter Wuille2015-12-111-7/+7
|/ | | | | | | | | | | | | | We used to have a trickle node, a node which was chosen in each iteration of the send loop that was privileged and allowed to send out queued up non-time critical messages. Since the removal of the fixed sleeps in the network code, this resulted in fast and attackable treatment of such broadcasts. This pull request changes the 3 remaining trickle use cases by random delays: * Local address broadcast (while also removing the the wiping of the seen filter) * Address relay * Inv relay (for transactions; blocks are always relayed immediately) The code is based on older commits by Patrick Strateman.
* TRIVIAL: Missing includesJorge Timón2015-07-231-4/+1
|
* Reinitialize state in between individual unit tests.Pieter Wuille2015-03-031-1/+3
| | | | | This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.
* Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|