- Implements getmocktime instead of time.sleep to prevent races
- Enforce success of all mocktime operations
- Do not increment mocktime with 0 seconds
- Use fresh incoming peers for each test
- Explicitly do test teardown
- Remove TXID_RELAY_DELAY as this no longer exists in the dogecoind
implementation
- Add the inflight throttling test to replace the removed inflight
limit test
- Add an expiry fallback test
Maintaining up to 100000 INVs per peer is excessive. A Dogecoin
Core node will never send more than 7 invs per second.
Backported from: de11b0a4
Original Author: Pieter Wuille <pieter@wuille.net>
The major changes are:
* Announcements from outbound (and whitelisted) peers are now
always preferred over those from inbound peers. This used to be
the case for the first request (by delaying the first request
from inbound peers), and a bias after. The 2s delay for requests
from inbound peers still exists, but after that, if viable
outbound peers remain for any given transaction, they will
always be tried first.
* No more hard cap of 100 in flight transactions per peer, as
there is less need for it (memory usage is linear in the number
of announcements, but independent from the number in flight,
and CPU usage isn't affected by it). Furthermore, if only one
peer announces a transaction, and it has over 100 in flight and
requestable already, we still want to request it from them. The
cap is replaced with an additional 2s delay (possibly combined
with the existing 2s delays for inbound connections).
Backported from: 242d1647
173a1d2d
Original Author: Pieter Wuille <pieter@wuille.net>
Conflicts:
- replaced GenTx with uint256 because no segwit
- removed additional 2s penalty for non-segwit peers
- used int64_t instead of std::chrono::microseconds per utiltime
- implemented TxRequest as g_txrequest instead of as a member of
PeerManager, which we don't have
- removed the Dogecoin-specific strict max inflight test
- make exceptions for whitelisted nodes as there is no fine-
grained permission system
This adds a new module that defines TxRequestTracker, a data
structure that maintains all information about transaction
requests, and coordinates requests.
Backported from: da3b8fde
3c7fe0e5
fd9a0060
Original Author: Pieter Wuille <pieter@wuille.net>
Conflicts:
- replaced GenTx with uint256 because no segwit
- used int64_t instead of std::chrono::microseconds per utiltime
- removed wtxid tests
1. Allow more time for notifications to be delivered under load
2. Assure that in a non-hostile reorg the tracked transaction
isn't mined prematurely by mining 80-bytes blocks
3. Test all 4 messages for the doublespend scenario at once to
not error out when the conflict races the new transaction
This allows us to more strictly test the reorg behavior while
reducing race issues
Currently difficulty adjustment violations are not reported for
chains that branch off before the last checkpoint. Change this
by moving the checkpoint check after the difficulty check.
Backported from: 85c82b50
Original Author: Pieter Wuille <pieter.wuille@gmail.com>
This makes orphan processing work like handling getdata messages:
After every actual transaction validation attempt, interrupt
processing to deal with messages arriving from other peers.
Cherry-picked from: 866c8058a
Reduces complexity in processing of orphans when receiving tx
messages over p2p. and isolate the functionality in its own
function ProcessOrphanTx
Backported from: 9453018f
6e051f3d
Original Author: Pieter Wuille <pieter.wuille@gmail.com>
Headers-first is the primary method of announcement on the network.
If a node fell back sending blocks by inv, it's probably for a
re-org. The final block hash provided should be the highest, so
send a getheaders and then fetch the blocks we need to catch up.
Backported from: 74673663
Original Author: John Newbery <john@johnnewbery.com>
In boost 1.74.0, boost::filesystem adapted path::copy_option enum
to be the same as the enum in the fs::path from c++17, which is
now called copy_options, and its member "overwrite_if_exists"
is now called "overwrite_existing". In boost 1.85, the deprecated
copy_option enum is fully removed.
Because Dogecoin Core currently supports boost 1.60 and up,
conditionally implement the new enum based on the boost version
that is built against.
fs::basename() and fs::extension() have been removed in boost 1.85,
use path::stem() and path::extension() instead. This is safe since
boost 1.44 (boost::filesystem version 3), and the minimum supported
boost version for Dogecoin Core is 1.60.
path::is_complete() has been deprecated since boost::filesystem
version 3, which was introduced with boost 1.44.0, and removed in
1.85.0. The minimum supported boost version has been 1.60.0 since
Dogecoin Core release v1.14.3, so this can be safely replaced.
Removes crosslinking of documentation in favor of a link hierarchy:
- main README.md links to doc/intl/README.md
- doc/intl/README.md links to individual translated documents
This reduces conflicts between translations.
This will allow compiling with the c++17 standard, which on some
distributions (macOS, FreeBSD) is required when using system
dependencies.
The ./configure script will now allow specifying --enable-c++17 to
enable c++17. The default remains c++11, and c++14 also remains
available.
random_shuffle is deprecated since c++11 and removed in c++17. Use
the shuffle function instead, now that we have a standardized
interface available on FastRandomContext.
This enables c++17 compilation
This makes it possible to plug it into the various standard C++11 random
distribution algorithms and other functions like std::shuffle.
Cherry-picked from: 1ec1602a4549f6b68586cead8eff701bceb624f5
-add msvc ssize_t definition in compat.h
-change NUM_OS_RANDOM_BYTES to int from ssize_t in random.h
Includes squashed commit: f7dc99244c8e78dbd0196f612690efcc449c37dc
Inspired by: fbf327b13868861c2877c5754caf5a9816f2603c