Commit Graph

470 Commits

Author SHA1 Message Date
moneromooo cb069d0a42
p2p: remove banned peers from the white list 2020-10-27 22:35:14 +00:00
selsta aad2f87a53
net_node: add --ban-list option 2020-10-20 19:39:44 +02:00
Lee Clagett 2abdbf63cf Add support for i2p and tor seed nodes 2020-10-19 13:13:07 +00:00
Lee Clagett 13350f79df Do not use peer_id tracking method over i2p/tor 2020-10-15 16:47:59 +00:00
xiphon a12a8174e0 Dandelion++: skip desynced peers in stem phase 2020-10-12 13:44:06 +00:00
moneromooo-monero 7175dcb107
replace most boost serialization with existing monero serialization
This reduces the attack surface for data that can come from
malicious sources (exported output and key images, multisig
transactions...) since the monero serialization is already
exposed to the outside, and the boost lib we were using had
a few known crashers.

For interoperability, a new load-deprecated-formats wallet
setting is added (off by default). This allows loading boost
format data if there is no alternative. It will likely go
at some point, along with the ability to load those.

Notably, the peer lists file still uses the boost serialization
code, as the data it stores is define in epee, while the new
serialization code is in monero, and migrating it was fairly
hairy. Since this file is local and not obtained from anyone
else, the marginal risk is minimal, but it could be migrated
later if needed.

Some tests and tools also do, this will stay as is for now.
2020-08-17 16:23:58 +00:00
Alexander Blair 9414194b1e
Merge pull request #6571
1d31e6c00 net_node: remove dead seed nodes (selsta)
2020-08-05 07:57:54 -07:00
Alexander Blair a0d179e528
Merge pull request #6512
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-19 03:32:59 -07:00
Lee Clagett 7aeb503547 Fix boost <1.60 compilation and fix boost 1.73+ warnings 2020-05-31 21:18:11 -04:00
selsta 1d31e6c000
net_node: remove dead seed nodes 2020-05-20 01:06:03 +02:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 8d0f1696df
Merge pull request #6471
c6a1294 add another seed node (Gingeropolous/selsta)
9faf3d1 Add erciccione's seed node (erciccione/selsta)
2020-05-06 00:23:59 -05:00
luigi1111 6e7b883212
Merge pull request #6443
145be6d p2p: startup speedup, init seed nodes on first 'connect_to_seed()' (xiphon)
2020-05-01 15:23:05 -05:00
Gingeropolous c6a1294b5e
add another seed node
node is funded by random people and managed by me. currently functioning as public node at uwillrunanodesoon.moneroworld.com
2020-04-22 15:43:22 +02:00
erciccione 9faf3d1a72
Add erciccione's seed node 2020-04-22 10:24:40 +02:00
xiphon 145be6dbdb p2p: startup speedup, init seed nodes on first 'connect_to_seed()' 2020-04-21 23:40:04 +00:00
guy 79a1653a07 p2p: add seed node. 2020-04-21 15:35:30 +02:00
luigi1111 97af9649c9
Merge pull request #6372
7b9017f p2p: plug tor to clearnet association vector (Aaron Hook)
2020-04-04 13:09:55 -05:00
moneromooo-monero 21fe6a289b
p2p: fix frequent weak_ptr exception on connection
When a handshake fails, it can fail due to timeout or destroyed
connection, in which case the connection will be, or already is,
closed, and we don't want to do it twice.
Additionally, when closing a connection directly from the top
level code, ensure the connection is gone from the m_connects
list so it won't be used again.

AFAICT this is now clean in netstat, /proc/PID/fd and print_cn.

This fixes a noisy (but harmless) exception.
2020-03-31 20:29:41 +00:00
Alexander Blair 3ed5e7ce9f
Merge pull request #6295
bcae95a2 p2p: do not add recently failed addresses to the peerlist (moneromooo-monero)
2020-03-27 12:30:06 -07:00
Alexander Blair e160e0b517
Merge pull request #6283
a84131ce p2p: fix off by one adding fallback peers (moneromooo-monero)
2020-03-27 12:19:55 -07:00
Alexander Blair c038cc8b79
Merge pull request #6280
b818522d p2p: fix spurious warning when we're connected to at last one seed (moneromooo-monero)
2020-03-27 12:17:54 -07:00
Alexander Blair 3baa68bbab
Merge pull request #6279
36bdf402 p2p: fix adding wrong indices to the filtered peer list (moneromooo-monero)
2020-03-27 12:17:07 -07:00
Lee Clagett 02d887c2e5 Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
  - Stem loops detected in tx_pool.cpp
  - Embargo timeout for a blackhole attack during stem phase
