From d95d953ac7cb83e0bf253b9f6284fc889108e196 Mon Sep 17 00:00:00 2001 From: blondfrogs Date: Thu, 11 Jun 2020 11:31:15 -0600 Subject: [PATCH] Add full cache validation --- test/daemon/kawpow.cpp | 13 +++++++------ test/unittests/progpow_test_vectors.hpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/daemon/kawpow.cpp b/test/daemon/kawpow.cpp index 38084bde..864712ca 100644 --- a/test/daemon/kawpow.cpp +++ b/test/daemon/kawpow.cpp @@ -23,7 +23,7 @@ int main(int argc, const char* argv[]) { static int epoch_number = 0; std::uint16_t SrvPort = DEFAULT_PORT; - static ethash::epoch_context_ptr context_light{nullptr, nullptr}; + static ethash::epoch_context_full_ptr context_full{nullptr, nullptr}; for (int i = 0; i < argc; ++i) { @@ -41,9 +41,10 @@ int main(int argc, const char* argv[]) } // Build context - if (!context_light || context_light->epoch_number != epoch_number) { + if (!context_full || context_full->epoch_number != epoch_number) { std::cout << "Building context for epoch: " << epoch_number << std::endl; - context_light = ethash::create_epoch_context(epoch_number); + context_full = ethash::create_epoch_context_full(epoch_number); + } if (!event_init()) @@ -126,12 +127,12 @@ int main(int argc, const char* argv[]) // Check epoch number and context epoch_number = (int) nHeight / ETHASH_EPOCH_LENGTH; - if (!context_light || context_light->epoch_number != epoch_number) { - context_light = ethash::create_epoch_context(epoch_number); + if (!context_full || context_full->epoch_number != epoch_number) { std::cout << "Building new context for epoch: " << epoch_number << std::endl; + context_full = ethash::create_epoch_context_full(epoch_number); } - const auto result = progpow::hash(*context_light, (int) nHeight, header_hash, nNonce); + const auto result = progpow::hash(*context_full, (int) nHeight, header_hash, nNonce); std::string share_met = "false"; std::string block_met = "false"; std::string mix_match = "false"; diff --git a/test/unittests/progpow_test_vectors.hpp b/test/unittests/progpow_test_vectors.hpp index 22eabe21..81c36dcf 100644 --- a/test/unittests/progpow_test_vectors.hpp +++ b/test/unittests/progpow_test_vectors.hpp @@ -58,7 +58,7 @@ progpow_hash_test_case progpow_hash_test_cases[] = { "4cf1fa62f25b577ac822a6a28d55f8b7e3ae7fe983abd868ae00927e68c41016"}, {170915, "5b3e8dfa1aafd3924a51f33e2d672d8dae32fa528d8b1d378d6e4db0ec5d665d", "0000000044975727", "efb29147484c434f1cc59629da90fd0343e3b047407ecd36e9ad973bd51bbac5", - "e7e6bb3b2f9acd3864bc86f72f87237eaf475633ef650c726ac80eb0adf116b6"}, + "e7e6bb3b2f9acd3864bc86f72f87237eaf475633ef650c726ac80eb0adf116b6"} }; } // namespace