Commit Graph

86 Commits

Author SHA1 Message Date
wowario 2f3f3b7a6e
remove rx_set code 2024-03-09 16:04:31 +03:00
wowario b414a0659d
use rx_set_miner_thread after RX_BLOCK_VERSION 2024-03-09 16:04:16 +03:00
wowario 0c4915d707
vote by block 2024-03-09 15:58:12 +03:00
wowario ff34adf8b7
tidy up miner msgs 2024-03-09 15:58:12 +03:00
wowario 48841789cb
miner block header signing 2024-03-09 15:58:11 +03:00
SChernykh 1d1d5fb74c Fixed RandomX initialization when mining from scratch 2023-04-27 16:24:15 +02: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 bb093ec9a8
Merge pull request #8223
17772ef Eliminate dependence on boost::interprocess #8223 (Jeffrey)
2022-04-06 00:19:59 -04:00
Jeffrey 17772ef53e Eliminate dependence on boost::interprocess #8223
In this repo, `boost::interprocess` was being used soley to make `uint32_t` operations atomic. So I replaced each instance of
`boost::interprocess::ipcdetail::atomic(...)32` with `std::atomic` methods. I replaced member declarations as applicable. For example,
when I needed to change a `volatile uint32_t` into a `std::atomic<uint32_t>`. Sometimes, a member was being used a boolean flag, so
I replaced it with `std::atomic<bool>`.

You may notice that I didn't touch `levin_client_async.h`. That is because this file is entirely unused and will be deleted in PR monero-project#8211.

Additional changes from review:
* Make some local variables const
* Change postfix operators to prefix operators where value was not need
2022-03-30 13:18:32 -05:00
mj-xmr da9aa1f7f8
Copyright: Update to 2022 2022-03-04 06:59:20 +01:00
mj-xmr 673c6d2d11 Reduce compilation time of epee/portable_storage_template_helper.h 2021-03-28 15:41:48 +02:00
moneromooo-monero 9d42649d58
core: fix mining from a block that's not the current top 2020-08-27 15:13:00 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
moneromooo-monero c2095fc27b
miner: use verification mode for low diff one block nonce searches
This avoids lengthy init times when testing
2020-02-06 14:27:10 +00:00
moneromooo-monero ebc6ce44f4
cryptonote: untangle dependency from miner to blockchain
It causes link errors at least on mac
2019-10-31 01:06:42 +00:00
pkubaj 0f4fddc2f8
Add also ifdef __x86_64__ 2019-10-13 19:08:23 +00:00
pkubaj 7fdaa8285e
Fix build on FreeBSD/!x86
Checking battery status uses x86-only headers and functions. Remove this functionality to get it to build on other architectures.
2019-10-13 16:43:18 +00:00
Howard Chu 81c2ad6d5b
RandomX integration
Support RandomX PoW algorithm
2019-09-25 21:29:42 +01:00
Lev Sizov 928f4be953 Make null hash constants constexpr
Simplify m_template initialization in miner
2019-09-05 17:37:19 +02:00
Lev Sizov 4ad191ffa9 Removed unused boost/value_init header 2019-09-02 14:38:29 +02:00
Jesus Ramirez 2cd4fd8972 Changed the use of boost:value_initialized for C++ list initializer 2019-09-02 14:16:29 +02:00
moneromooo-monero bcd2da76cd
miner: fix --bg-mining-enable description 2019-07-02 17:43:36 +00:00
ston1th f2f207d635 miner: fix double free of thread attributes
issue: #5568
2019-06-09 10:51:18 +02:00
Doyle 6643b04737 Increment m_threads_active when mining thread starts 2019-04-15 13:08:33 +10:00
moneromooo-monero 064ab12340
functional_tests: add more blockchain related tests
Related to emission, reorgs, getting tx data back, output
distribution and histogram
2019-04-11 11:07:58 +00:00
Riccardo Spagni 38717dafc0
Merge pull request #5381
def40161 miner: fix race when stopping mining with start mining enabled (moneromooo-monero)
2019-04-11 13:03:32 +02:00
moneromooo-monero a2561653cb
wallet: new option to start background mining
The setup-background-mining option can be used to select
background mining when a wallet loads. The user will be asked
the first time the wallet is created.
2019-04-04 18:10:45 +00:00
moneromooo-monero def4016171 miner: fix race when stopping mining with start mining enabled 2019-04-01 19:28:50 +00:00
Riccardo Spagni 574c399386
Merge pull request #5288
39f000b3 miner: fix possible exit crash due to race in stop (moneromooo-monero)
2019-04-01 17:20:25 +02:00
Riccardo Spagni 429930534d
Merge pull request #5185
59478c80 daemon: new mining_status command (moneromooo-monero)
2019-03-17 17:55:32 +02:00
moneromooo-monero 39f000b394
miner: fix possible exit crash due to race in stop
If a thread asks to stop the miner, m_stop will be set, and
that thread will wait to join. If the main thread is exiting
at that time, it will ask the miner to stop, but the miner
will claim it's not mining and early out since m_stop is
set. This will cause the database and other things to get
shutdown. If the miner happens to find a block at that time,
it will try to call core, and crash.