2020-03-26 15:01:30 +00:00
luigi1111 7c74e1919e
Merge pull request #6405
8d23047 p2p: add another seed node (moneromooo-monero)
2020-04-10 16:13:04 -05:00
moneromooo-monero 8d230473ef
p2p: add another seed node
Node from syksy, administered by mooo
2020-03-27 22:51:44 +00:00
Aaron Hook aa93e38862 p2p: remove old debug commands 2020-03-20 22:09:44 -07:00
moneromooo-monero bcae95a22e
p2p: do not add recently failed addresses to the peerlist 2020-03-20 15:45:26 +00:00
Alexander Blair 092a57df99
Merge pull request #6243
4771a7ae p2p: remove obsolete local time in handshake (moneromooo-monero)
2fbbc4a2 p2p: avoid sending the same peer list over and over (moneromooo-monero)
3004835b epee: remove backward compatible endian specific address serialization (moneromooo-monero)
39a343d7 p2p: remove backward compatible peer list (moneromooo-monero)
60631802 p2p: simplify last_seen serialization now we have optional stores (moneromooo-monero)
9467b2e4 cryptonote_protocol: omit top 64 bits of difficulty when 0 (moneromooo-monero)
b595583f serialization: do not write optional fields with default value (moneromooo-monero)
5f98b46d p2p: remove obsolete local time from TIMED_SYNC (moneromooo-monero)
2020-03-12 00:32:46 -07:00
Aaron Hook 7b9017f671
p2p: plug tor to clearnet association vector
During the handshake for an incoming connection, the peer id is checked against the local node's peer id only for the specific zone of the incoming peer, in order to avoid linking public addresses to tor addresses:
5d7ae2d279/src/p2p/net_node.inl (L2343)

However, on handshakes for outgoing connections, all zones are checked:
5d7ae2d279/src/p2p/net_node.inl (L1064)

