Commit Graph

8228 Commits

Author SHA1 Message Date
Suhas Daftuar 29bff0e684 Add some travis debugging for python scripts
Adds printing to the console before/after calls to bitcoin-cli -rpcwait,
if the PYTHON_DEBUG environment variable is initialized.
2015-04-28 16:51:46 -04:00
Suhas Daftuar d76412b068 Add script manipulation tools for use in mininode testing framework
script.py is modified from the code in python-bitcoinlib, and provides tools
for manipulating and creating CScript objects.

bignum.py is a dependency for script.py

script_test.py is an example test that uses the script tools for running a test
that compares the behavior of two nodes, in a comptool- style test, for each of
the test cases in the bitcoin unit test script files, script_valid.json and
script_invalid.json.  (This test is very slow to run, but is a proof of concept
for how we can write tests to compare consensus-critical behavior between
different versions of bitcoind.)

bipdersig-p2p.py is another example test in the comptool framework, which tests
deployment of BIP DERSIG for a single node.  It uses the script.py tools for
manipulating signatures to be non-DER compliant.
2015-04-28 15:09:29 -04:00
Suhas Daftuar b93974c3f3 Add comparison tool test runner, built on mininode
comptool.py creates a tool for running a test suite on top of the mininode p2p
framework.  It supports two types of tests: those for which we expect certain
behavior (acceptance or rejection of a block or transaction) and those for
which we are just comparing that the behavior of 2 or more nodes is the same.

blockstore.py defines BlockStore and TxStore, which provide db-backed maps
between block/tx hashes and the corresponding block or tx.

blocktools.py defines utility functions for creating and manipulating blocks
and transactions.

invalidblockrequest.py is an example test in the comptool framework, which
tests the behavior of a single node when sent two different types of invalid
blocks (a block with a duplicated transaction and a block with a bad coinbase
value).
2015-04-28 12:40:56 -04:00
Suhas Daftuar 6c1d1ba6fc Python p2p testing framework
mininode.py provides a framework for connecting to a bitcoin node over the p2p
network. NodeConn is the main object that manages connectivity to a node and
provides callbacks; the interface for those callbacks is defined by NodeConnCB.
Defined also are all data structures from bitcoin core that pass on the network
(CBlock, CTransaction, etc), along with de-/serialization functions.

maxblocksinflight.py is an example test using this framework that tests whether
a node is limiting the maximum number of in-flight block requests.

