2016-09-29 07:57:47 +02:00
# Copyright (c) 2013-2016 The Bitcoin Core developers
2018-01-12 16:11:18 +01:00
# Copyright (c) 2014-2018 The Dash Core developers
2016-09-29 07:57:47 +02:00
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
2021-01-22 04:32:24 +01:00
# Pattern rule to print variables, e.g. make print-top_srcdir
2021-07-18 07:35:28 +02:00
print-% : FORCE
2021-04-08 23:19:05 +02:00
@echo '$*' = '$($*)'
2021-01-22 04:32:24 +01:00
2022-05-02 17:31:46 +02:00
DIST_SUBDIRS = secp256k1
2013-09-09 04:02:28 +02:00
2022-08-23 18:03:33 +02:00
AM_LDFLAGS = $( LIBTOOL_LDFLAGS) $( HARDENED_LDFLAGS) $( GPROF_LDFLAGS) $( SANITIZER_LDFLAGS)
2021-06-17 16:20:41 +02:00
AM_CXXFLAGS = $( DEBUG_CXXFLAGS) $( HARDENED_CXXFLAGS) $( WARN_CXXFLAGS) $( NOWARN_CXXFLAGS) $( ERROR_CXXFLAGS) $( GPROF_CXXFLAGS) $( SANITIZER_CXXFLAGS)
2018-05-14 15:27:46 +02:00
AM_CPPFLAGS = $( DEBUG_CPPFLAGS) $( HARDENED_CPPFLAGS)
2017-04-17 21:10:47 +02:00
AM_LIBTOOLFLAGS = --preserve-dup-deps
2022-08-23 18:03:33 +02:00
PTHREAD_FLAGS = $( PTHREAD_CFLAGS) $( PTHREAD_LIBS)
2016-06-05 21:30:13 +02:00
EXTRA_LIBRARIES =
2014-06-04 23:13:03 +02:00
2020-12-01 05:18:46 +01:00
i f E N A B L E _ S T A C K T R A C E S
2019-07-02 06:16:11 +02:00
i f E N A B L E _ C R A S H _ H O O K S
i f C R A S H _ H O O K S _ W R A P P E D _ C X X _ A B I
2019-02-21 19:37:16 +01:00
# Wrap internal C++ ABI's so that we can attach stacktraces to exceptions
LDFLAGS_WRAP_EXCEPTIONS = -Wl,-wrap,__cxa_allocate_exception -Wl,-wrap,__cxa_free_exception
i f T A R G E T _ W I N D O W S
LDFLAGS_WRAP_EXCEPTIONS += -Wl,-wrap,_assert -Wl,-wrap,_wassert
e l s e
LDFLAGS_WRAP_EXCEPTIONS += -Wl,-wrap,__assert_fail
e n d i f
e n d i f
e n d i f
i f T A R G E T _ W I N D O W S
BACKTRACE_LIB = -ldbghelp -lbacktrace
e l s e
BACKTRACE_LIB = -lbacktrace
e n d i f
2020-12-01 05:18:46 +01:00
e n d i f #ENABLE_STACKTRACES
2019-02-21 19:37:16 +01:00
2022-05-02 17:31:46 +02:00
BITCOIN_INCLUDES = -I$( builddir) -I$( srcdir) /secp256k1/include -I$( srcdir) /$( UNIVALUE_INCLUDE_DIR_INT) $( BDB_CPPFLAGS) $( BOOST_CPPFLAGS) $( LEVELDB_CPPFLAGS)
2024-07-12 20:29:37 +02:00
BITCOIN_INCLUDES += -isystem$( srcdir) /dashbls/include -isystem$( srcdir) /dashbls/depends/relic/include -isystem$( srcdir) /dashbls/depends/minialloc/include
BITCOIN_INCLUDES += -isystem$( srcdir) /immer
2018-10-03 14:53:21 +02:00
2022-07-08 10:22:25 +02:00
LIBBITCOIN_SERVER = libbitcoin_server.a
LIBBITCOIN_COMMON = libbitcoin_common.a
LIBBITCOIN_CONSENSUS = libbitcoin_consensus.a
LIBBITCOIN_CLI = libbitcoin_cli.a
LIBBITCOIN_UTIL = libbitcoin_util.a
LIBBITCOIN_CRYPTO_BASE = crypto/libbitcoin_crypto_base.a
LIBBITCOINQT = qt/libbitcoinqt.a
2022-11-22 18:34:46 +01:00
LIBDASHBLS = dashbls/libdashbls.la
2014-11-05 16:58:37 +01:00
LIBSECP256K1 = secp256k1/libsecp256k1.la
2016-06-01 18:22:20 +02:00
i f E N A B L E _ Z M Q
2022-07-08 10:22:25 +02:00
LIBBITCOIN_ZMQ = libbitcoin_zmq.a
2016-06-01 18:22:20 +02:00
e n d i f
i f B U I L D _ B I T C O I N _ L I B S
2022-08-02 18:35:18 +02:00
LIBBITCOINCONSENSUS = libdashconsensus.la
2016-06-01 18:22:20 +02:00
e n d i f
i f E N A B L E _ W A L L E T
2022-07-08 10:22:25 +02:00
LIBBITCOIN_WALLET = libbitcoin_wallet.a
LIBBITCOIN_WALLET_TOOL = libbitcoin_wallet_tool.a
2016-06-01 18:22:20 +02:00
e n d i f
2018-06-11 14:41:08 +02:00
LIBBITCOIN_CRYPTO = $( LIBBITCOIN_CRYPTO_BASE)
i f E N A B L E _ S S E 4 1
2022-07-08 10:22:25 +02:00
LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.a
2018-06-11 14:41:08 +02:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_SSE41)
e n d i f
i f E N A B L E _ A V X 2
2022-07-08 10:22:25 +02:00
LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.a
2018-06-11 14:41:08 +02:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_AVX2)
e n d i f
2022-02-14 20:47:24 +01:00
i f E N A B L E _ X 8 6 _ S H A N I
2022-07-08 10:22:25 +02:00
LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.a
2022-02-14 20:47:24 +01:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_X86_SHANI)
e n d i f
i f E N A B L E _ A R M _ S H A N I
2022-07-08 10:22:25 +02:00
LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.a
2022-02-14 20:47:24 +01:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_ARM_SHANI)
2018-07-09 20:33:41 +02:00
e n d i f
2018-06-11 14:41:08 +02:00
2022-11-22 18:34:46 +01:00
$(LIBDASHBLS) :
$( AM_V_at) $( MAKE) $( AM_MAKEFLAGS) -C $( @D)
2018-07-05 19:35:32 +02:00
$(LIBSECP256K1) : $( wildcard secp 256k 1/src /*.h ) $( wildcard secp 256k 1/src /*.c ) $( wildcard secp 256k 1/include /*)
2014-11-06 02:56:45 +01:00
$( AM_V_at) $( MAKE) $( AM_MAKEFLAGS) -C $( @D) $( @F)
2014-06-19 15:10:04 +02:00
2014-10-21 08:36:09 +02:00
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
# But to build the less dependent modules first, we manually select their order here:
2016-06-05 21:30:13 +02:00
EXTRA_LIBRARIES += \
2016-06-01 18:22:20 +02:00
$( LIBBITCOIN_CRYPTO) \
$( LIBBITCOIN_UTIL) \
$( LIBBITCOIN_COMMON) \
$( LIBBITCOIN_CONSENSUS) \
$( LIBBITCOIN_SERVER) \
$( LIBBITCOIN_CLI) \
$( LIBBITCOIN_WALLET) \
2019-01-31 17:07:45 +01:00
$( LIBBITCOIN_WALLET_TOOL) \
2016-06-01 18:22:20 +02:00
$( LIBBITCOIN_ZMQ)
2013-05-28 01:55:01 +02:00
2016-06-01 18:22:20 +02:00
lib_LTLIBRARIES = $( LIBBITCOINCONSENSUS)
2022-05-02 17:31:46 +02:00
noinst_LTLIBRARIES =
2013-05-28 01:55:01 +02:00
2013-09-08 04:44:12 +02:00
bin_PROGRAMS =
2016-12-15 16:55:14 +01:00
noinst_PROGRAMS =
2014-05-28 19:38:41 +02:00
TESTS =
Simple benchmarking framework
Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)
Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.
The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.
See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'
To compile and run benchmarks:
cd src; make bench
Sample output:
Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
2015-09-24 19:13:38 +02:00
BENCHMARKS =
2013-09-08 04:44:12 +02:00
i f B U I L D _ B I T C O I N D
2015-03-19 15:15:08 +01:00
bin_PROGRAMS += dashd
2013-09-08 04:44:12 +02:00
e n d i f
2020-05-21 09:10:52 +02:00
i f B U I L D _ B I T C O I N _ N O D E
bin_PROGRAMS += dash-node
e n d i f
2018-09-27 17:12:28 +02:00
i f B U I L D _ B I T C O I N _ C L I
bin_PROGRAMS += dash-cli
e n d i f
i f B U I L D _ B I T C O I N _ T X
bin_PROGRAMS += dash-tx
2013-09-08 04:44:12 +02:00
e n d i f
2019-01-31 17:07:45 +01:00
i f E N A B L E _ W A L L E T
i f B U I L D _ B I T C O I N _ W A L L E T
bin_PROGRAMS += dash-wallet
e n d i f
e n d i f
2013-05-28 01:55:01 +02:00
2016-01-26 20:50:50 +01:00
.PHONY : FORCE check -symbols check -security
2015-03-19 15:15:08 +01:00
# dash core #
2014-01-11 15:22:07 +01:00
BITCOIN_CORE_H = \
Backport Bitcoin PR#8085: p2p: Begin encapsulation (#1537)
* net: move CBanDB and CAddrDB out of net.h/cpp
This will eventually solve a circular dependency
* net: Create CConnman to encapsulate p2p connections
* net: Move socket binding into CConnman
* net: move OpenNetworkConnection into CConnman
* net: move ban and addrman functions into CConnman
* net: Add oneshot functions to CConnman
* net: move added node functions to CConnman
* net: Add most functions needed for vNodes to CConnman
* net: handle nodesignals in CConnman
* net: Pass CConnection to wallet rather than using the global
* net: Add rpc error for missing/disabled p2p functionality
* net: Pass CConnman around as needed
* gui: add NodeID to the peer table
* net: create generic functor accessors and move vNodes to CConnman
* net: move whitelist functions into CConnman
* net: move nLastNodeId to CConnman
* net: move nLocalHostNonce to CConnman
This behavior seems to have been quite racy and broken.
Move nLocalHostNonce into CNode, and check received nonces against all
non-fully-connected nodes. If there's a match, assume we've connected
to ourself.
* net: move messageHandlerCondition to CConnman
* net: move send/recv statistics to CConnman
* net: move SendBufferSize/ReceiveFloodSize to CConnman
* net: move nLocalServices/nRelevantServices to CConnman
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 semOutbound and semMasternodeOutbound to CConnman
* net: SocketSendData returns written size
* net: move max/max-outbound to CConnman
* net: Pass best block known height into CConnman
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: pass CClientUIInterface into CConnman
* net: Drop StartNode/StopNode and use CConnman directly
* net: Introduce CConnection::Options to avoid passing so many params
* net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options
* net: move vNodesDisconnected into CConnman
* Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting
* Convert ForEachNode* functions to take a templated function argument rather than a std::function to eliminate std::function overhead
* net: move MAX_FEELER_CONNECTIONS into connman
2017-07-21 11:35:19 +02:00
addrdb.h \
2016-04-07 18:35:25 +02:00
addressindex.h \
2016-05-16 20:23:01 +02:00
spentindex.h \
2014-01-11 15:22:07 +01:00
addrman.h \
2024-06-03 16:16:57 +02:00
addrman_impl.h \
2021-03-22 18:10:27 +01:00
attributes.h \
2019-01-21 18:45:59 +01:00
banman.h \
2014-05-09 17:56:16 +02:00
base58.h \
2018-09-14 13:59:02 +02:00
batchedlogger.h \
2020-12-25 05:33:37 +01:00
bech32.h \
2024-03-05 19:38:20 +01:00
bip324.h \
Backport compact blocks functionality from bitcoin (#1966)
* Merge #8068: Compact Blocks
48efec8 Fix some minor compact block issues that came up in review (Matt Corallo)
ccd06b9 Elaborate bucket size math (Pieter Wuille)
0d4cb48 Use vTxHashes to optimize InitData significantly (Matt Corallo)
8119026 Provide a flat list of txid/terators to txn in CTxMemPool (Matt Corallo)
678ee97 Add BIP 152 to implemented BIPs list (Matt Corallo)
56ba516 Add reconstruction debug logging (Matt Corallo)
2f34a2e Get our "best three" peers to announce blocks using cmpctblocks (Matt Corallo)
927f8ee Add ability to fetch CNode by NodeId (Matt Corallo)
d25cd3e Add receiver-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
9c837d5 Add sender-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
00c4078 Add protocol messages for short-ids blocks (Matt Corallo)
e3b2222 Add some blockencodings tests (Matt Corallo)
f4f8f14 Add TestMemPoolEntryHelper::FromTx version for CTransaction (Matt Corallo)
85ad31e Add partial-block block encodings API (Matt Corallo)
5249dac Add COMPACTSIZE wrapper similar to VARINT for serialization (Matt Corallo)
cbda71c Move context-required checks from CheckBlockHeader to Contextual... (Matt Corallo)
7c29ec9 If AcceptBlockHeader returns true, pindex will be set. (Matt Corallo)
96806c3 Stop trimming when mapTx is empty (Pieter Wuille)
* Merge #8408: Prevent fingerprinting, disk-DoS with compact blocks
1d06e49 Ignore CMPCTBLOCK messages for pruned blocks (Suhas Daftuar)
1de2a46 Ignore GETBLOCKTXN requests for unknown blocks (Suhas Daftuar)
* Merge #8418: Add tests for compact blocks
45c7ddd Add p2p test for BIP 152 (compact blocks) (Suhas Daftuar)
9a22a6c Add support for compactblocks to mininode (Suhas Daftuar)
a8689fd Tests: refactor compact size serialization in mininode (Suhas Daftuar)
9c8593d Implement SipHash in Python (Pieter Wuille)
56c87e9 Allow changing BIP9 parameters on regtest (Suhas Daftuar)
* Merge #8505: Trivial: Fix typos in various files
1aacfc2 various typos (leijurv)
* Merge #8449: [Trivial] Do not shadow local variable, cleanup
a159f25 Remove redundand (and shadowing) declaration (Pavel Janík)
cce3024 Do not shadow local variable, cleanup (Pavel Janík)
* Merge #8739: [qa] Fix broken sendcmpct test in p2p-compactblocks.py
157254a Fix broken sendcmpct test in p2p-compactblocks.py (Suhas Daftuar)
* Merge #8854: [qa] Fix race condition in p2p-compactblocks test
b5fd666 [qa] Fix race condition in p2p-compactblocks test (Suhas Daftuar)
* Merge #8393: Support for compact blocks together with segwit
27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2 (Suhas Daftuar)
422fac6 [qa] Add support for compactblocks v2 to mininode (Suhas Daftuar)
f5b9b8f [qa] Fix bug in mininode witness deserialization (Suhas Daftuar)
6aa28ab Use cmpctblock type 2 for segwit-enabled transfer (Pieter Wuille)
be7555f Fix overly-prescriptive p2p-segwit test for new fetch logic (Matt Corallo)
06128da Make GetFetchFlags always request witness objects from witness peers (Matt Corallo)
* Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py
b55d941 [qa] Fix race condition in sendheaders.py (Suhas Daftuar)
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py (Suhas Daftuar)
* Merge #8904: [qa] Fix compact block shortids for a test case
4cdece4 [qa] Fix compact block shortids for a test case (Dagur Valberg Johannsson)
* Merge #8637: Compact Block Tweaks (rebase of #8235)
3ac6de0 Align constant names for maximum compact block / blocktxn depth (Pieter Wuille)
b2e93a3 Add cmpctblock to debug help list (instagibbs)
fe998e9 More agressively filter compact block requests (Matt Corallo)
02a337d Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
* Merge #8975: Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/
6f2f639 Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/ (Jorge Timón)
* Merge #8968: Don't hold cs_main when calling ProcessNewBlock from a cmpctblock
72ca7d9 Don't hold cs_main when calling ProcessNewBlock from a cmpctblock (Matt Corallo)
* Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processing
dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
* Merge #8515: A few mempool removal optimizations
0334430 Add some missing includes (Pieter Wuille)
4100499 Return shared_ptr<CTransaction> from mempool removes (Pieter Wuille)
51f2783 Make removed and conflicted arguments optional to remove (Pieter Wuille)
f48211b Bypass removeRecursive in removeForReorg (Pieter Wuille)
* Merge #9026: Fix handling of invalid compact blocks
d4833ff Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
88c3549 Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
c93beac [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
* Merge #9039: Various serialization simplifcations and optimizations
d59a518 Use fixed preallocation instead of costly GetSerializeSize (Pieter Wuille)
25a211a Add optimized CSizeComputer serializers (Pieter Wuille)
a2929a2 Make CSerAction's ForRead() constexpr (Pieter Wuille)
a603925 Avoid -Wshadow errors (Pieter Wuille)
5284721 Get rid of nType and nVersion (Pieter Wuille)
657e05a Make GetSerializeSize a wrapper on top of CSizeComputer (Pieter Wuille)
fad9b66 Make nType and nVersion private and sometimes const (Pieter Wuille)
c2c5d42 Make streams' read and write return void (Pieter Wuille)
50e8a9c Remove unused ReadVersion and WriteVersion (Pieter Wuille)
* Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842)
dac53b5 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
55bfddc [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
47e9659 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
* Merge #9160: [trivial] Fix hungarian variable name
ec34648 [trivial] Fix hungarian variable name (Russell Yanofsky)
* Merge #9159: [qa] Wait for specific block announcement in p2p-compactblocks
dfa44d1 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
* Merge #9125: Make CBlock a vector of shared_ptr of CTransactions
b4e4ba4 Introduce convenience type CTransactionRef (Pieter Wuille)
1662b43 Make CBlock::vtx a vector of shared_ptr<CTransaction> (Pieter Wuille)
da60506 Add deserializing constructors to CTransaction and CMutableTransaction (Pieter Wuille)
0e85204 Add serialization for unique_ptr and shared_ptr (Pieter Wuille)
* Merge #8872: Remove block-request logic from INV message processing
037159c Remove block-request logic from INV message processing (Matt Corallo)
3451203 [qa] Respond to getheaders and do not assume a getdata on inv (Matt Corallo)
d768f15 [qa] Make comptool push blocks instead of relying on inv-fetch (mrbandrews)
* Merge #9199: Always drop the least preferred HB peer when adding a new one.
ca8549d Always drop the least preferred HB peer when adding a new one. (Gregory Maxwell)
* Merge #9233: Fix some typos
15fa95d Fix some typos (fsb4000)
* Merge #9260: Mrs Peacock in The Library with The Candlestick (killed main.{h,cpp})
76faa3c Rename the remaining main.{h,cpp} to validation.{h,cpp} (Matt Corallo)
e736772 Move network-msg-processing code out of main to its own file (Matt Corallo)
87c35f5 Remove orphan state wipe from UnloadBlockIndex. (Matt Corallo)
* Merge #9014: Fix block-connection performance regression
dd0df81 Document ConnectBlock connectTrace postconditions (Matt Corallo)
2d6e561 Switch pblock in ProcessNewBlock to a shared_ptr (Matt Corallo)
2736c44 Make the optional pblock in ActivateBestChain a shared_ptr (Matt Corallo)
ae4db44 Create a shared_ptr for the block we're connecting in ActivateBCS (Matt Corallo)
fd9d890 Keep blocks as shared_ptrs, instead of copying txn in ConnectTip (Matt Corallo)
6fdd43b Add struct to track block-connect-time-generated info for callbacks (Matt Corallo)
* Merge #9240: Remove txConflicted
a874ab5 remove internal tracking of mempool conflicts for reporting to wallet (Alex Morcos)
bf663f8 remove external usage of mempool conflict tracking (Alex Morcos)
* Merge #9344: Do not run functions with necessary side-effects in assert()
da9cdd2 Do not run functions with necessary side-effects in assert() (Gregory Maxwell)
* Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlock
a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
* Merge #9352: Attempt reconstruction from all compact block announcements
813ede9 [qa] Update compactblocks test for multi-peer reconstruction (Suhas Daftuar)
7017298 Allow compactblock reconstruction when block is in flight (Suhas Daftuar)
* Merge #9252: Release cs_main before calling ProcessNewBlock, or processing headers (cmpctblock handling)
bd02bdd Release cs_main before processing cmpctblock as header (Suhas Daftuar)
680b0c0 Release cs_main before calling ProcessNewBlock (cmpctblock handling) (Suhas Daftuar)
* Merge #9283: A few more CTransactionRef optimizations
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)
* Merge #9375: Relay compact block messages prior to full block connection
02ee4eb Make most_recent_compact_block a pointer to a const (Matt Corallo)
73666ad Add comment to describe callers to ActivateBestChain (Matt Corallo)
962f7f0 Call ActivateBestChain without cs_main/with most_recent_block (Matt Corallo)
0df777d Use a temp pindex to avoid a const_cast in ProcessNewBlockHeaders (Matt Corallo)
c1ae4fc Avoid holding cs_most_recent_block while calling ReadBlockFromDisk (Matt Corallo)
9eb67f5 Ensure we meet the BIP 152 old-relay-types response requirements (Matt Corallo)
5749a85 Cache most-recently-connected compact block (Matt Corallo)
9eaec08 Cache most-recently-announced block's shared_ptr (Matt Corallo)
c802092 Relay compact block messages prior to full block connection (Matt Corallo)
6987219 Add a CValidationInterface::NewPoWValidBlock callback (Matt Corallo)
180586f Call AcceptBlock with the block's shared_ptr instead of CBlock& (Matt Corallo)
8baaba6 [qa] Avoid race in preciousblock test. (Matt Corallo)
9a0b2f4 [qa] Make compact blocks test construction using fetch methods (Matt Corallo)
8017547 Make CBlockIndex*es in net_processing const (Matt Corallo)
* Merge #9486: Make peer=%d log prints consistent
e6111b2 Make peer id logging consistent ("peer=%d" instead of "peer %d") (Matt Corallo)
* Merge #9400: Set peers as HB peers upon full block validation
d4781ac Set peers as HB peers upon full block validation (Gregory Sanders)
* Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for compact-block-reconstruction
c594580 Add braces around AddToCompactExtraTransactions (Matt Corallo)
1ccfe9b Clarify comment about mempool/extra conflicts (Matt Corallo)
fac4c78 Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo)
b55b416 Add extra_count lower bound to compact reconstruction debug print (Matt Corallo)
863edb4 Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo)
7f8c8ca Consider all orphan txn for compact-block-extra-txn cache (Matt Corallo)
93380c5 Use replaced transactions in compact block reconstruction (Matt Corallo)
1531652 Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo)
edded80 Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo)
c735540 Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
* Merge #9587: Do not shadow local variable named `tx`.
44f2baa Do not shadow local variable named `tx`. (Pavel Janík)
* Merge #9510: [trivial] Fix typos in comments
cc16d99 [trivial] Fix typos in comments (practicalswift)
* Merge #9604: [Trivial] add comment about setting peer as HB peer.
dd5b011 [Trivial] add comment about setting peer as HB peer. (John Newbery)
* Fix using of AcceptToMemoryPool in PrivateSend code
* add `override`
* fSupportsDesiredCmpctVersion
* bring back tx ressurection in DisconnectTip
* Fix delayed headers
* Remove unused CConnman::FindNode overload
* Fix typos and comments
* Fix minor code differences
* Don't use rejection cache for corrupted transactions
Partly based on https://github.com/bitcoin/bitcoin/pull/8525
* Backport missed cs_main locking changes
Missed from https://github.com/bitcoin/bitcoin/commit/58a215ce8c13b900cf982c39f8ee4879290d1a95
* Backport missed comments and mapBlockSource.emplace call
Missed from two commits:
https://github.com/bitcoin/bitcoin/commit/88c35491ab19f9afdf9b3fa9356a072f70ef2f55
https://github.com/bitcoin/bitcoin/commit/7c98ce584ec23bcddcba8cdb33efa6547212f6ef
* Add CheckPeerHeaders() helper and check in (nCount == 0) too
2018-04-11 13:06:01 +02:00
blockencodings.h \
2014-01-11 15:22:07 +01:00
bloom.h \
2016-11-13 18:52:34 +01:00
cachemap.h \
cachemultimap.h \
2018-08-26 16:57:01 +02:00
blockfilter.h \
2020-07-01 15:18:55 +02:00
bloom.h \
2014-09-03 02:20:09 +02:00
chain.h \
2014-01-11 15:22:07 +01:00
chainparams.h \
2014-06-19 15:10:04 +02:00
chainparamsbase.h \
2014-07-24 13:52:57 +02:00
chainparamsseeds.h \
2014-01-11 15:22:07 +01:00
checkqueue.h \
clientversion.h \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin.h \
2021-10-01 21:19:08 +02:00
coinjoin/client.h \
2023-12-12 18:02:55 +01:00
coinjoin/common.h \
refactor: subsume CoinJoin objects under CJContext, deglobalize coinJoin{ClientQueueManager,Server} (#5337)
## Motivation
CoinJoin's subsystems are initialized by variables and managers that
occupy the global context. The _extent_ to which these subsystems
entrench themselves into the codebase is difficult to assess and moving
them out of the global context forces us to enumerate the subsystems in
the codebase that rely on CoinJoin logic and enumerate the order in
which components are initialized and destroyed.
Keeping this in mind, the scope of this pull request aims to:
* Reduce the amount of CoinJoin-specific entities present in the global
scope
* Make the remaining usage of these entities in the global scope
explicit and easily searchable
## Additional Information
* The initialization of `CCoinJoinClientQueueManager` is dependent on
blocks-only mode being disabled (which can be alternatively interpreted
as enabling the relay of transactions). The same applies to
`CBlockPolicyEstimator`, which `CCoinJoinClientQueueManager` depends.
Therefore, `CCoinJoinClientQueueManager` is only initialized if
transaction relaying is enabled and so is its scheduled maintenance
task. This can be found by looking at `init.cpp`
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L1681-L1683),
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L2253-L2255)
and
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L2326-L2327).
For this reason, `CBlockPolicyEstimator` is not a member of `CJContext`
and its usage is fulfilled by passing it as a reference when
initializing the scheduling task.
* `CJClientManager` has not used `CConnman` or `CTxMemPool` as `const`
as existing code that is outside the scope of this PR would cast away
constness, which would be unacceptable. Furthermore, some logical paths
are taken that will grind to a halt if they are stored as `const`.
Examples of such a call chains would be:
* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoinClientSession::DoAutomaticDenominating >
CCoinJoinClientSession::StartNewQueue > CConnman::AddPendingMasternode`
which modifies `CConnman::vPendingMasternodes`, which is non-const
behaviour
* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoin::IsCollateralValid > AcceptToMemoryPool` which adds a
transaction to the memory pool, which is non-const behaviour
* There were cppcheck [linter
failures](https://github.com/dashpay/dash/pull/5337#issuecomment-1685084688)
that seemed to be caused by the usage of `Assert` in
`coinjoin/client.h`. This seems to be resolved by backporting
[bitcoin#24714](https://github.com/bitcoin/bitcoin/pull/24714). (Thanks
@knst!)
* Depends on #5546
---------
Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-09-13 19:52:38 +02:00
coinjoin/context.h \
2021-10-01 21:19:08 +02:00
coinjoin/options.h \
coinjoin/server.h \
coinjoin/util.h \
2014-01-11 15:22:07 +01:00
coins.h \
compat.h \
2019-02-15 15:57:07 +01:00
compat/assumptions.h \
2015-05-13 18:59:50 +02:00
compat/byteswap.h \
2022-04-25 11:59:51 +02:00
compat/cpuid.h \
2015-05-13 18:59:50 +02:00
compat/endian.h \
2014-10-19 04:28:43 +02:00
compressor.h \
2022-10-22 19:18:03 +02:00
context.h \
2015-01-24 15:29:29 +01:00
consensus/consensus.h \
2021-11-16 16:19:47 +01:00
consensus/tx_check.h \
2019-07-23 11:20:23 +02:00
consensus/tx_verify.h \
2014-06-24 05:10:24 +02:00
core_io.h \
2016-04-09 21:57:53 +02:00
core_memusage.h \
2016-12-21 09:26:29 +01:00
cuckoocache.h \
2021-07-12 05:25:27 +02:00
ctpl_stl.h \
2018-05-24 13:50:57 +02:00
cxxtimer.hpp \
2020-07-01 15:18:55 +02:00
dbwrapper.h \
2021-07-01 19:15:03 +02:00
deploymentinfo.h \
deploymentstatus.h \
2023-07-24 18:39:38 +02:00
evo/assetlocktx.h \
2023-02-14 19:48:33 +01:00
evo/dmn_types.h \
2019-03-22 11:52:37 +01:00
evo/cbtx.h \
2024-03-14 04:29:04 +01:00
evo/chainhelper.h \
2023-07-24 18:39:38 +02:00
evo/creditpool.h \
2019-03-22 11:52:37 +01:00
evo/deterministicmns.h \
2022-02-26 19:50:35 +01:00
evo/dmnstate.h \
2018-05-24 14:28:23 +02:00
evo/evodb.h \
2019-03-22 11:52:37 +01:00
evo/mnauth.h \
2021-12-11 21:00:27 +01:00
evo/mnhftx.h \
2018-02-13 13:36:36 +01:00
evo/providertx.h \
2018-04-09 10:35:43 +02:00
evo/simplifiedmns.h \
2019-03-22 11:52:37 +01:00
evo/specialtx.h \
2022-01-24 15:20:50 +01:00
evo/specialtxman.h \
2016-03-02 22:20:04 +01:00
dsnotificationinterface.h \
2019-05-21 15:26:15 +02:00
governance/governance.h \
2021-10-01 21:19:08 +02:00
governance/classes.h \
2023-12-01 10:59:14 +01:00
governance/common.h \
2021-10-01 21:19:08 +02:00
governance/exceptions.h \
governance/object.h \
governance/validators.h \
governance/vote.h \
governance/votedb.h \
2023-10-22 16:14:30 +02:00
gsl/assert.h \
gsl/pointers.h \
2016-04-10 08:31:32 +02:00
flat-database.h \
2021-08-12 09:02:29 +02:00
flatfile.h \
2017-04-06 20:19:21 +02:00
fs.h \
evhttpd implementation
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with #4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.
- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.
- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral
- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.
- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.
By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided.
What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.
Configuration options:
- `-rpcthreads`: repurposed as "number of work handler threads". Still
defaults to 4.
- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.
- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.
- `-debug=http`: low-level http activity logging
2015-01-23 07:53:17 +01:00
httprpc.h \
httpserver.h \
2020-11-18 17:13:27 +01:00
i2p.h \
2018-06-07 17:59:30 +02:00
index/base.h \
2021-08-12 09:04:28 +02:00
index/blockfilterindex.h \
2023-07-30 13:49:32 +02:00
index/coinstatsindex.h \
2020-08-17 12:47:05 +02:00
index/disktxpos.h \
2021-05-25 12:48:04 +02:00
index/txindex.h \
2016-06-03 01:11:02 +02:00
indirectmap.h \
2014-01-11 15:22:07 +01:00
init.h \
2024-07-20 20:07:14 +02:00
init/common.h \
2018-11-09 15:36:34 +01:00
interfaces/chain.h \
2024-01-01 11:13:25 +01:00
interfaces/coinjoin.h \
2020-10-01 16:05:57 +02:00
interfaces/handler.h \
interfaces/node.h \
interfaces/wallet.h \
2014-01-11 15:22:07 +01:00
key.h \
Merge #11372: Address encoding cleanup
92f1f8b31 Split off key_io_tests from base58_tests (Pieter Wuille)
119b0f85e Split key_io (address/key encodings) off from base58 (Pieter Wuille)
ebfe217b1 Stop using CBase58Data for ext keys (Pieter Wuille)
32e69fa0d Replace CBitcoinSecret with {Encode,Decode}Secret (Pieter Wuille)
Pull request description:
This PR contains some of the changes left as TODO in #11167 (and built on top of that PR). They are not intended for backporting.
This removes the `CBase58`, `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey` classes, in favor of simple `Encode`/`Decode` functions. Furthermore, all Bitcoin-specific logic (addresses, WIF, BIP32) is moved to `key_io.{h,cpp}`, leaving `base58.{h,cpp}` as a pure utility that implements the base58 encoding/decoding logic.
Tree-SHA512: a5962c0ed27ad53cbe00f22af432cf11aa530e3efc9798e25c004bc9ed1b5673db5df3956e398ee2c085e3a136ac8da69fe7a7d97a05fb2eb3be0b60d0479655
Make linter happy
Dashify
2018-03-07 00:04:56 +01:00
key_io.h \
2014-01-11 15:22:07 +01:00
limitedmap.h \
2021-10-02 19:32:24 +02:00
llmq/blockprocessor.h \
llmq/chainlocks.h \
2022-02-26 19:50:35 +01:00
llmq/clsig.h \
2023-10-18 05:31:40 +02:00
llmq/commitment.h \
llmq/context.h \
2021-10-02 19:32:24 +02:00
llmq/debug.h \
2023-10-18 05:31:40 +02:00
llmq/dkgsession.h \
2021-10-02 19:32:24 +02:00
llmq/dkgsessionhandler.h \
llmq/dkgsessionmgr.h \
2023-10-18 05:31:40 +02:00
llmq/ehf_signals.cpp \
llmq/ehf_signals.h \
2021-10-02 19:32:24 +02:00
llmq/instantsend.h \
2024-01-18 02:56:41 +01:00
llmq/options.h \
2023-10-18 05:31:40 +02:00
llmq/params.h \
llmq/quorums.h \
2021-10-02 19:32:24 +02:00
llmq/signing.h \
llmq/signing_shares.h \
2023-10-18 05:31:40 +02:00
llmq/snapshot.h \
2021-10-02 19:32:24 +02:00
llmq/utils.h \
2018-04-20 07:02:12 +02:00
logging.h \
2019-09-19 19:59:49 +02:00
logging/timer.h \
2022-02-26 13:19:13 +01:00
mapport.h \
2021-10-01 21:19:08 +02:00
masternode/node.h \
masternode/meta.h \
masternode/payments.h \
masternode/sync.h \
masternode/utils.h \
2015-05-04 00:20:46 +02:00
memusage.h \
2014-10-30 23:50:15 +01:00
merkleblock.h \
2017-04-12 09:04:06 +02:00
messagesigner.h \
2014-01-11 15:22:07 +01:00
miner.h \
net.h \
Merge #16248: Make whitebind/whitelist permissions more flexible
c5b404e8f1973afe071a07c63ba1038eefe13f0f Add functional tests for flexible whitebind/list (nicolas.dorier)
d541fa391844f658bd7035659b5b16695733dd56 Replace the use of fWhitelisted by permission checks (nicolas.dorier)
ecd5cf7ea4c3644a30092100ffc399e30e193275 Do not disconnect peer for asking mempool if it has NO_BAN permission (nicolas.dorier)
e5b26deaaa6842f7dd7c4537ede000f965ea0189 Make whitebind/whitelist permissions more flexible (nicolas.dorier)
Pull request description:
# Motivation
In 0.19, bloom filter will be disabled by default. I tried to make [a PR](https://github.com/bitcoin/bitcoin/pull/16176) to enable bloom filter for whitelisted peers regardless of `-peerbloomfilters`.
Bloom filter have non existent privacy and server can omit filter's matches. However, both problems are completely irrelevant when you connect to your own node. If you connect to your own node, bloom filters are the most bandwidth efficient way to synchronize your light client without the need of some middleware like Electrum.
It is also a superior alternative to BIP157 as it does not require to maintain an additional index and it would work well on pruned nodes.
When I attempted to allow bloom filters for whitelisted peer, my proposal has been NACKed in favor of [a more flexible approach](https://github.com/bitcoin/bitcoin/pull/16176#issuecomment-500762907) which should allow node operator to set fine grained permissions instead of a global `whitelisted` attribute.
Doing so will also make follow up idea very easy to implement in a backward compatible way.
# Implementation details
The PR propose a new format for `--white{list,bind}`. I added a way to specify permissions granted to inbound connection matching `white{list,bind}`.
The following permissions exists:
* ForceRelay
* Relay
* NoBan
* BloomFilter
* Mempool
Example:
* `-whitelist=bloomfilter@127.0.0.1/32`.
* `-whitebind=bloomfilter,relay,noban@127.0.0.1:10020`.
If no permissions are specified, `NoBan | Mempool` is assumed. (making this PR backward compatible)
When we receive an inbound connection, we calculate the effective permissions for this peer by fetching the permissions granted from `whitelist` and add to it the permissions granted from `whitebind`.
To keep backward compatibility, if no permissions are specified in `white{list,bind}` (e.g. `--whitelist=127.0.0.1`) then parameters `-whitelistforcerelay` and `-whiterelay` will add the permissions `ForceRelay` and `Relay` to the inbound node.
`-whitelistforcerelay` and `-whiterelay` are ignored if the permissions flags are explicitly set in `white{bind,list}`.
# Follow up idea
Based on this PR, other changes become quite easy to code in a trivially review-able, backward compatible way:
* Changing `connect` at rpc and config file level to understand the permissions flags.
* Changing the permissions of a peer at RPC level.
ACKs for top commit:
laanwj:
re-ACK c5b404e8f1973afe071a07c63ba1038eefe13f0f
Tree-SHA512: adfefb373d09e68cae401247c8fc64034e305694cdef104bdcdacb9f1704277bd53b18f52a2427a5cffdbc77bda410d221aed252bc2ece698ffbb9cf1b830577
2019-08-14 16:35:54 +02:00
net_permissions.h \
2017-08-09 02:19:06 +02:00
net_processing.h \
2019-11-04 13:18:19 +01:00
net_types.h \
2017-09-03 15:29:10 +02:00
netaddress.h \
2015-05-13 18:59:50 +02:00
netbase.h \
2016-09-27 09:50:04 +02:00
netfulfilledman.h \
2016-11-25 20:01:56 +01:00
netmessagemaker.h \
2023-07-24 20:42:13 +02:00
node/blockstorage.h \
2021-11-01 12:24:34 +01:00
node/coin.h \
2020-12-15 17:22:23 +01:00
node/coinstats.h \
2022-04-05 11:09:41 +02:00
node/context.h \
2023-12-12 17:40:10 +01:00
node/psbt.h \
2019-01-09 07:16:50 +01:00
node/transaction.h \
2020-07-01 15:18:55 +02:00
node/ui_interface.h \
2022-05-21 12:08:48 +02:00
node/utxo_snapshot.h \
2014-01-11 15:22:07 +01:00
noui.h \
Merge #17261: Make ScriptPubKeyMan an actual interface and the wallet to have multiple
3f373659d732a5b1e5fdc692a45b2b8179f66bec Refactor: Replace SigningProvider pointers with unique_ptrs (Andrew Chow)
3afe53c4039103670cec5f9cace897ead76e20a8 Cleanup: Drop unused GUI learnRelatedScripts method (Andrew Chow)
e2f02aa59e3402048269362ff692d49a6df35cfd Refactor: Copy CWallet signals and print function to LegacyScriptPubKeyMan (Andrew Chow)
c729afd0a3b74a3943e4c359270beaf3e6ff8a7b Box the wallet: Add multiple keyman maps and loops (Andrew Chow)
4977c30d59e88a3e5ee248144bcc023debcd895b refactor: define a UINT256_ONE global constant (Andrew Chow)
415afcccd3e5583defdb76e3a280f48e98983301 HD Split: Avoid redundant upgrades (Andrew Chow)
01b4511206e399981a77976deb15785d18db46ae Make UpgradeKeyMetadata work only on LegacyScriptPubKeyMan (Andrew Chow)
4a7e43e8460127a40a7895519587399feff3b682 Store p2sh scripts in AddAndGetDestinationForScript (Andrew Chow)
501acb5538008d98abe79288b92040bc186b93f3 Always try to sign for all pubkeys in multisig (Andrew Chow)
81610eddbc57c46ae243f45d73e715d509f53a6c List output types in an array in order to be iterated over (Andrew Chow)
eb81fc3ee58d3e88af36d8091b9e4017a8603b3c Refactor: Allow LegacyScriptPubKeyMan to be null (Andrew Chow)
fadc08ad944cad42e805228cdd58e0332f4d7184 Locking: Lock cs_KeyStore instead of cs_wallet in legacy keyman (Andrew Chow)
f5be479694d4dbaf59eef562d80fbeacb3bb7dc1 wallet: Improve CWallet:MarkDestinationsDirty (João Barbosa)
Pull request description:
Continuation of wallet boxes project.
Actually makes ScriptPubKeyMan an interface which LegacyScriptPubkeyMan. Moves around functions and things from CWallet into LegacyScriptPubKeyMan so that they are actually separate things without circular dependencies.
***
Introducing the `ScriptPubKeyMan` (short for ScriptPubKeyManager) for managing scriptPubKeys and their associated scripts and keys. This functionality is moved over from `CWallet`. Instead, `CWallet` will have a pointer to a `ScriptPubKeyMan` for every possible address type, internal and external. It will fetch the correct `ScriptPubKeyMan` as necessary. When fetching new addresses, it chooses the `ScriptPubKeyMan` based on address type and whether it is change. For signing, it takes the script and asks each `ScriptPubKeyMan` for whether that `ScriptPubKeyMan` considers that script `IsMine`, whether it has that script, or whether it is able to produce a signature for it. If so, the `ScriptPubKeyMan` will provide a `SigningProvider` to the caller which will use that in order to sign.
There is currently one `ScriptPubKeyMan` - the `LegacyScriptPubKeyMan`. Each `CWallet` will have only one `LegacyScriptPubKeyMan` with the pointers for all of the address types and change pointing to this `LegacyScriptPubKeyMan`. It is created when the wallet is loaded and all keys and metadata are loaded into it instead of `CWallet`. The `LegacyScriptPubKeyMan` is primarily made up of all of the key and script management that used to be in `CWallet`. For convenience, `CWallet` has a `GetLegacyScriptPubKeyMan` which will return the `LegacyScriptPubKeyMan` or a `nullptr` if it does not have one (not yet implemented, but callers will check for the `nullptr`). For purposes of signing, `LegacyScriptPubKeyMan`'s `GetSigningProvider` will return itself rather than a separate `SigningProvider`. This will be different for future `ScriptPubKeyMan`s.
The `LegacyScriptPubKeyMan` will also handle the importing and exporting of keys and scripts instead of `CWallet`. As such, a number of RPCs have been limited to work only if a `LegacyScriptPubKeyMan` can be retrieved from the wallet. These RPCs are `sethdseed`, `addmultisigaddress`, `importaddress`, `importprivkey`, `importpubkey`, `importmulti`, `dumpprivkey`, and `dumpwallet`. Other RPCs which relied on the wallet for scripts and keys have been modified in order to take the `SigningProvider` retrieved from the `ScriptPubKeyMan` for a given script.
Overall, these changes should not effect how everything actually works and the user should experience no difference between having this change and not having it. As such, no functional tests were changed, and the only unit tests changed were those that were directly accessing `CWallet` functions that have been removed.
This PR is the last step in the [Wallet Structure Changes](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes).
ACKs for top commit:
instagibbs:
re-utACK https://github.com/bitcoin/bitcoin/pull/17261/commits/3f373659d732a5b1e5fdc692a45b2b8179f66bec
Sjors:
re-utACK 3f373659d732a5b1e5fdc692a45b2b8179f66bec (it still compiles on macOS after https://github.com/bitcoin/bitcoin/pull/17261#discussion_r370377070)
meshcollider:
Tested re-ACK 3f373659d732a5b1e5fdc692a45b2b8179f66bec
Tree-SHA512: f8e2b8d9efa750b617691e8702d217ec4c33569ec2554a060141d9eb9b9a3a5323e4216938e2485c44625d7a6e0925d40dea1362b3af9857cf08860c2f344716
2019-10-07 20:11:34 +02:00
outputtype.h \
2017-05-09 09:11:09 +02:00
policy/feerate.h \
2014-08-26 22:28:32 +02:00
policy/fees.h \
2024-01-29 16:01:14 +01:00
policy/packages.h \
2015-06-24 07:25:30 +02:00
policy/policy.h \
2021-11-16 16:19:47 +01:00
policy/settings.h \
2014-03-10 16:46:53 +01:00
pow.h \
2014-01-11 15:22:07 +01:00
protocol.h \
2019-01-30 06:32:38 +01:00
psbt.h \
2014-06-26 14:41:53 +02:00
random.h \
2022-04-25 11:59:51 +02:00
randomenv.h \
2017-04-13 00:24:40 +02:00
reverse_iterator.h \
2017-03-31 12:57:22 +02:00
rpc/blockchain.h \
2017-07-03 15:13:34 +02:00
rpc/client.h \
2024-06-26 20:19:26 +02:00
rpc/index_util.h \
2023-04-16 21:53:03 +02:00
rpc/mining.h \
2017-07-03 15:13:34 +02:00
rpc/protocol.h \
2021-11-16 16:19:47 +01:00
rpc/rawtransaction_util.h \
2016-03-31 10:55:06 +02:00
rpc/register.h \
2022-02-27 08:46:53 +01:00
rpc/request.h \
rpc/server.h \
2024-06-26 12:56:02 +02:00
rpc/server_util.h \
2020-05-15 11:34:41 +02:00
rpc/util.h \
2019-02-26 14:13:19 +01:00
saltedhasher.h \
2015-04-02 16:33:45 +02:00
scheduler.h \
2021-07-20 17:59:35 +02:00
script/descriptor.h \
2022-07-13 05:46:31 +02:00
script/keyorigin.h \
2014-09-10 16:16:09 +02:00
script/sigcache.h \
2014-08-27 17:22:33 +02:00
script/sign.h \
2022-07-13 05:46:31 +02:00
script/signingprovider.h \
2014-08-23 03:35:51 +02:00
script/standard.h \
2021-06-21 00:49:59 +02:00
shutdown.h \
2023-10-22 16:14:30 +02:00
source_location.h \
2015-02-09 20:28:29 +01:00
spork.h \
2019-02-21 19:37:16 +01:00
stacktraces.h \
2014-10-22 21:08:30 +02:00
streams.h \
2020-12-15 17:22:23 +01:00
statsd_client.h \
2018-10-26 07:04:22 +02:00
support/allocators/mt_pooled_secure.h \
support/allocators/pooled_secure.h \
2015-01-22 21:02:44 +01:00
support/allocators/secure.h \
support/allocators/zeroafterfree.h \
2015-01-21 01:23:25 +01:00
support/cleanse.h \
2017-01-05 11:10:40 +01:00
support/events.h \
2016-11-02 11:16:19 +01:00
support/lockedpool.h \
2014-01-11 15:22:07 +01:00
sync.h \
2023-09-14 18:54:58 +02:00
timestampindex.h \
2017-08-09 18:06:31 +02:00
threadinterrupt.h \
2020-07-01 15:18:55 +02:00
threadsafety.h \
2014-06-19 15:08:37 +02:00
timedata.h \
2015-08-25 20:12:08 +02:00
torcontrol.h \
2014-01-11 15:22:07 +01:00
txdb.h \
txmempool.h \
2014-10-18 19:53:37 +02:00
undo.h \
2019-03-11 06:33:46 +01:00
unordered_lru_cache.h \
2019-02-15 00:10:52 +01:00
util/bip32.h \
2021-06-26 12:37:06 +02:00
util/bytevectorhash.h \
2022-02-27 09:05:32 +01:00
util/check.h \
2024-05-14 19:22:42 +02:00
util/edge.h \
2022-10-23 23:00:17 +02:00
util/enumerate.h \
2021-02-24 09:07:10 +01:00
util/epochguard.h \
2021-06-25 08:07:28 +02:00
util/error.h \
2023-12-17 08:32:55 +01:00
util/expected.h \
2022-01-06 17:27:06 +01:00
util/fastrange.h \
2021-06-25 08:07:28 +02:00
util/fees.h \
2022-06-14 08:30:28 +02:00
util/golombrice.h \
2023-08-23 20:55:19 +02:00
util/hasher.h \
2023-04-26 08:28:10 +02:00
util/hash_type.h \
2022-04-26 01:40:41 +02:00
util/irange.h \
2021-06-27 08:33:13 +02:00
util/asmap.h \
2021-02-01 13:35:28 +01:00
util/getuniquepath.h \
2019-09-25 16:55:52 +02:00
util/macros.h \
2022-09-18 22:49:22 +02:00
util/message.h \
2021-06-27 08:33:13 +02:00
util/moneystr.h \
2023-08-24 12:00:16 +02:00
util/overflow.h \
2021-12-21 13:05:29 +01:00
util/ranges.h \
2020-11-18 17:13:27 +01:00
util/readwritefile.h \
2023-02-20 11:12:12 +01:00
util/underlying.h \
2021-06-16 10:43:28 +02:00
util/serfloat.h \
2022-04-14 20:22:46 +02:00
util/settings.h \
2023-08-01 11:01:41 +02:00
util/ranges_set.h \
2022-10-26 13:25:11 +02:00
util/sock.h \
2021-06-27 08:33:13 +02:00
util/string.h \
2020-07-01 15:18:55 +02:00
util/spanparsing.h \
util/system.h \
2021-06-27 08:33:13 +02:00
util/time.h \
2023-08-26 11:50:37 +02:00
util/thread.h \
2021-06-27 08:33:13 +02:00
util/threadnames.h \
2021-03-11 15:23:24 +01:00
util/tokenpipe.h \
2020-09-05 16:36:47 +02:00
util/trace.h \
2022-03-24 05:13:51 +01:00
util/translation.h \
2021-09-09 15:55:03 +02:00
util/types.h \
2020-07-01 15:18:55 +02:00
util/ui_change_type.h \
2021-06-25 08:07:28 +02:00
util/url.h \
2019-10-18 15:56:43 +02:00
util/vector.h \
2024-05-10 20:19:03 +02:00
util/wpipe.h \
2017-08-09 02:19:06 +02:00
validation.h \
2015-02-05 01:11:44 +01:00
validationinterface.h \
2016-02-15 05:13:27 +01:00
versionbits.h \
2022-03-03 19:37:45 +01:00
wallet/bdb.h \
2024-01-31 19:17:56 +01:00
wallet/bip39.h \
wallet/bip39_english.h \
2016-10-21 15:30:14 +02:00
wallet/coincontrol.h \
2020-07-01 15:18:55 +02:00
wallet/coinselection.h \
2020-05-28 08:13:19 +02:00
wallet/context.h \
2015-03-22 20:18:55 +01:00
wallet/crypter.h \
2015-05-13 18:59:50 +02:00
wallet/db.h \
2020-12-17 15:18:13 +01:00
wallet/dump.h \
2017-08-02 13:19:28 +02:00
wallet/fees.h \
2024-01-31 18:17:05 +01:00
wallet/hdchain.h \
2022-04-04 00:26:52 +02:00
wallet/ismine.h \
2021-11-16 16:19:47 +01:00
wallet/load.h \
2016-01-20 15:15:29 +01:00
wallet/rpcwallet.h \
2022-03-06 08:00:20 +01:00
wallet/salvage.h \
2022-08-08 18:05:21 +02:00
wallet/scriptpubkeyman.h \
2023-02-04 19:26:20 +01:00
wallet/sqlite.h \
2015-02-03 21:09:47 +01:00
wallet/wallet.h \
2014-11-18 18:06:32 +01:00
wallet/walletdb.h \
2019-01-31 17:07:45 +01:00
wallet/wallettool.h \
2017-11-18 14:32:50 +01:00
wallet/walletutil.h \
2020-07-01 15:18:55 +02:00
walletinitinterface.h \
2016-12-19 12:38:35 +01:00
warnings.h \
2014-11-18 18:06:32 +01:00
zmq/zmqabstractnotifier.h \
zmq/zmqnotificationinterface.h \
2018-07-09 17:05:14 +02:00
zmq/zmqpublishnotifier.h \
2020-09-01 09:40:13 +02:00
zmq/zmqrpc.h \
zmq/zmqutil.h
2014-11-18 18:06:32 +01:00
2013-05-28 01:55:01 +02:00
obj/build.h : FORCE
2014-06-05 20:22:54 +02:00
@$( MKDIR_P) $( builddir) /obj
2017-03-25 12:15:01 +01:00
@$( top_srcdir) /share/genbuild.sh " $( abs_top_builddir) /src/obj/build.h " \
" $( abs_top_srcdir) "
2022-07-08 10:22:25 +02:00
libbitcoin_util_a-clientversion.$(OBJEXT) : obj /build .h
2013-05-28 01:55:01 +02:00
2015-04-03 00:51:08 +02:00
# server: shared between dashd and dash-qt
2021-11-16 16:19:47 +01:00
# Contains code accessing mempool and chain state that is meant to be separated
# from wallet and gui code (see node/README.md). Shared code should go in
2022-07-08 10:22:25 +02:00
# libbitcoin_common or libbitcoin_util libraries, instead.
libbitcoin_server_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( MINIUPNPC_CPPFLAGS) $( NATPMP_CPPFLAGS) $( EVENT_CFLAGS) $( EVENT_PTHREADS_CFLAGS)
libbitcoin_server_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_server_a_SOURCES = \
Backport Bitcoin PR#8085: p2p: Begin encapsulation (#1537)
* net: move CBanDB and CAddrDB out of net.h/cpp
This will eventually solve a circular dependency
* net: Create CConnman to encapsulate p2p connections
* net: Move socket binding into CConnman
* net: move OpenNetworkConnection into CConnman
* net: move ban and addrman functions into CConnman
* net: Add oneshot functions to CConnman
* net: move added node functions to CConnman
* net: Add most functions needed for vNodes to CConnman
* net: handle nodesignals in CConnman
* net: Pass CConnection to wallet rather than using the global
* net: Add rpc error for missing/disabled p2p functionality
* net: Pass CConnman around as needed
* gui: add NodeID to the peer table
* net: create generic functor accessors and move vNodes to CConnman
* net: move whitelist functions into CConnman
* net: move nLastNodeId to CConnman
* net: move nLocalHostNonce to CConnman
This behavior seems to have been quite racy and broken.
Move nLocalHostNonce into CNode, and check received nonces against all
non-fully-connected nodes. If there's a match, assume we've connected
to ourself.
* net: move messageHandlerCondition to CConnman
* net: move send/recv statistics to CConnman
* net: move SendBufferSize/ReceiveFloodSize to CConnman
* net: move nLocalServices/nRelevantServices to CConnman
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 semOutbound and semMasternodeOutbound to CConnman
* net: SocketSendData returns written size
* net: move max/max-outbound to CConnman
* net: Pass best block known height into CConnman
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: pass CClientUIInterface into CConnman
* net: Drop StartNode/StopNode and use CConnman directly
* net: Introduce CConnection::Options to avoid passing so many params
* net: add nSendBufferMaxSize/nReceiveFloodSize to CConnection::Options
* net: move vNodesDisconnected into CConnman
* Made the ForEachNode* functions in src/net.cpp more pragmatic and self documenting
* Convert ForEachNode* functions to take a templated function argument rather than a std::function to eliminate std::function overhead
* net: move MAX_FEELER_CONNECTIONS into connman
2017-07-21 11:35:19 +02:00
addrdb.cpp \
2023-09-24 22:54:01 +02:00
addressindex.cpp \
2017-05-03 11:36:20 +02:00
addrman.cpp \
2019-01-21 18:45:59 +01:00
banman.cpp \
2018-09-14 13:59:02 +02:00
batchedlogger.cpp \
2024-03-05 19:38:20 +01:00
bip324.cpp \
Backport compact blocks functionality from bitcoin (#1966)
* Merge #8068: Compact Blocks
48efec8 Fix some minor compact block issues that came up in review (Matt Corallo)
ccd06b9 Elaborate bucket size math (Pieter Wuille)
0d4cb48 Use vTxHashes to optimize InitData significantly (Matt Corallo)
8119026 Provide a flat list of txid/terators to txn in CTxMemPool (Matt Corallo)
678ee97 Add BIP 152 to implemented BIPs list (Matt Corallo)
56ba516 Add reconstruction debug logging (Matt Corallo)
2f34a2e Get our "best three" peers to announce blocks using cmpctblocks (Matt Corallo)
927f8ee Add ability to fetch CNode by NodeId (Matt Corallo)
d25cd3e Add receiver-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
9c837d5 Add sender-side protocol implementation for CMPCTBLOCK stuff (Matt Corallo)
00c4078 Add protocol messages for short-ids blocks (Matt Corallo)
e3b2222 Add some blockencodings tests (Matt Corallo)
f4f8f14 Add TestMemPoolEntryHelper::FromTx version for CTransaction (Matt Corallo)
85ad31e Add partial-block block encodings API (Matt Corallo)
5249dac Add COMPACTSIZE wrapper similar to VARINT for serialization (Matt Corallo)
cbda71c Move context-required checks from CheckBlockHeader to Contextual... (Matt Corallo)
7c29ec9 If AcceptBlockHeader returns true, pindex will be set. (Matt Corallo)
96806c3 Stop trimming when mapTx is empty (Pieter Wuille)
* Merge #8408: Prevent fingerprinting, disk-DoS with compact blocks
1d06e49 Ignore CMPCTBLOCK messages for pruned blocks (Suhas Daftuar)
1de2a46 Ignore GETBLOCKTXN requests for unknown blocks (Suhas Daftuar)
* Merge #8418: Add tests for compact blocks
45c7ddd Add p2p test for BIP 152 (compact blocks) (Suhas Daftuar)
9a22a6c Add support for compactblocks to mininode (Suhas Daftuar)
a8689fd Tests: refactor compact size serialization in mininode (Suhas Daftuar)
9c8593d Implement SipHash in Python (Pieter Wuille)
56c87e9 Allow changing BIP9 parameters on regtest (Suhas Daftuar)
* Merge #8505: Trivial: Fix typos in various files
1aacfc2 various typos (leijurv)
* Merge #8449: [Trivial] Do not shadow local variable, cleanup
a159f25 Remove redundand (and shadowing) declaration (Pavel Janík)
cce3024 Do not shadow local variable, cleanup (Pavel Janík)
* Merge #8739: [qa] Fix broken sendcmpct test in p2p-compactblocks.py
157254a Fix broken sendcmpct test in p2p-compactblocks.py (Suhas Daftuar)
* Merge #8854: [qa] Fix race condition in p2p-compactblocks test
b5fd666 [qa] Fix race condition in p2p-compactblocks test (Suhas Daftuar)
* Merge #8393: Support for compact blocks together with segwit
27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2 (Suhas Daftuar)
422fac6 [qa] Add support for compactblocks v2 to mininode (Suhas Daftuar)
f5b9b8f [qa] Fix bug in mininode witness deserialization (Suhas Daftuar)
6aa28ab Use cmpctblock type 2 for segwit-enabled transfer (Pieter Wuille)
be7555f Fix overly-prescriptive p2p-segwit test for new fetch logic (Matt Corallo)
06128da Make GetFetchFlags always request witness objects from witness peers (Matt Corallo)
* Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py
b55d941 [qa] Fix race condition in sendheaders.py (Suhas Daftuar)
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py (Suhas Daftuar)
* Merge #8904: [qa] Fix compact block shortids for a test case
4cdece4 [qa] Fix compact block shortids for a test case (Dagur Valberg Johannsson)
* Merge #8637: Compact Block Tweaks (rebase of #8235)
3ac6de0 Align constant names for maximum compact block / blocktxn depth (Pieter Wuille)
b2e93a3 Add cmpctblock to debug help list (instagibbs)
fe998e9 More agressively filter compact block requests (Matt Corallo)
02a337d Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
* Merge #8975: Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/
6f2f639 Chainparams: Trivial: In AppInit2(), s/Params()/chainparams/ (Jorge Timón)
* Merge #8968: Don't hold cs_main when calling ProcessNewBlock from a cmpctblock
72ca7d9 Don't hold cs_main when calling ProcessNewBlock from a cmpctblock (Matt Corallo)
* Merge #8995: Add missing cs_main lock to ::GETBLOCKTXN processing
dfe7906 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
* Merge #8515: A few mempool removal optimizations
0334430 Add some missing includes (Pieter Wuille)
4100499 Return shared_ptr<CTransaction> from mempool removes (Pieter Wuille)
51f2783 Make removed and conflicted arguments optional to remove (Pieter Wuille)
f48211b Bypass removeRecursive in removeForReorg (Pieter Wuille)
* Merge #9026: Fix handling of invalid compact blocks
d4833ff Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
88c3549 Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
c93beac [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
* Merge #9039: Various serialization simplifcations and optimizations
d59a518 Use fixed preallocation instead of costly GetSerializeSize (Pieter Wuille)
25a211a Add optimized CSizeComputer serializers (Pieter Wuille)
a2929a2 Make CSerAction's ForRead() constexpr (Pieter Wuille)
a603925 Avoid -Wshadow errors (Pieter Wuille)
5284721 Get rid of nType and nVersion (Pieter Wuille)
657e05a Make GetSerializeSize a wrapper on top of CSizeComputer (Pieter Wuille)
fad9b66 Make nType and nVersion private and sometimes const (Pieter Wuille)
c2c5d42 Make streams' read and write return void (Pieter Wuille)
50e8a9c Remove unused ReadVersion and WriteVersion (Pieter Wuille)
* Merge #9058: Fixes for p2p-compactblocks.py test timeouts on travis (#8842)
dac53b5 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
55bfddc [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
47e9659 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
* Merge #9160: [trivial] Fix hungarian variable name
ec34648 [trivial] Fix hungarian variable name (Russell Yanofsky)
* Merge #9159: [qa] Wait for specific block announcement in p2p-compactblocks
dfa44d1 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
* Merge #9125: Make CBlock a vector of shared_ptr of CTransactions
b4e4ba4 Introduce convenience type CTransactionRef (Pieter Wuille)
1662b43 Make CBlock::vtx a vector of shared_ptr<CTransaction> (Pieter Wuille)
da60506 Add deserializing constructors to CTransaction and CMutableTransaction (Pieter Wuille)
0e85204 Add serialization for unique_ptr and shared_ptr (Pieter Wuille)
* Merge #8872: Remove block-request logic from INV message processing
037159c Remove block-request logic from INV message processing (Matt Corallo)
3451203 [qa] Respond to getheaders and do not assume a getdata on inv (Matt Corallo)
d768f15 [qa] Make comptool push blocks instead of relying on inv-fetch (mrbandrews)
* Merge #9199: Always drop the least preferred HB peer when adding a new one.
ca8549d Always drop the least preferred HB peer when adding a new one. (Gregory Maxwell)
* Merge #9233: Fix some typos
15fa95d Fix some typos (fsb4000)
* Merge #9260: Mrs Peacock in The Library with The Candlestick (killed main.{h,cpp})
76faa3c Rename the remaining main.{h,cpp} to validation.{h,cpp} (Matt Corallo)
e736772 Move network-msg-processing code out of main to its own file (Matt Corallo)
87c35f5 Remove orphan state wipe from UnloadBlockIndex. (Matt Corallo)
* Merge #9014: Fix block-connection performance regression
dd0df81 Document ConnectBlock connectTrace postconditions (Matt Corallo)
2d6e561 Switch pblock in ProcessNewBlock to a shared_ptr (Matt Corallo)
2736c44 Make the optional pblock in ActivateBestChain a shared_ptr (Matt Corallo)
ae4db44 Create a shared_ptr for the block we're connecting in ActivateBCS (Matt Corallo)
fd9d890 Keep blocks as shared_ptrs, instead of copying txn in ConnectTip (Matt Corallo)
6fdd43b Add struct to track block-connect-time-generated info for callbacks (Matt Corallo)
* Merge #9240: Remove txConflicted
a874ab5 remove internal tracking of mempool conflicts for reporting to wallet (Alex Morcos)
bf663f8 remove external usage of mempool conflict tracking (Alex Morcos)
* Merge #9344: Do not run functions with necessary side-effects in assert()
da9cdd2 Do not run functions with necessary side-effects in assert() (Gregory Maxwell)
* Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlock
a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
* Merge #9352: Attempt reconstruction from all compact block announcements
813ede9 [qa] Update compactblocks test for multi-peer reconstruction (Suhas Daftuar)
7017298 Allow compactblock reconstruction when block is in flight (Suhas Daftuar)
* Merge #9252: Release cs_main before calling ProcessNewBlock, or processing headers (cmpctblock handling)
bd02bdd Release cs_main before processing cmpctblock as header (Suhas Daftuar)
680b0c0 Release cs_main before calling ProcessNewBlock (cmpctblock handling) (Suhas Daftuar)
* Merge #9283: A few more CTransactionRef optimizations
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)
* Merge #9375: Relay compact block messages prior to full block connection
02ee4eb Make most_recent_compact_block a pointer to a const (Matt Corallo)
73666ad Add comment to describe callers to ActivateBestChain (Matt Corallo)
962f7f0 Call ActivateBestChain without cs_main/with most_recent_block (Matt Corallo)
0df777d Use a temp pindex to avoid a const_cast in ProcessNewBlockHeaders (Matt Corallo)
c1ae4fc Avoid holding cs_most_recent_block while calling ReadBlockFromDisk (Matt Corallo)
9eb67f5 Ensure we meet the BIP 152 old-relay-types response requirements (Matt Corallo)
5749a85 Cache most-recently-connected compact block (Matt Corallo)
9eaec08 Cache most-recently-announced block's shared_ptr (Matt Corallo)
c802092 Relay compact block messages prior to full block connection (Matt Corallo)
6987219 Add a CValidationInterface::NewPoWValidBlock callback (Matt Corallo)
180586f Call AcceptBlock with the block's shared_ptr instead of CBlock& (Matt Corallo)
8baaba6 [qa] Avoid race in preciousblock test. (Matt Corallo)
9a0b2f4 [qa] Make compact blocks test construction using fetch methods (Matt Corallo)
8017547 Make CBlockIndex*es in net_processing const (Matt Corallo)
* Merge #9486: Make peer=%d log prints consistent
e6111b2 Make peer id logging consistent ("peer=%d" instead of "peer %d") (Matt Corallo)
* Merge #9400: Set peers as HB peers upon full block validation
d4781ac Set peers as HB peers upon full block validation (Gregory Sanders)
* Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for compact-block-reconstruction
c594580 Add braces around AddToCompactExtraTransactions (Matt Corallo)
1ccfe9b Clarify comment about mempool/extra conflicts (Matt Corallo)
fac4c78 Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo)
b55b416 Add extra_count lower bound to compact reconstruction debug print (Matt Corallo)
863edb4 Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo)
7f8c8ca Consider all orphan txn for compact-block-extra-txn cache (Matt Corallo)
93380c5 Use replaced transactions in compact block reconstruction (Matt Corallo)
1531652 Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo)
edded80 Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo)
c735540 Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
* Merge #9587: Do not shadow local variable named `tx`.
44f2baa Do not shadow local variable named `tx`. (Pavel Janík)
* Merge #9510: [trivial] Fix typos in comments
cc16d99 [trivial] Fix typos in comments (practicalswift)
* Merge #9604: [Trivial] add comment about setting peer as HB peer.
dd5b011 [Trivial] add comment about setting peer as HB peer. (John Newbery)
* Fix using of AcceptToMemoryPool in PrivateSend code
* add `override`
* fSupportsDesiredCmpctVersion
* bring back tx ressurection in DisconnectTip
* Fix delayed headers
* Remove unused CConnman::FindNode overload
* Fix typos and comments
* Fix minor code differences
* Don't use rejection cache for corrupted transactions
Partly based on https://github.com/bitcoin/bitcoin/pull/8525
* Backport missed cs_main locking changes
Missed from https://github.com/bitcoin/bitcoin/commit/58a215ce8c13b900cf982c39f8ee4879290d1a95
* Backport missed comments and mapBlockSource.emplace call
Missed from two commits:
https://github.com/bitcoin/bitcoin/commit/88c35491ab19f9afdf9b3fa9356a072f70ef2f55
https://github.com/bitcoin/bitcoin/commit/7c98ce584ec23bcddcba8cdb33efa6547212f6ef
* Add CheckPeerHeaders() helper and check in (nCount == 0) too
2018-04-11 13:06:01 +02:00
blockencodings.cpp \
2018-08-26 16:57:01 +02:00
blockfilter.cpp \
2014-09-03 02:20:09 +02:00
chain.cpp \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin.cpp \
refactor: subsume CoinJoin objects under CJContext, deglobalize coinJoin{ClientQueueManager,Server} (#5337)
## Motivation
CoinJoin's subsystems are initialized by variables and managers that
occupy the global context. The _extent_ to which these subsystems
entrench themselves into the codebase is difficult to assess and moving
them out of the global context forces us to enumerate the subsystems in
the codebase that rely on CoinJoin logic and enumerate the order in
which components are initialized and destroyed.
Keeping this in mind, the scope of this pull request aims to:
* Reduce the amount of CoinJoin-specific entities present in the global
scope
* Make the remaining usage of these entities in the global scope
explicit and easily searchable
## Additional Information
* The initialization of `CCoinJoinClientQueueManager` is dependent on
blocks-only mode being disabled (which can be alternatively interpreted
as enabling the relay of transactions). The same applies to
`CBlockPolicyEstimator`, which `CCoinJoinClientQueueManager` depends.
Therefore, `CCoinJoinClientQueueManager` is only initialized if
transaction relaying is enabled and so is its scheduled maintenance
task. This can be found by looking at `init.cpp`
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L1681-L1683),
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L2253-L2255)
and
[here](https://github.com/dashpay/dash/blob/93f8df1c31fdce6a14f149acfdff22678c3f22ca/src/init.cpp#L2326-L2327).
For this reason, `CBlockPolicyEstimator` is not a member of `CJContext`
and its usage is fulfilled by passing it as a reference when
initializing the scheduling task.
* `CJClientManager` has not used `CConnman` or `CTxMemPool` as `const`
as existing code that is outside the scope of this PR would cast away
constness, which would be unacceptable. Furthermore, some logical paths
are taken that will grind to a halt if they are stored as `const`.
Examples of such a call chains would be:
* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoinClientSession::DoAutomaticDenominating >
CCoinJoinClientSession::StartNewQueue > CConnman::AddPendingMasternode`
which modifies `CConnman::vPendingMasternodes`, which is non-const
behaviour
* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoin::IsCollateralValid > AcceptToMemoryPool` which adds a
transaction to the memory pool, which is non-const behaviour
* There were cppcheck [linter
failures](https://github.com/dashpay/dash/pull/5337#issuecomment-1685084688)
that seemed to be caused by the usage of `Assert` in
`coinjoin/client.h`. This seems to be resolved by backporting
[bitcoin#24714](https://github.com/bitcoin/bitcoin/pull/24714). (Thanks
@knst!)
* Depends on #5546
---------
Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-09-13 19:52:38 +02:00
coinjoin/context.cpp \
2021-10-01 21:19:08 +02:00
coinjoin/server.cpp \
2019-07-23 11:20:23 +02:00
consensus/tx_verify.cpp \
2022-02-26 13:19:13 +01:00
dbwrapper.cpp \
2021-07-01 19:15:03 +02:00
deploymentstatus.cpp \
2017-12-01 19:53:34 +01:00
dsnotificationinterface.cpp \
2023-07-24 18:39:38 +02:00
evo/assetlocktx.cpp \
2019-03-22 11:52:37 +01:00
evo/cbtx.cpp \
2023-07-24 18:39:38 +02:00
evo/creditpool.cpp \
2024-03-14 04:29:04 +01:00
evo/chainhelper.cpp \
2019-03-22 11:52:37 +01:00
evo/deterministicmns.cpp \
2022-02-26 19:50:35 +01:00
evo/dmnstate.cpp \
2018-05-24 14:28:23 +02:00
evo/evodb.cpp \
2019-03-22 11:52:37 +01:00
evo/mnauth.cpp \
2021-12-11 21:00:27 +01:00
evo/mnhftx.cpp \
2018-02-13 13:36:36 +01:00
evo/providertx.cpp \
2018-04-09 10:35:43 +02:00
evo/simplifiedmns.cpp \
2019-03-22 11:52:37 +01:00
evo/specialtx.cpp \
2022-01-24 15:20:50 +01:00
evo/specialtxman.cpp \
2021-08-12 09:02:29 +02:00
flatfile.cpp \
2020-07-01 15:18:55 +02:00
governance/classes.cpp \
governance/exceptions.cpp \
governance/governance.cpp \
governance/object.cpp \
governance/validators.cpp \
governance/vote.cpp \
governance/votedb.cpp \
gsl/assert.cpp \
evhttpd implementation
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with #4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.
- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.
- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral
- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.
- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.
By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided.
What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.
Configuration options:
- `-rpcthreads`: repurposed as "number of work handler threads". Still
defaults to 4.
- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.
- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.
- `-debug=http`: low-level http activity logging
2015-01-23 07:53:17 +01:00
httprpc.cpp \
httpserver.cpp \
2020-11-18 17:13:27 +01:00
i2p.cpp \
2018-06-07 17:59:30 +02:00
index/base.cpp \
2021-08-12 09:04:28 +02:00
index/blockfilterindex.cpp \
2023-07-30 13:49:32 +02:00
index/coinstatsindex.cpp \
2021-05-25 12:48:04 +02:00
index/txindex.cpp \
2013-11-29 16:50:11 +01:00
init.cpp \
2019-01-08 09:13:56 +01:00
llmq/quorums.cpp \
2021-10-02 19:32:24 +02:00
llmq/blockprocessor.cpp \
llmq/commitment.cpp \
llmq/chainlocks.cpp \
2022-02-26 19:50:35 +01:00
llmq/clsig.cpp \
2021-10-02 19:32:24 +02:00
llmq/debug.cpp \
llmq/dkgsessionhandler.cpp \
llmq/dkgsessionmgr.cpp \
llmq/dkgsession.cpp \
2022-11-07 19:09:44 +01:00
llmq/context.cpp \
2021-10-02 19:32:24 +02:00
llmq/instantsend.cpp \
2024-01-18 02:56:41 +01:00
llmq/options.cpp \
2022-04-16 16:46:04 +02:00
llmq/snapshot.cpp \
2021-10-02 19:32:24 +02:00
llmq/signing.cpp \
llmq/signing_shares.cpp \
llmq/utils.cpp \
2022-02-26 13:19:13 +01:00
mapport.cpp \
2021-10-01 21:19:08 +02:00
masternode/node.cpp \
masternode/meta.cpp \
masternode/payments.cpp \
masternode/sync.cpp \
masternode/utils.cpp \
2013-12-08 15:26:08 +01:00
miner.cpp \
2013-11-29 16:50:11 +01:00
net.cpp \
2016-09-27 09:50:04 +02:00
netfulfilledman.cpp \
2017-08-09 02:19:06 +02:00
net_processing.cpp \
2023-07-24 20:42:13 +02:00
node/blockstorage.cpp \
2021-11-01 12:24:34 +01:00
node/coin.cpp \
2020-12-15 17:22:23 +01:00
node/coinstats.cpp \
2022-04-05 11:09:41 +02:00
node/context.cpp \
2023-04-13 08:37:54 +02:00
node/interfaces.cpp \
2023-12-12 17:40:10 +01:00
node/psbt.cpp \
2019-01-09 07:16:50 +01:00
node/transaction.cpp \
2020-07-01 15:18:55 +02:00
node/ui_interface.cpp \
2013-11-29 16:50:11 +01:00
noui.cpp \
2014-08-26 22:28:32 +02:00
policy/fees.cpp \
2024-01-18 20:17:25 +01:00
policy/packages.cpp \
2014-10-12 00:41:05 +02:00
policy/policy.cpp \
2021-11-16 16:19:47 +01:00
policy/settings.cpp \
2014-03-10 16:46:53 +01:00
pow.cpp \
2014-11-11 10:52:43 +01:00
rest.cpp \
2017-07-03 15:13:34 +02:00
rpc/blockchain.cpp \
2022-10-21 16:49:43 +02:00
rpc/coinjoin.cpp \
rpc/evo.cpp \
2024-06-26 20:19:26 +02:00
rpc/index_util.cpp \
2017-07-03 15:13:34 +02:00
rpc/masternode.cpp \
rpc/governance.cpp \
rpc/mining.cpp \
rpc/misc.cpp \
rpc/net.cpp \
2022-10-21 16:49:43 +02:00
rpc/quorums.cpp \
2017-07-03 15:13:34 +02:00
rpc/rawtransaction.cpp \
rpc/server.cpp \
2024-06-26 12:56:02 +02:00
rpc/server_util.cpp \
2014-11-06 09:24:41 +01:00
script/sigcache.cpp \
2021-06-21 00:49:59 +02:00
shutdown.cpp \
2017-12-01 19:53:34 +01:00
spork.cpp \
2020-12-15 17:22:23 +01:00
statsd_client.cpp \
2014-06-19 15:08:37 +02:00
timedata.cpp \
2015-08-25 20:12:08 +02:00
torcontrol.cpp \
2013-11-29 16:50:11 +01:00
txdb.cpp \
txmempool.cpp \
2017-08-09 02:19:06 +02:00
validation.cpp \
2015-02-05 01:11:44 +01:00
validationinterface.cpp \
2016-02-15 05:13:27 +01:00
versionbits.cpp \
2013-11-29 16:50:11 +01:00
$( BITCOIN_CORE_H)
2021-08-05 17:22:48 +02:00
i f E N A B L E _ W A L L E T
2022-07-08 10:22:25 +02:00
libbitcoin_server_a_SOURCES += wallet/init.cpp
2021-08-05 17:22:48 +02:00
e n d i f
2021-08-05 16:41:46 +02:00
i f ! E N A B L E _ W A L L E T
2022-07-08 10:22:25 +02:00
libbitcoin_server_a_SOURCES += dummywallet.cpp
2021-08-05 16:41:46 +02:00
e n d i f
2014-11-18 18:06:32 +01:00
i f E N A B L E _ Z M Q
2022-07-08 10:22:25 +02:00
libbitcoin_zmq_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( ZMQ_CFLAGS)
libbitcoin_zmq_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_zmq_a_SOURCES = \
2014-11-18 18:06:32 +01:00
zmq/zmqabstractnotifier.cpp \
zmq/zmqnotificationinterface.cpp \
2018-07-09 17:05:14 +02:00
zmq/zmqpublishnotifier.cpp \
2020-09-01 09:40:13 +02:00
zmq/zmqrpc.cpp \
zmq/zmqutil.cpp
2014-11-18 18:06:32 +01:00
e n d i f
2015-04-03 00:51:08 +02:00
# wallet: shared between dashd and dash-qt, but only linked
2014-06-19 15:10:04 +02:00
# when wallet enabled
2023-02-03 15:46:16 +01:00
libbitcoin_wallet_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( SQLITE_CFLAGS)
2022-07-08 10:22:25 +02:00
libbitcoin_wallet_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_wallet_a_SOURCES = \
2024-01-01 11:15:01 +01:00
coinjoin/client.cpp \
2024-01-01 11:13:25 +01:00
coinjoin/interfaces.cpp \
2024-01-01 11:15:01 +01:00
coinjoin/util.cpp \
2024-01-31 19:17:56 +01:00
wallet/bip39.cpp \
Merge #12257: [wallet] Use destination groups instead of coins in coin select
232f96f5c8a3920c09db92f4dbac2ad7d10ce8cf doc: Add release notes for -avoidpartialspends (Karl-Johan Alm)
e00b4699cc6d2ee5697d38dd6607eb2631c9b77a clean-up: Remove no longer used ivars from CInputCoin (Karl-Johan Alm)
43e04d13b1ffc02b1082176e87f420198b40c7b1 wallet: Remove deprecated OutputEligibleForSpending (Karl-Johan Alm)
0128121101fb3ee82f3abd3973a967a4226ffe0e test: Add basic testing for wallet groups (Karl-Johan Alm)
59d6f7b4e2f847ec1f2ff46c84e6157655984f85 wallet: Switch to using output groups instead of coins in coin selection (Karl-Johan Alm)
87ebce25d66952f5ce565bb5130dcf5e24049872 wallet: Add output grouping (Karl-Johan Alm)
bb629cb9dc567cc819724d9f4852652926e60cbf Add -avoidpartialspends and m_avoid_partial_spends (Karl-Johan Alm)
65b3eda458221644616d0fdd6ba0fe01bdbce893 wallet: Add input bytes to CInputCoin (Karl-Johan Alm)
a443d7a0ca333b0bae63e04b5d476f9ad9c7aeac moveonly: CoinElegibilityFilter into coinselection.h (Karl-Johan Alm)
173e18a289088c6087ba6fac708e322aa63b7a94 utils: Add insert() convenience templates (Karl-Johan Alm)
Pull request description:
This PR adds an optional (off by default) `-avoidpartialspends` flag, which changes coin select to use output groups rather than outputs, where each output group corresponds to all outputs with the same destination.
It is a privacy improvement, as each time you spend some output, any other output that is publicly associated with the destination (address) will also be spent at the same time, at the cost of fee increase for cases where coin select without group restriction would find a more optimal set of coins (see example below).
For regular use without address reuse, this PR should have no effect on the user experience whatsoever; it only affects users who, for some reason, have multiple outputs with the same destination (i.e. address reuse).
Nodes with this turned off will still try to avoid partial spending, if the fee of the resulting transaction is not greater than the fee of the original transaction.
Example: a node has four outputs linked to two addresses `A` and `B`:
* 1.0 btc to `A`
* 0.5 btc to `A`
* 1.0 btc to `B`
* 0.5 btc to `B`
The node sends 0.2 btc to `C`. Without `-avoidpartialspends`, the following coin selection will occur:
* 0.5 btc to `A` or `B` is picked
* 0.2 btc is output to `C`
* 0.3 - fee is output to (unique change address)
With `-avoidpartialspends`, the following will instead happen:
* Both of (0.5, 1.0) btc to `A` or `B` is picked (one or the other pair)
* 0.2 btc is output to `C`
* 1.3 - fee is output to (unique change address)
As noted, the pro here is that, assuming nobody sends to the address after you spend from it, you will only ever use one address once. The con is that the transaction becomes slightly larger in this case, because it is overpicking outputs to adhere to the no partial spending rule.
This complements #10386, in particular it addresses @luke-jr and @gmaxwell's concerns in https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-300667926 and https://github.com/bitcoin/bitcoin/pull/10386#issuecomment-302361381.
Together with `-avoidreuse`, this fully addresses the concerns in #10065 I believe.
Tree-SHA512: 24687a4490ba59cf4198ed90052944ff4996653a4257833bb52ed24d058b3e924800c9b3790aeb6be6385b653b49e304453e5d7ff960e64c682fc23bfc447621
# Conflicts:
# src/Makefile.am
# src/bench/coin_selection.cpp
# src/wallet/coincontrol.h
# src/wallet/coinselection.cpp
# src/wallet/coinselection.h
# src/wallet/init.cpp
# src/wallet/test/coinselector_tests.cpp
# src/wallet/wallet.cpp
# src/wallet/wallet.h
# test/functional/test_runner.py
2018-07-24 15:06:21 +02:00
wallet/coincontrol.cpp \
2020-05-28 08:13:19 +02:00
wallet/context.cpp \
2015-03-22 20:18:55 +01:00
wallet/crypter.cpp \
2015-02-03 21:09:47 +01:00
wallet/db.cpp \
2020-12-17 15:18:13 +01:00
wallet/dump.cpp \
2017-08-02 13:19:28 +02:00
wallet/fees.cpp \
2024-01-31 18:17:05 +01:00
wallet/hdchain.cpp \
2023-04-13 08:37:54 +02:00
wallet/interfaces.cpp \
2021-11-16 16:19:47 +01:00
wallet/load.cpp \
2015-02-03 21:09:47 +01:00
wallet/rpcdump.cpp \
wallet/rpcwallet.cpp \
2022-08-08 18:05:21 +02:00
wallet/scriptpubkeyman.cpp \
2015-02-03 21:09:47 +01:00
wallet/wallet.cpp \
wallet/walletdb.cpp \
2017-11-18 14:32:50 +01:00
wallet/walletutil.cpp \
Backport bitcoin#10637 (partial) (#3878)
* Calculate and store the number of bytes required to spend an input
* Store effective value, fee, and long term fee in CInputCoin
Have CInputCOin store effective value information. This includes the effective
value itself, the fee, and the long term fee for the input
* Implement Branch and Bound coin selection in a new file
Create a new file for coin selection logic and implement the BnB algorithm in it.
* Move output eligibility to a separate function
* Use a struct for output eligibility
Instead of specifying 3 parameters, use a struct for those parameters
in order to reduce the number of arguments to SelectCoinsMinConf.
* Remove coinselection.h -> wallet.h circular dependency
Changes CInputCoin to coinselection and to use CTransactionRef in
order to avoid a circular dependency. Also moves other coin selection
specific variables out of wallet.h to coinselectoin.h
* Add tests for the Branch and Bound algorithm
* Move current coin selection algorithm to coinselection.{cpp,h}
Moves the current coin selection algorithm out of SelectCoinsMinConf
and puts it in coinselection.{cpp,h}. The new function, KnapsackSolver,
instead of taking a vector of COutputs, will take a vector of CInputCoins
that is prepared by SelectCoinsMinConf.
* Move original knapsack solver tests to coinselector_tests.cpp
* Add a GetMinimumFeeRate function which is wrapped by GetMinimumFee
* Have SelectCoinsMinConf and SelectCoins use BnB or Knapsack and use it (partial)
Allows SelectCoinsMinConf and SelectCoins be able to switch between
using BnB or Knapsack for choosing coins.
Has SelectCoinsMinConf do the preprocessing necessary to support either
BnB or Knapsack. This includes calculating the filtering the effective
values for each input.
Uses BnB in CreateTransaction to find an exact match for the output.
If BnB fails, it will fallback to the Knapsack solver.
Dash specific note: just always use Knapsack in CreateTransaction.
* Benchmark BnB in the worst case where it exhausts
* Add a test to make sure that negative effective values are filtered
* More of 12747: Fix typos
Co-authored-by: Andrew Chow <achow101-github@achow101.com>
2020-12-18 18:43:48 +01:00
wallet/coinselection.cpp \
2013-11-27 15:41:12 +01:00
$( BITCOIN_CORE_H)
2023-02-03 15:46:16 +01:00
i f U S E _ S Q L I T E
libbitcoin_wallet_a_SOURCES += wallet/sqlite.cpp
e n d i f
2023-02-04 19:28:21 +01:00
i f U S E _ B D B
libbitcoin_wallet_a_SOURCES += wallet/bdb.cpp wallet/salvage.cpp
e n d i f
2023-02-03 15:46:16 +01:00
2022-07-08 10:22:25 +02:00
libbitcoin_wallet_tool_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libbitcoin_wallet_tool_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_wallet_tool_a_SOURCES = \
2019-01-31 17:07:45 +01:00
wallet/wallettool.cpp \
$( BITCOIN_CORE_H)
2014-06-19 15:10:04 +02:00
# crypto primitives library
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_base_a_CPPFLAGS = $( AM_CPPFLAGS) $( PIC_FLAGS)
crypto_libbitcoin_crypto_base_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS) $( PIC_FLAGS)
crypto_libbitcoin_crypto_base_a_SOURCES = \
2016-06-01 18:22:20 +02:00
crypto/aes.cpp \
crypto/aes.h \
2017-04-24 14:02:12 +02:00
crypto/chacha20.h \
crypto/chacha20.cpp \
2024-03-05 19:38:20 +01:00
crypto/chacha20poly1305.h \
crypto/chacha20poly1305.cpp \
2014-06-09 21:17:27 +02:00
crypto/common.h \
2021-08-09 01:21:35 +02:00
crypto/hkdf_sha256_32.cpp \
crypto/hkdf_sha256_32.h \
2014-10-26 09:38:13 +01:00
crypto/hmac_sha256.cpp \
crypto/hmac_sha256.h \
2014-10-26 09:23:23 +01:00
crypto/hmac_sha512.cpp \
crypto/hmac_sha512.h \
2022-02-26 11:45:32 +01:00
crypto/muhash.h \
crypto/muhash.cpp \
2019-03-27 11:46:07 +01:00
crypto/poly1305.h \
crypto/poly1305.cpp \
2022-01-24 15:21:38 +01:00
crypto/pkcs5_pbkdf2_hmac_sha512.cpp \
crypto/pkcs5_pbkdf2_hmac_sha512.h \
2014-06-09 21:17:27 +02:00
crypto/ripemd160.cpp \
2015-04-14 10:51:14 +02:00
crypto/aes_helper.c \
2017-07-03 15:14:07 +02:00
crypto/ripemd160.h \
crypto/sha1.cpp \
crypto/sha1.h \
crypto/sha256.cpp \
crypto/sha256.h \
2020-08-30 21:54:45 +02:00
crypto/sha3.cpp \
crypto/sha3.h \
2017-07-03 15:14:07 +02:00
crypto/sha512.cpp \
2021-06-26 12:37:06 +02:00
crypto/sha512.h \
crypto/siphash.cpp \
crypto/siphash.h
2017-07-03 15:14:07 +02:00
2017-09-05 22:12:42 +02:00
i f U S E _ A S M
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
2017-07-20 20:16:28 +02:00
e n d i f
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $( SSE41_CXXFLAGS)
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
2018-06-04 09:11:18 +02:00
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $( AVX2_CXXFLAGS)
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
2018-06-04 09:11:18 +02:00
2017-07-03 15:14:07 +02:00
# x11
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_base_a_SOURCES += \
2015-04-14 10:51:14 +02:00
crypto/blake.c \
crypto/bmw.c \
crypto/cubehash.c \
crypto/echo.c \
crypto/groestl.c \
crypto/jh.c \
crypto/keccak.c \
crypto/luffa.c \
crypto/shavite.c \
crypto/simd.c \
crypto/skein.c \
2015-04-04 22:00:03 +02:00
crypto/sph_blake.h \
crypto/sph_bmw.h \
crypto/sph_cubehash.h \
crypto/sph_echo.h \
crypto/sph_groestl.h \
crypto/sph_jh.h \
crypto/sph_keccak.h \
crypto/sph_luffa.h \
crypto/sph_shavite.h \
crypto/sph_simd.h \
crypto/sph_skein.h \
2017-07-03 15:14:07 +02:00
crypto/sph_types.h
2014-07-29 17:12:44 +02:00
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libbitcoin_crypto_x86_shani_a_CXXFLAGS += $( X86_SHANI_CXXFLAGS)
crypto_libbitcoin_crypto_x86_shani_a_CPPFLAGS += -DENABLE_X86_SHANI
crypto_libbitcoin_crypto_x86_shani_a_SOURCES = crypto/sha256_x86_shani.cpp
2022-02-14 20:47:24 +01:00
2022-07-08 10:22:25 +02:00
crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libbitcoin_crypto_arm_shani_a_CXXFLAGS += $( ARM_SHANI_CXXFLAGS)
crypto_libbitcoin_crypto_arm_shani_a_CPPFLAGS += -DENABLE_ARM_SHANI
crypto_libbitcoin_crypto_arm_shani_a_SOURCES = crypto/sha256_arm_shani.cpp
2018-07-09 20:33:41 +02:00
2016-02-02 18:37:36 +01:00
# consensus: shared between all executables that validate any consensus rules.
2022-07-08 10:22:25 +02:00
libbitcoin_consensus_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libbitcoin_consensus_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_consensus_a_SOURCES = \
2016-02-02 18:37:36 +01:00
amount.h \
arith_uint256.cpp \
arith_uint256.h \
2018-10-12 19:39:17 +02:00
bls/bls.cpp \
bls/bls.h \
2016-02-02 18:37:36 +01:00
consensus/merkle.cpp \
consensus/merkle.h \
consensus/params.h \
2021-11-16 16:19:47 +01:00
consensus/tx_check.cpp \
2016-02-02 18:37:36 +01:00
consensus/validation.h \
hash.cpp \
hash.h \
prevector.h \
primitives/block.cpp \
primitives/block.h \
primitives/transaction.cpp \
primitives/transaction.h \
pubkey.cpp \
pubkey.h \
2022-08-02 18:35:18 +02:00
script/bitcoinconsensus.cpp \
2016-02-02 18:37:36 +01:00
script/interpreter.cpp \
script/interpreter.h \
script/script.cpp \
script/script.h \
script/script_error.cpp \
script/script_error.h \
serialize.h \
2018-04-08 17:57:22 +02:00
span.h \
2018-12-10 05:40:08 +01:00
streams.h \
2016-02-02 18:37:36 +01:00
tinyformat.h \
uint256.cpp \
uint256.h \
2021-06-27 08:33:13 +02:00
util/strencodings.cpp \
util/strencodings.h \
2022-05-05 08:28:29 +02:00
util/string.cpp \
2016-02-02 18:37:36 +01:00
version.h
2015-04-03 00:51:08 +02:00
# common: shared between dashd, and dash-qt and non-server tools
2022-07-08 10:22:25 +02:00
libbitcoin_common_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libbitcoin_common_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_common_a_SOURCES = \
2014-06-25 10:03:00 +02:00
base58.cpp \
2020-12-25 05:33:37 +01:00
bech32.cpp \
2021-11-16 16:19:47 +01:00
bloom.cpp \
2013-11-27 15:41:12 +01:00
chainparams.cpp \
2014-06-25 10:03:00 +02:00
coins.cpp \
2014-10-19 04:28:43 +02:00
compressor.cpp \
2014-06-24 05:10:24 +02:00
core_read.cpp \
core_write.cpp \
2021-07-01 19:15:03 +02:00
deploymentinfo.cpp \
2023-12-01 10:59:14 +01:00
governance/common.cpp \
2024-07-20 20:07:14 +02:00
init/common.cpp \
2013-11-27 15:41:12 +01:00
key.cpp \
Merge #11372: Address encoding cleanup
92f1f8b31 Split off key_io_tests from base58_tests (Pieter Wuille)
119b0f85e Split key_io (address/key encodings) off from base58 (Pieter Wuille)
ebfe217b1 Stop using CBase58Data for ext keys (Pieter Wuille)
32e69fa0d Replace CBitcoinSecret with {Encode,Decode}Secret (Pieter Wuille)
Pull request description:
This PR contains some of the changes left as TODO in #11167 (and built on top of that PR). They are not intended for backporting.
This removes the `CBase58`, `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey` classes, in favor of simple `Encode`/`Decode` functions. Furthermore, all Bitcoin-specific logic (addresses, WIF, BIP32) is moved to `key_io.{h,cpp}`, leaving `base58.{h,cpp}` as a pure utility that implements the base58 encoding/decoding logic.
Tree-SHA512: a5962c0ed27ad53cbe00f22af432cf11aa530e3efc9798e25c004bc9ed1b5673db5df3956e398ee2c085e3a136ac8da69fe7a7d97a05fb2eb3be0b60d0479655
Make linter happy
Dashify
2018-03-07 00:04:56 +01:00
key_io.cpp \
2021-11-16 16:19:47 +01:00
merkleblock.cpp \
2021-08-31 15:59:12 +02:00
net_types.cpp \
2017-09-03 15:29:10 +02:00
netaddress.cpp \
2013-11-27 15:41:12 +01:00
netbase.cpp \
Merge #16248: Make whitebind/whitelist permissions more flexible
c5b404e8f1973afe071a07c63ba1038eefe13f0f Add functional tests for flexible whitebind/list (nicolas.dorier)
d541fa391844f658bd7035659b5b16695733dd56 Replace the use of fWhitelisted by permission checks (nicolas.dorier)
ecd5cf7ea4c3644a30092100ffc399e30e193275 Do not disconnect peer for asking mempool if it has NO_BAN permission (nicolas.dorier)
e5b26deaaa6842f7dd7c4537ede000f965ea0189 Make whitebind/whitelist permissions more flexible (nicolas.dorier)
Pull request description:
# Motivation
In 0.19, bloom filter will be disabled by default. I tried to make [a PR](https://github.com/bitcoin/bitcoin/pull/16176) to enable bloom filter for whitelisted peers regardless of `-peerbloomfilters`.
Bloom filter have non existent privacy and server can omit filter's matches. However, both problems are completely irrelevant when you connect to your own node. If you connect to your own node, bloom filters are the most bandwidth efficient way to synchronize your light client without the need of some middleware like Electrum.
It is also a superior alternative to BIP157 as it does not require to maintain an additional index and it would work well on pruned nodes.
When I attempted to allow bloom filters for whitelisted peer, my proposal has been NACKed in favor of [a more flexible approach](https://github.com/bitcoin/bitcoin/pull/16176#issuecomment-500762907) which should allow node operator to set fine grained permissions instead of a global `whitelisted` attribute.
Doing so will also make follow up idea very easy to implement in a backward compatible way.
# Implementation details
The PR propose a new format for `--white{list,bind}`. I added a way to specify permissions granted to inbound connection matching `white{list,bind}`.
The following permissions exists:
* ForceRelay
* Relay
* NoBan
* BloomFilter
* Mempool
Example:
* `-whitelist=bloomfilter@127.0.0.1/32`.
* `-whitebind=bloomfilter,relay,noban@127.0.0.1:10020`.
If no permissions are specified, `NoBan | Mempool` is assumed. (making this PR backward compatible)
When we receive an inbound connection, we calculate the effective permissions for this peer by fetching the permissions granted from `whitelist` and add to it the permissions granted from `whitebind`.
To keep backward compatibility, if no permissions are specified in `white{list,bind}` (e.g. `--whitelist=127.0.0.1`) then parameters `-whitelistforcerelay` and `-whiterelay` will add the permissions `ForceRelay` and `Relay` to the inbound node.
`-whitelistforcerelay` and `-whiterelay` are ignored if the permissions flags are explicitly set in `white{bind,list}`.
# Follow up idea
Based on this PR, other changes become quite easy to code in a trivially review-able, backward compatible way:
* Changing `connect` at rpc and config file level to understand the permissions flags.
* Changing the permissions of a peer at RPC level.
ACKs for top commit:
laanwj:
re-ACK c5b404e8f1973afe071a07c63ba1038eefe13f0f
Tree-SHA512: adfefb373d09e68cae401247c8fc64034e305694cdef104bdcdacb9f1704277bd53b18f52a2427a5cffdbc77bda410d221aed252bc2ece698ffbb9cf1b830577
2019-08-14 16:35:54 +02:00
net_permissions.cpp \
Merge #17261: Make ScriptPubKeyMan an actual interface and the wallet to have multiple
3f373659d732a5b1e5fdc692a45b2b8179f66bec Refactor: Replace SigningProvider pointers with unique_ptrs (Andrew Chow)
3afe53c4039103670cec5f9cace897ead76e20a8 Cleanup: Drop unused GUI learnRelatedScripts method (Andrew Chow)
e2f02aa59e3402048269362ff692d49a6df35cfd Refactor: Copy CWallet signals and print function to LegacyScriptPubKeyMan (Andrew Chow)
c729afd0a3b74a3943e4c359270beaf3e6ff8a7b Box the wallet: Add multiple keyman maps and loops (Andrew Chow)
4977c30d59e88a3e5ee248144bcc023debcd895b refactor: define a UINT256_ONE global constant (Andrew Chow)
415afcccd3e5583defdb76e3a280f48e98983301 HD Split: Avoid redundant upgrades (Andrew Chow)
01b4511206e399981a77976deb15785d18db46ae Make UpgradeKeyMetadata work only on LegacyScriptPubKeyMan (Andrew Chow)
4a7e43e8460127a40a7895519587399feff3b682 Store p2sh scripts in AddAndGetDestinationForScript (Andrew Chow)
501acb5538008d98abe79288b92040bc186b93f3 Always try to sign for all pubkeys in multisig (Andrew Chow)
81610eddbc57c46ae243f45d73e715d509f53a6c List output types in an array in order to be iterated over (Andrew Chow)
eb81fc3ee58d3e88af36d8091b9e4017a8603b3c Refactor: Allow LegacyScriptPubKeyMan to be null (Andrew Chow)
fadc08ad944cad42e805228cdd58e0332f4d7184 Locking: Lock cs_KeyStore instead of cs_wallet in legacy keyman (Andrew Chow)
f5be479694d4dbaf59eef562d80fbeacb3bb7dc1 wallet: Improve CWallet:MarkDestinationsDirty (João Barbosa)
Pull request description:
Continuation of wallet boxes project.
Actually makes ScriptPubKeyMan an interface which LegacyScriptPubkeyMan. Moves around functions and things from CWallet into LegacyScriptPubKeyMan so that they are actually separate things without circular dependencies.
***
Introducing the `ScriptPubKeyMan` (short for ScriptPubKeyManager) for managing scriptPubKeys and their associated scripts and keys. This functionality is moved over from `CWallet`. Instead, `CWallet` will have a pointer to a `ScriptPubKeyMan` for every possible address type, internal and external. It will fetch the correct `ScriptPubKeyMan` as necessary. When fetching new addresses, it chooses the `ScriptPubKeyMan` based on address type and whether it is change. For signing, it takes the script and asks each `ScriptPubKeyMan` for whether that `ScriptPubKeyMan` considers that script `IsMine`, whether it has that script, or whether it is able to produce a signature for it. If so, the `ScriptPubKeyMan` will provide a `SigningProvider` to the caller which will use that in order to sign.
There is currently one `ScriptPubKeyMan` - the `LegacyScriptPubKeyMan`. Each `CWallet` will have only one `LegacyScriptPubKeyMan` with the pointers for all of the address types and change pointing to this `LegacyScriptPubKeyMan`. It is created when the wallet is loaded and all keys and metadata are loaded into it instead of `CWallet`. The `LegacyScriptPubKeyMan` is primarily made up of all of the key and script management that used to be in `CWallet`. For convenience, `CWallet` has a `GetLegacyScriptPubKeyMan` which will return the `LegacyScriptPubKeyMan` or a `nullptr` if it does not have one (not yet implemented, but callers will check for the `nullptr`). For purposes of signing, `LegacyScriptPubKeyMan`'s `GetSigningProvider` will return itself rather than a separate `SigningProvider`. This will be different for future `ScriptPubKeyMan`s.
The `LegacyScriptPubKeyMan` will also handle the importing and exporting of keys and scripts instead of `CWallet`. As such, a number of RPCs have been limited to work only if a `LegacyScriptPubKeyMan` can be retrieved from the wallet. These RPCs are `sethdseed`, `addmultisigaddress`, `importaddress`, `importprivkey`, `importpubkey`, `importmulti`, `dumpprivkey`, and `dumpwallet`. Other RPCs which relied on the wallet for scripts and keys have been modified in order to take the `SigningProvider` retrieved from the `ScriptPubKeyMan` for a given script.
Overall, these changes should not effect how everything actually works and the user should experience no difference between having this change and not having it. As such, no functional tests were changed, and the only unit tests changed were those that were directly accessing `CWallet` functions that have been removed.
This PR is the last step in the [Wallet Structure Changes](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes).
ACKs for top commit:
instagibbs:
re-utACK https://github.com/bitcoin/bitcoin/pull/17261/commits/3f373659d732a5b1e5fdc692a45b2b8179f66bec
Sjors:
re-utACK 3f373659d732a5b1e5fdc692a45b2b8179f66bec (it still compiles on macOS after https://github.com/bitcoin/bitcoin/pull/17261#discussion_r370377070)
meshcollider:
Tested re-ACK 3f373659d732a5b1e5fdc692a45b2b8179f66bec
Tree-SHA512: f8e2b8d9efa750b617691e8702d217ec4c33569ec2554a060141d9eb9b9a3a5323e4216938e2485c44625d7a6e0925d40dea1362b3af9857cf08860c2f344716
2019-10-07 20:11:34 +02:00
outputtype.cpp \
2017-05-09 09:11:09 +02:00
policy/feerate.cpp \
2021-11-16 16:19:47 +01:00
policy/policy.cpp \
2013-11-27 15:41:12 +01:00
protocol.cpp \
2022-09-18 23:11:49 +02:00
psbt.cpp \
2021-11-16 16:19:47 +01:00
rpc/rawtransaction_util.cpp \
rpc/util.cpp \
2019-02-26 14:13:19 +01:00
saltedhasher.cpp \
2015-04-02 16:33:45 +02:00
scheduler.cpp \
2021-07-20 17:59:35 +02:00
script/descriptor.cpp \
2014-08-27 17:22:33 +02:00
script/sign.cpp \
2022-07-13 05:46:31 +02:00
script/signingprovider.cpp \
2014-08-23 03:35:51 +02:00
script/standard.cpp \
2016-12-19 12:38:35 +01:00
warnings.cpp \
2014-06-19 15:10:04 +02:00
$( BITCOIN_CORE_H)
# util: shared between all executables.
2022-07-08 10:22:25 +02:00
libbitcoin_util_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libbitcoin_util_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_util_a_SOURCES = \
2019-01-17 15:57:38 +01:00
bls/bls_batchverifier.h \
2018-10-12 19:39:17 +02:00
bls/bls_ies.cpp \
bls/bls_ies.h \
bls/bls_worker.cpp \
bls/bls_worker.h \
2023-12-12 18:02:55 +01:00
coinjoin/common.cpp \
coinjoin/options.cpp \
2016-11-02 11:16:19 +01:00
support/lockedpool.cpp \
2014-06-19 15:10:04 +02:00
chainparamsbase.cpp \
2014-10-29 02:33:23 +01:00
clientversion.cpp \
2014-12-15 10:22:19 +01:00
compat/strnlen.cpp \
2017-04-06 20:19:21 +02:00
fs.cpp \
2021-11-16 16:19:47 +01:00
interfaces/handler.cpp \
2018-04-20 07:02:12 +02:00
logging.cpp \
2024-06-18 16:18:24 +02:00
messagesigner.cpp \
2014-06-26 14:41:53 +02:00
random.cpp \
2022-04-25 11:59:51 +02:00
randomenv.cpp \
2022-02-27 08:46:53 +01:00
rpc/request.cpp \
2019-02-21 19:37:16 +01:00
stacktraces.cpp \
2015-01-21 01:23:25 +01:00
support/cleanse.cpp \
2013-11-27 15:41:12 +01:00
sync.cpp \
2017-08-09 18:06:31 +02:00
threadinterrupt.cpp \
2022-09-18 22:49:22 +02:00
util/asmap.cpp \
2019-02-15 00:10:52 +01:00
util/bip32.cpp \
2021-06-26 12:37:06 +02:00
util/bytevectorhash.cpp \
2023-08-24 10:29:24 +02:00
util/check.cpp \
2024-05-14 19:22:42 +02:00
util/edge.cpp \
2021-06-25 08:07:28 +02:00
util/error.cpp \
util/fees.cpp \
2023-08-23 20:55:19 +02:00
util/hasher.cpp \
2021-02-01 13:35:28 +01:00
util/getuniquepath.cpp \
2022-10-26 13:25:11 +02:00
util/sock.cpp \
2021-06-27 08:33:13 +02:00
util/system.cpp \
2022-09-18 22:49:22 +02:00
util/message.cpp \
2021-06-27 08:33:13 +02:00
util/moneystr.cpp \
2020-11-18 17:13:27 +01:00
util/readwritefile.cpp \
2022-04-14 20:22:46 +02:00
util/settings.cpp \
2023-08-01 11:01:41 +02:00
util/ranges_set.cpp \
2019-07-30 23:53:05 +02:00
util/spanparsing.cpp \
2021-06-27 08:33:13 +02:00
util/strencodings.cpp \
util/time.cpp \
2021-06-16 10:43:28 +02:00
util/serfloat.cpp \
2021-06-27 08:33:13 +02:00
util/string.cpp \
2023-08-26 11:50:37 +02:00
util/thread.cpp \
2021-06-27 08:33:13 +02:00
util/threadnames.cpp \
2021-03-11 15:23:24 +01:00
util/tokenpipe.cpp \
2024-05-10 20:19:03 +02:00
util/wpipe.cpp \
2013-05-28 01:55:01 +02:00
$( BITCOIN_CORE_H)
2020-04-10 18:52:32 +02:00
i f U S E _ L I B E V E N T
libbitcoin_util_a_SOURCES += util/url.cpp
e n d i f
2015-04-03 00:51:08 +02:00
# cli: shared between dash-cli and dash-qt
2022-07-08 10:22:25 +02:00
libbitcoin_cli_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libbitcoin_cli_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libbitcoin_cli_a_SOURCES = \
2019-10-02 18:36:01 +02:00
compat/stdin.h \
compat/stdin.cpp \
2017-07-03 15:13:34 +02:00
rpc/client.cpp \
2013-11-27 15:41:12 +01:00
$( BITCOIN_CORE_H)
2022-07-08 10:22:25 +02:00
nodist_libbitcoin_util_a_SOURCES = $( srcdir) /obj/build.h
2013-05-28 01:55:01 +02:00
#
2020-05-21 09:10:52 +02:00
# dashd & dash-node binaries #
bitcoin_daemon_sources = bitcoind.cpp
bitcoin_bin_cppflags = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
bitcoin_bin_cxxflags = $( AM_CXXFLAGS) $( PIE_FLAGS)
bitcoin_bin_ldflags = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS) $( PTHREAD_FLAGS)
2014-11-21 00:24:50 +01:00
i f T A R G E T _ W I N D O W S
2020-05-21 09:10:52 +02:00
bitcoin_daemon_sources += dashd-res.rc
2014-11-21 00:24:50 +01:00
e n d i f
2020-05-21 09:10:52 +02:00
bitcoin_bin_ldadd = \
2020-12-17 13:46:20 +01:00
$( LIBBITCOIN_WALLET) \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_COMMON) \
$( LIBBITCOIN_UTIL) \
2020-05-21 09:10:52 +02:00
$( LIBUNIVALUE) \
2016-06-01 18:22:20 +02:00
$( LIBBITCOIN_ZMQ) \
2016-02-02 18:37:36 +01:00
$( LIBBITCOIN_CONSENSUS) \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_CRYPTO) \
2022-11-22 18:34:46 +01:00
$( LIBDASHBLS) \
2013-11-12 21:09:55 +01:00
$( LIBLEVELDB) \
2017-06-13 19:38:37 +02:00
$( LIBLEVELDB_SSE42) \
2014-11-05 16:58:37 +01:00
$( LIBMEMENV) \
$( LIBSECP256K1)
2014-06-06 16:57:28 +02:00
2020-05-21 09:10:52 +02:00
bitcoin_bin_ldadd += $( BACKTRACE_LIB) $( BOOST_LIBS) $( BDB_LIBS) $( MINIUPNPC_LIBS) $( NATPMP_LIBS) $( SQLITE_LIBS) $( EVENT_PTHREADS_LIBS) $( EVENT_LIBS) $( ZMQ_LIBS) $( GMP_LIBS)
dashd_SOURCES = $( bitcoin_daemon_sources)
dashd_CPPFLAGS = $( bitcoin_bin_cppflags)
dashd_CXXFLAGS = $( bitcoin_bin_cxxflags)
dashd_LDFLAGS = $( bitcoin_bin_ldflags)
dashd_LDADD = $( LIBBITCOIN_SERVER) $( bitcoin_bin_ldadd)
dash_node_SOURCES = $( bitcoin_daemon_sources)
dash_node_CPPFLAGS = $( bitcoin_bin_cppflags)
dash_node_CXXFLAGS = $( bitcoin_bin_cxxflags)
dash_node_LDFLAGS = $( bitcoin_bin_ldflags)
dash_node_LDADD = $( LIBBITCOIN_SERVER) $( bitcoin_bin_ldadd)
2013-05-28 01:55:01 +02:00
2016-02-02 16:28:56 +01:00
# dash-cli binary #
2022-07-08 10:40:53 +02:00
dash_cli_SOURCES = bitcoin-cli.cpp
2016-02-02 16:28:56 +01:00
dash_cli_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( EVENT_CFLAGS)
dash_cli_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2022-08-23 18:03:33 +02:00
dash_cli_LDFLAGS = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS) $( PTHREAD_FLAGS)
2013-05-28 01:55:01 +02:00
2013-09-18 21:53:29 +02:00
i f T A R G E T _ W I N D O W S
2016-02-02 16:28:56 +01:00
dash_cli_SOURCES += dash-cli-res.rc
2013-09-18 21:53:29 +02:00
e n d i f
2015-03-19 15:15:08 +01:00
dash_cli_LDADD = \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_CLI) \
2015-09-04 16:11:34 +02:00
$( LIBUNIVALUE) \
2016-05-30 15:46:16 +02:00
$( LIBBITCOIN_UTIL) \
2018-06-11 14:41:08 +02:00
$( LIBBITCOIN_CRYPTO)
2022-11-22 18:34:46 +01:00
dash_cli_LDADD += $( BACKTRACE_LIB) $( BOOST_LIBS) $( EVENT_LIBS) $( GMP_LIBS)
2013-10-11 23:09:59 +02:00
#
2015-04-03 00:51:08 +02:00
# dash-tx binary #
2022-07-08 10:40:53 +02:00
dash_tx_SOURCES = bitcoin-tx.cpp
2016-02-02 16:28:56 +01:00
dash_tx_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
dash_tx_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2022-08-23 18:03:33 +02:00
dash_tx_LDFLAGS = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS) $( PTHREAD_FLAGS)
2014-11-21 00:24:50 +01:00
2015-05-02 17:30:38 +02:00
i f T A R G E T _ W I N D O W S
2016-02-02 16:28:56 +01:00
dash_tx_SOURCES += dash-tx-res.rc
2015-05-02 17:30:38 +02:00
e n d i f
2015-04-03 00:51:08 +02:00
dash_tx_LDADD = \
2015-09-04 16:11:34 +02:00
$( LIBUNIVALUE) \
2014-07-29 17:12:44 +02:00
$( LIBBITCOIN_COMMON) \
$( LIBBITCOIN_UTIL) \
2016-02-02 18:37:36 +01:00
$( LIBBITCOIN_CONSENSUS) \
2014-11-05 16:58:37 +01:00
$( LIBBITCOIN_CRYPTO) \
2022-11-22 18:34:46 +01:00
$( LIBDASHBLS) \
2014-11-21 00:24:50 +01:00
$( LIBSECP256K1)
2014-10-13 05:28:58 +02:00
2022-11-22 18:34:46 +01:00
dash_tx_LDADD += $( BACKTRACE_LIB) $( BOOST_LIBS) $( GMP_LIBS)
2013-10-11 23:09:59 +02:00
#
2019-01-31 17:07:45 +01:00
# dash-wallet binary #
2022-07-08 10:40:53 +02:00
dash_wallet_SOURCES = bitcoin-wallet.cpp
2020-05-21 09:10:52 +02:00
dash_wallet_CPPFLAGS = $( bitcoin_bin_cppflags)
dash_wallet_CXXFLAGS = $( bitcoin_bin_cxxflags)
dash_wallet_LDFLAGS = $( bitcoin_bin_ldflags)
dash_wallet_LDADD = $( LIBBITCOIN_WALLET_TOOL) $( bitcoin_bin_ldadd)
2019-01-31 17:07:45 +01:00
i f T A R G E T _ W I N D O W S
dash_wallet_SOURCES += dash-wallet-res.rc
e n d i f
#
2017-04-15 09:29:09 +02:00
# dashconsensus library #
2014-10-15 00:22:55 +02:00
i f B U I L D _ B I T C O I N _ L I B S
2022-08-02 18:35:18 +02:00
include_HEADERS = script/bitcoinconsensus.h
libdashconsensus_la_SOURCES = support/cleanse.cpp $( crypto_libbitcoin_crypto_base_a_SOURCES) $( libbitcoin_consensus_a_SOURCES)
2013-05-28 01:55:01 +02:00
2022-08-02 18:35:18 +02:00
libdashconsensus_la_LDFLAGS = $( AM_LDFLAGS) -no-undefined $( RELDFLAGS)
2022-11-22 18:34:46 +01:00
libdashconsensus_la_LIBADD = $( LIBDASHBLS) $( LIBSECP256K1) $( GMP_LIBS)
2022-08-02 18:35:18 +02:00
libdashconsensus_la_CPPFLAGS = $( AM_CPPFLAGS) -I$( builddir) /obj -I$( srcdir) /secp256k1/include -DBUILD_BITCOIN_INTERNAL
2024-07-12 20:29:37 +02:00
libdashconsensus_la_CPPFLAGS += -isystem$( srcdir) /dashbls/include -isystem$( srcdir) /dashbls/depends/relic/include -isystem$( srcdir) /dashbls/depends/minialloc/include
libdashconsensus_la_CPPFLAGS += -isystem$( srcdir) /immer
2022-08-02 18:35:18 +02:00
libdashconsensus_la_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2014-11-21 00:24:50 +01:00
2014-11-07 04:43:19 +01:00
e n d i f
2014-11-21 00:24:50 +01:00
#
2013-09-14 17:52:42 +02:00
2016-06-01 18:22:20 +02:00
CTAES_DIST = crypto/ctaes/bench.c
CTAES_DIST += crypto/ctaes/ctaes.c
CTAES_DIST += crypto/ctaes/ctaes.h
CTAES_DIST += crypto/ctaes/README.md
CTAES_DIST += crypto/ctaes/test.c
2016-06-10 09:58:37 +02:00
CLEANFILES = $( EXTRA_LIBRARIES)
2015-05-28 02:47:53 +02:00
CLEANFILES += *.gcda *.gcno
CLEANFILES += compat/*.gcda compat/*.gcno
CLEANFILES += consensus/*.gcda consensus/*.gcno
2020-08-15 03:32:11 +02:00
CLEANFILES += crc32c/src/*.gcda crc32c/src/*.gcno
2015-05-28 02:47:53 +02:00
CLEANFILES += crypto/*.gcda crypto/*.gcno
2020-08-15 03:32:11 +02:00
CLEANFILES += index/*.gcda index/*.gcno
CLEANFILES += interfaces/*.gcda interfaces/*.gcno
CLEANFILES += node/*.gcda node/*.gcno
2015-05-28 02:47:53 +02:00
CLEANFILES += policy/*.gcda policy/*.gcno
CLEANFILES += primitives/*.gcda primitives/*.gcno
2020-08-15 03:32:11 +02:00
CLEANFILES += rpc/*.gcda rpc/*.gcno
2015-05-28 02:47:53 +02:00
CLEANFILES += script/*.gcda script/*.gcno
CLEANFILES += support/*.gcda support/*.gcno
CLEANFILES += univalue/*.gcda univalue/*.gcno
2020-08-15 03:32:11 +02:00
CLEANFILES += util/*.gcda util/*.gcno
2015-05-28 02:47:53 +02:00
CLEANFILES += wallet/*.gcda wallet/*.gcno
CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno
CLEANFILES += zmq/*.gcda zmq/*.gcno
2017-10-04 15:07:38 +02:00
CLEANFILES += obj/build.h
2013-05-28 01:55:01 +02:00
2022-11-30 20:21:07 +01:00
IMMER_DIST = immer/immer
2022-11-22 18:34:46 +01:00
LIBDASHBLS_DIST = dashbls
2022-11-30 20:21:07 +01:00
EXTRA_DIST = \
$( CTAES_DIST) \
$( IMMER_DIST) \
$( LIBDASHBLS_DIST)
2017-04-21 10:59:01 +02:00
2022-08-02 18:34:58 +02:00
config/bitcoin-config.h : config /stamp -h 1
2017-04-21 10:59:01 +02:00
@$( MAKE) -C $( top_builddir) $( subdir) /$( @)
2022-08-02 18:34:58 +02:00
config/stamp-h1 : $( top_srcdir ) /$( subdir ) /config /bitcoin -config .h .in $( top_builddir ) /config .status
2017-04-21 10:59:01 +02:00
$( AM_V_at) $( MAKE) -C $( top_builddir) $( subdir) /$( @)
2022-08-02 18:34:58 +02:00
$(top_srcdir)/$(subdir)/config/bitcoin-config.h.in : $( am__configure_deps )
$( AM_V_at) $( MAKE) -C $( top_srcdir) $( subdir) /config/bitcoin-config.h.in
2017-04-21 10:59:01 +02:00
2017-04-21 10:59:01 +02:00
2013-05-28 01:55:01 +02:00
clean-local :
2022-11-22 18:34:46 +01:00
-$( MAKE) -C dashbls clean
2014-11-06 02:56:45 +01:00
-$( MAKE) -C secp256k1 clean
2015-05-28 02:47:53 +02:00
-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno
2014-06-09 20:58:30 +02:00
-rm -f config.h
2016-06-10 09:58:37 +02:00
-rm -rf test/__pycache__
2019-07-02 06:16:11 +02:00
-rm -rf *.dSYM test/*.dSYM bench/*.dSYM qt/*.dSYM qt/test/*.dSYM
2014-05-28 19:38:41 +02:00
2014-06-04 23:13:03 +02:00
.rc.o :
2014-06-05 20:17:50 +02:00
@test -f $( WINDRES)
2016-02-04 13:41:58 +01:00
## FIXME: How to get the appropriate modulename_CPPFLAGS in here?
$( AM_V_GEN) $( WINDRES) $( DEFS) $( DEFAULT_INCLUDES) $( INCLUDES) $( CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@
2014-06-04 23:13:03 +02:00
2016-01-26 20:50:50 +01:00
check-symbols : $( bin_PROGRAMS )
2023-05-13 17:23:21 +02:00
@echo "Running symbol and dynamic library checks..."
2023-06-04 19:34:54 +02:00
$( AM_V_at) $( PYTHON) $( top_srcdir) /contrib/devtools/symbol-check.py $( bin_PROGRAMS)
2016-01-26 20:50:50 +01:00
check-security : $( bin_PROGRAMS )
i f H A R D E N
@echo "Checking binary security..."
2023-06-04 19:34:54 +02:00
$( AM_V_at) $( PYTHON) $( top_srcdir) /contrib/devtools/security-check.py $( bin_PROGRAMS)
2016-01-26 20:50:50 +01:00
e n d i f
2014-06-04 23:13:03 +02:00
2019-07-02 06:16:11 +02:00
osx_debug : $( bin_PROGRAMS )
for i in $( bin_PROGRAMS) ; do mkdir -p $$ i.dSYM/Contents/Resources/DWARF && $( DSYMUTIL_FLAT) -o $$ i.dSYM/Contents/Resources/DWARF/$$ ( basename $$ i) $$ i & > /dev/null ; done
2021-07-15 22:42:55 +02:00
i n c l u d e M a k e f i l e . c r c 3 2 c . i n c l u d e
2016-06-05 21:30:13 +02:00
i n c l u d e M a k e f i l e . l e v e l d b . i n c l u d e
2019-11-21 21:13:08 +01:00
i n c l u d e M a k e f i l e . t e s t _ u t i l . i n c l u d e
2022-09-20 10:32:09 +02:00
i n c l u d e M a k e f i l e . t e s t _ f u z z . i n c l u d e
2019-11-21 21:13:08 +01:00
2014-05-28 19:38:41 +02:00
i f E N A B L E _ T E S T S
i n c l u d e M a k e f i l e . t e s t . i n c l u d e
e n d i f
Simple benchmarking framework
Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)
Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.
The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.
See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'
To compile and run benchmarks:
cd src; make bench
Sample output:
Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
2015-09-24 19:13:38 +02:00
i f E N A B L E _ B E N C H
i n c l u d e M a k e f i l e . b e n c h . i n c l u d e
e n d i f
2014-05-28 19:38:41 +02:00
i f E N A B L E _ Q T
i n c l u d e M a k e f i l e . q t . i n c l u d e
e n d i f
i f E N A B L E _ Q T _ T E S T S
i n c l u d e M a k e f i l e . q t t e s t . i n c l u d e
e n d i f
2022-05-02 17:31:46 +02:00
i n c l u d e M a k e f i l e . u n i v a l u e . i n c l u d e