If an attacker wanted to link a specific tor node to a public node, they could potentially connect to as many public nodes as possible, get themselves added to the peer whitelist, maybe stuff some more attacker-owned addresses into the greylist, then disconnect, and for any future incoming connections, respond with the tor node's id in an attempt to link the public/tor addresses.
2020-03-07 18:12:59 +00:00
Alexander Blair 4764d18eeb
Merge pull request #6248
21c3d42e p2p: drop the peerlist dump to TRACE (moneromooo-monero)
2020-02-28 20:21:27 -08:00
Alexander Blair 34d7ea62f6
Merge pull request #6053
deb350b7 always print peer IDs in the same format (moneromooo-monero)
2020-02-06 00:28:47 -08:00
moneromooo-monero b818522d29
p2p: fix spurious warning when we're connected to at last one seed 2020-01-31 15:11:22 +00:00
moneromooo-monero 4771a7aec1
p2p: remove obsolete local time in handshake
Also removes a potential fingerprinting vector
2020-01-29 14:39:58 +00:00
moneromooo-monero 2fbbc4a2d3
p2p: avoid sending the same peer list over and over
Nodes remember which connections have been sent which peer addresses
and won't send it again. This causes more addresses to be sent as
the connection lifetime grows, since there is no duplication anymore,
which increases the diffusion speed of peer addresses. The whole
white list is now considered for sending, not just the most recent
seen peers. This further hardens against topology discovery, though
it will more readily send peers that have been last seen earlier
than it otherwise would. While this does save a fair amount of net
bandwidth, it makes heavy use of std::set lookups, which does bring
network_address::less up the profile, though not too aggressively.
2020-01-29 14:39:56 +00:00
moneromooo-monero 39a343d76e
p2p: remove backward compatible peer list 2020-01-26 18:37:33 +00:00
moneromooo-monero 606318026e
p2p: simplify last_seen serialization now we have optional stores 2020-01-26 18:37:32 +00:00
moneromooo-monero 5f98b46d58
p2p: remove obsolete local time from TIMED_SYNC 2020-01-26 18:37:26 +00:00
moneromooo-monero 56a4469ef3
network: log traffic and add a simple traffic analysis script 2020-01-26 00:33:41 +00:00
Alexander Blair f20a962774
Merge pull request #6153
24adee4a p2p: don't request flags after closing connection (moneromooo-monero)
2020-01-24 20:06:46 -08:00
Alexander Blair d1b08c00cf
Merge pull request #6146
70c9cd3c Change to Tx diffusion (Dandelion++ fluff) instead of flooding (Lee Clagett)
2020-01-24 20:06:34 -08:00
Alexander Blair c6f4113265
Merge pull request #6119
6f45cfa5 p2p: zero last seen timestamp when inserting a new peer (moneromooo-monero)
2020-01-16 17:29:27 -08:00
moneromooo-monero a84131cea3
p2p: fix off by one adding fallback peers
The code would ignore the first one to be added
2020-01-07 14:40:26 +00:00
moneromooo-monero 36bdf40288
p2p: fix adding wrong indices to the filtered peer list 2020-01-03 17:56:54 +00:00
moneromooo-monero 21c3d42eb9
p2p: drop the peerlist dump to TRACE
It's spammy
2019-12-17 20:27:04 +00:00
moneromooo-monero 24adee4a08
p2p: don't request flags after closing connection 2019-11-19 02:03:39 +00:00
moneromooo-monero 6f45cfa5c5
p2p: zero last seen timestamp when inserting a new peer 2019-11-11 12:44:35 +00:00
Lee Clagett 70c9cd3c9c Change to Tx diffusion (Dandelion++ fluff) instead of flooding 2019-11-04 09:23:20 +00:00
Lee Clagett 5d7ae2d279 Adding support for hidden (anonymity) txpool 2019-11-02 20:36:03 +00:00
moneromooo-monero deb350b783
always print peer IDs in the same format 2019-10-29 11:30:20 +00:00
luigi1111 68b03abdc5
Merge pull request #6021
65e8a89 Change monerod --proxy to --tx-proxy (vtnerd)
2019-10-25 13:52:19 -05:00
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
Lee Clagett 65e8a89e1c Change monerod --proxy to --tx-proxy 2019-10-24 21:06:31 -04:00
luigi1111 1e9b577f2a
Merge pull request #5985
6fdaaba node.inl, add xmrchain.net IP to hardcoded peers (Gingeropolous)
2019-10-22 10:22:02 -05:00
luigi1111 017baeeab5
Merge pull request #5956
ec7f2ff p2p: reject invalid rpc_port in peer lists (xiphon)
2019-10-16 13:44:25 -05:00
luigi1111 67043d642d
Merge pull request #5954
4ce40ed p2p: reject invalid pruning seeds in peer lists (moneromooo-monero)
2019-10-16 13:42:23 -05:00
luigi1111 fcb4c72bb5
Merge pull request #5943
d4d2b5c p2p+rpc: don't skip p2p or rpc port bind failure by default (xiphon)
2019-10-14 20:05:25 -05:00
luigi1111 dc48cdc998
Merge pull request #5933
3455efa ban peers sending bad pow outright (moneromooo-monero)
2019-10-14 18:07:54 -05:00
Gingeropolous 6fdaaba935
node.inl, add xmrchain.net IP to hardcoded peers
added for mainnet, testnet, and stagenet. 

server is owner by snipa, both snipa and I have access to it. No idea where its hosted. 

