* 'dev' of https://github.com/jl777/komodo: (1062 commits)
Delay PoW check until connect block
Declare
KOMODO_NEWBLOCKS
Prevent autorewind if syncing. Not a critical update
Change n0/n1 size to int32_t
Syntax
Fix n -> static n0/n1
Test
Test
Test
KOMODO_LONGESTCHAIN = height;
Sync main.cpp to jl777
-print
-USD/EUR
readme
curl fix
-print
Fix buffer overflows and reduce KMD men usage
-print
Test
...
The Equihash check caused block index loading to take around 38x longer.
However, we don't need to check it directly, as the only paths to writing a
block header to disk already go through a proof-of-work check (e.g. receiving a
block over the network). By forcing the block header inside the CBlockIndex to
be re-serialized, we retain the benefits of the consistency check without the
overhead at startup.
Co-authored-by: Brad Miller <brad@z.cash>
Check Equihash solution when loading block index
An additional consistency check, which also ensures that the in-memory representation
matches the stored index.
read hashReserved from disk
This fixes a bug where the hashReserved field of the block header is not properly read back into CBlockIndex when loaded from disk. This happens to cause no issues currently because hashReserved has always been its default value (== 0), but if a block were ever mined where this was not the case, headers read back from disk would appear to have an invalid solution
Delta values will be stored for new blocks; old blocks can be filled in by
re-indexing. The net value currently in the Sprout circuit is only calculated
when delta values for all previous blocks are present.
Requires placing block-107134.tar.gz (containing the block, and a fake CoinsDB
containing its inputs) into the base directory of the repository. This can be
generated using qa/zcash/create_benchmark_archive.py (see the script for usage
details).
To facilitate generation of the fake CoinsDB, an additional field 'valueZat' has
been added to 'getrawtransaction' containing the integer number of zatoshis
instead of a decimal number of ZEC.
Closes#2355.
For leveldb "An iterator operates on a snapshot of the database taken
when the iterator is created". This means that it is unnecessary to
lock out other threads while computing statistics, and neither to hold
cs_main for the whole time. Let the thread run free.
The main and test networks are configured to use parameters that are currently
low-memory but usable with the basic solver; they will be increased once the
solver is optimised. The regtest network is configured to have extremely low
memory usage for speed.
Note that Bitcoin's double-hasher is used for the difficulty check. This does
not match the paper, but is simpler than changing the block header
serialization. Single hashing is kept for the EquiHash solver because there is
no requirement on execution time there, only on memory usage.