Age | Commit message (Collapse) | Author | Files | Lines |
|
5b4fea7 Copyright: Update to 2023 (mj-xmr)
|
|
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.
|
|
|
|
Co-authored-by: plowsof <plowsof@protonmail.com>
extra files
|
|
|
|
- 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
|
|
|
|
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.
|
|
|
|
|
|
Update copyright year to 2020
|
|
fe92fa1 [randomx] Add missing randomx_vm_set_cache() (cohcho)
|
|
|
|
Don't try to allocate the dataset repeatedly if it has already failed.
|
|
* 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
|
|
Make sure dataset gets re-init'd if a reorg changes the epoch
|
|
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.
|
|
Was using the wrong cache slot, and returning invalid PoW hashes to RPC clients
|
|
Support RandomX PoW algorithm
|