xmrchain.net is a block explorer thats been around a while.
2019-10-13 17:13:57 -04:00
xiphon d4d2b5c79a p2p+rpc: don't skip p2p or rpc port bind failure by default 2019-10-13 13:27:46 +00:00
luigi1111 b0840a8e01
Merge pull request #5932
f3b65c6 Request a thread stack size that is large enough for unbound (omartijn)
2019-10-08 14:45:21 -05:00
luigi1111 342e7f844f
Merge pull request #5921
2a7d915 Fixed i2p/tor tx flooding bug (white noise disabled) (vtnerd)
2019-10-08 14:31:53 -05:00
moneromooo-monero 4ce40edb27
p2p: reject invalid pruning seeds in peer lists 2019-10-02 19:29:05 +00:00
xiphon ec7f2ff9ed p2p: reject invalid rpc_port in peer lists 2019-10-02 19:04:57 +00:00
moneromooo-monero 3455efafa8
ban peers sending bad pow outright
PoW is expensive to verify, so be strict
2019-09-25 16:00:43 +00:00
Martijn Otto f3b65c66f8
Request a thread stack size that is large enough for unbound
Unbound uses a 64 kb large character array on the stack, which
leads to a stack overflow for some libc implementations. musl
only gives 80 kb in total. This PR changes the stack size for
these threads to 1mb, which solves the segmentation fault.
2019-09-25 16:37:06 +02:00
moneromooo-monero 7b076d5170
p2p: fix bans taking port into account 2019-09-16 22:45:45 +00:00
luigi1111 86938725ae
Merge pull request #5841
cae488d p2p: reject incoming connections to self (moneromooo-monero)
2019-09-08 19:48:09 -05:00
luigi1111 15dabf7d18
Merge pull request #5839
e353e3d p2p: sanitize peer lists (moneromooo-monero)
2019-09-08 19:45:09 -05:00
luigi1111 3b28ff2d6d
Merge pull request #5838
2e26536 p2p: move log away from global (moneromooo-monero)
2019-09-08 19:43:46 -05:00
moneromooo-monero bc1144e98e
Fix IP address serialization on big endian
IP addresses are stored in network byte order even on little
endian hosts
2019-09-04 14:54:01 +00:00
moneromooo-monero cae488dc9b
p2p: reject incoming connections to self 2019-08-22 17:08:29 +00:00
moneromooo-monero e353e3d757
p2p: sanitize peer lists
Also remove the delta time fixup, since we now ignore those
as they're attacker controlled
2019-08-21 15:54:27 +00:00
moneromooo-monero 2e2653602f
p2p: move log away from global
It was here while debugging, and I forgot to move it away
2019-08-21 14:00:43 +00:00
luigi1111 c9df9d683a
Merge pull request #5696
fd60d05 daemon: fix print_pl only printing public zone peers (moneromooo-monero)
2019-08-20 01:50:10 -05:00
moneromooo-monero fd60d05d5d
daemon: fix print_pl only printing public zone peers 2019-08-19 23:39:51 +00:00
luigi1111 f205d28e96
Merge pull request #5727
7b9a420 Replace std::random_shuffle with std::shuffle (tomsmeding)
2019-08-19 17:31:39 -05:00
luigi1111 017162b5b2
Merge pull request #5682
3768db2 p2p: add a reference to Cao, Tong et al. for the last_seen changes (moneromooo-monero)
2019-08-15 17:27:30 -05:00
luigi1111 8a0711f2f2
Merge pull request #5674
fcbf7b3 p2p: propagate out peers limit to payload handler (moneromooo-monero)
098aadf p2p: close the right number of connections on setting max in/out peers (moneromooo-monero)
2019-08-15 17:22:39 -05:00
Tom Smeding 7b9a420787 Replace std::random_shuffle with std::shuffle
According to [1], std::random_shuffle is deprecated in C++14 and removed
in C++17. Since std::shuffle is available since C++11 as a replacement
and monero already requires C++11, this is a good replacement.

A cryptographically secure random number generator is used in all cases
to prevent people from perhaps copying an insecure std::shuffle call
over to a place where a secure one would be warranted. A form of
defense-in-depth.

[1]: https://en.cppreference.com/w/cpp/algorithm/random_shuffle
2019-08-15 16:33:15 +02:00
Thomas Winget 155475d971
Add IPv6 support
new cli options (RPC ones also apply to wallet):
  --p2p-bind-ipv6-address (default = "::")
  --p2p-bind-port-ipv6    (default same as ipv4 port for given nettype)
  --rpc-bind-ipv6-address (default = "::1")

  --p2p-use-ipv6          (default false)
  --rpc-use-ipv6          (default false)

  --p2p-require-ipv4      (default true, if ipv4 bind fails and this is
                           true, will not continue even if ipv6 bind
                           successful)
  --rpc-require-ipv4      (default true, description as above)

