Commit Graph

714 Commits

Author SHA1 Message Date
Braydon Fuller
fbe64cf4a2
test: add net pool getheaders, tx, and merkleblock handler tests 2019-05-24 17:58:26 -07:00
Braydon Fuller
357ad4c2c4
test: start net pool handler tests 2019-05-24 17:58:26 -07:00
Braydon Fuller
4f76cfe3b9
test: add net peer handler tests 2019-05-24 17:58:26 -07:00
Braydon Fuller
9db43a7e1f
test: add net packet, framer and common tests 2019-05-24 17:58:25 -07:00
Braydon Fuller
55979c17b4
Merge pull request #777 from nodar-chkuaselidze/depupdates
Dependency updates, support node v12
2019-05-24 17:48:09 -07:00
Nodar Chkuaselidze
fc283caf80
test: close worker pool. limit workers to 2. 2019-05-19 20:17:39 +04:00
Nodar Chkuaselidze
091ba49408
pkg: upgrade deps. update ignore and rc files.
bench: remove chacha that is out of the scope, it was part of the bip151 implementation.
test: increase timeouts.
2019-05-19 18:42:07 +04:00
Nodar Chkuaselidze
1fceb14e32
blockstore-test: use try/catch instead of promise.catch/finally.
finally was introduce in node v10, so this test will fail on v8.6.0 node.
2019-05-18 16:36:38 +04:00
Braydon Fuller
ed06c2184d
indexer: check that blocks are connected
There was a rare case that a block could be incorrectly added to
the indexer if the indexer was disabled during a reorg to a height
that matched the height that was expected, and the `sync` method
for the indexer wasn't called that would detect the reorg.
2019-05-15 12:11:37 -07:00
Braydon Fuller
cede31d86f
indexer: cleanup and check pruned and index options 2019-05-15 12:11:37 -07:00
Braydon Fuller
5d18f9ba2e
indexer: index the genesis block 2019-05-15 12:11:37 -07:00
Braydon Fuller
efb2551555
indexer: fix reset and reorg handling 2019-05-15 12:11:37 -07:00
Braydon Fuller
865f7401ba
test: add test for retroactively enabling indexer 2019-05-15 12:11:37 -07:00
Braydon Fuller
b4be8574e5
test: improve addrindex tests
- Vectors for p2wsh and p2sh.
- Edge case for witness program.
- Improve determinism by not comparing mtime.
- Various edge and error cases.
2019-05-15 12:11:32 -07:00
Braydon Fuller
69e9844f82
test: cleanup and add txindex tests 2019-05-15 12:11:05 -07:00
Nodar Chkuaselidze
f30276bc27
test: add mempool indexing tests 2019-05-15 12:11:05 -07:00
Nodar Chkuaselidze
80aaa148e4
test: add mempool index persistence test 2019-05-15 12:11:05 -07:00
Braydon Fuller
b37ac59973
test: add utility to wait for values 2019-05-15 12:11:05 -07:00
Braydon Fuller
bb797602e6
node: add http indexer info 2019-05-15 12:11:05 -07:00
Braydon Fuller
bd26dbf32d
mempool: update for addrindex 2019-05-15 12:11:05 -07:00
Braydon Fuller
4c8f11ed34
node: update http for addrindex 2019-05-15 12:11:05 -07:00
Braydon Fuller
06ef0e3615
indexer: simplify addrindex query 2019-05-15 12:11:05 -07:00
Braydon Fuller
93c6ff845e
indexer: fix, simplify and rewrite indexer base
- Write indexer state and index atomically.
- Simplify chain state with current height.
- Roll forward to best height.
- Synchronize the index with the chain with common method `sync` for
  the events 'connect', 'disconnect' and 'reset'. This will prevent
  any of the events from conflicting with each other.
