aboutsummaryrefslogtreecommitdiff
path: root/src/p2p (follow)
AgeCommit message (Collapse)AuthorFilesLines
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).
2015-02-24Daemonize changes pulled in -- daemon buildsThomas Winget2-4/+7
many RPC functions added by the daemonize changes (and related changes on the upstream dev branch that were not merged) were commented out (apart from return). Other than that, this *should* work...at any rate, it builds, and that's something.
2015-02-202014 network limit 1.2 +utils +toc -doc -drmonerorfree2monero6-52/+55
new update of the pr with network limits more debug options: discarding downloaded blocks all or after given height. trying to trigger the locking errors. debug levels polished/tuned to sane values. debug/logging improved. warning: this pr should be correct code, but it could make an existing (in master version) locking error appear more often. it's a race on the list (map) of peers, e.g. between closing/deleting them versus working on them in net-limit sleep in sending chunk. the bug is not in this code/this pr, but in the master version. the locking problem of master will be fixed in other pr. problem is ub, and in practice is seems to usually cause program abort (tested on debian stable with updated gcc). see --help for option to add sleep to trigger the error faster.
2015-02-202014 network limit 1.1 +utils +toc -doc -drmonerorfree2monero9-183/+293
Update of the PR with network limits works very well for all speeds (but remember that low download speed can stop upload because we then slow down downloading of blockchain requests too) more debug options fixed pedantic warnings in our code should work again on Mac OS X and FreeBSD fixed warning about size_t tested on Debian, Ubuntu, Windows(testing now) TCP options and ToS (QoS) flag FIXED peer number limit FIXED some spikes in ingress/download FIXED problems when other up and down limit
2015-02-202014 network limit 1.0a +utils +toc -doc -drmonerorfree2monero9-47/+1541
commands and options for network limiting works very well e.g. for 50 KiB/sec up and down ToS (QoS) flag peer number limit TODO some spikes in ingress/download TODO problems when other up and down limit added "otshell utils" - simple logging (with colors, text files channels)
2015-01-14Fix seed node threaded DNS lookupwarptangent1-28/+41
Use copied value of seed node index during thread creation, not reference. - fixes segfault Use boost::thread::try_join_until() instead of an atomic flag result variable for each thread. Add and handle interrupt for thread timeout. - fixes segfault where a thread exceeds requested timeout and tries to assign results to a referenced, but now out-of-scope, variable in the main thread.
2015-01-08Merge pull request #206Riccardo Spagni1-11/+57
1b46226 std::atomic_flag has no copy/move constructor, can't have a vector (Thomas Winget) df53c0a small typo in previous commit (Thomas Winget) 4a53898 DNS seed timeout and fallback (Thomas Winget)
2015-01-02year updated in licenseRiccardo Spagni7-7/+7
2014-12-15std::atomic_flag has no copy/move constructor, can't have a vectorThomas Winget1-9/+7
2014-12-15small typo in previous commitThomas Winget1-1/+1
2014-12-15DNS seed timeout and fallbackThomas Winget1-11/+59
2014-10-02remove dangling upnp port mappings, updated miniupnpcRiccardo Spagni1-2/+10
2014-09-30reload checkpoints file every ~hr and print if any failThomas Winget1-1/+3
also some other minor bug squashing and code formatting
2014-09-24use boost::asio::ip::address because cross-platform plzRiccardo Spagni1-96/+27
2014-09-23seed node DNS code updated to use DNSResolverThomas Winget1-41/+111
Also implemented rudimentary IPv6 support, but commented it out because it's not widely supported by ISPs for now, and thus is not currently supported by Monero.
2014-09-23ipv4 and ipv6 resolution workingThomas Winget2-11/+34
IPv4 and IPv6 name resolution working. Unit tests written (and passing). net_node.{h,inl} code modified to use DNS seeds.
2014-09-15Fix time_t serialization issueZachary Michaels3-5/+9
On 32-bit MinGW-w64, time_t is int32_t. The existing code was serializing time_t directly and implicitly assuming that time_t is int64_t. This commit formalizes that assumption by serializing int64_t directly and casting to time_t where appropriate. Thanks go to greatwolf for reporting this issue. monero-project/bitmonero#88
2014-09-15Make P2P use the testnet data dirZachary Michaels1-1/+3
2014-09-15Replace macro with equivalent function callZachary Michaels1-49/+45
Also removed useless bool return
2014-09-15Add testnet seed nodesZachary Michaels1-3/+8
2014-09-15Separate network id for testnetZachary Michaels1-2/+10
2014-09-15Separate p2p port for testnetZachary Michaels2-5/+23
2014-09-15Reorganize testnet constantsZachary Michaels3-40/+4
2014-09-15Add testnet flagZachary Michaels2-17/+22
Source: cryptonotefoundation
2014-09-12versioning now includes the commit hash, or -final for tagged releasesRiccardo Spagni1-1/+1
2014-09-10more dynamic miniupnp fixesfluffypony1-2/+9
2014-09-10miniupnpc includes fixedfluffypony1-2/+2
2014-09-09moved non-critical warnings and errors to log level 1fluffypony1-4/+4
2014-07-23License updated to BSD 3-clausefluffypony8-29/+236
2014-07-01Allow priority peers when there are exclusive peersZachary Michaels1-1/+1
Per my reading this change makes sense since a subset of the exclusive peers could be priority peers. Priority peers that are not exclusive will not get loaded, and priority peers that *are* exclusive will get special treatment. Prior to this change it looks like priority peers were silently ignored when exclusive peers were provided.
2014-06-10added new seed nodesfluffypony1-0/+9
2014-05-250.8.8updatemydesktop2-77/+142
2014-04-30mac osx building fixesmydesktop1-1/+4
2014-04-30various fixes to allow mac osx compilationmydesktop2-3/+5
2014-04-302nd seed node addedthankful_for_today1-0/+1
2014-04-18Bitmonero releasethankful_for_today2-11/+2
2014-04-09Port mapping with UPnPAntonio Juarez1-0/+35
2014-03-20some fixesAntonio Juarez5-28/+63
2014-03-03moved all stuff to githubAntonio Juarez8-0/+2042