Commit Graph

288 Commits

Author SHA1 Message Date
wowario a177241046
mod variant4_random_math 2024-03-09 15:58:13 +03:00
wowario da6a2dc2c5
bump RX block version 2024-03-09 15:54:20 +03:00
SChernykh e7d51e5583 JH hash compiler workarounds
- Fixed uninitialized `state->x` warning
- Fixed broken code with `-O3` or `-Ofast`

The old code is known to break GCC 10.1 and GCC 11.4
2023-11-04 21:01:47 +01:00
SChernykh c742fa4c6e Fixed deadlock and crash when syncing with full dataset on Windows
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-03-29 08:44:20 +02:00
SChernykh f456b3f023 Demote large pages warning to `mdebug` 2023-01-17 18:16:47 +01:00
SChernykh 480b050cc3 RandomX: print VM allocation warnings only once 2023-01-11 19:18:41 +01:00
SChernykh f698f2b708 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
2022-12-14 07:21:00 +01:00
luigi1111 156151396e
Merge pull request #8262
268a039 Optimized keccak implementation (SChernykh)
2022-05-10 16:47:13 -05:00
SChernykh 268a0393e9 Optimized keccak implementation
All tests were conducted on the same PC (Ryzen 5 5600X running at fixed 4.65 GHz).

Before:
test_cn_fast_hash<32> (100000 calls) - OK: 1 us/call
test_cn_fast_hash<16384> (1000 calls) - OK: 164 us/call

After:
test_cn_fast_hash<32> (100000 calls) - OK: 0 us/call
test_cn_fast_hash<16384> (1000 calls) - OK: 31 us/call

More than 5 times speedup for cn_fast_hash.

Also noticed consistent 1-2% improvement in test_construct_tx results.
2022-04-18 10:01:13 +02:00
j-berman ea87b30f89 Add view tags to outputs to reduce wallet scanning time
Implements view tags as proposed by @UkoeHB in MRL issue
https://github.com/monero-project/research-lab/issues/73

