Commit Graph

730 Commits

Author SHA1 Message Date
TomZ 929491828f Move code to delay checks not relevant 2019-03-03 20:01:34 +01:00
TomZ 7b185570e5 Various cleanups and fixes 2019-02-25 21:35:05 +01:00
TomZ 65fbe65196 Cleanup unused code 2019-02-25 18:41:35 +01:00
TomZ 31650b7340 Squashed commit of the utxo-lockfree-map branch
Replace the m_buckets unsorted map with a lock-free version
based on atomic pointers. (BucketMap)
remove the m_leafs and move those into the bucket struct.
Make the access to the jumptable transactional to avoid one big lock
over all datastructures.

On my threadripper 2990WX the entire 150GB BCH blockchain was
parsed and imported in under 3 hours.
2019-02-23 15:33:22 +01:00
TomZ b7c9b467ff Use less threads 2019-02-23 15:24:31 +01:00
TomZ ea0f634665 Put the log lines in the right group 2019-02-22 22:27:04 +01:00
TomZ 3f1fae0adb Fix case where indexDB inconsistency was not detected properly
When a block is expected to be on-disk, but we don't know where it is
this now no longer leads to a validation process hanging.
2019-02-18 18:31:17 +01:00
TomZ 3c13ff18e4 Make exceptions have a bit more context 2019-02-18 18:31:17 +01:00
TomZ 41b1a2058b Minor fixlet 2019-02-18 18:31:17 +01:00
TomZ caff0b1ee2 Add block-maintainance cronjob
Every 15 minutes we check and take action should there be a need
to delete old revert files or truncate blk files.
2019-02-15 13:31:49 +01:00
TomZ c09a5f94f6 Simplify and avoid race-conditions 2019-02-06 16:30:25 +01:00
TomZ c367278a1d Cleanup resizing code
We no longer resize blk / rev files, which was a premature optimization.
This means this code is obsolete.
2019-02-06 13:40:40 +01:00
TomZ 8998b0afaf Move slow unmapping to be done outside the mutex 2019-02-06 13:39:56 +01:00
TomZ bd9d735a66 Also print the path to the used logs.conf 2019-02-03 19:49:39 +01:00
TomZ 265852c2d6 Fix log category 2019-02-03 19:12:42 +01:00
TomZ 5747a3b888 Change m_flushScheduled to be an atomic 2019-02-03 19:02:53 +01:00
TomZ 775a06b4d1 Make optimization do what the comment says
The optimization was wrongly implemented making it worse
instead of better. This fixes that.
2019-02-03 19:00:55 +01:00
TomZ 135bbb9a5f Cleanup BOOST_FOREACH -> for(:) 2018-12-30 15:33:11 +01:00
TomZ 898cb1fc5f Remove dead code
As the miners have started using the block-version bits for their
own purposes this means that BIP9 checks are rather irrelevant.
Signalling using version bits is rather silly anyway.

In Flowee there will no longer be warnings generated based on
these now outdated assumptions.
And this means less code :)
2018-12-30 13:51:25 +01:00
TomZ 4623a07968 Remove some usages of the multi-chain feature
During the BCH fork-off time we allowed the client to be started
as either BCH or BTC and as such there are several code-paths
that behave different based on this user setting.
We remove those as we no longer allow starting as BTC client.

