aboutsummaryrefslogtreecommitdiff
path: root/src/p2p (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-26Merge pull request #4612Riccardo Spagni1-4/+8
2d48861d p2p: only deinitialize what's been initialized in offline mode (moneromooo-monero)
2018-10-16p2p: only deinitialize what's been initialized in offline modemoneromooo-monero1-4/+8
2018-10-15p2p: a negative result from UPNP_GetValidIGD is an errormoneromooo-monero1-2/+2
as per the source documentation
2018-10-15Merge pull request #4578Riccardo Spagni1-3/+3
76d6d832 Revert "p2p: connect via the bound ip, if any" (moneromooo-monero)
2018-10-13Revert "p2p: connect via the bound ip, if any"moneromooo-monero1-3/+3
This reverts commit 909398efc79cb1fa92e330e9a50a316ca5858953. It looks like it's causing trouble with tor on some setups
2018-10-12Remove epee header dependency on cryptonote_coremoneromooo-monero1-0/+1
2018-08-15Merge pull request #4089luigi11111-3/+3
909398e p2p: connect via the bound ip, if any (moneromooo-monero)
2018-07-19Merge pull request #4075luigi11111-1/+0
438d52d remove epee from link lines where it's redundant (moneromooo-monero)
2018-07-19Merge pull request #3854luigi11111-0/+3
149da42 db_lmdb: enable batch transactions by default (stoffu) 34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn) 9e1403e update get_info RPC and bump RPC version (vicsn) 207b66e first new functional tests (vicsn)
2018-07-02p2p: connect via the bound ip, if anymoneromooo-monero1-3/+3
2018-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas1-0/+3
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
2018-06-28remove epee from link lines where it's redundantmoneromooo-monero1-1/+0
For some reason, this confuses and kills ASAN on startup as it thinks const uint8_t ipv4_network_address::ID is defined multiple times.
2018-06-27Merge pull request #3982luigi11111-16/+46
08b85a8 cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X (stoffu) 0cf80ba net_node: resolve host for node addresses given via command line flags (stoffu)
2018-06-19Merge pull request #3861luigi11112-0/+16
de1ffe0 p2p: warn when no incoming connections are seen for a while (moneromooo-monero)
2018-06-11net_node: resolve host for node addresses given via command line flagsstoffu1-13/+43
2018-06-11cryptonote_config: add get_config to refactor x = testnet ? ↵stoffu1-3/+3
config::testnet::X : stagenet ? config::stagenet::X : config::X
2018-05-26p2p: warn when no incoming connections are seen for a whilemoneromooo-monero2-0/+16
2018-04-29p2p: fix fallback seed node usagemoneromooo-monero2-3/+11
Those were added to the seed nodes list even when they had already been added. Moreover, the current index was not reset after they were added, typically causing previous seeds to be used, and some of those fallback seeds to not be tried.
2018-04-25Fix broken interactive daemon 'limit' commands plus RPC callsrbrunner71-2/+2
2018-04-21Build: update CMake and p2p for in-tree miniupnpanonimal1-10/+3
(cherry picked from commit a7366b5feeffaeb65b217b2d6f138e0ab1c90192)
2018-04-19CMake: update new location of in-tree miniupnpcanonimal1-3/+3
(cherry picked from commit b16a282f97d8f6c967e8a0b1ecfd75110f095182)
2018-04-12Merge pull request #3502Riccardo Spagni1-1/+1
11c933e1 fix lambda compile error on openbsd (moneromooo-monero)
2018-03-27fix lambda compile error on openbsdmoneromooo-monero1-1/+1
2018-03-22p2p: correct port number for seed nodesstoffu1-3/+3
2018-03-13p2p: fix network ID being uninitialised when using exclusive peersmoneromooo-monero1-1/+4
2018-03-05Stagenetstoffu3-18/+34
2018-02-20Merge pull request #3290Riccardo Spagni1-0/+1
1d28c0d8 p2p: restore m_testnet assignment lost during rebase (whythat)
2018-02-18p2p: restore m_testnet assignment lost during rebasewhythat1-0/+1
2018-02-18p2p: need libcryptonote_core due to arg_testnet_on being usedstoffu1-0/+1
2018-02-16options: add testnet option dependencieswhythat1-2/+6
2018-02-16options: remove testnet-* optionswhythat3-16/+6
2018-02-16Merge pull request #3196Riccardo Spagni1-1/+2
eda9fb5b p2p: fix testnet/mainnet port mixup (moneromooo-monero)
2018-02-16Merge pull request #3226Riccardo Spagni2-2/+2
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero) 2e3e90ac pass large parameters by const ref, not value (moneromooo-monero) 61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero) 9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero) 8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero) 9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero) 24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero) f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero) c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero) fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero) 03887f11 keccak: fix sanity check bounds test (moneromooo-monero) ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero) bece67f9 miner: restore std::cout precision after modification (moneromooo-monero) 1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16Merge pull request #3221Riccardo Spagni1-0/+2
2e584dcb p2p: do not try to connect to peers in offline mode (moneromooo-monero)
2018-02-02pass large parameters by const ref, not valuemoneromooo-monero2-2/+2
Coverity 136394 136397 136409 136526 136529 136533 175302
2018-02-01p2p: do not try to connect to peers in offline modemoneromooo-monero1-0/+2
2018-01-29Allow the number of incoming connections to be limitedErik de Castro Lopo4-3/+63
It was already possible to limit outgoing connections. One might want to do this on home network connections with high bandwidth but low usage caps.
2018-01-29Rename delete_connections to delete_out_connectionsErik de Castro Lopo2-2/+2
This rename is needed so that delete_in_connections can be added.
2018-01-29Rename connections_count to max_out_connection_countErik de Castro Lopo2-12/+12
This is needed so that a max_in_connection_count can be added.
2018-01-28p2p: fix testnet/mainnet port mixupmoneromooo-monero1-1/+2
2018-01-27Merge pull request #3145Riccardo Spagni1-6/+6
fd1dfac5 p2p: don't lookup seed IPs if using an exclusive peer (moneromooo-monero) b50182ae p2p: don't connect to seeds if using an exclusive peer (moneromooo-monero)
2018-01-26Update 2018 copyrightxmr-eric9-9/+9
2018-01-18p2p: fix picking peers off an empty gray listmoneromooo-monero1-1/+4
2018-01-17p2p: don't lookup seed IPs if using an exclusive peermoneromooo-monero1-5/+5
2018-01-17p2p: don't connect to seeds if using an exclusive peermoneromooo-monero1-1/+1
2018-01-10fix some link errors in debug mode for macosstoffu1-0/+1
2017-12-25Merge pull request #2928Riccardo Spagni1-2/+5
d28c388f p2p: stop net server before closing starting connections (moneromooo-monero)
2017-12-18p2p: use size_t for arbitrary counters instead of uint8_tmoneromooo-monero1-2/+2
2017-12-17Merge pull request #2877Riccardo Spagni10-1261/+90
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero) bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero) 4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
2017-12-16move connection_basic and network_throttle from src/p2p to epeemoneromooo-monero6-1214/+0
These even had the epee namespace. This fixes some ugly circular dependencies.
2017-12-16cryptonote_core does not depend on p2p anymoremoneromooo-monero4-47/+90
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
2017-12-16move includes around to lessen overall loadmoneromooo-monero1-0/+2
2017-12-16Merge pull request #2878Riccardo Spagni1-4/+2
abebe392 rpc: add offline state in info rpc (moneromooo-monero) 7696e849 core: make --offline also disable DNS lookups (moneromooo-monero)
2017-12-15p2p: stop net server before closing starting connectionsmoneromooo-monero1-2/+5
This fixes a hang on exit due to race where a connection adds itself to the server after the starting connections are closed, but before the net server marks itself as stopped.
2017-11-30core: make --offline also disable DNS lookupsmoneromooo-monero1-4/+2
2017-11-28Corrections in rate limiting / trottle code, especially in 'out' directionrbrunner75-33/+18
Deleted 3 out of 4 calls to method connection_basic::sleep_before_packet that were erroneous / superfluous, which enabled the elimination of a "fudge" factor of 2.1 in connection_basic::set_rate_up_limit; also ended the multiplying of limit values and numbers of bytes transferred by 1024 before handing them over to the global throttle objects
2017-11-14Merge pull request #2736Riccardo Spagni1-2/+3
0d9c0db9 Do not build against epee_readline if it was not built (Howard Chu) 178014c9 split off readline code into epee_readline (moneromooo-monero) a9e14a19 link against readline only for monerod and wallet-wallet-{rpc,cli} (moneromooo-monero) 437421ce wallet: move some scoped_message_writer calls from the libs (moneromooo-monero) e89994e9 wallet: rejig to avoid prompting in wallet2 (moneromooo-monero) ec5135e5 move input_line from command_line to simplewallet (moneromooo-monero) 082db75f move cryptonote command line options to cryptonote_core (moneromooo-monero)
2017-11-14move cryptonote command line options to cryptonote_coremoneromooo-monero1-2/+3
Those have no reason to be in a generic module
2017-11-14remove "using namespace std" from headersmoneromooo-monero1-2/+2
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;
2017-10-09Fix an object lifetime bug in net load testsmoneromooo-monero1-1/+1
The commands handler must not be destroyed before the config object, or we'll be accessing freed memory. An earlier attempt at using boost::shared_ptr to control object lifetime turned out to be very invasive, though would be a better solution in theory.
2017-10-05Upgrades to epee::net_utils::network_addressLee Clagett3-15/+22
- internal nullptr checks - prevent modifications to network_address (shallow copy issues) - automagically works with any type containing interface functions - removed fnv1a hashing - ipv4_network_address now flattened with no base class
2017-09-25version: fix link to new version stringsmoneromooo-monero1-0/+1
p2p uses it, and the cpp file needs to know the symbols should be public
2017-09-25Merge pull request #2424Riccardo Spagni1-20/+1
28b72b6e tx_pool: pre-init tvc.m_verifivation_failed before processing (moneromooo-monero) 50a629b2 core_tests: catch (impossible in practice) tx extra api failure (moneromooo-monero) fee15ef1 wallet2: catch failure to parse address (moneromooo-monero) 1399e26d net_peerlist: remove dead code (moneromooo-monero) 50e09698 tx_pool: guard against failure getting tx hash (moneromooo-monero) 54cc209a wallet_rpc_server: catch failure to create directory (moneromooo-monero) 3e55099c wallet_rpc_server: init m_vm to NULL in ctor (moneromooo-monero) 7d0dde5e wallet_args: remove redundant default value for --log-file (moneromooo-monero) ed4a3350 wallet2: catch failure to save keys file (moneromooo-monero) 44434c8a wallet2_api: check whether dynamic_cast returns NULL (moneromooo-monero) 92f2f687 core: check return value from parse_hexstr_to_binbuff (moneromooo-monero) 5475692e wallet2_api: remove an unused, uninitialized, field (moneromooo-monero) a7ba3de1 libwallet_api_tests: initialize newblock_triggered on reset (moneromooo-monero) b2763ace wallet2_api: init error code to "no error" in the ctor (moneromooo-monero) b5faac53 get_blockchain_top now returns void (moneromooo-monero) 2e44d8f2 wallet_rpc_server: guard against exceptions (moneromooo-monero) 4230876b simplewallet: guard against I/O exceptions (moneromooo-monero) 06c1e057 daemon: initialize decode_as_json in RPC request (moneromooo-monero) 11f71af5 http_base: init size_t in http_request_info ctor (moneromooo-monero)
2017-09-25Merge pull request #2442Riccardo Spagni1-2/+0
e29282d2 build: auto update version info without manually deleting version.h (stoffu)
2017-09-25net_peerlist: remove dead codemoneromooo-monero1-20/+1
CID 175290
2017-09-25Merge pull request #2428Riccardo Spagni1-0/+2
054054c9 p2p: disable gray list housekeeping when an exclusive node is given (moneromooo-monero)
2017-09-21Merge pull request #2302Riccardo Spagni1-0/+5
ef005f5e p2p: add a couple early outs when the stop signal is received (moneromooo-monero) 80d361c7 abstract_tcp_server2: improve tracking/cancelling of early connections (moneromooo-monero)
2017-09-21build: auto update version info without manually deleting version.hstoffu1-2/+0
2017-09-20Merge pull request #2376Riccardo Spagni2-48/+102
e3680b69 Rename m_listenning_port to m_listening_port (MaxXor) a1ea475f Delete UPnP port mapping on exit (MaxXor)
2017-09-10p2p: disable gray list housekeeping when an exclusive node is givenmoneromooo-monero1-0/+2
Exclusive nodes may be used for privacy reasons, and thus we don't want to connect to other nodes, even for checking connectivity. See https://github.com/monero-project/monero/issues/2346
2017-09-02Merge pull request #2329Riccardo Spagni1-0/+2
e3c4395a p2p: init hashes after deserializing a network address (moneromooo-monero)
2017-09-01Rename m_listenning_port to m_listening_portMaxXor2-7/+7
2017-08-29Delete UPnP port mapping on exitMaxXor2-43/+97
2017-08-23print peer id in 0 padded hex for consistencymoneromooo-monero2-6/+13
2017-08-23p2p: init hashes after deserializing a network addressmoneromooo-monero1-0/+2
Fixes multiple connections to the same address
2017-08-21cryptonote_protocol: misc fixes to the new sync algorithmmoneromooo-monero1-0/+2
Fix sync wedge corner case: It could happen if a connection went into standby mode, while it was the one which had requested the next span, and that span was still waiting for the data, and that peer is not on the main chain. Other peers can then start asking for that data again and again, but never get it as only that forked peer does. And various other fixes
2017-08-16p2p: add a couple early outs when the stop signal is receivedmoneromooo-monero1-0/+5
This avoids quicker exit
2017-08-15Merge pull request #2282Riccardo Spagni1-0/+2
7fdc178a p2p: fix random peer index being too large (moneromooo-monero)
2017-08-15Merge pull request #2277Riccardo Spagni1-4/+3
6ce769c1 p2p: get net log spam down a bit (moneromooo-monero)
2017-08-15Merge pull request #2236Riccardo Spagni1-22/+22
cb2d5110 Tweak net logs so we get more info on why networking can't start (moneromooo-monero)
2017-08-15Tweak net logs so we get more info on why networking can't startmoneromooo-monero1-22/+22
This should prevent "silent" failures to start
2017-08-11p2p: fix random peer index being too largemoneromooo-monero1-0/+2
2017-08-10p2p: get net log spam down a bitmoneromooo-monero1-4/+3
2017-08-09p2p: fallback on seed nodes if we can't make a connectionmoneromooo-monero2-6/+26
This avoids failing to connect to the network in case all known peers are unavailable (which can happen if the peer list is small).
2017-08-08net_node: fix m_in_timedsync initializationmoneromooo-monero2-1/+2
This fixes nodes not being able to connect to nodes which use recent code. While there, init peer_id too.
2017-08-07Merge pull request #2149Riccardo Spagni3-0/+14
158c3ecf core: thread most of handle_incoming_tx (moneromooo-monero) f57ee382 cryptonote_protocol: retry stale spans early (moneromooo-monero) 90df52e1 cryptonote_protocol: light cleanup (moneromooo-monero) 84e23156 cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages (moneromooo-monero) 5be43fcd cryptonote_protocol_handler: sync speedup (moneromooo-monero)
2017-08-07Merge pull request #2234Riccardo Spagni7-15/+17
214fd81e some include cleanup (moneromooo-monero)
2017-08-07Merge pull request #2220Riccardo Spagni1-0/+3
c6ba7d11 p2p: move m_in_timedsync from connection_context to p2p_connection_context (moneromooo-monero)
2017-08-07Merge pull request #2219Riccardo Spagni1-6/+14
04ebfbfe p2p: close connections when exiting (moneromooo-monero) 9a10148c p2p: fix thread leak (moneromooo-monero)
2017-08-07Merge pull request #2215Riccardo Spagni2-1/+9
06aea2cf move get_proof_of_trust_hash from util.h to p2p_protocol_defs.h (moneromooo-monero)
2017-08-07cryptonote_protocol_handler: sync speedupmoneromooo-monero3-0/+14
A block queue is now placed between block download and block processing. Blocks are now requested only from one peer (unless starved). Includes a new sync_info coommand.
2017-08-01network_throttle: remove unneeded heap allocationsmoneromooo-monero2-19/+6
This will keep leak traces less noisy, as those were one off allocations that were technically leaking.
2017-08-01p2p: move m_in_timedsync from connection_context to p2p_connection_contextmoneromooo-monero1-0/+3
It's got no place in the base class as it's P2P specific field
2017-07-31some include cleanupmoneromooo-monero7-15/+17
2017-07-29p2p: close connections when exitingmoneromooo-monero1-0/+8
This ensures they don't leak if they were in the middle of an async operation.
2017-07-28p2p: fix thread leakmoneromooo-monero1-6/+6
2017-07-27move get_proof_of_trust_hash from util.h to p2p_protocol_defs.hmoneromooo-monero2-1/+9
This avoids having to include p2p_protocol_defs.h in util.h, as util.h is used a lot, and p2p_protocol_defs.h includes a lot of other things that most users don't need.
2017-06-28Remove typeid use in network_addressmoneromooo-monero3-20/+12
Since I had to add an ID to the derived classes anyway, this can be used instead. This removes an apparently pointless warning from CLANG too.
2017-06-24Merge pull request #2073Riccardo Spagni1-2/+6
07c4276c Don't issue a new timedsync while one is already in progress (Howard Chu) cf3a376c Don't timeout a slow operation that's making progress (Howard Chu) 340830de Fix PR#2039 (Howard Chu)
2017-06-15Don't issue a new timedsync while one is already in progressHoward Chu1-2/+6
A timedsync is issued every minute on a connection, but the input tineout is 2 minutes. This means a new sync request could be issued while a slow sync request was already in progress. The additional request will further clog the network on a slow connection, and cause a premature timeout.
2017-05-27abstracted nework addressesmoneromooo-monero6-189/+320
All code which was using ip and port now uses a new IPv4 object, subclass of a new network_address class. This will allow easy addition of I2P addresses later (and also IPv6, etc). Both old style and new style peer lists are now sent in the P2P protocol, which is inefficient but allows peers using both codebases to talk to each other. This will be removed in the future. No other subclasses than IPv4 exist yet.
2017-05-05Merge pull request #1701Riccardo Spagni5-18/+207
8277e67f Add anchor connections (Miguel Herranz)
2017-03-18p2p: use the fallback seed IPs when not enough seeds are foundmoneromooo-monero2-27/+64
In case the DNS seed(s) is/are down, which would otherwise cause the fallback seeds to never be used. Also if the seeds resolve to too few IPs.
2017-02-28Make gray peer selection uniformMiguel Herranz1-1/+8
Prevents the system from always picking the gray peers with the most recent last_seen.
2017-02-27Make get_random_gray_peer distribution uniformMiguel Herranz1-5/+2
get_random_gray_peer is used to implement feeler connections, described in: https://eprint.iacr.org/2015/263.pdf 2. Random selection
2017-02-21updated fallback nodesRiccardo Spagni1-6/+12
2017-02-21update copyright year, fix occasional lack of newline at line endRiccardo Spagni14-14/+14
2017-02-21core: add p2p bind port options from net_nodemoneromooo-monero1-2/+2
They're now used by core to determine the data directory to use for the txpool directory. This fixes an assert in the core tests, which don't use the RPC server, which normally initializes the P2P code.
2017-02-13network_throttle: demote spammy logs to TRACEmoneromooo-monero1-2/+2
2017-02-12net_node: fix spurious warning about using uninitialized datamoneromooo-monero1-1/+1
This is only used to load, not save
2017-02-10Add anchor connectionsMiguel Herranz5-18/+207
Based on https://eprint.iacr.org/2015/263.pdf 4. Anchor connections. Peer list serialisation version bumped to 5.
2017-02-08extract some basic code from libcryptonote_core into libcryptonote_basickenshi841-0/+1
2017-02-02Merge pull request #1641Riccardo Spagni1-0/+5
ca94d0a4 Separate data per P2P port (Miguel Herranz)
2017-02-02Merge pull request #1617Riccardo Spagni7-12/+8
0644eed7 Remove boost/foreach.cpp includes (Miguel Herranz) 36dd3e23 Replace BOOST_REVERSE_FOREACH with ranged for (Miguel Herranz) 629e3101 Replace BOOST_FOREACH with C++11 ranged for (Miguel Herranz)
2017-01-28Separate data per P2P portMiguel Herranz1-0/+5
poolstate.bin and p2pstate.bin are stored in .bitmonero/ if the default P2P port is being used. If another port is used both files are stored in .bitmonero/PORTNUMBER/.
2017-01-23Remove unreachable returnsMiguel Herranz1-3/+0
CATCH_ENTRY_L0 already returns the second value.
2017-01-22Remove boost/foreach.cpp includesMiguel Herranz5-5/+0
2017-01-22Replace BOOST_REVERSE_FOREACH with ranged forMiguel Herranz1-3/+4
2017-01-22Replace BOOST_FOREACH with C++11 ranged forMiguel Herranz3-4/+4
2017-01-22Merge pull request #1609Riccardo Spagni2-2/+17
4cdf0a35 p2p: always recreate a new peer id on startup (moneromooo-monero)
2017-01-22Merge pull request #1606Riccardo Spagni1-3/+3
f8b97aef p2p: show ban/unban logs by default again (moneromooo-monero)
2017-01-22p2p: always recreate a new peer id on startupmoneromooo-monero2-2/+17
This prevents easy fingerprinting when you change IPs, and will be a must when kovri gets used.
2017-01-21p2p: show ban/unban logs by default againmoneromooo-monero1-3/+3
2017-01-21Rename method to get_random_gray_peerMiguel Herranz2-4/+4
2017-01-21Fix logging that broke after rebasingMiguel Herranz1-1/+1
2017-01-21Use set_peer_just_seen to keep last_seen updatedMiguel Herranz1-1/+1
2017-01-21Add gray peer list housekeeping systemMiguel Herranz3-0/+121
A random peer from the gray peer list is selected and a connection is made to check if the peer is alive. If the connection and handshake are successful the peer is promoted to the white peer list, in case of failure the peer is evicted from the gray peer list. The connection is closed after the check in either case.
2017-01-20Merge pull request #1593Riccardo Spagni1-2/+4
cbcdf8ad Honor depth in get_peerlist_head method (Miguel Herranz)
2017-01-20Merge pull request #1572Riccardo Spagni2-0/+32
0e0e6c5f Reduce to one connection per IP (Miguel Herranz) 3f269e98 Limit incoming connections from the same IP (Miguel Herranz)
2017-01-18Honor depth in get_peerlist_head methodMiguel Herranz1-2/+4
The method returned depth + 2 because: - push_back was executed before the condition. - > instead of >= causing one more iteration.
2017-01-16Reduce to one connection per IPMiguel Herranz1-1/+1
2017-01-16Change logging to easylogging++moneromooo-monero5-427/+91
This replaces the epee and data_loggers logging systems with a single one, and also adds filename:line and explicit severity levels. Categories may be defined, and logging severity set by category (or set of categories). epee style 0-4 log level maps to a sensible severity configuration. Log files now also rotate when reaching 100 MB. To select which logs to output, use the MONERO_LOGS environment variable, with a comma separated list of categories (globs are supported), with their requested severity level after a colon. If a log matches more than one such setting, the last one in the configuration string applies. A few examples: This one is (mostly) silent, only outputting fatal errors: MONERO_LOGS=*:FATAL This one is very verbose: MONERO_LOGS=*:TRACE This one is totally silent (logwise): MONERO_LOGS="" This one outputs all errors and warnings, except for the "verify" category, which prints just fatal errors (the verify category is used for logs about incoming transactions and blocks, and it is expected that some/many will fail to verify, hence we don't want the spam): MONERO_LOGS=*:WARNING,verify:FATAL Log levels are, in decreasing order of priority: FATAL, ERROR, WARNING, INFO, DEBUG, TRACE Subcategories may be added using prefixes and globs. This example will output net.p2p logs at the TRACE level, but all other net* logs only at INFO: MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE Logs which are intended for the user (which Monero was using a lot through epee, but really isn't a nice way to go things) should use the "global" category. There are a few helper macros for using this category, eg: MGINFO("this shows up by default") or MGINFO_RED("this is red"), to try to keep a similar look and feel for now. Existing epee log macros still exist, and map to the new log levels, but since they're used as a "user facing" UI element as much as a logging system, they often don't map well to log severities (ie, a log level 0 log may be an error, or may be something we want the user to see, such as an important info). In those cases, I tried to use the new macros. In other cases, I left the existing macros in. When modifying logs, it is probably best to switch to the new macros with explicit levels. The --log-level options and set_log commands now also accept category settings, in addition to the epee style log levels.
2017-01-15Limit incoming connections from the same IPMiguel Herranz2-0/+32
2017-01-14remove unused fields from network_throttle (unused-private-field warning)Chris Vickio1-3/+0
2016-12-20also use portable serializer for boost_serialization_helper.h and ↵kenshi842-7/+28
net_node.inl, completely adandon boost/archive/binary_oarchive.hpp
2016-12-04Merge pull request #1398Riccardo Spagni1-4/+4
f4772bae Fix a few minor typos (Pierre Boyer)
2016-12-04Merge pull request #1397Riccardo Spagni1-0/+1
3f7d6fb5 Fix delayed exit when syncing (moneromooo-monero)
2016-12-04Merge pull request #1396Riccardo Spagni1-4/+6
7c0dd5e4 net_node: drop connections from banned IPs after looping through connections (moneromooo-monero)
2016-12-04Fix a few minor typosPierre Boyer1-4/+4
2016-12-04Fix delayed exit when syncingmoneromooo-monero1-0/+1
2016-12-03net_node: drop connections from banned IPs after looping through connectionsmoneromooo-monero1-4/+6
This keeps the connections lock just for the time of looping and adding connectoins to a list, and the dropping happens after it. This should avoid lengthy delays waiting for the connections lock.
2016-12-01p2p: possibly fix crash in relay_blocksmoneromooo-monero3-6/+17
2016-11-23Fix DNS failures in offline mode preventing daemon startupmoneromooo-monero1-1/+1
2016-11-09add lightweight block propagation ("fluffy blocks")Dion Ahmetaj4-6/+81
Added a new command to the P2P protocol definitions to allow querying for support flags. Implemented handling of new support flags command in net_node. Changed for_each callback template to include support flags. Updated print_connections command to show peer support flags. Added p2p constant for signaling fluffy block support. Added get_pool_transaction function to cryptnote_core. Added new commands to cryptonote protocol for relaying fluffy blocks. Implemented handling of fluffy block command in cryptonote protocol. Enabled fluffy block support in node initial configuration. Implemented get_testnet function in cryptonote_core. Made it so that fluffy blocks only run on testnet.
2016-10-04Merge pull request #1165Riccardo Spagni1-0/+12
e57379a p2p: drop any existing connection to a banned IP (moneromooo-monero)
2016-10-02p2p: drop any existing connection to a banned IPmoneromooo-monero1-0/+12
2016-09-26Cleanup. Dropped "bit" from bitmonero.Randi Joseph1-2/+2
2016-09-26Cleanup. Dropped "bit" from bitmonero.Randi Joseph1-1/+1
2016-09-18remove dead backup seed nodes, add new onesRiccardo Spagni1-24/+6
2016-09-18cmake: transitive deps and remove deprecated LINK_*redfish1-7/+10
Keep the immediate direct deps at the library that depends on them, declare deps as PUBLIC so that targets that link against that library get the library's deps as transitive deps. Break dep cycle between blockchain_db <-> crytonote_core. No code refactoring, just hide cycle from cmake so that it doesn't complain (cycles are allowed only between static libs, not shared libs). This is in preparation for supproting BUILD_SHARED_LIBS cmake built-in option for building internal libs as shared.
2016-07-03allow peers without portmoneromooo-monero1-0/+5
The default port is then used
2016-06-19Merge pull request #846Riccardo Spagni4-4/+4
de030d9 fix: error: -Werror=misleading-indentation (moneroexample) c2d7300 contrib: epee: add exception spec to throwing destructors (redfish) 6898741 src: p2p: add exception spec to throwing destructors (redfish) 21dbc95 crypto: slow-hash: fix misleading indent (redfish) 70f3634 crypto: slow-hash: remove unused hash list for ARM (redfish) 1a7772f crypto: oaes_lib: remove unused _NR array (redfish) 6462a3a crypto: fix compile error: use named type in sizeof (redfish)
2016-06-19Merge pull request #775Riccardo Spagni1-2/+2
e409e59 Print stack trace on exceptions (moneromooo-monero) ef4ff42 connection_basic: avoid gratuitous exception (moneromooo-monero)
2016-05-18src: p2p: add exception spec to throwing destructorsredfish4-4/+4
The destructors get a noexcept(true) spec by default, but these destructors in fact throw exceptions. An alternative fix might be to not throw (most if not all of these throws are non-essential error-reporting/logging).
2016-04-17net_node: fix connection leak when ping fails with bad responsemoneromooo-monero1-0/+1
If there is no comms error, but the response is not as expected, close would not be called.
2016-03-28connection_basic: avoid gratuitous exceptionmoneromooo-monero1-2/+2
The remote endpoint is usually invalid, so use a version of the call that returns an error code instead.
2016-03-21Revert "Print stack trace upon exceptions"moneromooo-monero1-4/+3
Ain't nobody got time for link/cmake skullduggery. This reverts commit fff238ec94ac6d45fc18c315d7bc590ddfaad63d.
2016-03-19Print stack trace upon exceptionsmoneromooo-monero1-3/+4
Useful for debugging users' logs
2016-03-12p2p: lock access to the blocked ips mapmoneromooo-monero2-3/+3
2016-03-11Use boost::thread instead of std::threadHoward Chu6-30/+31
and all other associated IPC
2016-02-18Use boost::thread instead of std::threadHoward Chu3-3/+4
std::thread crashes on (at least) ARMv6 g++ 4.8/4.9
2016-01-14'max limit of...' is redundant wording, rephrasebinaryFate1-1/+1
2015-12-31updated copyright yearRiccardo Spagni16-16/+16
2015-12-30net_peerlist: move a couple functions from public to privatemoneromooo-monero1-2/+2
They do not take the object lock, and are meant to be used only internally, called from a function which does take the lock.
2015-12-22net_node: fix a hang on exitmoneromooo-monero1-1/+1
One loop was not paying attention to the stop signal, and could end up looping forever
2015-12-19Add missing semicolons after log statementsmoneromooo-monero1-1/+1
2015-12-18Merge pull request #543Riccardo Spagni1-1/+1
63cb1a5 move another non user useful log to L1 (moneromooo-monero) 02827d5 p2p: minor log formatting fix (moneromooo-monero)
2015-12-17p2p: minor log formatting fixmoneromooo-monero1-1/+1
2015-12-15Replace tabs with two spaces for consistency with rest of codebasewarptangent2-236/+236
Remove trailing whitespace in same files.
2015-12-09Merge pull request #527Riccardo Spagni1-2/+1
336b375 Register daemon command line arguments to core if they're used in core (moneromooo-monero)
2015-12-08Register daemon command line arguments to core if they're used in coremoneromooo-monero1-2/+1
This fixes coretests, which does not register daemon specific arguments, but uses core, which uses those arguments. Also gets rid of an unwanted dependency on daemon code from core.
2015-12-08Merge pull request #526Riccardo Spagni2-0/+12
2c83055 net_node: add a --offline argument (moneromooo-monero)
2015-12-07net_node: add a --offline argumentmoneromooo-monero2-0/+12
It will not try to connect to the monero network, nor listen
2015-12-07p2p: failure to load p2pstate.bin is not fatal anymoremoneromooo-monero1-2/+11
Clear any partially loaded data, and start with a default config
2015-11-26add RPC calls and commands to get/set bansmoneromooo-monero3-4/+28
2015-11-25net_node: allow bans for custom amounts of timemoneromooo-monero2-4/+4
m_blocked_ips now stores the unblocking time, rather than the blocking time. Also change > to >=, since banning for 0 seconds should not ban
2015-11-23Add IP blocking for misbehaving nodes (adapted from Boolberry)Javier Smooth4-2/+98
With minor cleanup and fixes (spelling, indent) by moneromooo
2015-11-23quiet down p2p logging a bitJavier Smooth1-1/+1
2015-10-05Update to compile with latest miniupnpcwarptangent1-0/+6
upnpDiscover() takes a new argument for TTL. Use the suggested default of 2.
2015-08-14net_node: Use DNS resolver singletonwarptangent1-1/+1
Each thread can use the same resolver.
2015-08-11net_node: skimplify rate limit code, and log as appropriatemoneromooo-monero1-8/+5
2015-07-15** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY)NoodleDoodleNoodleDoodleNoodleDoodleNoo2-10/+25
Bockchain: 1. Optim: Multi-thread long-hash computation when encountering groups of blocks. 2. Optim: Cache verified txs and return result from cache instead of re-checking whenever possible. 3. Optim: Preload output-keys when encoutering groups of blocks. Sort by amount and global-index before bulk querying database and multi-thread when possible. 4. Optim: Disable double spend check on block verification, double spend is already detected when trying to add blocks. 5. Optim: Multi-thread signature computation whenever possible. 6. Patch: Disable locking (recursive mutex) on called functions from check_tx_inputs which causes slowdowns (only seems to happen on ubuntu/VMs??? Reason: TBD) 7. Optim: Removed looped full-tx hash computation when retrieving transactions from pool (???). 8. Optim: Cache difficulty/timestamps (735 blocks) for next-difficulty calculations so that only 2 db reads per new block is needed when a new block arrives (instead of 1470 reads). Berkeley-DB: 1. Fix: 32-bit data errors causing wrong output global indices and failure to send blocks to peers (etc). 2. Fix: Unable to pop blocks on reorganize due to transaction errors. 3. Patch: Large number of transaction aborts when running multi-threaded bulk queries. 4. Patch: Insufficient locks error when running full sync. 5. Patch: Incorrect db stats when returning from an immediate exit from "pop block" operation. 6. Optim: Add bulk queries to get output global indices. 7. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 8. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 9. Optim: Added thread-safe buffers used when multi-threading bulk queries. 10. Optim: Added support for nosync/write_nosync options for improved performance (*see --db-sync-mode option for details) 11. Mod: Added checkpoint thread and auto-remove-logs option. 12. *Now usable on 32-bit systems like RPI2. LMDB: 1. Optim: Added custom comparison for 256-bit key tables (minor speed-up, TBD: get actual effect) 2. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 3. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 4. Optim: Added support for sync/writemap options for improved performance (*see --db-sync-mode option for details) 5. Mod: Auto resize to +1GB instead of multiplier x1.5 ETC: 1. Minor optimizations for slow-hash for ARM (RPI2). Incomplete. 2. Fix: 32-bit saturation bug when computing next difficulty on large blocks. [PENDING ISSUES] 1. Berkely db has a very slow "pop-block" operation. This is very noticeable on the RPI2 as it sometimes takes > 10 MINUTES to pop a block during reorganization. This does not happen very often however, most reorgs seem to take a few seconds but it possibly depends on the number of outputs present. TBD. 2. Berkeley db, possible bug "unable to allocate memory". TBD. [NEW OPTIONS] (*Currently all enabled for testing purposes) 1. --fast-block-sync arg=[0:1] (default: 1) a. 0 = Compute long hash per block (may take a while depending on CPU) b. 1 = Skip long-hash and verify blocks based on embedded known good block hashes (faster, minimal CPU dependence) 2. --db-sync-mode arg=[[safe|fast|fastest]:[sync|async]:[nblocks_per_sync]] (default: fastest:async:1000) a. safe = fdatasync/fsync (or equivalent) per stored block. Very slow, but safest option to protect against power-out/crash conditions. b. fast/fastest = Enables asynchronous fdatasync/fsync (or equivalent). Useful for battery operated devices or STABLE systems with UPS and/or systems with battery backed write cache/solid state cache. Fast - Write meta-data but defer data flush. Fastest - Defer meta-data and data flush. Sync - Flush data after nblocks_per_sync and wait. Async - Flush data after nblocks_per_sync but do not wait for the operation to finish. 3. --prep-blocks-threads arg=[n] (default: 4 or system max threads, whichever is lower) Max number of threads to use when computing long-hash in groups. 4. --show-time-stats arg=[0:1] (default: 1) Show benchmark related time stats. 5. --db-auto-remove-logs arg=[0:1] (default: 1) For berkeley-db only. Auto remove logs if enabled. **Note: lmdb and berkeley-db have changes to the tables and are not compatible with official git head version. At the moment, you need a full resync to use this optimized version. [PERFORMANCE COMPARISON] **Some figures are approximations only. Using a baseline machine of an i7-2600K+SSD+(with full pow computation): 1. The optimized lmdb/blockhain core can process blocks up to 585K for ~1.25 hours + download time, so it usually takes 2.5 hours to sync the full chain. 2. The current head with memory can process blocks up to 585K for ~4.2 hours + download time, so it usually takes 5.5 hours to sync the full chain. 3. The current head with lmdb can process blocks up to 585K for ~32 hours + download time and usually takes 36 hours to sync the full chain. Averate procesing times (with full pow computation): lmdb-optimized: 1. tx_ave = 2.5 ms / tx 2. block_ave = 5.87 ms / block memory-official-repo: 1. tx_ave = 8.85 ms / tx 2. block_ave = 19.68 ms / block lmdb-official-repo (0f4a036437fd41a5498ee5e74e2422ea6177aa3e) 1. tx_ave = 47.8 ms / tx 2. block_ave = 64.2 ms / block **Note: The following data denotes processing times only (does not include p2p download time) lmdb-optimized processing times (with full pow computation): 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.25 hours processing time (--db-sync-mode=fastest:async:1000). 2. Laptop, Dual-core / 4-threads U4200 (3Mb) - 4.90 hours processing time (--db-sync-mode=fastest:async:1000). 3. Embedded, Quad-core / 4-threads Z3735F (2x1Mb) - 12.0 hours processing time (--db-sync-mode=fastest:async:1000). lmdb-optimized processing times (with per-block-checkpoint) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 10 minutes processing time (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with full pow computation) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.8 hours processing time (--db-sync-mode=fastest:async:1000). 2. RPI2. Improved from estimated 3 months(???) into 2.5 days (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with per-block-checkpoint) 1. RPI2. 12-15 hours (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000).
2015-06-06properly decrement p2p socket countThomas Winget1-0/+1
2015-05-31cleaning up, removing redundant files, renaming, fixing incorrect licensesRiccardo Spagni9-11/+64
2015-05-28net_peerlist: fix grayt/white naming mismatchmoneromooo-monero1-2/+2
Looking at how these are called confirms this must have been a mistake
2015-05-26Merge pull request #292Riccardo Spagni1-31/+36
c44755a Build seed node list without duplicates (warptangent)
2015-05-25Fix compile for GCC 5.1.0warptangent1-1/+5
Add fix for compile error with multiple uses of peerid_type (uint64_t) variable in lambda expression. - known GCC issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65843 epee: replace return value of nullptr for expected boolean with false. Fixes #231.
2015-05-25Build seed node list without duplicateswarptangent1-31/+36
The random selection of a node shouldn't favor repeats that occur in the hardcoded and DNS seed node lists. Remove hardcoded ":18080" address which gives parse error. Test: bitmonerod --log-level 2 The seed node list displayed at startup shouldn't show duplicate addresses (includes port).
2015-05-17s/terget/target/moneromooo-monero4-7/+7
2015-05-17print limits when running limit commands with no argumentsmoneromooo-monero2-0/+19
It's more user friendly that an error message saying the command does not exist.
2015-05-06Merge branch 'clang_fixes' into clang_fixes-masterSergey Kazenyuk2-10/+10
2015-04-20Fix missing virtual destructorSergey Kazenyuk2-2/+4
2015-04-08[fix] Network 1.8: unlimited the RPC connectionsrfree2monero3-1/+22
works for unit tests build, too
2015-04-02Merge pull request #252Riccardo Spagni11-49/+1776
618f20c Network 1.7; Quieted the debug a bit. (rfree2monero) 391c7f9 Utils: use const, document dbg. Less default debug (rfree2monero) 44f4234 [fix] mac os x includes std::random... (rfree2monero) 162c993 Network 1.6: network limits, logging, +doxy (rfree2monero) a3b2226 my changelog (rfree2monero) 2900b1e doxygen files (rfree2monero) 1489310 doxygen related tool (rfree2monero) f9dba47 added windows_stream.* console colors (rfree2monero) c511abf remerged; commands JSON. logging upgrade. doxygen (rfree2monero) f79821a fix locking in count-peers thread (2) (rfree2monero) 0198ffb 2014 network limit 1.3 fix log/path/data +utils (rfree2monero) ae2a506 2014 network limit 1.2 +utils +toc -doc -drmonero (rfree2monero) 0f06dca fixed size_t on windows (rfree2monero) 39fc63f removed not needed <netinet/in.h> (rfree2monero) 5ce4256 2014 network limit 1.1 +utils +toc -doc -drmonero (rfree2monero) eabb519 2014 network limit 1.0a +utils +toc -doc -drmonero (rfree2monero)
2015-04-02Network 1.7; Quieted the debug a bit.rfree2monero1-5/+5
Really really finall version of this changes I hope.
2015-04-02update hardcoded fallback seedsRiccardo Spagni1-12/+25
2015-04-01remerged; commands JSON. logging upgrade. doxygenrfree2monero5-39/+69
2015-04-01Merge remote-tracking branch 'monero-official/master' into network-1.6-work1rfree2monero2-14/+14
2015-02-24fix locking in count-peers thread (2)rfree2monero3-11/+27
2015-02-242014 network limit 1.3 fix log/path/data +utilsrfree2monero4-60/+137
+toc -doc -drmonero Fixed the windows path, and improved logging and data (for graph) logging, fixed some locks and added more checks. Still there is a locking error, not added by my patches, but present in master version (locking of map/list of peers).