ipv6 addresses are to be specified as "[xx:xx:xx::xx:xx]:port" except
in the cases of the cli args for bind address.  For those the square
braces can be omitted.
2019-07-31 20:04:57 -04:00
Lee Clagett 2a7d91523b Fixed i2p/tor tx flooding bug (white noise disabled) 2019-07-29 12:27:00 +00:00
luigi1111 61512cf798
Merge pull request #5610
068fa1c p2p: delay IGP probing on startup (moneromooo-monero)
2019-07-24 14:35:11 -05:00
luigi1111 e241a6280d
Merge pull request #5582
fcfcc3a rpc: in/out peers can now return the setting's value (moneromooo-monero)
2019-07-24 14:18:09 -05:00
luigi1111 e579fe4ae0
Merge pull request #5530
6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
2019-07-24 14:07:29 -05:00
luigi1111 1880c1a582
Merge pull request #5363
515ac29 p2p: store network address directly in blocked host list (moneromooo-monero)
65c4004 allow blocking whole subnets (moneromooo-monero)
2019-07-24 13:47:41 -05:00
Riccardo Spagni 8eb075e789
Merge pull request #5732
a96c1a46 cryptonote_protocol: drop peers we can't download from when syncing (moneromooo-monero)
ab361df2 p2p: add a few missing connection close calls (moneromooo-monero)
2019-07-17 21:18:20 +02:00
Lee Clagett 3b24b1d082 Added support for "noise" over I1P/Tor to mask Tx transmission. 2019-07-17 14:22:37 +00:00
moneromooo-monero 65c4004963
allow blocking whole subnets 2019-07-16 11:35:53 +00:00
moneromooo-monero 515ac2951d
p2p: store network address directly in blocked host list
rather than their string representation
2019-07-16 11:35:52 +00:00
moneromooo-monero 4ee095c200
p2p: don't connect to more than one IP per class B if we can 2019-07-05 18:25:52 +00:00
moneromooo-monero ab361df2cd
p2p: add a few missing connection close calls 2019-07-04 21:56:10 +00:00
moneromooo-monero 4237707d3e
p2p: don't forget pruning seed or public RPC port when updating peers
Older nodes don't pass that information around
2019-06-26 10:20:19 +00:00
moneromooo-monero 3768db227c
p2p: add a reference to Cao, Tong et al. for the last_seen changes
"Exploring the Monero Peer-to-Peer Network". https://eprint.iacr.org/2019/411
2019-06-21 10:34:33 +00:00
moneromooo-monero 098aadf084
p2p: close the right number of connections on setting max in/out peers 2019-06-19 11:49:36 +00:00
moneromooo-monero fcbf7b3f74
p2p: propagate out peers limit to payload handler 2019-06-19 11:49:36 +00:00
moneromooo-monero 2cbe75661c
p2p: fix GCC 9.1 crash 2019-06-08 17:52:53 +00:00
moneromooo-monero 068fa1ca5c
p2p: delay IGP probing on startup
We might have external access without having to do this
2019-06-06 10:33:02 +00:00
moneromooo-monero fcfcc3ac86
rpc: in/out peers can now return the setting's value 2019-05-30 12:13:31 +00:00
moneromooo-monero 6abaaaa994
remove obsolete save_graph skeleton code 2019-05-10 14:17:18 +00:00
moneromooo-monero 28a7d31565
p2p: do not send last_seen timestamp to peers
This can be used for fingerprinting and working out the
network topology.

Instead of sending the first N (which are sorted by last
seen time), we sent a random subset of the first N+N/5,
which ensures reasonably recent peers are used, while
preventing repeated calls from deducing new entries are
peers the target node just connected to.

The list is also randomly shuffled so the original set of
timestamps cannot be approximated.
2019-04-24 17:56:12 +00:00
Riccardo Spagni 8d16e92dcb
Merge pull request #5425
58585986 p2p: fix integer overflow in host bans (moneromooo-monero)
2019-04-16 22:38:56 +02:00
moneromooo-monero 5858598604
p2p: fix integer overflow in host bans 2019-04-11 21:59:27 +00:00
stoffu a2195b9b7f
crypto: replace rand<T>()%N idiom with unbiased rand_idx(N) 2019-04-04 22:38:19 +09:00
Riccardo Spagni 6e0242f861
Merge pull request #5334
19f8089f p2p: don't lookup seed nodes when offline (moneromooo-monero)
2019-04-01 17:37:01 +02:00
moneromooo-monero 19f8089fca
p2p: don't lookup seed nodes when offline
This will cause DNS requests, which will block and timeout
if there is really no network connectivity
2019-03-22 15:47:48 +00:00
rbrunner7 85f2f8c933 Fix daemon startup parameter '--limit-rate' processing after parameter defaults 2019-03-20 16:40:59 +01:00
Riccardo Spagni bf0f85221b
Merge pull request #5195
a54e81e5 daemon: add '--no-sync' arg to optionally disable blockchain sync (xiphon)
2019-03-19 10:57:28 +02:00
Riccardo Spagni 848591c4d8
Merge pull request #5190
551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
2019-03-17 17:56:04 +02:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
moneromooo-monero ceb72be329
p2p: avoid busy loop when we have nothing to connect to 2019-03-05 12:00:45 +00:00
moneromooo-monero e396146aee
default initialize rpc structures 2019-03-04 22:38:03 +00:00
Riccardo Spagni 4466f4504e
Merge pull request #5091
123fc2a2 i2p: initial support (Jethro Grassie)
2019-03-04 21:20:34 +02:00
xiphon a54e81e572 daemon: add '--no-sync' arg to optionally disable blockchain sync 2019-02-25 03:22:14 +00:00
xiphon 551104fbf1 daemon: add --public-node mode, RPC port propagation over P2P 2019-02-25 02:40:23 +03:00
moneromooo-monero 2456945408
epee: add SSL support
RPC connections now have optional tranparent SSL.

