aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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
|
* Remove CheckMinWork, as we always know all parent headersPieter Wuille2014-10-141-45/+0
|
* test: Fix DoS tests after c74332cWladimir J. van der Laan2014-09-201-3/+7
| | | | Fix data structure mismatch ... The mind boggles that they were still passing at all.
* Move CTxDestination from script/script to script/standardPieter Wuille2014-09-161-3/+3
|
* Stricter handling of orphan transactionsGavin Andresen2014-09-101-4/+13
| | | | | | | Prevent denial-of-service attacks by banning peers that send us invalid orphan transactions and only storing orphan transactions given to us by a peer while the peer is connected.
* Separate script/signjtimon2014-09-081-1/+1
|
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-1/+1
|
* Merge pull request #4377Pieter Wuille2014-08-271-5/+1
|\ | | | | | | | | | | 654871d replace ComputeMinWork with CheckMinWork (jtimon) b343c1a Move CBlockIndex::GetBlockWork() to pow::GetProofIncrement(nBits) (jtimon) c2c02f3 Move UpdateTime to pow (jtimon)
| * replace ComputeMinWork with CheckMinWorkjtimon2014-08-231-5/+1
| |
* | Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+1
|/ | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* Remove timing-based signature cache unit testGavin Andresen2014-06-251-87/+0
| | | | | | | | | | | | | | | | | Two changes: First removes a unit test that fails in my development environment (OSX, compiled -g3 with clang). sipa says that's not terribly surprising; the CMutableTransaction change makes signing a little more expensive but verification quicker. The unit test timed sign+verify-uncached versus verify-cached-five-times. He also says the test will be invalid when libsec256kp1 is integrated (because validation is super-optimized over signing). core.h change fixes a compiler warning (clang -Wall : CMutableTransaction defined as struct, declared as class in script.h).
* Refactor proof of work related functions out of mainjtimon2014-06-231-0/+1
|
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-6/+6
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* Reduce bignum.h now it is only needed for scriptnum_testsPieter Wuille2014-05-091-1/+0
|
* Move {Get,Set}Compact from bignum to uint256Pieter Wuille2014-05-091-2/+2
|
* Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-0/+4
| | | | | | | | - Add license headers to source files (years based on commit dates) in `src/test` as well as `qa` - Add `README.md` to `src/test/data` specifying MIT license Fixes #3848
* Per-peer block download tracking and stalled download detection.Pieter Wuille2014-02-081-1/+0
| | | | | | | | | Keep track of which block is being requested (and to be requested) from each peer, and limit the number of blocks in-flight per peer. In addition, detect stalled downloads, and disconnect if they persist for too long. This means blocks are never requested twice, and should eliminate duplicate downloads during synchronization.
* Add main-specific node statePieter Wuille2013-12-081-7/+19
|