Commit Graph

352 Commits

Author SHA1 Message Date
SChernykh
028a5d0c88 Fixed memory leak after loading block cache 2022-03-24 18:30:23 +01:00
SChernykh
8b27faad6d BlockCache: fixed collisions of same height blocks 2022-03-24 16:03:12 +01:00
SChernykh
cdc3206ee8 Optimized keccak 2022-03-24 12:52:57 +01:00
SChernykh
0c2b7d6010 More time handling fixes 2022-03-23 15:49:24 +01:00
SChernykh
ef15c3b54f Show sidechain ID in status 2022-03-23 14:17:40 +01:00
SChernykh
f4bcdc7fe9 Use steady_clock to time peer list requests 2022-03-23 11:37:05 +01:00
SChernykh
aada1bb5cc Use chrono::steady_clock for internal timestamps 2022-03-23 11:30:38 +01:00
SChernykh
c21d052d7a Refactored RNG usage across the code 2022-03-17 16:14:29 +01:00
SChernykh
62b1690780 Added an option to disable RandomX for the build 2022-03-15 17:11:45 +01:00
SChernykh
0db57e5047 p2pool v1.8 2022-02-27 19:56:47 +01:00
SChernykh
e7919514d4 TCPServer: fixed uninitialized variables 2022-02-25 15:31:35 +01:00
SChernykh
7ab21c6afd TCPServer: reduced memory usage 2022-02-23 17:07:50 +01:00
SChernykh
2209e0cc70 P2PServer: relaxed peer list request restriction 2022-02-22 11:06:12 +01:00
SChernykh
a73b4616a4 Fixed Coverity issues 2022-02-22 00:38:08 +01:00
SChernykh
9593311332 Added bans console command 2022-02-21 19:59:57 +01:00
SChernykh
9a09d15bea P2PServer: use high_resolution_clock for ping time 2022-02-21 18:46:53 +01:00
SChernykh
f082488e4b TCPServer: use steady_clock for bans 2022-02-21 18:41:36 +01:00
SChernykh
752e2381d6 P2PServer: added more protocol checks 2022-02-21 16:54:53 +01:00
SChernykh
de9f13d393 Check for unknown command line parameters 2022-02-21 08:02:36 +01:00
SChernykh
272d206741 stats_mod api: updated min payout value 2022-02-20 17:08:27 +01:00
SChernykh
8045c40026 Check for proper --local-api usage 2022-02-18 16:21:28 +01:00
SChernykh
d4a1b14820 Use monerod peers to find p2pool nodes 2022-02-17 22:10:52 +01:00
SChernykh
cc6ce4a366 Reset stratum share counters after initial sync 2022-02-17 11:19:11 +01:00
SChernykh
42370bf11e p2pool v1.7 2022-02-14 19:29:55 +01:00
SChernykh
ec2f4467fb Added --mini command line option to connect to p2pool-mini 2022-02-14 13:57:59 +01:00
SChernykh
9f449320b5 StartumServer: disconnect and ban inactive clients 2022-02-08 15:00:08 +01:00
SChernykh
8767ef9e19 Display payout amount when a block is found 2022-01-29 17:09:43 +01:00
SChernykh
cf184295b4 Updated version 2022-01-26 19:42:49 +01:00
SChernykh
1e4e4bd08e Added miner statistics to data api 2022-01-24 10:42:21 +01:00
SChernykh
a640e41d74 Improved RNG initialization 2022-01-24 00:37:39 +01:00
SChernykh
38ffd73b54 Fixed new Coverity issue 2022-01-23 13:03:56 +01:00
SChernykh
c10a5ce323 Miner code cleanup 2022-01-23 11:03:26 +01:00
SChernykh
e2931f94b5 Added embedded miner 2022-01-22 23:30:19 +01:00
SChernykh
248fcee174 Update version 2022-01-09 17:19:20 +01:00
SChernykh
89bcceb986 Added p2pool mini seed nodes and default port 2021-12-30 11:10:18 +01:00
SChernykh
2b01350add Added outpeers and inpeers console commands 2021-12-26 15:28:33 +01:00
SChernykh
f1b6212c82 P2PServer: add connection limits
#87 Added `--out-peers` and `--in-peers` command line options.
2021-12-26 14:59:45 +01:00
SChernykh
d8bba4dc82 Updated version mismatch error message 2021-12-07 16:25:23 +01:00
SChernykh
eaf29872cb Update version 2021-12-01 18:24:36 +01:00
SChernykh
f9def6cb73 Added "calc_pow" RPC support 2021-11-21 09:12:21 +01:00
SChernykh
07cfb54bdc JSONRPCRequest: fixed undefined behavior in the error handler 2021-11-10 16:26:01 +01:00
SChernykh
5dd8d11b72 TCPServer: removed unused field 2021-11-09 15:48:59 +01:00
SChernykh
e44baad73c Update version 2021-11-05 15:39:20 +01:00
SChernykh
bb7a5b4d6d Cleanup 2021-11-02 17:18:02 +01:00
SChernykh
64116643c2 Fixed block broadcasts 2021-11-01 19:36:11 +01:00
SChernykh
1e4c6ef5f4 Added block verification test 2021-11-01 18:53:34 +01:00
SChernykh
61edc6ed70 Reduce cache flush frequency to once per minute 2021-11-01 11:29:59 +01:00
SChernykh
dff2413cae TCPServer: make write buffers global
Reduced memory usage per connection.
2021-10-31 20:29:35 +01:00
SChernykh
998c2ba72f Fixed msys2 build crash 2021-10-31 20:29:35 +01:00
SChernykh
b56d027dd5 Include P2P peer list into miner count 2021-10-31 20:29:35 +01:00
SChernykh
eaed654012 Check for missing data from monerod on each new block
It helps in these cases:
- monerod was down/unavailable for a while and then restarted
- monerod was out of sync and then jumped several block heights ahead
2021-10-31 12:20:29 +01:00
SChernykh
981b161cc9 SideChain: faster processing of repeated broadcasts 2021-10-31 11:06:00 +01:00
SChernykh
f59e9171e8 SideChain: use a separate lock for m_seenBlocks 2021-10-31 10:26:13 +01:00
SChernykh
b45540ca08 TCPServer: clean up old IP bans 2021-10-29 14:54:36 +02:00
SChernykh
806e1ca0a3 SideChain: faster check for low-diff spam blocks 2021-10-29 11:39:15 +02:00
SChernykh
113e39817d Cleanup old Monero blocks data 2021-10-29 11:14:28 +02:00
SChernykh
0869326f39 SideChain: count miners in the last 48 hours 2021-10-29 10:37:12 +02:00
SChernykh
75d62c0303 SideChain: cleanup m_seenBlocks when pruning old blocks 2021-10-29 10:34:53 +02:00
SChernykh
da4686b88f ZMQReader: start after initial RPC calls are finished 2021-10-28 20:05:40 +02:00
SChernykh
a008eac8c6 ZMQReader: more reliable connect() 2021-10-28 19:28:33 +02:00
SChernykh
3d60ae8c32 Fix: don't start until monerod is fully synchronized 2021-10-28 18:47:28 +02:00
SChernykh
88f346414a Fixed race condition when using --no-color 2021-10-28 10:36:50 +02:00
SChernykh
2071a24a9f Update version 2021-10-27 17:27:48 +02:00
SChernykh
1c0da4513f Added --no-color command line option
`--no-color` disables colors in console output
2021-10-27 16:48:17 +02:00
SChernykh
6a002cda46 Create msvc-analysis.yml 2021-10-27 16:06:36 +02:00
SChernykh
c0c210664a Show uptime in status 2021-10-26 17:55:47 +02:00
SChernykh
6859d11445 Disable console quick-edit mode on Windows
Prevent user from accidentally selecting text in console and freezing all output
2021-10-26 17:42:00 +02:00
SChernykh
111324b6e0 Added console command to show connected peers 2021-10-24 16:04:30 +02:00
SChernykh
148b9dd294 Switch to faster unordered_map/set 2021-10-22 18:34:20 +02:00
SChernykh
04d18cdf1d P2PServer: fixed m_timer leak 2021-10-21 19:19:22 +02:00
SChernykh
352ad81a0a StratumServer: faster processing of regular shares 2021-10-21 19:09:36 +02:00
SChernykh
d26902468d P2PServer: peer list tweaks
- Increase outgoing connections to 10
- Stricter handling of peer list responses
2021-10-21 15:55:00 +02:00
SChernykh
0382027d70 Fixed wrong error message 2021-10-21 10:12:57 +02:00
SChernykh
966b499e5c ZMQReader: keep trying to connect on startup 2021-10-21 00:22:53 +02:00
SChernykh
9885f82e9e Limit user name length to 64 characters
Also avoid creating temporary strings (`" user " + client->m_customUser`) when logging user name
2021-10-19 21:09:08 +02:00
WeebDataHoarder
bc341918f6 Decode custom user from stratum client, display stratum client+user on SHARE FOUND and client mainchain found message 2021-10-19 19:33:15 +02:00
SChernykh
f17c23528a Update version 2021-10-17 11:00:51 +02:00
SChernykh
a06f4dcdcd P2PServer: fixed ever growing memory usage 2021-10-17 10:57:33 +02:00
SChernykh
816a29c5ab Added --no-cache command line parameter 2021-10-16 13:45:28 +02:00
SChernykh
285560e120 Fixed possible sidechain split during RandomX epoch change 2021-10-16 09:57:13 +02:00
SChernykh
39ba5c4131 P2PServer: check for messages that shouldn't be sent 2021-10-15 17:09:51 +02:00
SChernykh
9b86f8e81f Peer list refactoring
- Remove peers that weren't seen for > 1 hour
- Better peer selection algorithm for PEER_LIST_RESPONSE
2021-10-15 11:32:01 +02:00
SChernykh
9e90e988fa Refactored array_size to make it always constexpr 2021-10-14 16:46:49 +02:00
SChernykh
39b2167c98 Show correct max log level in usage 2021-10-14 13:59:11 +02:00
SChernykh
f3024d3556 StratumServer: submit Monero block as soon as possible
1-3 ms saved when a block is found
2021-10-13 18:57:21 +02:00
SChernykh
61ac90f1d5
Fixed typo 2021-10-13 14:56:27 +02:00
SChernykh
60a8538e0c P2PServer: show an error when there are no ZMQ messages 2021-10-09 11:01:26 +02:00
SChernykh
77a3a5857c P2PServer: show an error when there are no connections 2021-10-08 18:21:31 +02:00
SChernykh
af2a8eeb08 Tweaked warning level for lagging nodes 2021-10-06 15:22:03 +02:00
SChernykh
54d0ab3658 Move most block broadcasts to log level 6 2021-10-06 09:47:41 +02:00
SChernykh
c9faa92098 StratumServer: fixed "bad share" ban logic 2021-10-04 15:51:28 +02:00
SChernykh
52e5008bf4 Refactoring
- Skip calling time(nullptr) twice
- Use getter method for m_api instead of exposing it
- Moved api_udate_*() back to private since they're not used anywhere else
2021-10-04 10:28:56 +02:00
SChernykh
a0a31b0f3b
Merge pull request #51 from Tonux599/stratumServerJson-staging
API for stratum server statistics.
2021-10-04 11:16:37 +03:00
Thomas Clarke
7742d163f7
API for stratum server statistics.
Users can pass `--stratum-api` to command line to enable a file called `local/stats` in `--data-api` directory. `local/stats` contains statistics that `StratumServer status` provides but in JSON format. It is currently setup that `local/stats` is updated each time a new job is sent to a worker.
2021-10-03 22:32:13 +01:00
SChernykh
7d66864b01 Print P2Pool version 2021-10-02 17:06:48 +02:00
SChernykh
2a3cd13b19 P2PServer: delete old cached blocks after initial sync
Saves ~20 MB of memory
2021-10-01 15:31:47 +02:00
SChernykh
4bcaa41c8e Clear crypto derivation/key cache when a block is found 2021-09-27 13:47:27 +02:00
SChernykh
4fce76576f ZMQ reader: abort if connect to monerod failed 2021-09-27 13:47:27 +02:00
SChernykh
f05f7c4268 Fixed wrong nonce values in submit_block error log 2021-09-26 16:50:24 +02:00
SChernykh
ae8733c187 Update RandomX 2021-09-22 17:59:58 +02:00
SChernykh
5c92920619 Default log level 3
Also refactored default port numbers
2021-09-18 10:03:06 +02:00
SChernykh
b4ea125a8a Hardcode default consensus ID for faster startup 2021-09-16 14:23:14 +02:00
SChernykh
8aa9e54dc4 BlockTemplate: wait for 10 seconds before including new transactions 2021-09-14 12:54:42 +02:00
SChernykh
b35b4a9f76 Crypto: added cache for faster key derivation 2021-09-14 11:06:49 +02:00
SChernykh
ba6a2c8eb2 P2PServer: relax stale block restriction 2021-09-13 19:25:12 +02:00
SChernykh
14e26f5c17 Fix: always check before closing TCP handles 2021-09-13 19:11:59 +02:00
SChernykh
4c5144b37f Check monerod RPC version at startup 2021-09-13 18:27:47 +02:00
SChernykh
42dd58d778 P2PServer: check broadcasts for wrong height 2021-09-13 15:48:05 +02:00
SChernykh
da0f376bef P2PServer: ban peers that don't broadcast blocks 2021-09-13 15:01:02 +02:00
SChernykh
0d439e7712 SideChain: submit blocks to monerod in more cases 2021-09-13 10:16:45 +02:00
SChernykh
b8f04ac787 Tweaked block broadcast rules 2021-09-11 23:44:09 +02:00
WeebDataHoarder
7bad1e05a4 Implemented shares/uncles position chart on status command
Shows progress in slices of PPNLS window. Shares move left to right as they age.
A dot "." indicates no shares, 1-9 for that number in shares, for 9+ it shows a "+".