An optional private key and certificate file can be passed,
using the --{rpc,daemon}-ssl-private-key and
--{rpc,daemon}-ssl-certificate options. Those have as
argument a path to a PEM format private private key and
certificate, respectively.
If not given, a temporary self signed certificate will be used.

SSL can be enabled or disabled using --{rpc}-ssl, which
accepts autodetect (default), disabled or enabled.

Access can be restricted to particular certificates using the
--rpc-ssl-allowed-certificates, which takes a list of
paths to PEM encoded certificates. This can allow a wallet to
connect to only the daemon they think they're connected to,
by forcing SSL and listing the paths to the known good
certificates.

To generate long term certificates:

openssl genrsa -out /tmp/KEY 4096
openssl req -new -key /tmp/KEY -out /tmp/REQ
openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT

/tmp/KEY is the private key, and /tmp/CERT is the certificate,
both in PEM format. /tmp/REQ can be removed. Adjust the last
command to set expiration date, etc, as needed. It doesn't
make a whole lot of sense for monero anyway, since most servers
will run with one time temporary self signed certificates anyway.

SSL support is transparent, so all communication is done on the
existing ports, with SSL autodetection. This means you can start
using an SSL daemon now, but you should not enforce SSL yet or
nothing will talk to you.
2019-02-02 20:05:33 +00:00
Jethro Grassie 123fc2a25a
i2p: initial support 2019-01-30 13:37:45 -05:00
Lee Clagett 973403bc9f Adding initial support for broadcasting transactions over Tor
- Support for ".onion" in --add-exclusive-node and --add-peer
  - Add --anonymizing-proxy for outbound Tor connections
  - Add --anonymous-inbounds for inbound Tor connections
  - Support for sharing ".onion" addresses over Tor connections
  - Support for broadcasting transactions received over RPC exclusively
    over Tor (else broadcast over public IP when Tor not enabled).
2019-01-28 23:56:33 +00:00
moneromooo-monero b750fb27b0
Pruning
The blockchain prunes seven eighths of prunable tx data.
This saves about two thirds of the blockchain size, while
keeping the node useful as a sync source for an eighth
of the blockchain.

No other data is currently pruned.

There are three ways to prune a blockchain:

- run monerod with --prune-blockchain
- run "prune_blockchain" in the monerod console
- run the monero-blockchain-prune utility

The first two will prune in place. Due to how LMDB works, this
will not reduce the blockchain size on disk. Instead, it will
mark parts of the file as free, so that future data will use
that free space, causing the file to not grow until free space
grows scarce.

The third way will create a second database, a pruned copy of
the original one. Since this is a new file, this one will be
smaller than the original one.

