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.
2015-09-04 16:11:34 +02:00
DIST_SUBDIRS = secp256k1 univalue
2013-09-09 04:02:28 +02:00
2018-03-29 22:57:09 +02:00
AM_LDFLAGS = $( PTHREAD_CFLAGS) $( 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
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
2017-07-04 05:20:19 +02:00
i f E M B E D D E D _ U N I V A L U E
LIBUNIVALUE = univalue/libunivalue.la
$(LIBUNIVALUE) : $( wildcard univalue /lib /*) $( wildcard univalue /include /*)
$( AM_V_at) $( MAKE) $( AM_MAKEFLAGS) -C $( @D) $( @F)
e l s e
LIBUNIVALUE = $( UNIVALUE_LIBS)
e n d i f
2020-03-19 23:46:56 +01:00
BITCOIN_INCLUDES = -I$( builddir) $( BDB_CPPFLAGS) $( BOOST_CPPFLAGS) $( LEVELDB_CPPFLAGS) $( CRYPTO_CFLAGS) $( SSL_CFLAGS)
2014-06-05 21:24:48 +02:00
2014-06-06 16:57:28 +02:00
BITCOIN_INCLUDES += -I$( srcdir) /secp256k1/include
2017-07-04 05:20:19 +02:00
BITCOIN_INCLUDES += $( UNIVALUE_CFLAGS)
2014-06-06 16:57:28 +02:00
2021-03-26 13:32:31 +01:00
BLS_LIBS = -lbls-dash -lgmp
2018-10-03 14:53:21 +02:00
2018-04-18 13:49:57 +02:00
LIBBITCOIN_SERVER = libdash_server.a
LIBBITCOIN_COMMON = libdash_common.a
LIBBITCOIN_CONSENSUS = libdash_consensus.a
LIBBITCOIN_CLI = libdash_cli.a
LIBBITCOIN_UTIL = libdash_util.a
2018-06-11 14:41:08 +02:00
LIBBITCOIN_CRYPTO_BASE = crypto/libdash_crypto_base.a
2018-04-18 13:49:57 +02:00
LIBBITCOINQT = qt/libdashqt.a
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
2018-04-18 13:49:57 +02:00
LIBBITCOIN_ZMQ = libdash_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
LIBBITCOINCONSENSUS = libdashconsensus.la
e n d i f
i f E N A B L E _ W A L L E T
2018-04-18 13:49:57 +02:00
LIBBITCOIN_WALLET = libdash_wallet.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
2019-10-01 13:42:08 +02:00
LIBBITCOIN_CRYPTO_SSE41 = crypto/libdash_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
2019-10-01 13:42:08 +02:00
LIBBITCOIN_CRYPTO_AVX2 = crypto/libdash_crypto_avx2.a
2018-06-11 14:41:08 +02:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_AVX2)
e n d i f
2018-07-09 20:33:41 +02:00
i f E N A B L E _ S H A N I
2019-10-01 13:42:08 +02:00
LIBBITCOIN_CRYPTO_SHANI = crypto/libdash_crypto_shani.a
2018-07-09 20:33:41 +02:00
LIBBITCOIN_CRYPTO += $( LIBBITCOIN_CRYPTO_SHANI)
e n d i f
2018-06-11 14:41:08 +02:00
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) \
$( LIBBITCOIN_ZMQ)
2013-05-28 01:55:01 +02:00
2016-06-01 18:22:20 +02:00
lib_LTLIBRARIES = $( LIBBITCOINCONSENSUS)
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
2014-08-16 06:48:24 +02:00
i f B U I L D _ B I T C O I N _ U T I L S
2015-04-03 00:51:08 +02:00
bin_PROGRAMS += dash-cli dash-tx
2013-09-08 04:44:12 +02:00
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 \
2021-03-22 18:10:27 +01:00
attributes.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 \
2017-05-29 13:51:40 +02:00
bip39.h \
bip39_english.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 \
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
checkpoints.h \
checkqueue.h \
clientversion.h \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin.h \
coinjoin/coinjoin-client.h \
2021-03-27 04:11:33 +01:00
coinjoin/coinjoin-client-options.h \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin-server.h \
coinjoin/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 \
compat/endian.h \
compat/sanity.h \
2014-10-19 04:28:43 +02:00
compressor.h \
2015-01-24 15:29:29 +01:00
consensus/consensus.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 \
2019-03-22 11:52:37 +01:00
evo/cbtx.h \
evo/deterministicmns.h \
2018-05-24 14:28:23 +02:00
evo/evodb.h \
2019-03-22 11:52:37 +01:00
evo/mnauth.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 \
2016-03-02 22:20:04 +01:00
dsnotificationinterface.h \
2019-05-21 15:26:15 +02:00
governance/governance.h \
governance/governance-classes.h \
governance/governance-exceptions.h \
governance/governance-object.h \
governance/governance-validators.h \
governance/governance-vote.h \
governance/governance-votedb.h \
2016-04-10 08:31:32 +02:00
flat-database.h \
2017-05-29 13:51:40 +02:00
hdchain.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 \
2018-06-07 17:59:30 +02:00
index/base.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 \
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-12-26 12:53:29 +01:00
keepass.h \
2014-01-11 15:22:07 +01:00
keystore.h \
2015-10-23 03:33:06 +02:00
dbwrapper.h \
2014-01-11 15:22:07 +01:00
limitedmap.h \
2019-01-08 09:13:56 +01:00
llmq/quorums.h \
2018-11-23 15:42:09 +01:00
llmq/quorums_blockprocessor.h \
2018-05-24 16:14:55 +02:00
llmq/quorums_commitment.h \
2019-01-22 14:20:32 +01:00
llmq/quorums_chainlocks.h \
2019-01-08 09:55:19 +01:00
llmq/quorums_debug.h \
2018-05-24 16:14:55 +02:00
llmq/quorums_dkgsessionhandler.h \
llmq/quorums_dkgsessionmgr.h \
llmq/quorums_dkgsession.h \
2018-11-23 15:42:09 +01:00
llmq/quorums_init.h \
2018-09-21 16:01:04 +02:00
llmq/quorums_instantsend.h \
2019-01-15 15:35:26 +01:00
llmq/quorums_signing.h \
2019-01-17 16:42:03 +01:00
llmq/quorums_signing_shares.h \
2018-05-24 16:14:55 +02:00
llmq/quorums_utils.h \
2018-04-20 07:02:12 +02:00
logging.h \
2019-09-19 19:59:49 +02:00
logging/timer.h \
2019-05-21 15:26:15 +02:00
masternode/activemasternode.h \
masternode/masternode-meta.h \
masternode/masternode-payments.h \
masternode/masternode-sync.h \
masternode/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 \
2017-08-09 02:19:06 +02:00
net_processing.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 \
2020-12-15 17:22:23 +01:00
node/coinstats.h \
2014-01-11 15:22:07 +01:00
noui.h \
2017-05-09 09:11:09 +02:00
policy/feerate.h \
2014-08-26 22:28:32 +02:00
policy/fees.h \
2015-06-24 07:25:30 +02:00
policy/policy.h \
2014-03-10 16:46:53 +01:00
pow.h \
2014-01-11 15:22:07 +01:00
protocol.h \
2014-06-26 14:41:53 +02:00
random.h \
2017-04-13 00:24:40 +02:00
reverse_iterator.h \
2015-09-03 18:53:00 +02:00
reverselock.h \
2017-03-31 12:57:22 +02:00
rpc/blockchain.h \
2017-07-03 15:13:34 +02:00
rpc/client.h \
2017-07-03 13:55:20 +02:00
rpc/mining.h \
2017-07-03 15:13:34 +02:00
rpc/protocol.h \
rpc/server.h \
2018-02-20 03:29:22 +01:00
rpc/rawtransaction.h \
2016-03-31 10:55:06 +02:00
rpc/register.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 \
2020-12-17 13:46:20 +01:00
script/ismine.h \
2014-09-10 16:16:09 +02:00
script/sigcache.h \
2014-08-27 17:22:33 +02:00
script/sign.h \
2014-08-23 03:35:51 +02:00
script/standard.h \
2021-06-21 00:49:59 +02:00
shutdown.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 \
threadsafety.h \
2017-08-09 18:06:31 +02:00
threadinterrupt.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 \
ui_interface.h \
2014-10-18 19:53:37 +02:00
undo.h \
2019-03-11 06:33:46 +01:00
unordered_lru_cache.h \
2021-06-26 12:37:06 +02:00
util/bytevectorhash.h \
2021-06-25 08:07:28 +02:00
util/error.h \
util/fees.h \
2021-06-27 08:33:13 +02:00
util/system.h \
util/asmap.h \
2019-09-25 16:55:52 +02:00
util/macros.h \
2021-06-27 08:33:13 +02:00
util/memory.h \
util/moneystr.h \
2021-06-16 10:43:28 +02:00
util/serfloat.h \
2021-06-27 08:33:13 +02:00
util/string.h \
util/time.h \
util/threadnames.h \
2019-10-10 20:23:41 +02:00
util/vector.h \
2021-06-25 08:07:28 +02:00
util/url.h \
util/validation.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 \
2020-04-18 11:59:40 +02:00
walletinitinterface.h \
2016-10-21 15:30:14 +02:00
wallet/coincontrol.h \
2015-03-22 20:18:55 +01:00
wallet/crypter.h \
2015-05-13 18:59:50 +02:00
wallet/db.h \
2017-08-02 13:19:28 +02:00
wallet/fees.h \
2016-01-20 15:15:29 +01:00
wallet/rpcwallet.h \
2015-02-03 21:09:47 +01:00
wallet/wallet.h \
2014-11-18 18:06:32 +01:00
wallet/walletdb.h \
2017-11-18 14:32:50 +01:00
wallet/walletutil.h \
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.h \
2016-12-19 12:38:35 +01:00
warnings.h \
2014-11-18 18:06:32 +01:00
zmq/zmqabstractnotifier.h \
zmq/zmqconfig.h\
zmq/zmqnotificationinterface.h \
2018-07-09 17:05:14 +02:00
zmq/zmqpublishnotifier.h \
zmq/zmqrpc.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) "
2018-04-18 13:49:57 +02:00
libdash_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
2018-04-18 13:49:57 +02:00
libdash_server_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( MINIUPNPC_CPPFLAGS) $( EVENT_CFLAGS) $( EVENT_PTHREADS_CFLAGS)
libdash_server_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_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 \
2017-05-03 11:36:20 +02:00
addrman.cpp \
2018-09-14 13:59:02 +02:00
batchedlogger.cpp \
2013-11-20 14:18:57 +01:00
bloom.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 \
2013-11-29 16:50:11 +01:00
checkpoints.cpp \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin.cpp \
coinjoin/coinjoin-server.cpp \
2019-07-23 11:20:23 +02:00
consensus/tx_verify.cpp \
2017-12-01 19:53:34 +01:00
dsnotificationinterface.cpp \
2019-03-22 11:52:37 +01:00
evo/cbtx.cpp \
evo/deterministicmns.cpp \
2018-05-24 14:28:23 +02:00
evo/evodb.cpp \
2019-03-22 11:52:37 +01:00
evo/mnauth.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 \
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 \
2018-06-07 17:59:30 +02:00
index/base.cpp \
2021-05-25 12:48:04 +02:00
index/txindex.cpp \
2018-09-12 17:11:12 +02:00
interfaces/handler.cpp \
interfaces/node.cpp \
2013-11-29 16:50:11 +01:00
init.cpp \
2015-10-23 03:33:06 +02:00
dbwrapper.cpp \
2019-05-21 15:26:15 +02:00
governance/governance.cpp \
governance/governance-classes.cpp \
governance/governance-object.cpp \
governance/governance-validators.cpp \
governance/governance-vote.cpp \
governance/governance-votedb.cpp \
2019-01-08 09:13:56 +01:00
llmq/quorums.cpp \
2018-11-23 15:42:09 +01:00
llmq/quorums_blockprocessor.cpp \
2018-05-24 16:14:55 +02:00
llmq/quorums_commitment.cpp \
2019-01-22 14:20:32 +01:00
llmq/quorums_chainlocks.cpp \
2019-01-08 09:55:19 +01:00
llmq/quorums_debug.cpp \
2018-05-24 16:14:55 +02:00
llmq/quorums_dkgsessionhandler.cpp \
llmq/quorums_dkgsessionmgr.cpp \
llmq/quorums_dkgsession.cpp \
2018-11-23 15:42:09 +01:00
llmq/quorums_init.cpp \
2018-09-21 16:01:04 +02:00
llmq/quorums_instantsend.cpp \
2019-01-15 15:35:26 +01:00
llmq/quorums_signing.cpp \
2019-01-17 16:42:03 +01:00
llmq/quorums_signing_shares.cpp \
2018-05-24 16:14:55 +02:00
llmq/quorums_utils.cpp \
2019-05-21 15:26:15 +02:00
masternode/activemasternode.cpp \
masternode/masternode-meta.cpp \
masternode/masternode-payments.cpp \
masternode/masternode-sync.cpp \
masternode/masternode-utils.cpp \
2014-10-30 23:50:15 +01:00
merkleblock.cpp \
2017-04-12 09:04:06 +02:00
messagesigner.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 \
2020-12-15 17:22:23 +01:00
node/coinstats.cpp \
2013-11-29 16:50:11 +01:00
noui.cpp \
2014-08-26 22:28:32 +02:00
policy/fees.cpp \
2014-10-12 00:41:05 +02:00
policy/policy.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 \
rpc/masternode.cpp \
rpc/governance.cpp \
rpc/mining.cpp \
rpc/misc.cpp \
rpc/net.cpp \
rpc/rawtransaction.cpp \
2018-02-13 13:36:59 +01:00
rpc/rpcevo.cpp \
2019-01-08 09:55:19 +01:00
rpc/rpcquorums.cpp \
2017-07-03 15:13:34 +02:00
rpc/server.cpp \
2021-03-17 23:36:11 +01:00
rpc/coinjoin.cpp \
2018-06-24 16:52:59 +02:00
rpc/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 \
2016-04-19 16:10:39 +02:00
ui_interface.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)
2014-11-18 18:06:32 +01:00
i f E N A B L E _ Z M Q
2018-04-18 13:49:57 +02:00
libdash_zmq_a_CPPFLAGS = $( BITCOIN_INCLUDES) $( ZMQ_CFLAGS)
libdash_zmq_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_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 \
zmq/zmqrpc.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
2018-04-18 13:49:57 +02:00
libdash_wallet_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libdash_wallet_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_wallet_a_SOURCES = \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin-client.cpp \
2021-03-27 04:11:33 +01:00
coinjoin/coinjoin-client-options.cpp \
2021-03-17 23:36:11 +01:00
coinjoin/coinjoin-util.cpp \
2020-10-01 16:05:57 +02:00
interfaces/wallet.cpp \
2014-12-26 12:53:29 +01:00
keepass.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 \
2015-03-22 20:18:55 +01:00
wallet/crypter.cpp \
2015-02-03 21:09:47 +01:00
wallet/db.cpp \
2017-08-02 13:19:28 +02:00
wallet/fees.cpp \
wallet/init.cpp \
2015-02-03 21:09:47 +01:00
wallet/rpcdump.cpp \
wallet/rpcwallet.cpp \
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)
2014-06-19 15:10:04 +02:00
# crypto primitives library
2017-09-05 23:15:41 +02:00
crypto_libdash_crypto_base_a_CPPFLAGS = $( AM_CPPFLAGS) $( PIC_FLAGS)
2018-06-11 14:41:08 +02:00
crypto_libdash_crypto_base_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS) $( PIC_FLAGS)
crypto_libdash_crypto_base_a_SOURCES = \
2016-06-01 18:22:20 +02:00
crypto/aes.cpp \
crypto/aes.h \
2019-07-11 21:36:46 +02:00
crypto/chacha_poly_aead.h \
crypto/chacha_poly_aead.cpp \
2017-04-24 14:02:12 +02:00
crypto/chacha20.h \
crypto/chacha20.cpp \
2014-06-09 21:17:27 +02:00
crypto/common.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 \
2019-03-27 11:46:07 +01:00
crypto/poly1305.h \
crypto/poly1305.cpp \
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
2018-06-11 14:41:08 +02:00
crypto_libdash_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
2017-07-20 20:16:28 +02:00
e n d i f
2019-10-01 13:42:08 +02:00
crypto_libdash_crypto_sse41_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libdash_crypto_sse41_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libdash_crypto_sse41_a_CXXFLAGS += $( SSE41_CXXFLAGS)
crypto_libdash_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
crypto_libdash_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
2018-06-04 09:11:18 +02:00
2019-10-01 13:42:08 +02:00
crypto_libdash_crypto_avx2_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libdash_crypto_avx2_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libdash_crypto_avx2_a_CXXFLAGS += $( AVX2_CXXFLAGS)
crypto_libdash_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
crypto_libdash_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
2019-10-01 13:42:08 +02:00
crypto_libdash_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
2019-10-01 13:42:08 +02:00
crypto_libdash_crypto_shani_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
crypto_libdash_crypto_shani_a_CPPFLAGS = $( AM_CPPFLAGS)
crypto_libdash_crypto_shani_a_CXXFLAGS += $( SHANI_CXXFLAGS)
crypto_libdash_crypto_shani_a_CPPFLAGS += -DENABLE_SHANI
crypto_libdash_crypto_shani_a_SOURCES = crypto/sha256_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.
2018-04-18 13:49:57 +02:00
libdash_consensus_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libdash_consensus_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_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 \
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 \
script/dashconsensus.cpp \
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 \
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
2018-04-18 13:49:57 +02:00
libdash_common_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libdash_common_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_common_a_SOURCES = \
2014-06-25 10:03:00 +02:00
base58.cpp \
2020-12-25 05:33:37 +01:00
bech32.cpp \
2017-05-29 13:51:40 +02:00
bip39.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 \
2017-05-29 13:51:40 +02:00
hdchain.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 \
2014-06-25 10:03:00 +02:00
keystore.cpp \
2017-09-03 15:29:10 +02:00
netaddress.cpp \
2013-11-27 15:41:12 +01:00
netbase.cpp \
2017-05-09 09:11:09 +02:00
policy/feerate.cpp \
2013-11-27 15:41:12 +01:00
protocol.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 \
2020-12-17 13:46:20 +01:00
script/ismine.cpp \
2014-08-27 17:22:33 +02:00
script/sign.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.
# This library *must* be included to make sure that the glibc
# backward-compatibility objects and their sanity checks are linked.
2018-04-18 13:49:57 +02:00
libdash_util_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libdash_util_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_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 \
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/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \
compat/strnlen.cpp \
2017-04-06 20:19:21 +02:00
fs.cpp \
2018-04-20 07:02:12 +02:00
logging.cpp \
2014-06-26 14:41:53 +02:00
random.cpp \
2017-07-03 15:13:34 +02:00
rpc/protocol.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 \
2021-06-26 12:37:06 +02:00
util/bytevectorhash.cpp \
2021-06-25 08:07:28 +02:00
util/error.cpp \
util/fees.cpp \
2021-06-27 08:33:13 +02:00
util/system.cpp \
util/asmap.cpp \
util/moneystr.cpp \
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 \
util/threadnames.cpp \
2021-06-25 08:07:28 +02:00
util/url.cpp \
util/validation.cpp \
2013-05-28 01:55:01 +02:00
$( BITCOIN_CORE_H)
2014-03-28 00:58:41 +01:00
i f G L I B C _ B A C K _ C O M P A T
2018-04-18 13:49:57 +02:00
libdash_util_a_SOURCES += compat/glibc_compat.cpp
2018-07-12 15:28:59 +02:00
AM_LDFLAGS += -Wl,--wrap= log2f -Wl,--wrap= __divmoddi4
2014-03-28 00:58:41 +01:00
e n d i f
2015-04-03 00:51:08 +02:00
# cli: shared between dash-cli and dash-qt
2018-04-18 13:49:57 +02:00
libdash_cli_a_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
libdash_cli_a_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
libdash_cli_a_SOURCES = \
2017-07-03 15:13:34 +02:00
rpc/client.cpp \
2013-11-27 15:41:12 +01:00
$( BITCOIN_CORE_H)
2018-04-18 13:49:57 +02:00
nodist_libdash_util_a_SOURCES = $( srcdir) /obj/build.h
2013-05-28 01:55:01 +02:00
#
2018-04-18 13:49:57 +02:00
# dashd binary #
2016-02-02 16:28:56 +01:00
dashd_SOURCES = dashd.cpp
dashd_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
dashd_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2019-02-21 19:37:16 +01:00
dashd_LDFLAGS = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS)
2014-11-21 00:24:50 +01:00
i f T A R G E T _ W I N D O W S
2016-02-02 16:28:56 +01:00
dashd_SOURCES += dashd-res.rc
2014-11-21 00:24:50 +01:00
e n d i f
2015-03-19 15:15:08 +01:00
dashd_LDADD = \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_SERVER) \
2020-12-17 13:46:20 +01:00
$( LIBBITCOIN_WALLET) \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_COMMON) \
2015-09-04 16:11:34 +02:00
$( LIBUNIVALUE) \
2014-06-19 15:10:04 +02:00
$( LIBBITCOIN_UTIL) \
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) \
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
2019-02-21 19:37:16 +01:00
dashd_LDADD += $( BACKTRACE_LIB) $( BOOST_LIBS) $( BDB_LIBS) $( SSL_LIBS) $( CRYPTO_LIBS) $( MINIUPNPC_LIBS) $( EVENT_PTHREADS_LIBS) $( EVENT_LIBS) $( ZMQ_LIBS) $( BLS_LIBS)
2013-05-28 01:55:01 +02:00
2016-02-02 16:28:56 +01:00
# dash-cli binary #
dash_cli_SOURCES = dash-cli.cpp
dash_cli_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES) $( EVENT_CFLAGS)
dash_cli_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2019-02-21 19:37:16 +01:00
dash_cli_LDFLAGS = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS)
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)
2019-02-21 19:37:16 +01:00
dash_cli_LDADD += $( BACKTRACE_LIB) $( BOOST_LIBS) $( SSL_LIBS) $( CRYPTO_LIBS) $( EVENT_LIBS) $( BLS_LIBS)
2013-10-11 23:09:59 +02:00
#
2015-04-03 00:51:08 +02:00
# dash-tx binary #
2016-02-02 16:28:56 +01:00
dash_tx_SOURCES = dash-tx.cpp
dash_tx_CPPFLAGS = $( AM_CPPFLAGS) $( BITCOIN_INCLUDES)
dash_tx_CXXFLAGS = $( AM_CXXFLAGS) $( PIE_FLAGS)
2019-02-21 19:37:16 +01:00
dash_tx_LDFLAGS = $( LDFLAGS_WRAP_EXCEPTIONS) $( RELDFLAGS) $( AM_LDFLAGS) $( LIBTOOL_APP_LDFLAGS)
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) \
2014-11-21 00:24:50 +01:00
$( LIBSECP256K1)
2014-10-13 05:28:58 +02:00
2019-02-21 19:37:16 +01:00
dash_tx_LDADD += $( BACKTRACE_LIB) $( BOOST_LIBS) $( CRYPTO_LIBS) $( BLS_LIBS)
2013-10-11 23:09:59 +02:00
#
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
2017-04-15 09:29:09 +02:00
include_HEADERS = script/dashconsensus.h
2018-06-11 14:41:08 +02:00
libdashconsensus_la_SOURCES = support/cleanse.cpp $( crypto_libdash_crypto_base_a_SOURCES) $( libdash_consensus_a_SOURCES)
2013-05-28 01:55:01 +02:00
2014-10-15 00:22:55 +02:00
i f G L I B C _ B A C K _ C O M P A T
2017-04-15 09:29:09 +02:00
libdashconsensus_la_SOURCES += compat/glibc_compat.cpp
2014-10-15 00:22:55 +02:00
e n d i f
2013-05-28 01:55:01 +02:00
2017-04-15 09:29:09 +02:00
libdashconsensus_la_LDFLAGS = $( AM_LDFLAGS) -no-undefined $( RELDFLAGS)
2018-10-03 14:53:21 +02:00
libdashconsensus_la_LIBADD = $( LIBSECP256K1) $( BLS_LIBS)
2017-04-15 09:29:09 +02:00
libdashconsensus_la_CPPFLAGS = $( AM_CPPFLAGS) -I$( builddir) /obj -I$( srcdir) /secp256k1/include -DBUILD_BITCOIN_INTERNAL
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
CLEANFILES += crypto/*.gcda crypto/*.gcno
CLEANFILES += policy/*.gcda policy/*.gcno
CLEANFILES += primitives/*.gcda primitives/*.gcno
CLEANFILES += script/*.gcda script/*.gcno
CLEANFILES += support/*.gcda support/*.gcno
CLEANFILES += univalue/*.gcda univalue/*.gcno
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
2018-08-29 15:31:21 +02:00
IMMER_DIST = immer
2016-06-10 09:58:37 +02:00
EXTRA_DIST = $( CTAES_DIST)
2018-08-29 15:31:21 +02:00
EXTRA_DIST += $( IMMER_DIST)
2013-05-28 01:55:01 +02:00
2017-04-21 10:59:01 +02:00
config/dash-config.h : config /stamp -h 1
@$( MAKE) -C $( top_builddir) $( subdir) /$( @)
config/stamp-h1 : $( top_srcdir ) /$( subdir ) /config /dash -config .h .in $( top_builddir ) /config .status
$( AM_V_at) $( MAKE) -C $( top_builddir) $( subdir) /$( @)
$(top_srcdir)/$(subdir)/config/dash-config.h.in : $( am__configure_deps )
$( AM_V_at) $( MAKE) -C $( top_srcdir) $( subdir) /config/dash-config.h.in
2017-04-21 10:59:01 +02:00
2013-05-28 01:55:01 +02:00
clean-local :
2014-11-06 02:56:45 +01:00
-$( MAKE) -C secp256k1 clean
2015-10-13 19:40:47 +02:00
-$( MAKE) -C univalue 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 )
i f G L I B C _ B A C K _ C O M P A T
@echo "Checking glibc back compat..."
2019-03-18 16:31:05 +01:00
$( AM_V_at) READELF = $( READELF) CPPFILT = $( CPPFILT) $( PYTHON) $( top_srcdir) /contrib/devtools/symbol-check.py < $( bin_PROGRAMS)
2016-01-26 20:50:50 +01:00
e n d i f
check-security : $( bin_PROGRAMS )
i f H A R D E N
@echo "Checking binary security..."
2019-03-18 16:31:05 +01:00
$( AM_V_at) READELF = $( READELF) OBJDUMP = $( OBJDUMP) $( 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
2014-06-04 23:13:03 +02:00
%.pb.cc %.pb.h : %.proto
2014-06-05 20:17:50 +02:00
@test -f $( PROTOC)
2016-04-05 17:37:57 +02:00
$( AM_V_GEN) $( PROTOC) --cpp_out= $( @D) --proto_path= $( <D) $<
2014-06-04 23:13:03 +02:00
2016-06-05 21:30:13 +02:00
i f E M B E D D E D _ L E V E L D B
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
e n d i f
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