aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/rx-slow-hash.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-04-25Merge pull request #8698luigi11111-1/+1
5b4fea7 Copyright: Update to 2023 (mj-xmr)
2023-03-29Fixed deadlock and crash when syncing with full dataset on WindowsSChernykh1-1/+2
It's not allowed to use WaitForSingleObject with _beginthread, because the thread closes its own handle before exiting. So the wait function will either wait on an invalid handle, or on a different handle used by something else. Or, if it starts waiting before the thread exits, the behavior is undefined according to MS: "If this handle is closed while the wait is still pending, the function's behavior is undefined." In my test sync I observed threads getting stuck infinitely on WaitForSingleObject, and then rx_set_main_seedhash spamming new threads when RandomX seed changes again. Eventually the system ran out of resources, and monerod aborted with "Couldn't start RandomX seed thread" message. This PR fixes it by using `_beginthreadex` instead and explicitly closing the handle when it's safe.
2023-01-17Demote large pages warning to `mdebug`SChernykh1-4/+7
2023-01-16Copyright: Update to 2023mj-xmr1-1/+1
Co-authored-by: plowsof <plowsof@protonmail.com> extra files
2023-01-11RandomX: print VM allocation warnings only onceSChernykh1-2/+10
2023-01-09Refactored rx-slow-hash.cSChernykh1-189/+324
- Straight-forward call interface: `void rx_slow_hash(const char *seedhash, const void *data, size_t length, char *result_hash)` - Consensus chain seed hash is now updated by calling `rx_set_main_seedhash` whenever a block is added/removed or a reorg happens - `rx_slow_hash` will compute correct hash no matter if `rx_set_main_seedhash` was called or not (the only difference is performance) - New environment variable `MONERO_RANDOMX_FULL_MEM` to force use the full dataset for PoW verification (faster block verification) - When dataset is used for PoW verification, dataset updates don't stall other threads (verification is done in light mode then) - When mining is running, PoW checks now also use dataset for faster verification
2022-03-04Copyright: Update to 2022mj-xmr1-1/+1
2022-02-19crypto: fix constant randomx exceptions in large page allocatormoneromooo-monero1-1/+4
If allocating large pages fails, we don't try again. This has the obvious drawback of not being able to use large pages if they fail once.
2021-02-11Honor LARGE_PAGES flag in randomx umaskHoward Chu1-10/+18
2020-08-27functional_tests: add randomx testsmoneromooo-monero1-4/+46
2020-05-06Update copyright year to 2020SomaticFanatic1-1/+1
Update copyright year to 2020
2020-03-31Merge pull request #6298luigi11111-0/+4
fe92fa1 [randomx] Add missing randomx_vm_set_cache() (cohcho)
2020-01-17[randomx] Add missing randomx_vm_set_cache()cohcho1-0/+4
2019-12-09Silence miner debugmsg spamHoward Chu1-7/+14
Don't try to allocate the dataset repeatedly if it has already failed.
2019-10-13RandomX: update to v1.1.4tevador1-76/+30
* Faster cache initialization with SSSE3/AVX2 * Automatic detection of CPU capabilities in RandomX * Fixed a possible out-of-bounds access in superscalar program generator * Use MONERO_RANDOMX_UMASK to manually disable RandomX flags in monerod
2019-10-07Fix for miners on reorgHoward Chu1-1/+4
Make sure dataset gets re-init'd if a reorg changes the epoch
2019-10-05Update to RandomX v1.1.3, simplifyHoward Chu1-19/+2
We don't need to detect if the cache has changed, just always call to set it on the VM. The call will be a no-op if the cache hasn't changed.
2019-10-03Fix randomx cache selection for RPCsHoward Chu1-12/+28
Was using the wrong cache slot, and returning invalid PoW hashes to RPC clients
2019-09-25RandomX integrationHoward Chu1-0/+357
Support RandomX PoW algorithm