This also adds support to util.py for specifying the binary to use when
starting nodes (for tests that compare the behavior of different bitcoind
versions), and adds maxblocksinflight.py to the pull tester.
2015-04-28 12:38:29 -04:00
Pieter Wuille 7bf5d5efa6
Merge pull request #5918
f7303f9 Use equivalent PoW for non-main-chain requests (Pieter Wuille)
2015-04-28 07:46:27 -07:00
Pieter Wuille 9e06be2802
Merge pull request #6054
d1af89e use const reference as param in ConnectThroughProxy/Socks5 (Philip Kaufmann)
2015-04-28 07:02:34 -07:00
Philip Kaufmann d1af89e655 use const reference as param in ConnectThroughProxy/Socks5
- also ensure code style conformance by replacing bool static with static bool
2015-04-28 14:44:56 +02:00
Wladimir J. van der Laan 18d2832678
Merge pull request #5971
351593b replace absolute sleep with conditional wait (pstratem)
2015-04-28 10:41:46 +02:00
Wladimir J. van der Laan 5048465fc5
Merge pull request #5662
00dcaf4 Change download logic to allow calling getheaders/getdata on inbound peers (Suhas Daftuar)
2015-04-28 10:17:04 +02:00
Wladimir J. van der Laan 6364408122
Merge pull request #5199
1ec900a Remove broken+useless lock/unlock log prints (Matt Corallo)
352ed22 Add merkle blocks test (Matt Corallo)
59ed61b Add RPC call to generate and verify merkle blocks (Matt Corallo)
30da90d Add CMerkleBlock constructor for tx set + block and an empty one (Matt Corallo)
2015-04-28 10:07:25 +02:00
Wladimir J. van der Laan f9645ba80a
qt: translation update 2015-04-28 09:47:26 +02:00
pstratem 351593b9c8 replace absolute sleep with conditional wait 2015-04-27 11:48:31 -07:00
Wladimir J. van der Laan 1d9d314573
Merge pull request #5696
691161d Consensus: Create consensus/consensus.h with some constants (jtimon)
2015-04-26 14:42:09 +02:00
Wladimir J. van der Laan 1623f6e337
Merge pull request #6033
cd558b4 FreeBSD, OpenBSD thread renaming. (sinetek)
2015-04-24 16:36:00 +02:00
Wladimir J. van der Laan b9311fb631
Merge pull request #6028
1d5b47a nLastTry is only used for addrman entries (Pieter Wuille)
2015-04-24 16:11:23 +02:00
Wladimir J. van der Laan 585b5dba74
Merge pull request #6036
f89b092 add rpc test for listunspents support for zero value txouts (Jonas Schnelli)
219953c Show zero value txouts in listunspent. (Gregory Maxwell)
2015-04-24 14:57:43 +02:00
Matt Corallo 1ec900a29e Remove broken+useless lock/unlock log prints 2015-04-24 02:28:47 -07:00
Wladimir J. van der Laan c2713042a3
Merge pull request #5863
f9ec3f0 Add block pruning functionality (mrbandrews)
2015-04-24 10:36:48 +02:00
Matt Corallo 352ed22c2c Add merkle blocks test 2015-04-23 21:19:15 -07:00
Matt Corallo 59ed61b389 Add RPC call to generate and verify merkle blocks 2015-04-23 17:50:39 -07:00
Matt Corallo 30da90de8d Add CMerkleBlock constructor for tx set + block and an empty one 2015-04-23 17:50:39 -07:00
Wladimir J. van der Laan 734f80a5d1
Merge pull request #6039
27ce808 tests: Error when setgenerate is used on regtest (Wladimir J. van der Laan)
2015-04-23 18:03:51 +02:00
Wladimir J. van der Laan cf7adad3bb
Merge pull request #6052
26414ca fix and enable bip32 unit test (Jonas Schnelli)
2015-04-23 14:58:13 +02:00
Jonas Schnelli 26414ca4fc fix and enable bip32 unit test
the bip32 unit test was not included in the make process
2015-04-23 13:21:05 +02:00
mrbandrews f9ec3f0fad Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:

- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
  reasonably be met, with some assumptions about block sizes, orphan rates,
  etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
  mainnet; defined separately for mainnet, testnet, and regtest in chainparams
  as nPruneAfterHeight).

This unsets NODE_NETWORK if pruning is enabled.

Also included is an RPC test for pruning (pruning.py).

Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-04-22 15:53:48 -04:00
Pieter Wuille f7303f9793 Use equivalent PoW for non-main-chain requests 2015-04-22 03:53:25 -07:00
Jonas Schnelli f89b092d75 add rpc test for listunspents support for zero value txouts 2015-04-21 02:25:35 -07:00
Wladimir J. van der Laan 27ce808fb5 tests: Error when setgenerate is used on regtest
Ever since #5957 there has been the problem that older RPC test cases
(as can be found plenty in open pulls) use setgenerate() on regtest,
assuming a different interpretation of the arguments. Directly
generating a number of blocks has been split off into a new method
`generate` - however using `setgenerate` with the previous arguments will
result in spawning an unreasonable number of threads, and well, simply
not work as expected without clear indication of the error.

Add an error to point the user at the right method.
2015-04-21 10:14:06 +02:00
sinetek cd558b421c FreeBSD, OpenBSD thread renaming. 2015-04-21 03:13:07 +07:00
jtimon 691161d419 Consensus: Create consensus/consensus.h with some constants 2015-04-20 21:27:51 +02:00
Gregory Maxwell 219953ce50 Show zero value txouts in listunspent.
It's reasonable that automatic coin selection will not pick a zero
 value txout, but they're actually  spendable; and you should know
 if you have them. Listing also makes them available to tools like
 dust-b-gone.
