9621 Commits

Author SHA1 Message Date
Ed Tubbs
cceba591b2 wallet: update derivation path to m/0'/3'/n'
tests: added DeriveNewChildKey test
2025-02-08 04:00:51 +00:00
chloefeal
31978e28ed
Fix typo src/rpc/blockchain.cpp
Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com>
2025-01-12 16:58:42 +08:00
chloefeal
5f4b86f4e7
Fix typo src/qt/guiutil.h
Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com>
2025-01-12 16:58:31 +08:00
oliveredget
e34cd76e1f
fix: typo in src/test/merkle_tests.cpp 2025-01-02 03:48:02 +08:00
Old Dip Tracker
d6ec20e178
Merge pull request #3717 from thisiskeanyvy/qt-translations-fr
Update and completing unfinished French translation files (bitcoin_fr.ts and bitcoin_fr_CA.ts)
2024-12-27 20:06:58 -05:00
thisiskeanyvy
05a231a1ae
Update and completing unfinished French translation files (bitcoin_fr.ts and bitcoin_fr_CA.ts) 2024-12-23 16:57:19 +01:00
qiandongyan
718ceafcef fix compatibility with boost 1.83
[Bugfix] Fix incorrect disconnect call for static functions

Problem:
When using `uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait)`
to disconnect a static function, the compilation fails because `boost::signals2::disconnect`
requires the exact type signature match of the slot. Using the function name directly
doesn't resolve to the correct function pointer for static functions.

Solution:
The fix explicitly uses `&BlockNotifyGenesisWait` to pass the function pointer.
This resolves the compilation error.

Impact:
Only affects the disconnect mechanism for static functions in `uiInterface.NotifyBlockTip`.

Signed-off-by: Dongyan Qian <dongyan0314@gmail.com>
2024-12-02 10:49:48 +08:00
Daniel Kraft
51cbc1fd5d
Check auxpow PoW before the auxpow itself.
This reverses the order in which the auxpow structure and the PoW on it
are verified.  By checking the PoW first, we make it harder for random
nodes to pass data of their choosing into CAuxPow::check.

Cherry-picked from: namecoin/namecoin-core@b6e3241b

Conflicts resolved:
- CAuxPow member name mismatch
- source code from validation.cpp resides in dogecoin.cpp
2024-11-30 14:01:03 -05:00
Patrick Lodder
149be06daf
bugfix: change asserts into handled failures for cmpctblk
Replaces assert() calls with if() statements returning functional
failure that can be handled for situations that can be triggered
from outside of compiled code - i.e. peers.

Backported from: 42bd4c74
Original Author: dergoegge <n.goeggi@gmail.com>
2024-10-09 15:34:16 -04:00
Patrick Lodder
a8c94c18df
update version info to 1.14.99 for master
the .99 makes sure that code in master is never mistaken for
release code, and is always a higher version than the last minor
release

Also set the last release date to match 1.14.8 instead of 1.14.7
2024-08-08 20:37:34 -04:00
chromatic
6cfd4524a0
Merge pull request #3558 from patricklodder/compat/boost185
compat: fix compatibility with boost 1.85
2024-07-17 22:58:01 -07:00
Patrick Lodder
2180b80dbf
cleanup: remove limitedmap 2024-07-14 22:02:03 -04:00
Patrick Lodder
8eb52142a7
policy: reduce MAX_PEER_TX_ANNOUNCEMENTS
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>
2024-07-14 21:57:47 -04:00
Patrick Lodder
3a700cde38
net: use txrequest for transaction request logic
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
2024-07-14 21:57:16 -04:00
Patrick Lodder
4bc8099741
Add txrequest module
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
2024-07-14 21:55:39 -04:00
Patrick Lodder
4add9776c2
add constant contructors for uint256 2024-07-14 21:45:03 -04:00
Patrick Lodder
38c3f67833
util: add c++14-style MakeUnique for use with c++11
Backported from: 86179897
Original author: practicalswift <practicalswift@users.noreply.github.com>
2024-07-14 21:45:02 -04:00
chromatic
2fcaf1310c
Merge pull request #3576 from patricklodder/bugfix/maskpow
validation: avoid masking of difficulty adjustment errors
2024-07-14 17:04:30 -07:00
chromatic
5788fb8f15
Merge pull request #3575 from patricklodder/perf/orphantx-interrupt
net: improve orphan processing
2024-07-14 11:21:11 -07:00
chromatic
cf2c9bac23
Merge pull request #3313 from patricklodder/1.14.7-fix-lock-debugging
refactor: fix undefined behavior and cleanup lock debugging code
2024-07-14 08:29:49 -07:00
chromatic
d099258fdc
Merge pull request #3568 from patricklodder/net/inv-buffer
p2p: reduce amount of getheaders sent per inv
2024-07-07 16:55:23 -07:00
Patrick Lodder
215fc33d08
validation: avoid masking of difficulty adjustment errors
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>
2024-07-03 17:31:22 -04:00
Pieter Wuille
9f2ab9ed6c
Interrupt orphan processing after every transaction
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
2024-07-03 16:30:01 -04:00
Patrick Lodder
0e4df473f6
p2p: simplify orphan processing
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>
2024-07-03 16:29:48 -04:00
Patrick Lodder
cedbbeba96
p2p: enforce cs_main lock when requesting headers 2024-07-03 14:01:44 -04:00
Patrick Lodder
3e64e6f226
p2p: Only send a getheaders for one block in an INV
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>
2024-07-03 14:01:36 -04:00
Patrick Lodder
846812cdde
cleanup: remove BOOST_FOREACH from timedata.cpp 2024-07-03 12:35:17 -04:00
Pieter Wuille
f88f9ddee2
Avoid the use of abs64 in timedata
Cherry-picked from: d1292f25
2024-07-03 12:16:46 -04:00
Patrick Lodder
d021d75fd5
add missing <list> include in validation.h
This omission was masked by including boost/unordered_map.hpp prior
to boost 1.85.0.
2024-06-25 10:03:41 -04:00
Patrick Lodder
95554c3e5c
fs: for boost 1.74 and up, use c++17 compatible copy_options
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.
2024-06-25 10:03:41 -04:00
Patrick Lodder
37909dd1b9
fs: don't use boost convenience functions
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.
2024-06-25 10:03:40 -04:00
Patrick Lodder
1d84f4f853
fs: use path::is_absolute() instead of path::is_complete()
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.
2024-06-25 10:03:40 -04:00
chromatic
e2b3c7eabb
Merge pull request #3393 from patricklodder/1.14.7-blockstats-dust
Add dust metrics to getblockstats
2024-06-23 18:11:16 -07:00
Patrick Lodder
caa79bd1a1
random: use std::shuffle instead of std::random_shuffle
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
2024-06-20 10:32:21 -04:00
Pieter Wuille
47b48521bb
Make FastRandomContext support standard C++11 RNG interface
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
2024-06-18 16:38:09 -07:00
Aaron Clauson
3606c85c7d
Minimal code changes to allow msvc compilation.
-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
2024-06-18 16:06:52 -07:00
Dag Robole
90d1972d81
Fix resource leak
Cherry-picked from: a8ae0b252a2007568e77f5aca1c7fa3ec5941b72
2024-06-18 15:19:51 -07:00
Pieter Wuille
60bd389823
Use rdrand as entropy source on supported platforms
Includes squashed commits:
5155d1101eb4fc9d4d797b583bb29f71807bd10b
a9e82f6512662054f64ed2bde590b2bb0831fc9d
674848fe1c43fb88870cf5ba16fca4e2524da793