- Fix the chain rollback and reset.
- Make sure blocks are connected in the correct order.
- Improve logging to log similar to chain.
2019-05-15 12:02:50 -07:00
Javed Khan
e2a6a92ebc
addrindexer: index by address prefix 2019-05-15 12:02:50 -07:00
Braydon Fuller
aa3f02d585
test: initial http tests for indexer 2019-05-15 12:02:49 -07:00
Braydon Fuller
7dc55c9c3c
indexer: remove address coin index 2019-05-15 12:02:48 -07:00
Braydon Fuller
05d55efb22
indexer: fix memory and cpu exhaustion for addrindex 2019-05-15 12:02:48 -07:00
Braydon Fuller
8bff122253
indexer: use chain and blocks for indexer, remove chain client 2019-05-15 12:02:47 -07:00
Braydon Fuller
f9aab08c46
indexer: add block position to tx 2019-05-15 12:02:47 -07:00
Javed Khan
05794f5cb3
indexer: add module indexer
module indexer introduces a extensible architecture for indexing the
chain. It provides a base class which handles syncing with the chain,
handling re-orgs, interruptions, dynamic toggling, etc. TXIndexer
and AddrIndexer are provided for indexing transactions and addresses,
using the same flags as before i.e --index-tx and --index-address.
Indexes are stored in a different database and can be maintained
independently of the chain.
2019-05-15 12:02:41 -07:00
Braydon Fuller
eba7bbeddc
wallet: handle multiple conflicting inputs 2019-05-14 14:29:41 -07:00
Javed Khan
d53fa0a1c5
chain: extend try..finally; restore consts to copy 2019-05-07 03:59:15 +05:30
Javed Khan
49143b2c16
chain: reset consensus params on assert fail 2019-05-07 03:48:31 +05:30
Javed Khan
4bc0bb2366
chain: add fee overflow test; rename error 2019-05-07 03:27:42 +05:30
Braydon Fuller
b68207610c
blockchain: do not accept forked chain older than last checkpoint
This has been patched in both bitcoind and btcd around February 20th, 2014. It was
shortly followed by a headers-first synchronization of blocks.

- d8b4b49667
- 50b6e10b57
2019-05-02 14:44:10 -07:00
Braydon Fuller
54383578fb
test: configurable and unique test directory path
- Multiple parallel runs of the same test will not conflict
  as a unique identifier is added to the test directory.
- The base test directory can be configured for various
  environments, and can be changed via the environment
  variable `TEMP`, see the implementation of `os.tmpdir()`
  for specific details.
2019-04-11 10:15:51 -07:00
Braydon Fuller
50fe51ca32
blockstore: close file if write or read throws 2019-04-08 13:26:16 -07:00
Braydon Fuller
83824d73b1
blockstore: optimize block read and index
There is potential for around a 10% to 23% increase to the performance
of block reads by using `allocUnsafe`, however there is already around
a 3 to 6 times increase to the performance. While it's safe to use
`allocUnsafe` as the number of bytes read is checked to be the same
size as the buffer allocation, there is a potential for test cases
to introduce _other_ behavior for `fs.read` that may not have the
same behavior, though this isn't currently the case.
2019-04-08 13:20:00 -07:00
Braydon Fuller
f3e517c3c0
blockstore: fix logger, improve messages 2019-04-08 13:18:58 -07:00
Braydon Fuller
961f6eddb5
blockstore: index undo blocks from files 2019-04-08 13:18:57 -07:00
Braydon Fuller
8fc605c4a9
blockstore: index after write interrupt and use less memory 2019-04-08 13:18:57 -07:00
Braydon Fuller
5cbbcf5409
blockstore: do not write block twice 2019-04-08 13:18:57 -07:00
Braydon Fuller
58e623e30a
test: minor, cleanup and clarity 2019-04-08 13:18:56 -07:00
Braydon Fuller
747a8e707b
blockstore: tests and fixes for blockstore error cases 2019-04-08 13:18:56 -07:00
Braydon Fuller
0f0cb00c54
blockstore: minor, spelling 2019-04-08 13:18:56 -07:00
Braydon Fuller
89d3253f29
blockstore: add ensure method to create directories 2019-04-08 13:18:54 -07:00
Braydon Fuller
0b0dd58a91
node: add blockstore to full node 2019-04-08 13:18:54 -07:00
Braydon Fuller
3cec13ef5e
blockstore: add block data types with an undo type 2019-04-08 13:18:53 -07:00
Braydon Fuller
abd2ae4b5d
blockstore: prevent blocks writes at the same position 2019-04-08 13:18:53 -07:00
Braydon Fuller
2d08b296f7
blockstore: recover from block write interrupt 2019-04-08 13:18:52 -07:00