2015-04-20 10:13:18 -07:00
Wladimir J. van der Laan b6ea3bcede
Merge pull request #5911
6be3562 rpc-tests: Add proxy test (Wladimir J. van der Laan)
67a7949 privacy: Stream isolation for Tor (Wladimir J. van der Laan)
2015-04-20 16:37:38 +02:00
Wladimir J. van der Laan 6be3562e50 rpc-tests: Add proxy test
Add test for -proxy, -onion and -proxyrandomize.
2015-04-20 15:04:33 +02:00
Wladimir J. van der Laan 71900b4426
Merge pull request #6029
a784f90 Cap nAttempts penalty at 8 and switch to pow instead of a division loop. (Gregory Maxwell)
2015-04-20 13:59:50 +02:00
Wladimir J. van der Laan 2bc6332df8
Merge pull request #6010
c1ecee8 Set nSequenceId when a block is fully linked (Suhas Daftuar)
2015-04-20 13:47:14 +02:00
Wladimir J. van der Laan 6a0bcb80e4
Merge pull request #6004
c6de7c3 trivial string change in wallet.cpp (the -> that) (Philip Kaufmann)
1e3473d Add operator names to DNS Seed list (Michael Ford)
a21df62 ensure consistent header comment naming conventions (Philip Kaufmann)
9e16cb1 Make 'Default: %u' spacing consistent in help message (Wladimir J. van der Laan)
6cb37a3 [Qt, Trivial] remove two unneeded includes of wallet/db.h (Philip Kaufmann)
68f795e [Qt, Trivial] fix header groupings + space, intdentation fixes (Philip Kaufmann)
985ec17 [Qt, Trivial] misc minor string changes (Philip Kaufmann)
c0555dc depends: latest config.guess and config.sub (Michael Ford)
89fc6b6 Remove leftover strlcpy.h copyright (Rob Van Mieghem)
468aa3b Re-wrote a passage of text that was difficult to understand. (Jason Lewicki)
71ad6bd [Trivial] format sync.h (Philip Kaufmann)
abcec30 Update REST URL to match reality (paveljanik)
447d37e  Use https link to bitcoin.org in Doxygen intro (Michael Ford)
c069234 Fix typo in init.cpp interpration/interpretation (Michael Ford)
52070c8 Removed '()' where used without contents inside (Nicolas Benoit)
30c1db1 Replaced current function names with __func__ in LogPrintf() calls. (Nicolas Benoit)
9bdd03f Point to the Debian 7.8 installer (Michael Ford)
0b2f930 Fix docs for 'complete' field in 'signrawtransaction' response (charlescharles)
c2f2161 Add x86_64* i686* mips* and arm* to depends .gitignore (Michael Ford)
fa535f9 Remove folder and images for bootstrap.md (sandakersmann)
60c1469 [Qt] header group cleanup (Philip Kaufmann)
2015-04-20 13:32:04 +02:00
Philip Kaufmann c6de7c35bc trivial string change in wallet.cpp (the -> that) 2015-04-20 13:29:23 +02:00
Michael Ford 1e3473d384 Add operator names to DNS Seed list 2015-04-20 13:29:23 +02:00
Philip Kaufmann a21df62069 ensure consistent header comment naming conventions
- BITCOIN_FOLDER_SUBFOLDER_FILENAME_H
2015-04-20 13:29:22 +02:00
Wladimir J. van der Laan 9e16cb108e Make 'Default: %u' spacing consistent in help message
Comment by pryds on Transifex.
2015-04-20 13:29:22 +02:00
Philip Kaufmann 6cb37a3ba0 [Qt, Trivial] remove two unneeded includes of wallet/db.h 2015-04-20 13:29:22 +02:00
Philip Kaufmann 68f795e8b2 [Qt, Trivial] fix header groupings + space, intdentation fixes 2015-04-20 13:29:22 +02:00
Philip Kaufmann 985ec17eee [Qt, Trivial] misc minor string changes
- write "Bitcoins" uppercase
- replace secure/insecure for payment requests with
  authenticated/unauthenticated
- change a translatable string for payment request expiry to match another
  existing string to only get ONE resulting string to translate
2015-04-20 13:29:22 +02:00
Michael Ford c0555dc8eb depends: latest config.guess and config.sub 2015-04-20 13:29:22 +02:00
Rob Van Mieghem 89fc6b67aa Remove leftover strlcpy.h copyright
src/strlcpy.h was removed by 6032e4f4e7
2015-04-20 13:29:21 +02:00
Jason Lewicki 468aa3bf0a Re-wrote a passage of text that was difficult to understand. 2015-04-20 13:29:21 +02:00
Philip Kaufmann 71ad6bd38b [Trivial] format sync.h 2015-04-20 13:29:21 +02:00
paveljanik abcec3082e Update REST URL to match reality 2015-04-20 13:29:21 +02:00
Michael Ford 447d37e7d3 Use https link to bitcoin.org in Doxygen intro 2015-04-20 13:29:21 +02:00
Michael Ford c069234665 Fix typo in init.cpp interpration/interpretation 2015-04-20 13:29:21 +02:00