add RandomWOW

pull/203/head
wowario 5 years ago
parent c319796355
commit a1258baf5a
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

6
.gitmodules vendored

@ -12,6 +12,6 @@
[submodule "external/trezor-common"] [submodule "external/trezor-common"]
path = external/trezor-common path = external/trezor-common
url = https://github.com/trezor/trezor-common.git url = https://github.com/trezor/trezor-common.git
[submodule "external/randomx"] [submodule "external/randomwow"]
path = external/randomx path = external/randomwow
url = https://github.com/tevador/RandomX url = https://github.com/wownero/RandomWOW

@ -205,7 +205,7 @@ if(NOT MANUAL_SUBMODULES)
check_submodule(external/unbound) check_submodule(external/unbound)
check_submodule(external/rapidjson) check_submodule(external/rapidjson)
check_submodule(external/trezor-common) check_submodule(external/trezor-common)
check_submodule(external/randomx) check_submodule(external/randomwow)
endif() endif()
endif() endif()

@ -40,7 +40,7 @@ Dates are provided in the format YYYY-MM-DD.
| 53666 | 2018-10-06 | Cool Cage | v0.3.0.0 | v0.3.1.3 | Cryptonight variant 2, LWMA v2, ringsize = 22, MMS | 53666 | 2018-10-06 | Cool Cage | v0.3.0.0 | v0.3.1.3 | Cryptonight variant 2, LWMA v2, ringsize = 22, MMS
| 63469 | 2018-11-11 | Dank Doge | v0.4.0.0 | v0.4.0.0 | LWMA v4 | 63469 | 2018-11-11 | Dank Doge | v0.4.0.0 | v0.4.0.0 | LWMA v4
| 81769 | 2019-02-19 | Erotic EggplantEmoji | v0.5.0.0 | v0.5.0.2 | Cryptonight/wow, LWMA v1 with N=144, Updated Bulletproofs, Fee Per Byte, Auto-churn | 81769 | 2019-02-19 | Erotic EggplantEmoji | v0.5.0.0 | v0.5.0.2 | Cryptonight/wow, LWMA v1 with N=144, Updated Bulletproofs, Fee Per Byte, Auto-churn
| XXXXX | 2019-XX-XX | F For Fappening | v0.6.0.0 | v0.6.0.0 | New PoW based on RandomX, new block weight algorithm, slightly more efficient RingCT format | 114969 | 2019-06-14 | F For Fappening | v0.6.0.0 | v0.6.0.0 | RandomWOW, new block weight algorithm, slightly more efficient RingCT format
X's indicate that these details have not been determined as of commit date. X's indicate that these details have not been determined as of commit date.

@ -100,4 +100,4 @@ endif()
add_subdirectory(db_drivers) add_subdirectory(db_drivers)
add_subdirectory(easylogging++) add_subdirectory(easylogging++)
add_subdirectory(randomx) add_subdirectory(randomwow)

@ -0,0 +1 @@
Subproject commit 435a8382d88cf81a85af680ff00dde7644ad4478

1
external/randomx vendored

@ -1 +0,0 @@
Subproject commit 1276d67d2f594ea4a8e9cde28253b1a74769aeb9

@ -209,11 +209,11 @@ static void rx_initdata(randomx_cache *rs_cache, const int miners) {
CTHR_THREAD_TYPE *st; CTHR_THREAD_TYPE *st;
si = malloc(miners * sizeof(seedinfo)); si = malloc(miners * sizeof(seedinfo));
if (si == NULL) if (si == NULL)
local_abort("Couldn't allocate RandomX mining threadinfo"); local_abort("Couldn't allocate RandomWOW mining threadinfo");
st = malloc(miners * sizeof(CTHR_THREAD_TYPE)); st = malloc(miners * sizeof(CTHR_THREAD_TYPE));
if (st == NULL) { if (st == NULL) {
free(si); free(si);
local_abort("Couldn't allocate RandomX mining threadlist"); local_abort("Couldn't allocate RandomWOW mining threadlist");
} }
for (i=0; i<miners-1; i++) { for (i=0; i<miners-1; i++) {
si[i].si_cache = rs_cache; si[i].si_cache = rs_cache;
@ -251,7 +251,7 @@ static void rx_seedhash_int(rx_state *rx_sp, const uint64_t height, const char *
if (cache == NULL) if (cache == NULL)
cache = randomx_alloc_cache(flags); cache = randomx_alloc_cache(flags);
if (cache == NULL) if (cache == NULL)
local_abort("Couldn't allocate RandomX cache"); local_abort("Couldn't allocate RandomWOW cache");
} }
randomx_init_cache(cache, hash, 32); randomx_init_cache(cache, hash, 32);
if (miners && rx_dataset != NULL) if (miners && rx_dataset != NULL)
@ -295,7 +295,7 @@ void rx_alt_slowhash(const uint64_t mainheight, const uint64_t seedheight, const
rx_vm = randomx_create_vm(flags, rx_sp->rs_cache, NULL); rx_vm = randomx_create_vm(flags, rx_sp->rs_cache, NULL);
} }
if (rx_vm == NULL) if (rx_vm == NULL)
local_abort("Couldn't allocate RandomX VM"); local_abort("Couldn't allocate RandomWOW VM");
} }
randomx_calculate_hash(rx_vm, data, length, hash); randomx_calculate_hash(rx_vm, data, length, hash);
} }
@ -333,7 +333,7 @@ void rx_slow_hash(const void *data, size_t length, char *hash, int miners) {
rx_vm = randomx_create_vm(flags, rx_sp->rs_cache, rx_dataset); rx_vm = randomx_create_vm(flags, rx_sp->rs_cache, rx_dataset);
} }
if (rx_vm == NULL) if (rx_vm == NULL)
local_abort("Couldn't allocate RandomX VM"); local_abort("Couldn't allocate RandomWOW VM");
} }
randomx_calculate_hash(rx_vm, data, length, hash); randomx_calculate_hash(rx_vm, data, length, hash);
} }

@ -95,6 +95,8 @@ static const struct {
{ 10, 63469, 0, 1541700352 }, { 10, 63469, 0, 1541700352 },
{ 11, 81769, 0, 1549238400 }, { 11, 81769, 0, 1549238400 },
{ 12, 82069, 0, 1549318761 }, { 12, 82069, 0, 1549318761 },
{ 13, 114969, 0, 1559292691 },
{ 14, 115257, 0, 1559292774 },
}; };
static const struct { static const struct {

@ -674,15 +674,8 @@ namespace cryptonote
bool get_block_longhash(const Blockchain *pbc, const block& b, crypto::hash& res, const uint64_t height, const int miners) bool get_block_longhash(const Blockchain *pbc, const block& b, crypto::hash& res, const uint64_t height, const int miners)
{ {
// block 202612 bug workaround
if (height == 202612)
{
static const std::string longhash_202612 = "84f64766475d51837ac9efbef1926486e58563c95a19fef4aec3254f03000000";
epee::string_tools::hex_to_pod(longhash_202612, res);
return true;
}
blobdata bd = get_block_hashing_blob(b); blobdata bd = get_block_hashing_blob(b);
const int pow_variant = b.major_version >= 7 ? b.major_version - 6 : 0; const int pow_variant = b.major_version >= 13 ? 6 : b.major_version >= 11 && b.major_version <= 12 ? 4 : 2;
if (pow_variant >= 6) { if (pow_variant >= 6) {
uint64_t seed_height; uint64_t seed_height;
if (rx_needhash(height, &seed_height)) { if (rx_needhash(height, &seed_height)) {

Loading…
Cancel
Save