Will not show shares or uncles lines unless you have one on window.
2021-09-10 16:59:15 +02:00
SChernykh
74096248e1 Better error handling of Monero RPC requests 2021-09-10 16:18:16 +02:00
SChernykh
36ee76d4d2 data api: fixed one block missing to calculate effort 2021-09-10 08:18:38 +02:00
SChernykh
3aa270a072 Fix for older compilers 2021-09-09 11:44:40 +02:00
SChernykh
7a97171b03 Tweaked block broadcast rules 2021-09-08 20:57:22 +02:00
SChernykh
52f195b89f Tweaked idle peer detection 2021-09-08 20:36:21 +02:00
SChernykh
ee7a1e54f7 DNS name resolution for command line parameters 2021-09-08 20:25:39 +02:00
SChernykh
c8a2a256e7 Fixed RandomX VM initialization 2021-09-08 11:49:54 +02:00
SChernykh
57bc38d2bb data api: added stats_mod 2021-09-08 09:57:31 +02:00
SChernykh
a332ac7d26 P2PServer: load peers from DNS 2021-09-07 21:43:44 +02:00
SChernykh
7ea1913a9d Update log.h 2021-09-07 14:14:11 +02:00
SChernykh
73c8b1294a P2PServer: connect to peers from the event loop thread
Better thread safety
2021-09-07 12:56:22 +02:00
SChernykh
ce8ec3860d Fixed memory leak 2021-09-07 10:22:58 +02:00
SChernykh
25772abc0f Show block share % in status 2021-09-07 09:53:38 +02:00
SChernykh
899d5a82dd data api: check p2pool shares that come after a Monero block 2021-09-06 23:33:52 +02:00
SChernykh
7b0cc256c5 P2PServer: ban peers that disconnect without finishing handshake 2021-09-06 16:17:20 +02:00
SChernykh
d3dc4c731f Added more tests 2021-09-06 15:49:39 +02:00
SChernykh
e264377f0e Added more checks 2021-09-06 09:17:39 +02:00
SChernykh
a36825424b Fixed some Coverity reports 2021-09-06 09:02:35 +02:00
SChernykh
2ecd935bc5 data api: fixed saving of p2pool.blocks 2021-09-05 23:05:36 +02:00
SChernykh
f3b6423d4c Log difficulty for found pool shares 2021-09-05 22:57:36 +02:00
SChernykh
82a88ce0ef data api: added block hashes to pool/blocks 2021-09-05 22:28:57 +02:00
SChernykh
884d0f180a TCP server: log IP addresses in more places 2021-09-05 20:21:33 +02:00
SChernykh
f3ee444aed Stratum server: log IP addresses that send bad data 2021-09-05 19:16:23 +02:00
SChernykh
dd0a35fb79 Show pool-side hashrate in status only when it's not zero 2021-09-05 15:56:50 +02:00
SChernykh
4deef2f807 Added cppcheck workflow 2021-09-05 12:53:40 +02:00
SChernykh
b31adbd5ae Added macOS build 2021-09-05 12:10:40 +02:00
SChernykh
e527b0c660 Added Windows builds 2021-09-05 11:28:24 +02:00
SChernykh
b17723f1e4 Removed unused code 2021-09-05 00:07:03 +02:00
SChernykh
1554a44f5c Added more integrity checks 2021-09-04 09:10:44 +02:00
SChernykh
08d2fbdbd1 Parse full 128-bit difficulty from monerod 2021-09-03 22:45:55 +02:00
SChernykh
661d596107 api: store difficulty and totalHashes for each block 2021-09-03 18:04:54 +02:00
SChernykh
2d8530798d Unit tests for difficulty_type 2021-09-03 11:32:11 +02:00
SChernykh
b26c4616d7 Fixed wrong diff in api/network/stats 2021-09-02 23:39:47 +02:00
SChernykh
70ff4ba859 Tweaked peer list logic 2021-09-02 19:21:38 +02:00
SChernykh
bab148fbad Added cppcheck scripts 2021-09-02 12:35:36 +02:00
SChernykh
55f8e9dc33 Added total blocks found 2021-09-02 09:02:24 +02:00
SChernykh
fbdef7d058 Count all miners that were active in last 24 hours 2021-09-01 20:48:03 +02:00
SChernykh
e1b4649c2a Added pool blocks 2021-09-01 17:35:54 +02:00