Add a benchmark for calling ConnectBlock on a block with many inputs

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.
This commit is contained in:
Jack Grigg
2017-05-12 13:00:15 +12:00
parent 20d61ac0ea
commit c66c731adf
8 changed files with 369 additions and 5 deletions

View File

@@ -2589,6 +2589,11 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp)
} else if (benchmarktype == "incnotewitnesses") {
int nTxs = params[2].get_int();
sample_times.push_back(benchmark_increment_note_witnesses(nTxs));
} else if (benchmarktype == "connectblockslow") {
if (Params().NetworkIDString() != "regtest") {
throw JSONRPCError(RPC_TYPE_ERROR, "Benchmark must be run in regtest mode");
}
sample_times.push_back(benchmark_connectblock_slow());
} else {
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid benchmarktype");
}