Commit graph

123 commits

Author SHA1 Message Date
SChernykh
094209f311 P2PServer: optimized update_peer_connections() 2022-04-07 16:48:01 +02:00
SChernykh
1b3c1eb850 P2PServer: increased peer timeout to 15 minutes 2022-03-30 22:47:10 +02:00
SChernykh
a2afa29052 Updated copyright 2022-03-30 14:42:26 +02:00
SChernykh
028a5d0c88 Fixed memory leak after loading block cache 2022-03-24 18:30:23 +01:00
SChernykh
0c2b7d6010 More time handling fixes 2022-03-23 15:49:24 +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
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
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
d4a1b14820 Use monerod peers to find p2pool nodes 2022-02-17 22:10:52 +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
61edc6ed70 Reduce cache flush frequency to once per minute 2021-11-01 11:29:59 +01:00
SChernykh
c0c210664a Show uptime in status 2021-10-26 17:55:47 +02:00
SChernykh
111324b6e0 Added console command to show connected peers 2021-10-24 16:04:30 +02:00
SChernykh
04d18cdf1d P2PServer: fixed m_timer leak 2021-10-21 19:19:22 +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
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
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
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
2a3cd13b19 P2PServer: delete old cached blocks after initial sync
Saves ~20 MB of memory
2021-10-01 15:31:47 +02:00
SChernykh
5c92920619 Default log level 3
Also refactored default port numbers
2021-09-18 10:03:06 +02:00
SChernykh
ba6a2c8eb2 P2PServer: relax stale block restriction 2021-09-13 19:25:12 +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
b8f04ac787 Tweaked block broadcast rules 2021-09-11 23:44:09 +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
a332ac7d26 P2PServer: load peers from DNS 2021-09-07 21:43:44 +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
7b0cc256c5 P2PServer: ban peers that disconnect without finishing handshake 2021-09-06 16:17:20 +02:00
SChernykh
884d0f180a TCP server: log IP addresses in more places 2021-09-05 20:21:33 +02:00
SChernykh
b31adbd5ae Added macOS build 2021-09-05 12:10:40 +02:00
SChernykh
70ff4ba859 Tweaked peer list logic 2021-09-02 19:21:38 +02:00
SChernykh
75843e9b37 P2PServer: don't broadcast stale blocks 2021-08-31 23:41:05 +02:00
SChernykh
1a83610299 P2PServer: simplified the code a bit 2021-08-31 23:11:58 +02:00
SChernykh
780afd84a2 Added checks for tx keys 2021-08-31 17:23:20 +02:00
SChernykh
662a7e91c8 P2PServer: always ban IPs that send bad blocks 2021-08-31 13:14:35 +02:00
SChernykh
7b197824fe P2PServer: add peers from the command line to the peer list on startup 2021-08-31 11:16:40 +02:00
SChernykh
114f6b627b P2PServer: don't allow multiple connections to/from the same IP 2021-08-31 10:41:41 +02:00
SChernykh
4757cdb8e2 P2PServer: added 1 second grace time for stale shares
Only for shares that lag 1 Monero block behind
2021-08-31 09:58:57 +02:00
SChernykh
dac74a8829 Update p2p_server.cpp 2021-08-29 17:42:49 +02:00
SChernykh
456f5d356f P2PServer: ban peers only after handshake finished and failed 2021-08-29 17:26:30 +02:00
SChernykh
14bb308794 P2PServer: clear m_missingBlockRequests when there is nothing missing 2021-08-27 21:09:35 +02:00
SChernykh
f9be0de8d2 P2PServer: ask peers about unknown blocks only once 2021-08-27 17:26:42 +02:00
SChernykh
81a12158fc P2PServer: don't add banned peers back to the peer list 2021-08-27 16:36:06 +02:00
SChernykh
3f1ee9ce4b TCPServer fixes
- Proper shutdown sequence, uv_close() must be called from the event loop thread
- Moved start_listening() to child class constructor because it must be ready before it can listen on sockets
- Added simple memory leak detector for Windows. Linux users can enjoy the leak sanitizer
2021-08-26 23:57:59 +02:00
SChernykh
dbf18c34a4 Fixed wrong uv loop in p2pserver::flush_cache() 2021-08-25 11:31:50 +02:00
SChernykh
7ab3c22114 Give only 5 seconds for new connections to complete handshake
This is to detect random port scans/non-p2pool connections quickly
2021-08-25 11:14:23 +02:00
SChernykh
a27577f735 Added log level 6 to reduce spam on level 5
Log level 5 is still default
2021-08-25 09:38:47 +02:00
SChernykh
09aedd9f9a Drop idle connections
Idle = didn't send any full messages in the last 5 minutes
2021-08-24 21:45:19 +02:00
SChernykh
6de98697a1 Only warn about lagging monerod if it's 2 or more blocks behind 2021-08-24 20:10:16 +02:00
SChernykh
20b3886bfb Less tolerance to lagging nodes
Ban nodes that are 5 or more Monero blocks behind.
2021-08-24 17:19:10 +02:00
SChernykh
69533fd209 Store only fully verified blocks in the cache 2021-08-24 13:46:38 +02:00
SChernykh
aba3bc50b8 Block cache WIP and other fixes
- Block cache is implemented only on Windows for now
- Tracking of background jobs
- More robust sidechain syncing
2021-08-24 11:42:41 +02:00
SChernykh
25ef5733a7 Skip duplicates in the saved peers list 2021-08-23 23:12:52 +02:00
SChernykh
fda80e3556 Sanity check 2021-08-23 23:09:59 +02:00
SChernykh
df52838433 Removed some noisy warning messages 2021-08-23 14:05:07 +02:00
SChernykh
510b7dbb85 Add files 2021-08-22 12:20:59 +02:00