Benchmark the largest valid Sapling transaction in validatelargetx

11130 inputs results in a transaction between 1992301 and 2003431 bytes.
This commit is contained in:
Jack Grigg 2018-04-26 15:05:10 +01:00
parent 15ec5525e3
commit ddcee7e13a
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
2 changed files with 4 additions and 4 deletions

View File

@ -2723,7 +2723,7 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp)
sample_times.push_back(benchmark_verify_equihash());
} else if (benchmarktype == "validatelargetx") {
// Number of inputs in the spending transaction that we will simulate
int nInputs = 555;
int nInputs = 11130;
if (params.size() >= 3) {
nInputs = params[2].get_int();
}

View File

@ -243,8 +243,8 @@ double benchmark_large_tx(size_t nInputs)
CMutableTransaction spending_tx;
spending_tx.fOverwintered = true;
spending_tx.nVersion = OVERWINTER_TX_VERSION;
spending_tx.nVersionGroupId = OVERWINTER_VERSION_GROUP_ID;
spending_tx.nVersionGroupId = SAPLING_VERSION_GROUP_ID;
spending_tx.nVersion = SAPLING_TX_VERSION;
auto input_hash = orig_tx.GetHash();
// Add nInputs inputs
@ -253,7 +253,7 @@ double benchmark_large_tx(size_t nInputs)
}
// Sign for all the inputs
auto consensusBranchId = NetworkUpgradeInfo[Consensus::UPGRADE_OVERWINTER].nBranchId;
auto consensusBranchId = NetworkUpgradeInfo[Consensus::UPGRADE_SAPLING].nBranchId;
for (size_t i = 0; i < nInputs; i++) {
SignSignature(tempKeystore, prevPubKey, spending_tx, i, 1000000, SIGHASH_ALL, consensusBranchId);
}