Just making sure: for non-mining P2Pools, is using --light-mode
to use just the cache for verification but not have the whole dataset in memory ideal?
|
if (m_pool && !m_pool->params().m_lightMode) { |
|
m_dataset = randomx_alloc_dataset(RANDOMX_FLAG_LARGE_PAGES); |
|
if (!m_dataset) { |
|
LOGWARN(1, "couldn't allocate RandomX dataset using large pages"); |
|
m_dataset = randomx_alloc_dataset(RANDOMX_FLAG_DEFAULT); |
|
if (!m_dataset) { |
|
LOGERR(1, "couldn't allocate RandomX dataset"); |
|
} |
|
} |
|
if (m_dataset) { |
|
memory_allocated += RANDOMX_DATASET_BASE_SIZE + RANDOMX_DATASET_EXTRA_SIZE; |
|
} |
|
} |
|
|
|
const randomx_flags flags = randomx_get_flags(); |
|
|
|
for (size_t i = 0; i < array_size(&RandomX_Hasher::m_cache); ++i) { |
|
m_cache[i] = randomx_alloc_cache(flags | RANDOMX_FLAG_LARGE_PAGES); |
|
if (!m_cache[i]) { |
|
LOGWARN(1, "couldn't allocate RandomX cache using large pages"); |
|
m_cache[i] = randomx_alloc_cache(flags); |
|
if (!m_cache[i]) { |
|
LOGERR(1, "couldn't allocate RandomX cache, aborting"); |
|
PANIC_STOP(); |
|
} |
|
} |
|
memory_allocated += RANDOMX_ARGON_MEMORY * 1024; |
|
} |
i.e, --light-mode
skips the first block for dataset allocation, but the cache always gets allocated, which is all we need for hash verification?