diff options
author | SChernykh <sergey.v.chernykh@gmail.com> | 2022-12-10 18:30:59 +0100 |
---|---|---|
committer | SChernykh <sergey.v.chernykh@gmail.com> | 2023-01-09 07:43:07 +0100 |
commit | dab7d01dc0357a926993e5205d02a063b6bdcda0 (patch) | |
tree | 1c33154463adaa4c96fce3fb397f3363d61e2883 /src/crypto/hash-ops.h | |
parent | Merge pull request #8635 (diff) | |
download | monero-dab7d01dc0357a926993e5205d02a063b6bdcda0.tar.xz |
Refactored rx-slow-hash.c
- 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
Diffstat (limited to 'src/crypto/hash-ops.h')
-rw-r--r-- | src/crypto/hash-ops.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/crypto/hash-ops.h b/src/crypto/hash-ops.h index b7ec80d7c..9d3abc3f8 100644 --- a/src/crypto/hash-ops.h +++ b/src/crypto/hash-ops.h @@ -97,5 +97,9 @@ void rx_slow_hash_allocate_state(void); void rx_slow_hash_free_state(void); uint64_t rx_seedheight(const uint64_t height); void rx_seedheights(const uint64_t height, uint64_t *seed_height, uint64_t *next_height); -void rx_slow_hash(const uint64_t mainheight, const uint64_t seedheight, const char *seedhash, const void *data, size_t length, char *hash, int miners, int is_alt); -void rx_reorg(const uint64_t split_height); + +void rx_set_main_seedhash(const char *seedhash, size_t max_dataset_init_threads); +void rx_slow_hash(const char *seedhash, const void *data, size_t length, char *result_hash); + +void rx_set_miner_thread(uint32_t value, size_t max_dataset_init_threads); +uint32_t rx_get_miner_thread(void); |