At tx construction, the sender adds a 1-byte view tag to each
output. The view tag is derived from the sender-receiver
shared secret. When scanning for outputs, the receiver can
check the view tag for a match, in order to reduce scanning
time. When the view tag does not match, the wallet avoids the
more expensive EC operations when deriving the output public
key using the shared secret.
2022-04-18 00:49:53 -07:00
mj-xmr 4db6aed98c CMake: Add missing headers via monero_find_all_headers macro 2022-04-06 08:12:44 +02:00
mj-xmr da9aa1f7f8
Copyright: Update to 2022 2022-03-04 06:59:20 +01:00
luigi1111 abae63c37d
Merge pull request #8052
c36ea26 fix ge_p3_is_point_at_infinity(), which is evaluating field elements that haven't been reduced by the field order (koe)
2022-03-02 18:52:51 -05:00
luigi1111 5eaa4434e8
Merge pull request #7877
e08abaa multisig key exchange update and refactor (koe)
2022-03-02 18:51:54 -05:00
koe e08abaa43f multisig key exchange update and refactor 2022-02-22 16:37:42 -06:00
moneromooo-monero 06e6c8bf4a
crypto: fix constant randomx exceptions in large page allocator
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.
2022-02-19 13:15:10 +00:00
koe c36ea26e5c fix ge_p3_is_point_at_infinity(), which is evaluating field elements that haven't been reduced by the field order 2022-01-25 07:14:46 -06:00
luigi1111 2844b5b8db
Merge pull request #8031
187633c slow_hash: don't blow out Mac stack on ARM64 (Howard Chu)
2021-11-09 22:50:36 -06:00
Howard Chu 187633c0ca
slow_hash: don't blow out Mac stack on ARM64 2021-10-30 22:24:55 +01:00
selsta 548cfc8d68
crypto: fix typo in ifdef 2021-10-29 17:55:51 +02:00
Howard Chu 9973edd4c3
ARMv8: detect AES support dynamically 2021-10-10 16:52:30 +01:00
selsta 0794811b40
cmake: set xcode file type 2021-04-28 14:49:13 +02:00
luigi1111 247db4e304
Merge pull request #7373
86263b3 Honor LARGE_PAGES flag in randomx umask (Howard Chu)
2021-03-29 21:41:56 -04:00
Howard Chu 86263b386c
Honor LARGE_PAGES flag in randomx umask 2021-02-11 14:42:49 +00:00
moneromooo-monero 19b228393f
New add_aux_pow RPC to support merge mining 2021-02-09 11:58:21 +00:00
moneromooo-monero 5ed604fe5b
crypto: fix non zero scalar being 0 after reducing 2020-12-04 01:00:03 +00:00
Riccardo Spagni aefa7740c3
Merge pull request #6111
d20ff4f64 functional_tests: add a large (many randomx epochs) p2p reorg test (moneromooo-monero)
6a0b3b1f8 functional_tests: add randomx tests (moneromooo-monero)
9d42649d5 core: fix mining from a block that's not the current top (moneromooo-monero)
2020-09-06 15:49:37 +02:00
moneromooo-monero 6a0b3b1f8a
functional_tests: add randomx tests 2020-08-27 15:13:03 +00:00
Sarang Noether 4b328c6616 CLSAG signatures 2020-08-27 12:43:29 +00:00
Alexander Blair e2e09d00c2
Merge pull request #6337
a11ec4ac1 Support for supercop ASM in wallet, and benchmark for supercop (Lee Clagett)
2020-08-16 12:38:44 -07:00
Sarang Noether 6bfcd31015 Updates InProofV1, OutProofV1, and ReserveProofV1 to new V2 variants that include all public proof parameters in Schnorr challenges, along with hash function domain separators. Includes new randomized unit tests. 2020-08-09 18:42:15 -04:00
Alexander Blair bb0241da6e
Merge pull request #6538
7178bb5c8 keccak: remove aligned check (moneromooo-monero)
2020-07-19 03:38:53 -07:00
moneromooo-monero 7178bb5c84
keccak: remove aligned check
Some tools report the alignment check as UB, which seems a bit
dubious, but since the performance difference between the two
versions is minimal, I'll go with the safe version
2020-05-16 12:28:27 +00:00
Lee Clagett a11ec4ac1d Support for supercop ASM in wallet, and benchmark for supercop 2020-05-16 10:25:17 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 b4023dcfc5
Merge pull request #6441
613071f use memwipe on secret k/alpha values (moneromooo-monero)
2020-05-05 23:39:32 -05:00
moneromooo-monero 613071f4fa
use memwipe on secret k/alpha values
Reported by UkoeHB_ and sarang
2020-04-15 01:16:31 +00:00
luigi1111 0253f86fde
Merge pull request #6298
fe92fa1 [randomx] Add missing randomx_vm_set_cache() (cohcho)
2020-03-31 13:36:21 -05:00
Lee Clagett 02d887c2e5 Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
  - Stem loops detected in tx_pool.cpp
  - Embargo timeout for a blackhole attack during stem phase
2020-03-26 15:01:30 +00:00
Alexander Blair 6742c4acb7
Merge pull request #6223
c3613031 Silence miner debugmsg spam (Howard Chu)
2020-02-28 19:45:55 -08:00
cohcho fe92fa1391 [randomx] Add missing randomx_vm_set_cache() 2020-01-17 19:25:26 +00:00
Howard Chu c361303184
Silence miner debugmsg spam
Don't try to allocate the dataset repeatedly if it has already failed.
2019-12-09 15:59:52 +00:00
Bert Peters b2ad757f48 Replace memset with memwipe. 2019-11-13 18:00:50 +01:00
tevador ea813cfb1b RandomX: update to v1.1.4
* 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-13 18:43:27 +02:00
Howard Chu f54301dd75
Fix for miners on reorg
Make sure dataset gets re-init'd if a reorg changes the epoch
2019-10-07 09:50:00 +01:00
Howard Chu 2675cf4483
Update to RandomX v1.1.3, simplify
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-05 18:51:20 +01:00
Howard Chu 1c600a492f
Fix randomx cache selection for RPCs
Was using the wrong cache slot, and returning invalid PoW hashes to RPC clients
2019-10-03 20:05:17 +01:00
Howard Chu 81c2ad6d5b
RandomX integration
Support RandomX PoW algorithm
2019-09-25 21:29:42 +01:00
luigi1111 ee6e849627
Merge pull request #5877
2cd4fd8 Changed the use of boost:value_initialized for C++ list initializer (JesusRami)
4ad191f Removed unused boost/value_init header (whyamiroot)
928f4be Make null hash constants constexpr (whyamiroot)
2019-09-24 10:08:44 -05:00
Lev Sizov 928f4be953 Make null hash constants constexpr
Simplify m_template initialization in miner
2019-09-05 17:37:19 +02:00