Cherry-picked from: cb24c8539d1098d1a61605b452ecfa11a693320d
2024-06-18 15:19:25 -07:00
Pieter Wuille
23bc7a072e
Use sanity check timestamps as entropy
Cherry-picked from: 2c0a6f157da3c6bb3b0a1e77f003caf0d9cb9d6c
2024-06-18 14:37:52 -07:00
Pieter Wuille
4a3c6ddc11
Test that GetPerformanceCounter() increments 2024-06-18 14:37:51 -07:00
Pieter Wuille
930acbfe49
Use hardware timestamps in RNG seeding 2024-06-18 14:37:44 -07:00
xanimo
d693d4a008
random: getentropy on macOS does not need unistd.h
change sys/random.h to random.h in AC_MSG_CHECK
remove definitions that are applicable to macos which include unistd.h
additionally change comparator argument from NULL to nullptr when evaluating &getentropy

Inspired by: c13c97dbf846cf0e6a5581ac414ef96a215b0dc6
2024-06-13 11:44:33 -07:00
James Hilliard
743c3acd3d
Check if sys/random.h is required for getentropy on OSX.
Cherry-picked from: ee2d10ad0c0e04d0b9da4535a6fff265ac2501e5
2024-06-13 11:42:50 -07:00
Pieter Wuille
265f258540
scripted-diff: Use new naming style for insecure_rand* functions
-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-

Cherry-picked from: e945848582160b23fa0bc6f797e2bd8ac676ee0e
2024-06-13 11:42:49 -07:00
Pieter Wuille
7abc3c6c6d
scripted-diff: Use randbits/bool instead of randrange where possible
-BEGIN VERIFY SCRIPT-
sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp
sed -i 's/insecure_randrange(256)/insecure_randbits(8)/g' src/test/*_tests.cpp
-END VERIFY SCRIPT-

Cherry-picked from: 2fcd9cc86bfce944e3312e9a24685403250f3bdc
2024-06-13 11:42:49 -07:00
Pieter Wuille
046cbb0091
Use randbits instead of ad-hoc emulation in prevector tests
Cherry-picked from: 2ada67852174a76753080d65a7adbe27241a9caa
2024-06-13 11:42:49 -07:00
Pieter Wuille
9fa9876e4c
Replace rand() & ((1 << N) - 1) with randbits(N)
Cherry-picked from: 5f0b04eedc5bbdb9319c9f1f1a6c599337f5bbe3
2024-06-13 11:42:48 -07:00
Pieter Wuille
a36981dec6
Replace more rand() % NUM by randranges
Cherry-picked from: 3ecabae36364e905e7821fba3e60aa7f8418de6c
2024-06-13 11:42:48 -07:00
Pieter Wuille
fe5b701634
scripted-diff: use insecure_rand256/randrange more
-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-

Cherry-picked from: efee1db21a652019e0ab18fffc233d91bb7f1816
2024-06-13 11:42:48 -07:00
Pieter Wuille
2ee602e3ce
Add various insecure_rand wrappers for tests
Cherry-picked from: 1119927df03c94f9306e4d92f55d147b900522fb
2024-06-13 11:42:47 -07:00