mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Fix BLS/BLS_DKG benchs after 15788
This commit is contained in:
parent
046fcc2060
commit
5ea0ae28a9
@ -18,9 +18,6 @@
|
||||
|
||||
static const char* DEFAULT_BENCH_FILTER = ".*";
|
||||
|
||||
void InitBLSTests();
|
||||
void CleanupBLSTests();
|
||||
|
||||
static void SetupBenchArgs()
|
||||
{
|
||||
gArgs.AddArg("-?", "Print this help message and exit", false, OptionsCategory::OPTIONS);
|
||||
|
@ -9,18 +9,6 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
CBLSWorker blsWorker;
|
||||
|
||||
void InitBLSTests()
|
||||
{
|
||||
blsWorker.Start();
|
||||
}
|
||||
|
||||
void CleanupBLSTests()
|
||||
{
|
||||
blsWorker.Stop();
|
||||
}
|
||||
|
||||
static void BuildTestVectors(size_t count, size_t invalidCount,
|
||||
BLSPublicKeyVector& pubKeys, BLSSecretKeyVector& secKeys, BLSSignatureVector& sigs,
|
||||
std::vector<uint256>& msgHashes,
|
||||
@ -327,6 +315,9 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
|
||||
return cancel;
|
||||
};
|
||||
|
||||
CBLSWorker blsWorker;
|
||||
blsWorker.Start();
|
||||
|
||||
// Benchmark.
|
||||
size_t i = 0;
|
||||
bench.minEpochIterations(1000).run([&] {
|
||||
@ -358,6 +349,8 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
|
||||
{
|
||||
UninterruptibleSleep(std::chrono::milliseconds{100});
|
||||
}
|
||||
|
||||
blsWorker.Stop();
|
||||
}
|
||||
|
||||
BENCHMARK(BLS_PubKeyAggregate_Normal)
|
||||
|
@ -6,8 +6,6 @@
|
||||
#include <random.h>
|
||||
#include <bls/bls_worker.h>
|
||||
|
||||
extern CBLSWorker blsWorker;
|
||||
|
||||
struct Member {
|
||||
CBLSId id;
|
||||
|
||||
@ -24,6 +22,7 @@ private:
|
||||
|
||||
BLSSecretKeyVector receivedSkShares;
|
||||
BLSVerificationVectorPtr quorumVvec;
|
||||
CBLSWorker blsWorker;
|
||||
|
||||
void ReceiveVvecs()
|
||||
{
|
||||
@ -67,10 +66,15 @@ public:
|
||||
ids.emplace_back(id);
|
||||
}
|
||||
|
||||
blsWorker.Start();
|
||||
for (int i = 0; i < quorumSize; i++) {
|
||||
blsWorker.GenerateContributions(quorumSize / 2 + 1, ids, members[i].vvec, members[i].skShares);
|
||||
}
|
||||
}
|
||||
~DKG()
|
||||
{
|
||||
blsWorker.Stop();
|
||||
}
|
||||
|
||||
void Bench_BuildQuorumVerificationVectors(benchmark::Bench& bench, uint32_t epoch_iters)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user