Commit Graph

187 Commits

Author SHA1 Message Date
Alexander Block
a173e6836c Implement integration tests for DKG error handling (#2905)
* Allow modifying simulate DKG error rates via RPC

* Don't lie to yourself :)

* Add some missing new-lines in LogPrintf calls

* More fine grained control over which messages to expect in mine_quorum

* Implement llmq-dkgerrors.py integration tests

These test DKG errors and malicious behavior.
2019-05-08 12:13:27 +03:00
Alexander Block
66a2cdeafc Properly handle conflicts between ChainLocks and InstantSend (#2904)
* Move code to write archived ISLOCKs into its own method

We'll need this from another method as well later.

* Return ISLOCK instead of conflicting txid in GetConflictingTx/GetConflictingLock

* Implement GetInstantSendLocksByParent and RemoveChainedInstantSendLocks

These allow to easily delete multiple chains (actually trees) of ISLOCKs
in one go.

* Implement RemoveConflictedTx and call it from RemoveMempoolConflictsForLock

Also add "retryChildren" parameter to RemoveNonLockedTx so that we can
skip retrying of non-locked children TXs.

* Properly handle/remove conflicted TXs (between mempool and new blocks)

* Track non-locked TXs by inputs

* Implement and call ResolveBlockConflicts

* Also call ResolveBlockConflicts from ConnectBlock

But only when a block is known to have a conflict and at the same time is
ChainLocked, which causes the ISLOCK to be pruned.

* Split out RemoveChainLockConflictingLock from ResolveBlockConflicts

* Implement "quorum getrecsig" RPC

* Include decoded TX data in result of create_raw_tx

* Implement support for CLSIG in mininode.py

* Fix condition for update of nonLockedTxs.pindexMined

* Only add entries to nonLockedTxsByInputs when AddNonLockedTx is called for the first time

* Implement support for ISLOCK in mininode.py

* Implement tests for ChainLock vs InstantSend lock conflict resolution

* Handle review comment

Bail out (continue) early
2019-05-07 15:14:33 +03:00
Alexander Block
999848432a Implement dip4-coinbasemerkleroots.py integration tests 2019-04-04 10:39:15 +02:00
UdjinM6
e52763d21b Refactor and fix instantsend tests/utils (#2776)
* Unify autoIS/send_smth functions

* Rename autoix-mempool.py -> autois-mempool.py

* Make sure create_raw_trx produces expected results

* Make sure sender has enough inputs and nodes are synced before starting the actual test

* Mine one block to clean mempool up

* 2 blocks is enough for IS on regtest

This also unifies it across different IS tests

* Allow wait_for_instantlock to be called on any node, not only on the one that has the tx in the wallet

* No need to query for tx this often in wait_for_instantlock

* Rename create_raw_trx -> create_raw_tx

* Fund sender with a single TX instead of 30
2019-03-18 14:50:44 +01:00
Wladimir J. van der Laan
d1a6022605 Merge #11113: [net] Ignore getheaders requests for very old side blocks
eff4bd8 [test] P2P functional test for certain fingerprinting protections (Jim Posen)
a2be3b6 [net] Ignore getheaders requests for very old side blocks (Jim Posen)

Pull request description:

  Sending a getheaders message with an empty locator and a stop hash is a request for a single header by hash. The node will respond with headers for blocks not in the main chain as well as those in the main chain. To avoid fingerprinting, the node should, however, ignore requests for headers on side branches that are too old. This replicates the logic that currently exists for `getdata` requests for blocks.

Tree-SHA512: e04ef61e2b73945be6ec5977b3c5680b6dc3667246f8bfb67afae1ecaba900c0b49b18bbbb74869f7a37ef70b6ed99e78ebe0ea0a1569369fad9e447d720ffc4
2019-03-12 10:43:47 +01:00
Alexander Block
e21da2d99b Move simple PoSe tests into llmq-simplepose.py
These tend to fail quite often on Travis due to multiple reasons. One
reason is that establishing intra quorum connections take some time and
the tests in dip3-deterministicmns.py did not sleep long enough. Another
reason is that the individual stages were not really checked for completion
but instead just a hardcoded sleep was used. And another reason was that
with a total of 13 MNs, it's not guaranteed that every DKG results in one
MN to be punished.
2019-03-12 07:02:52 +01:00
Alexander Block
886299a400 Implement llmq-chainlocks.py integration tests 2019-01-28 12:24:15 +01:00
Alexander Block
4d25148c03 Add llmq-signing.py tests 2019-01-21 14:42:08 +01:00
PastaPastaPasta
07dcddb4ca Backports 0.15 pr2 (#2597)
* Merge #9815: Trivial: use EXIT_ codes instead of magic numbers

a87d02a use EXIT_ codes instead of magic numbers (Marko Bencun)

* Merge #9801: Removed redundant parameter from mempool.PrioritiseTransaction

eaea2bb Removed redundant parameter from mempool.PrioritiseTransaction (gubatron)

* remove extra parameter (see 3a3745bb) in dash specific code

* Merge #9819: Remove harmless read of unusued priority estimates

bc8fd12 Remove harmless read of unusued priority estimates (Alex Morcos)

* Merge #9766: Add --exclude option to rpc-tests.py

c578408 Add exclude option to rpc-tests.py (John Newbery)

* Merge #9577: Fix docstrings in qa tests

3f95a80 Fix docstrings in qa tests (John Newbery)

* Merge #9823: qa: Set correct path for binaries in rpc tests

3333ad0 qa: Set correct path for binaries in rpc tests (MarcoFalke)

* Merge #9833: Trivial: fix comments referencing AppInit2

ef9f495 Trivial: fix comments referencing AppInit2 (Marko Bencun)

* Merge #9612: [trivial] Rephrase the definition of difficulty.

dc222f8 Trivial: Rephrase the definition of difficulty in the code. (Karl-Johan Alm)

* Merge #9847: Extra test vector for BIP32

30aedcb BIP32 extra test vector (Pieter Wuille)

* Merge #9839: [qa] Make import-rescan.py watchonly check reliable

864890a [qa] Make import-rescan.py watchonly check reliable (Russell Yanofsky)

Tree-SHA512: ea0e2b1d4fc8f35174c3d575fb751b428daf6ad3aa944fad4e3ddcc9195e4f17051473acabc54203b1d27cca64cf911b737ab92e986c40ef384410652e2dbea1

* Change back file params
2019-01-07 12:55:35 +03:00
PastaPastaPasta
a49f4123e5 Backports 0.15 pr1 (#2590)
* Merge #9744: Remove unused module from rpc-tests

a432aa0 Remove unused module from rpc-tests (Takashi Mitsuta)

* Merge #9696: [trivial] Fix recently introduced typos in comments

0c9b9b7 [trivial] Fix recently introduced typos in comments (practicalswift)

* Merge #9657: Improve rpc-tests.py

a6a3e58 Various review markups for rpc-tests.py improvements (John Newbery)
3de3ccd Refactor rpc-tests.py (John Newbery)
afd38e7 Improve rpc-tests.py arguments (John Newbery)
91bffff Use argparse in rpc_tests.py (John Newbery)
1581ecb Use configparser in rpc-tests.py (John Newbery)

* Merge #9724: Qt/Intro: Add explanation of IBD process

f6d18f5 Qt/Intro: Explain a bit more what will happen first time (Luke Dashjr)
50c5657 Qt/Intro: Storage shouldn't grow significantly with pruning enabled (Luke Dashjr)
9adb694 Qt/Intro: Move sizeWarningLabel text into C++ code (Luke Dashjr)

* Merge #9794: Minor update to qrencode package builder

1bfe6b4 Use package name variable inside $(package)_file_name variable (Mitchell Cash)

* Merge #9726: netbase: Do not print an error on connection timeouts through proxy

3ddfe29 netbase: Do not print an error on connection timeouts through proxy (Wladimir J. van der Laan)
13f6085 netbase: Make InterruptibleRecv return an error code instead of bool (Wladimir J. van der Laan)

* Merge #9727: Remove fallbacks for boost_filesystem < v3

056aba2 Remove fallbacks for boost_filesystem < v3 (Wladimir J. van der Laan)

* Merge #9485: ZMQ example using python3 and asyncio

b471daf Adddress nits, use asyncio signal handling, create_task (Bob McElrath)
4bb7d1b Add python version checks and 3.4 example (Bob McElrath)
5406d51 Rewrite to not use Polling wrapper for asyncio, link to python2.7 example (Bob McElrath)
5ea5368 ZMQ example using python3 and asyncio (Bob McElrath)

* Merge #9807: RPC doc fix-ups.

851f6a3 [qa][doc] Correct rpc test options in readme (fanquake)
41e7219 [trivial] Add tests_config.ini to .gitignore (fanquake)

* Dashify

Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>

* Change file permissions

* update travis.yml -parallel -> --jobs
2019-01-03 12:18:47 +03:00
gladcow
f7ab6c469c M-of-N-like sporks (#2288)
* support set of keys to sign spork

* several addresses support in -sporkkey

* tests for multykey sporks

* command line option -minsporkkeys

* make spork active only after given number of signers

* use signature in spork hash calculation

* test for new and old spork messages interaction

* add multikeyspork.py to integration tests

* change test to have ability to distinguish default spork value

* require min spork keys number to be more than the half of the common spork keys number

* calc current spork value with majority of signers

* set test nodes time in integration test

* extract keyid from signed spork message directly

* change -sporkaddr option syntax to process several addresses

* codestyle fixes

* fix test comments

* codestyle fixes

* simplify CSporkManager::SporkValueIsActive

* Calc signature hash without signature field

* do not restore pubkey ids from cach

* Calc different keyids to check signature because not all sporks can be synced at moment

* codestyle fixes

* Fix CSporkManager::CheckAndRemove to use several keys

* codestyle fixes

* Correct processing of not actual spork6 value with GetSignerKeyID
2018-09-30 20:01:33 +03:00
gladcow
5454bea377 Automatic InstantSend locks for "simple" transactions (#2140)
* add locktransaction rpc call

* Remove special instantsend fee for simple transactions

* Function to check if trx is simple enough to be autolocked

* Automatic lock for all received from peers simple trxes

If we get a new transaction with CInv message and it is "simple" and
is accepted in mempool, we initiate its lock. We don't lock orphan trxes
that accepted in mempool after this trx because they are locked by other
peers.

* Automatically lock simple trxes in wallet

* protocol bump for InstantSend without special fee

* Add function to detect used mempool share

* Mempool threshold for auto IX locks

* Add SPORK_16_INSTANTSEND_AUTOLOCKS spork

* Make autolocks active only when spork SPORK_16_INSTANTSEND_AUTOLOCKS is active

* BIP9 autolocks activation

* revert increasing min peer protocol version for mn rank

* move IsTrxSimple check to CTxLockRequest class

* make MAX_INPUTS_FOR_AUTO_IX private member of CTxLockRequest class

* make AUTO_IX_MEMPOOL_THRESHOLD private member of CInstantSend class

* remove locktransaction RPC call

* tests for automatic IS locks

* fix mempool threshod calculation

* bump mocktime in activate_autoix_bip9

* set node times

* no need to spam the node with gettransaction rpc requests that often

* use `spork active` instead of leaking spork logic into tests

* codestyle fixes

* add test description in comments

* fix typo

* sync test nodes more often during BIP9 activation

* Use 4th bit in BIP9 activation

* Fix comments according codestyle guide

* Call AcceptLockRequest and Vote at the first node creating autoix lock

* fix mempool used memory calculation

* rallback not necessary change in CWallet::CreateTransaction

* test for stopping autolocks for full mempool

* Inject "simple autolockable" txes into txlockrequest logic
2018-09-26 17:17:47 +03:00
PastaPastaPasta
8ea40102c0 Remove leftover RBF code from BTC (#2297)
* Remove leftover RBF code from BTC

* remove rbf #include

* remove rbf in rpc-tests

* removes replace-by-fee.py

* remove help text related to rbf

* remove comment text relating to rbf

* remove "-mempoolreplacement" cli option

* Remove (effectively dead) RBF code which would never have been called anyway and some assosiated variables

* since `setConflicts` is always empty, this is dead code

* Since we don't have RBF, don't have to do this check. Also, since `setConflicts` is always empty this is dead code

* removes unneccesary if as it will always be true

* remove unused `set<uint256> setConflicts`

* Removes replacement of conflicting txs, as conflicting txs are never accepted

* removes RBF from `validForFeeEstimation`

* removes (probably) unnecessary lock

* remove replacing part of the AcceptToMemoryPool and AcceptToMemoryPoolWIthTime

* fixes err in ps.cpp, didn't remove arg

* RBF in net_processing.cpp

* remove arg in ps-server.cpp

* removes another arg in PS code

* removes rawtx.c AcceptToMemoryPool arg

* removes arg in txvalidationcache_tests.cpp

* remove extra args

* forgot an arg

* fix typo in 82898b0

* remove unused fEnableReplacement in validation.h

* remove the removal reason REPLACED in txmempool.h

* removed unused variable

* comment typo
2018-09-20 15:39:34 +03:00
Alexander Block
47ca06ab33 DIP3 integration tests (#2280)
* Implement dip3 integration tests

This tests the full upgrade path from legacy MNs to deterministic MNs

* Invoke UpdatedBlockTip signal when invalidateblock RPC is called

Currently, UpdatedBlockTip would only be called if the invalidation resulted
in another chain becoming the longest one. This is inconsistent behavior
and was spotted when running dip3 integration tests.
2018-09-11 17:32:45 +03:00
gladcow
1767e3457e Save/load spork cache (#2206)
* CSporkManager class serialization

* Read/write sporks.dat file

* Move mapSporks into CSporkManager and serialize it

* fix GetSporkByHash

* spork tests

* add missed cs lock

* clear mapSporksByHash in CSporkManager::Clear

* use spork active rpc call to hide spork inner logic

* set small pause between rpc calls in cycles
2018-08-13 23:21:21 +03:00
gladcow
6da2837bdd InstantSend Integration tests (#2141)
* adjust `AddLocal` method only in regtest mode

* Create Masternodes in regtest

* sentinelping call for masternodes

* set externalip option for masternodes in regtest

* fix MNB relay during masternodes creation

* fix node_count naming

* instantsend doublespend

* decrease node restarts

* prevent spending masternode collaterals

* move long test to the test list start

* remove InstantSend spork sending

* remove spork-specific code

* fix checking double spend rejection
2018-07-12 12:04:42 +03:00
Alexander Block
8b4c419ed6 Revert "Merge #7542: Implement "feefilter" P2P message" (#2025)
This reverts commit 11ac70af9e.
2018-04-11 18:16:43 +03:00
gladcow
bc45a2f87a 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 58a215ce8c

* Backport missed comments and mapBlockSource.emplace call

Missed from two commits:
88c35491ab
7c98ce584e

* Add CheckPeerHeaders() helper and check in (nCount == 0) too
2018-04-11 14:06:01 +03:00
Wladimir J. van der Laan
9a37add21f Merge #8417: [QA] Add walletdump RPC test (including HD- & encryption-tests)
54af51d [QA] Add walletdump RPC test (including HD- & encryption-tests) (Jonas Schnelli)
2018-02-01 11:13:01 +01:00
Wladimir J. van der Laan
075b4d320c Merge #8636: Implement NULLDUMMY softfork (BIP147)
482f852 Implement NULLDUMMY softfork (Johnson Lau)
2018-01-30 20:12:34 +01:00
Wladimir J. van der Laan
fe0ef87cd3 Merge #9720: net: fix banning and disallow sending messages before receiving verack
d943491 qa: add a test to detect leaky p2p messages (Cory Fields)
8650bbb qa: Expose on-connection to mininode listeners (Matt Corallo)
5b5e4f8 qa: mininode learns when a socket connects, not its first action (Matt Corallo)
cbfc5a6 net: require a verack before responding to anything else (Cory Fields)
8502e7a net: parse reject earlier (Cory Fields)
c45b9fb net: correctly ban before the handshake is complete (Cory Fields)
2018-01-23 09:24:28 +01:00
Wladimir J. van der Laan
588b8e5caf Merge #9715: Disconnect peers which we do not receive VERACKs from within 60 sec
66f861a Add a test for P2P inactivity timeouts (Matt Corallo)
b436f92 qa: Expose on-connection to mininode listeners (Matt Corallo)
8aaba7a qa: mininode learns when a socket connects, not its first action (Matt Corallo)
2cbd119 Disconnect peers which we do not receive VERACKs from within 60 sec (Matt Corallo)
2018-01-23 09:24:28 +01:00
Wladimir J. van der Laan
119c3fe62f Merge #9516: Bug-fix: listsinceblock: use fork point as reference for blocks in reorg'd chains
7ba0a00 Testing: listsinceblock should not use orphan block height. (Karl-Johan Alm)
ee5c1ce Bug-fix: listsinceblock: use closest common ancestor when a block hash was provided for a chain that was not the main chain. (Karl-Johan Alm)
2018-01-21 12:48:33 +01:00
Wladimir J. van der Laan
eb7a6b08f1 Merge #8811: rpc: Add support for JSON-RPC named arguments
4e7e2e1 Update RPC argument names (John Newbery)
481f289 rpc: Named argument support for bitcoin-cli (Wladimir J. van der Laan)
9adb4e1 rpc: Argument name consistency (Wladimir J. van der Laan)
8d713f7 rpc: Named arguments for rawtransaction calls (Wladimir J. van der Laan)
37a166f rpc: Named arguments for wallet calls (Wladimir J. van der Laan)
78b684f rpc: Named arguments for mining calls (Wladimir J. van der Laan)
b8ebc59 rpc: Named arguments for net calls (Wladimir J. van der Laan)
2ca9dcd test: Add test for RPC named arguments (Wladimir J. van der Laan)
fba1a61 rpc: Named arguments for misc calls (Wladimir J. van der Laan)
286ec08 rpc: Add 'echo' call for testing (Wladimir J. van der Laan)
495eb44 rpc: Named arguments for blockchain calls (Wladimir J. van der Laan)
6f1c76a rpc: Support named arguments (Wladimir J. van der Laan)
5865d41 authproxy: Add support for RPC named arguments (Wladimir J. van der Laan)
2018-01-18 07:38:57 +01:00
Wladimir J. van der Laan
bf3cc9ff90 Merge #9331: [qa] Add test for rescan feature of wallet key import RPCs
d8c0b9f [qa] Add test for rescan feature of wallet key import RPCs (Russell Yanofsky)
2018-01-18 07:31:22 +01:00
Alexander Block
7322489ca2 Merge #9276: Some minor testing cleanups
30b620c remove obsolete run-bitcoind-for-test.sh (Alex Morcos)
2a99522 remove relaypriority from rpc tests (Alex Morcos)
e2184cc Reorder RPC tests for running time (Alex Morcos)

# Conflicts:
#	qa/pull-tester/rpc-tests.py
#	qa/pull-tester/run-bitcoind-for-test.sh.in
2018-01-17 17:31:12 +01:00
Wladimir J. van der Laan
1121f2f951 Merge #9098: [qa] Handle zombies and cluttered tmpdirs
fab0f07 [qa] rpc-tests: Apply random offset to portseed (MarcoFalke)
fae19aa [qa] test_framework: Exit when tmpdir exists (MarcoFalke)
2018-01-15 06:14:15 +01:00
Wladimir J. van der Laan
efded3ca9c Merge #7551: Add importmulti RPC call
215caba Add consistency check to RPC call importmulti (Pedro Branco)
cb08fdb Add importmulti rpc call (Pedro Branco)
2018-01-13 13:44:37 +01:00
Wladimir J. van der Laan
6e871c0c2e Merge #6996: Add preciousblock RPC
5805ac8 Add preciousblock tests (Pieter Wuille)
5127c4f Add preciousblock RPC (Pieter Wuille)
2018-01-12 09:58:15 +01:00
MarcoFalke
7f4439fa63 Merge #8789: [qa] pull-tester: Only print output when failed
fa427ce [qa] pull-tester: Only print output when failed (MarcoFalke)
2018-01-11 13:22:22 +01:00
Wladimir J. van der Laan
22604cbbcc Merge #8607: [doc] Fix doxygen off-by-one comments, fix typos
fafe7b3 contrib: Make fix-copyright-headers.py more portable (MarcoFalke)
fa27c0a [doc] Fix typos in comments, doxygen: Fix comment syntax (MarcoFalke)
fabfd5d [qa] pull-tester: Don't mute zmq ImportError (MarcoFalke)
67a5502 init: Fix typo in help message for -whitelistforcerelay (Wladimir J. van der Laan)
2018-01-09 14:04:21 +01:00
Wladimir J. van der Laan
e61556e20e Merge #8450: [Test] Replace rpc_wallet_tests.cpp with python RPC unit tests
9578333 Remove rpc_wallet_tests.cpp (Patrick Strateman)
25400c4 Account wallet feature RPC tests. (Patrick Strateman)
2018-01-09 14:04:19 +01:00
MarcoFalke
5b62ad34a3 Merge #8551: [qa] Remove unused code
faaec13 [qa] Remove unused code (MarcoFalke)
2018-01-08 18:04:55 +01:00
Wladimir J. van der Laan
7bba7375d0 Merge #8482: [qa] Use single cache dir for chains
fad8cf6 [qa] Use single cache dir for chains (MarcoFalke)
fa2d68f [qa] Adjust timeouts for micro-optimization of run time (MarcoFalke)
fae596f [qa] Sort scripts by time for pull_tester and don't overwrite setup_chain (MarcoFalke)
2018-01-08 18:04:55 +01:00
MarcoFalke
8c76eb7394 Merge #8400: [qa]: enable rpcbind_test
9bbb414 [qa]: enable rpcbind_test (whythat)
0ff4375 [qa]: add parsing for '<host>:<port>' argument form to rpc_url() (whythat)
2018-01-08 18:04:55 +01:00
Wladimir J. van der Laan
e2bcf8ae0c Merge #8216: [qa] assert 'changePosition out of bounds'
fa58f94 [qa] pull-tester: Start longest test first (MarcoFalke)
fa3b379 [qa] pull-tester: Fix assertion and check for run_parallel (MarcoFalke)
fa32465 [qa] fundrawtransaction: Create get_unspent() (MarcoFalke)
fa8ce3b [qa] assert 'changePosition out of bounds' (MarcoFalke)
2017-12-28 11:44:59 +01:00
Wladimir J. van der Laan
b95a338b30 Merge #8133: build: Finish up out-of-tree changes
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields)
340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields)
142ffc7 travis: use out-of-tree build (Cory Fields)
92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields)
ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields)
fc4ad0c build: more out-of-tree fixups (Cory Fields)
0cb0f26 build: out-of-tree fixups (Cory Fields)
2017-12-22 17:20:31 +01:00
Wladimir J. van der Laan
a0481f1ed0 Merge #8750: [qa] Refactor RPCTestHandler to prevent TimeoutExpired
dddd04f [qa] Refactor RPCTestHandler to prevent TimeoutExpired (MarcoFalke)
2017-12-22 06:33:01 +01:00
MarcoFalke
f1996dc8ca Merge #7972: [qa] pull-tester: Run rpc test in parallel
ccccc59 [qa] Add option --portseed to test_framework (MarcoFalke)
fa494de [qa] pull-tester: Run rpc test in parallel (MarcoFalke)
2017-12-21 18:50:13 +01:00
MarcoFalke
8bafa06b75 Merge #7971: [qa] Refactor test_framework and pull tester
fad3366 [qa] pull-tester: Adjust comment (MarcoFalke)
fafb33c [qa] Stop other nodes, even when one fails to stop (MarcoFalke)
2222dae [qa] Update README.md (MarcoFalke)
fabbf6b [qa] Refactor test_framework and pull tester (MarcoFalke)
2017-12-21 18:50:13 +01:00
Wladimir J. van der Laan
19a6c779e7 Merge #8030: test: Revert fatal-ness of missing python-zmq
65fee8e test: Revert fatal-ness of missing python-zmq (Wladimir J. van der Laan)
2017-12-21 18:50:13 +01:00
Wladimir J. van der Laan
25147c9dc7 Merge #7814: [qa] Switch to py3
fa389d4 [qa] Switch to py3 (MarcoFalke)
2017-12-21 17:31:54 +01:00
Wladimir J. van der Laan
90b00cfc66 Merge #7953: Create signmessagewithprivkey rpc
7db0ecb Test for signing messages (Andrew Chow)
f90efbf Create signmessagewithprivkey rpc (Andrew)
2017-12-21 17:30:51 +01:00
Wladimir J. van der Laan
ba65eb1ac3 Merge #7764: [qa] Don't run pruning.py twice
faa9f01 [qa] Don't run pruning.py twice (MarcoFalke)
2017-12-19 13:18:30 +01:00
Wladimir J. van der Laan
e2fefa539d Merge #7558: [RPC] Add import/removeprunedfunds rpc call
f1bb13c Added companion removeprunedfunds call. (instagibbs)
7eb7029 Add importprunedfunds rpc call (instagibbs)
2017-12-19 13:18:30 +01:00
Wladimir J. van der Laan
11ac70af9e Merge #7542: Implement "feefilter" P2P message
0371797 modify release-notes.md and bips.md (Alex Morcos)
b536a6f Add p2p test for feefilter (Alex Morcos)
5fa66e4 Create SingleNodeConnCB class for RPC tests (Alex Morcos)
9e072a6 Implement "feefilter" P2P message. (Alex Morcos)
2017-12-19 13:18:30 +01:00
Wladimir J. van der Laan
f1e95e3584 Merge #7635: [Documentation] Add dependency info to test docs
2ab835a Check if zmq is installed in tests, update docs (Elliot Olds)
2017-12-19 12:55:49 +01:00
UdjinM6
cd76f2a15c Disable HD wallet by default (#1629)
* disable hd wallet by default, fix related comments/help strings

* split tests for HD and non-HD cases
2017-09-20 23:31:12 +03:00
UdjinM6
27f3218de9 HD wallet (#1405)
* HD wallet

Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+

* minimal bip44 (hardcoded account and change)

* minimal bip39

Additional cmd-line options for new wallet:
-mnemonic
-mnemonicpassphrase

* Do not recreate HD wallet on encryption

Adjusted keypool.py test

* Do not store any private keys for hd wallet besides the master one

Derive all keys on the fly.
Original idea/implementation - btc PR9298, backported and improved

* actually use bip39

* pbkdf2 test

* backport wallet-hd.py test

* Allow specifying hd seed, add dumphdseed rpc, fix bugs

- -hdseed cmd-line param to specify HD seed on wallet creation
- dumphdseed rpc to dump HD seed
- allow seed of any size
- fix dumpwallet rpc bug (wasn't decrypting HD seed)
- print HD seed and extended public masterkey on dumpwallet

* top up keypool on HD wallet encryption

* split HD chain: external/internal

* add missing cs_wallet lock in init.cpp

* fix `const char *` issues (use strings)

* default mnemonic passphrase is an empty string in all cases

* store mnemonic/mnemonicpassphrase

replace dumphdseed with dumphdinfo

* Add fCrypted flag to CHDChain

* prepare internal structures for multiple HD accounts

(plus some code cleanup)

* use secure allocator for storing sensitive HD data

* use secure strings for mnemonic(passphrase)

* small fix in GenerateNewHDChain

* use 24 words for mnemonic by default

* make sure mnemonic passphrase provided by user does not exceed 256 symbols

* more usage of secure allocators and memory_cleanse

* code cleanup

* rename: CSecureVector -> SecureVector

* add missing include

* fix warning in rpcdump.cpp

* refactor mnemonic_check (also fix a bug)

* move bip39 functions to CMnemonic

* Few fixes for CMnemonic:
- use `SecureVector` for data, bits, seed
- `Check` should return bool

* init vectors with desired size where possible
2017-05-29 14:51:40 +03:00
UdjinM6
2d55b70381 (log) tweaks and (general) cleanup (#1086)
* docs

* deprecated/unused/duplicate

* comments

* log cleanup/verbosity tuning

* names/ifs/whitespaces/std
2016-10-22 20:52:14 +04:00