Once the database is pruned, it will stay pruned as it syncs.
That is, there is no need to use --prune-blockchain again, etc.
2019-01-22 20:30:51 +00:00
Riccardo Spagni e59813c3d7
Merge pull request #5029
d1b3990d p2p: don't stop the idle thread when no gray peers are found (moneromooo-monero)
2019-01-16 21:39:19 +02:00
Riccardo Spagni 3e9bb9626a
Merge pull request #5001
a5ffc2d5 Remove boost::lexical_cast for uuid and unused uuid function (Lee Clagett)
2019-01-16 19:27:13 +02:00
Riccardo Spagni 846362842c
Merge pull request #4976
85665003 epee: better network buffer data structure (moneromooo-monero)
2019-01-16 19:04:22 +02:00
moneromooo-monero d1b3990d40
p2p: don't stop the idle thread when no gray peers are found 2018-12-30 19:32:38 +00:00
moneromooo-monero 85665003a7
epee: better network buffer data structure
avoids pointless allocs and memcpy
2018-12-23 16:46:07 +00:00
Lee Clagett a5ffc2d5ad Remove boost::lexical_cast for uuid and unused uuid function 2018-12-23 11:11:30 +00:00
moneromooo-monero 570dd3690e
p2p: use vector instead of list for peer lists 2018-12-07 13:20:34 +00:00
Riccardo Spagni c00ac446fd
Merge pull request #4854
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-12-04 17:08:42 +02:00
Riccardo Spagni 46d0dc2808
Merge pull request #4776
03fc731b p2p: less frequent incoming connections check (moneromooo-monero)
14a5c206 p2p: tone down "no incoming connections" warning to info if in peers is 0 (moneromooo-monero)
2018-11-16 11:01:19 +02:00
Martijn Otto bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
moneromooo-monero 03fc731bf2
p2p: less frequent incoming connections check 2018-11-01 22:00:35 +00:00
moneromooo-monero 14a5c2068f
p2p: tone down "no incoming connections" warning to info if in peers is 0
Also add an info if not offline, since it weakens the network
2018-11-01 16:43:06 +00:00
RaskaRuby 2bd46065ae Expose limit-rate defaults from command line help 2018-10-31 14:47:20 -07:00
Riccardo Spagni ecc690a613
Merge pull request #4612
2d48861d p2p: only deinitialize what's been initialized in offline mode (moneromooo-monero)
2018-10-26 22:38:03 +02:00
moneromooo-monero 2d48861db7
p2p: only deinitialize what's been initialized in offline mode 2018-10-16 09:20:05 +00:00
moneromooo-monero 0fbbb065d4
p2p: a negative result from UPNP_GetValidIGD is an error
as per the source documentation
2018-10-15 22:41:00 +00:00
Riccardo Spagni fa7278d6b5
Merge pull request #4578
76d6d832 Revert "p2p: connect via the bound ip, if any" (moneromooo-monero)
2018-10-15 13:29:21 +02:00
moneromooo-monero 76d6d832d2
Revert "p2p: connect via the bound ip, if any"
This reverts commit 909398efc7.

It looks like it's causing trouble with tor on some setups
2018-10-13 10:20:04 +00:00
moneromooo-monero e736964a0c
Remove epee header dependency on cryptonote_core 2018-10-12 17:16:44 +00:00
luigi1111 b586ae1310
Merge pull request #4089
909398e p2p: connect via the bound ip, if any (moneromooo-monero)
2018-08-15 17:06:17 -05:00
luigi1111 f6d7e87b67
Merge pull request #4075
438d52d remove epee from link lines where it's redundant (moneromooo-monero)
2018-07-19 14:10:20 -05:00
luigi1111 025187e6c9
Merge pull request #3854
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-19 13:35:25 -05:00
moneromooo-monero 909398efc7
p2p: connect via the bound ip, if any 2018-07-02 18:06:04 +01:00
victorsintnicolaas 34cb6b4b70 add --regtest and --fixed-difficulty for regression testing
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-29 10:06:11 +02:00
moneromooo-monero 438d52deaf
remove epee from link lines where it's redundant
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-28 16:45:22 +01:00
luigi1111 3ad4ecd4ff
Merge pull request #3982
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-27 15:38:23 -05:00
luigi1111 cb130c7590
Merge pull request #3861
de1ffe0 p2p: warn when no incoming connections are seen for a while (moneromooo-monero)
2018-06-19 12:56:31 -05:00
stoffu 0cf80baea4
net_node: resolve host for node addresses given via command line flags 2018-06-11 20:17:13 +09:00
stoffu 08b85a8e00
cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X 2018-06-11 20:17:02 +09:00
moneromooo-monero de1ffe07b1
p2p: warn when no incoming connections are seen for a while 2018-05-26 14:37:07 +01:00
moneromooo-monero 1590183965
p2p: fix fallback seed node usage
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-29 14:58:42 +01:00