This also removes the check for the min-block-size (rollback protection)
as this is accomplished by the checkpoints on the BCH chain.
2018-12-30 13:33:25 +01:00
TomZ f790960a97 Another tag.
At least 50% of the UTXO entries reuse the posOnDisk
because they are outputs on the same tx. This changes
such entries from using 2 bytes to 1 byte only when saved
in a bucket.
2018-12-07 20:59:16 +01:00
TomZ 3e3f8843f3 Remove the optional replay protection feature
Its sundown has passed, so the code is now effectively dead.
2018-11-29 23:13:48 +01:00
TomZ 121895df1e Make UTXO DB logging less noisy 2018-11-24 11:50:21 +01:00
TomZ c6297727b8 Change the inserting to be in batches 2018-11-21 20:20:31 +01:00
TomZ d3bb3b1f1d Add support for std::set in the logger 2018-11-21 14:02:20 +01:00
TomZ 4142cd5c65 Merge branch '2018.02' 2018-11-21 12:51:52 +01:00
TomZ f89aa4598c Fix copy/paste error in chaintip-finding
and add some debug output on startup for the chaintips.
2018-11-21 12:49:18 +01:00
TomZ 4cd84c0d34 update comments about flowee.conf 2018-11-21 12:26:17 +01:00
TomZ b256676044 Rename debug.log -> hub.log 2018-11-21 12:18:32 +01:00
TomZ 7bfabca6fc Mark log-levels 2018-11-21 11:31:54 +01:00
TomZ 5ae14f17ac remove BIP9 warnings
The usage of block-version in ASICBoost means that BIP9 is not really
useful to detect, let alone generate warnings for.
2018-11-20 20:44:07 +01:00
TomZ 830726ef88 Make mining work again.
* Make mining software honor CTOR resorting.
* Fix bugs
2018-11-20 20:44:06 +01:00
TomZ 9d5f9d2142 Fix UTXO throttling feature
On low core-count machines the request to save could end up being
delayed since all threads are busy doing things like validating
transactions.
So when a really big block came in I ended up throttling while there
was no save method running in parallel at all.
This fixes this and also makes throtteling be a per-thread thing
instead of doing it inside the mutex.
2018-11-18 14:42:14 +01:00
TomZ 8f9b160012 Make mapper close more agressive
I expect that it would be bettter to make this configurable
because it is based on what the rest of the system is used for.
2018-11-18 12:27:41 +01:00
TomZ 58a9baba3a On loading, calculate nChainWork 2018-11-18 12:12:38 +01:00
TomZ 02ba17bce7 Enable checkpoint for reecent upgrade 2018-11-18 12:12:38 +01:00
TomZ ded88e733c Use simpler logic
Instead of depending on a hardcoded offset, just use index.
2018-11-17 16:46:49 +01:00
TomZ 75f08fc580 Be more careful when deciding to reorg
When reorgs greater than 6 are detected we refrain from taking
action (rolling back the chain) and wait for either user interaction
or till the chain extends the chain-tip again.
2018-11-17 16:01:46 +01:00
TomZ 71b45cd38c Merge branch 'dev/HFNov2018' 2018-11-15 23:40:56 +01:00
TomZ 1ce0fb9036 Update to actual block height 2018-11-15 23:37:10 +01:00
TomZ 1a4b3a0966 Use the flags for testing the 100 bytes txsize 2018-11-15 23:35:47 +01:00
TomZ c2412a0e59 Add testing for CTOR 2018-11-15 23:35:43 +01:00
TomZ cdec1fa593 Implement CTOR validation 2018-11-15 23:35:43 +01:00
TomZ 9aab378b0a Add checks for 100 bytes min tx size 2018-11-15 23:34:05 +01:00
TomZ 5655a30558 whitespace 2018-11-14 22:59:28 +01:00
TomZ ef279e6bc0 Add assert 2018-11-13 21:50:19 +01:00
TomZ 35225f1400 Update API to make keys by default compressed 2018-11-13 14:30:17 +01:00
TomZ 97c0239f1e Provide proper documentation to this method 2018-11-13 14:30:12 +01:00
TomZ d55c7bfed8 Make UTXO write timebased as well
The current system writes based on the amount of changes, which is a bit
risky as long as we have small blocks as the amount of changes may for
hours be below the "lets write" limit.

So also write every 5 minutes, just to make sure we won't keep data in
memory longer than needed. Also this allows pruning to happen for people
that don't run their node all the time.
2018-11-11 16:47:54 +01:00
TomZ 89eee0d333 Fix semi-mem-leak in the UTXO DB
we only save a subsection of stuff in memory on each round of saving,
but I set the counter to zero on how long to wait for the next save.
This makes us save more often till we actually saved most stuff, avoiding
buildups of caches until we do the periodic big flush.
2018-11-11 16:47:45 +01:00