Instead, lock and check whether any threads are currently
in m_threads, since they'll only be cleared once the threads
are joined. Moreover, since we lock, the second thread will
have to wait for the first one to have finished. Calling
join twice on a thread seems fine as per pthread_join(3).
2019-03-14 16:59:08 +00:00
moneromooo-monero 59478c80dd
daemon: new mining_status command 2019-03-09 20:51:53 +00:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
moneromooo-monero 23abe60705
check load_t_from_json return values 2019-03-04 22:38:06 +00:00
moneromooo-monero 8298f42e9d
miner: it can now autodetect the optimal number of threads 2019-02-23 12:22:32 +00:00
Riccardo Spagni e7d30780de
Merge pull request #4869
60f36386 Avoid unnecessary temp block and copy ctor (moneromooo-monero)
2018-12-04 17:12:47 +02:00
moneromooo-monero 60f36386e4
Avoid unnecessary temp block and copy ctor
block already has a default ctor, and the extra object
churn due to its innards (vectors, etc) is pointless.
2018-11-19 17:57:17 +00:00
Martijn Otto bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
moneromooo-monero 3bb4b0d41f
miner: fix build with boost 1.69 2018-10-22 22:17:15 +00:00
moneromooo-monero 6ca00b6d75
miner: really reset flags/precision on std::cout 2018-10-08 12:12:36 +00:00
Riccardo Spagni effcbf2060
Merge pull request #4459
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-29 22:20:38 +02:00
luigi1111 3235abc184
Merge pull request #4030
0c41488 miner: show id and height when a block is found (stoffu)
2018-07-19 13:53:36 -05:00
stoffu 0c4148845b
miner: show id and height when a block is found 2018-06-20 12:08:40 +09:00
cryptochangements34 6f9260e38e handle optional miner params better 2018-05-06 12:28:57 -04:00
Dimitris Apostolou 57c0b1ed9f Fix typos in various files 2018-03-15 18:25:38 +02:00
Riccardo Spagni 4f93f74528
Merge pull request #3277
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu)
af773211 Stagenet (stoffu)
cc9a0bee command_line: allow args to depend on more than one args (stoffu)
55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu)
450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu)
9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05 19:11:20 +02:00
Edward Betts fbcc91c2a4 Correct spelling mistakes. 2018-03-05 17:00:40 +00:00
stoffu af773211cb
Stagenet 2018-03-05 11:55:05 +09:00
Riccardo Spagni ff36fd93fd
Merge pull request #3255
3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
2018-02-20 17:47:03 +02:00
Timothy D. Prime 3962bcb2a2 Closes #2886: really ignore battery checking
Move option test first.
2018-02-12 10:29:22 -08:00