Commit graph

102 commits

Author SHA1 Message Date
moneromooo-monero
727e67cada
cryptonote_protocol: print peer top height along with its version 2017-08-23 13:38:06 +01:00
moneromooo-monero
70b8c6d77a
cryptonote_protocol: misc fixes to the new sync algorithm
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-21 21:57:19 +01:00
Riccardo Spagni
4466b6d1b0
Merge pull request #2303
5a283078 cryptonote_protocol: large block sync size before v4 (moneromooo-monero)
7b747607 cryptonote_protocol: kick idle synchronizing peers (moneromooo-monero)
2017-08-17 21:39:44 +02:00
Riccardo Spagni
4859a00134
Merge pull request #2300
42b34b35 Consistently print peer id in hex and on 16 chars (moneromooo-monero)
2017-08-17 21:36:15 +02:00
Riccardo Spagni
1d32a5a445
Merge pull request #2291
b59cd074 befor -> before (Nano Akron)
2017-08-17 21:35:48 +02:00
moneromooo-monero
5a283078ec
cryptonote_protocol: large block sync size before v4 2017-08-17 13:11:52 +01:00
moneromooo-monero
7b74760756
cryptonote_protocol: kick idle synchronizing peers
In case they dropped off downloading for any reason, they'll get
sent to download again.
2017-08-16 22:24:50 +01:00
moneromooo-monero
42b34b3545
Consistently print peer id in hex and on 16 chars 2017-08-16 10:56:55 +01:00
Nano Akron
b59cd0745b befor -> before
Really unique yet consistent spelling mistake
2017-08-15 23:23:26 +01:00
moneromooo-monero
827afcb7ea
protocol: pass blockchain cumulative difficulty when syncing
Not used yet.
2017-08-15 21:03:37 +01:00
Riccardo Spagni
53dde37ceb
Merge pull request #2276
a1891ebe tests: fix tests build (moneromooo-monero)
2017-08-15 20:53:41 +02:00
Riccardo Spagni
86cf8cac86
Merge pull request #2275
88e83f94 cryptonote_protocol_handler: log versions as unsigned ints (moneromooo-monero)
2017-08-15 20:53:08 +02:00
Riccardo Spagni
1d093eff67
Merge pull request #2273
0e8d60c0 cryptonote_protocol: fix recv/send idle time before handshake (moneromooo-monero)
2017-08-15 20:51:50 +02:00
Riccardo Spagni
e0df740bc9
Merge pull request #2272
f90bbe2a cryptonote_protocol: keep target in sync with dropped connections (moneromooo-monero)
2017-08-15 20:51:35 +02:00
moneromooo-monero
35e01a6e50
cryptonote_protocol: fix "holes" in block download schedule 2017-08-15 17:49:06 +01:00
moneromooo-monero
3da1edfde5
cryptonote_protocol: fix out of order addition
This was broken by the reorg fix, since we now have to add blocks
regardless of their starting height. We now check whether we know
the parent for the first block in the next span, or whether it was
requested. If neither, it's an orphan. If it is not known, but was
requested, we wait to get that block.
2017-08-15 16:54:08 +01:00
moneromooo-monero
2ec15a6931
daemon: print peers' top height in sync_info 2017-08-12 20:36:31 +01:00
moneromooo-monero
88e83f9427
cryptonote_protocol_handler: log versions as unsigned ints
They're interpreted as characters otherwise
2017-08-12 11:57:05 +01:00
moneromooo-monero
08abb670e1
protocol: fix reorgs while syncing 2017-08-12 11:22:42 +01:00
moneromooo-monero
a1891ebea9
tests: fix tests build
Add get_fork_version and add_ideal_fork_version to core so
cryptonote_protocol does not have to need the Blockchain
class directly, as it's not in its dependencies, and add
those to the fake core classes in tests too.
2017-08-10 11:12:56 +01:00
moneromooo-monero
0e8d60c06c
cryptonote_protocol: fix recv/send idle time before handshake 2017-08-09 21:22:05 +01:00
moneromooo-monero
f90bbe2a5c
cryptonote_protocol: keep target in sync with dropped connections
When a node is dropped, we stop considering its claimed blockchain
height as a factor in the target height calculation. This prevents
a runaway chain from being still thought to be the target even if
the nodes carrying it are dropped.
2017-08-09 20:49:24 +01:00
moneromooo-monero
635929eaca
protocol: add checks for top block hard fork version
We won't even talk to a peer which claims a wrong version
for its top block. This will avoid syncing to known bad
peers in the first place.
Also add IP fails when failing to verify a block.
2017-08-09 10:28:41 +01:00
Riccardo Spagni
6db8a60a18
Merge pull request #2149
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-07 15:24:58 +02:00
Riccardo Spagni
b1af32b48d
Merge pull request #2242
1c9196b0 cryptonote_protocol: fix days behind calc on testnet (moneromooo-monero)
2017-08-07 15:13:45 +02:00
Riccardo Spagni
ea46a5527a
Merge pull request #2234
214fd81e some include cleanup (moneromooo-monero)
2017-08-07 15:13:07 +02:00
moneromooo-monero
158c3ecff3
core: thread most of handle_incoming_tx 2017-08-07 09:33:20 +01:00
moneromooo-monero
f57ee382b8
cryptonote_protocol: retry stale spans early
Connections can be dropped by the net_node layer,
unbeknownst to cryptonote_protocol, which would then
not flush any spans scheduled to that connection,
which would cause it to be only downloaded again
once it becomes the next span (possibly after a small
delay if it had been requested less than 5 seconds
ago).
2017-08-07 09:33:17 +01:00
moneromooo-monero
90df52e12f
cryptonote_protocol: light cleanup 2017-08-07 09:33:14 +01:00
moneromooo-monero
84e23156ac
cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages 2017-08-07 09:33:09 +01:00
moneromooo-monero
5be43fcdba
cryptonote_protocol_handler: sync speedup
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-07 09:33:04 +01:00
moneromooo-monero
1c9196b0c5
cryptonote_protocol: fix days behind calc on testnet 2017-08-02 22:34:02 +01:00
moneromooo-monero
214fd81e93
some include cleanup 2017-07-31 16:36:52 +01:00
rbrunner7
f1b76c8424 cryptonote_protocol: Set send_idle_time in connection_info correctly 2017-07-24 18:58:39 +02:00
moneromooo-monero
8f96cfc20a
Remove typeid use in network_address
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-28 09:11:24 +01:00
Riccardo Spagni
a0174ad534
Merge pull request #2064
6fc2dc39 cryptonote_protocol_handler: fix crash in debug log (moneromooo-monero)
2017-06-18 16:40:52 +02:00
Riccardo Spagni
a237f90c5b
Merge pull request #2052
072102cf abstracted nework addresses (moneromooo-monero)
2017-06-18 14:23:59 +02:00
moneromooo-monero
6fc2dc3927
cryptonote_protocol_handler: fix crash in debug log 2017-06-01 19:42:33 +01:00
moneromooo-monero
072102cfd2
abstracted nework addresses
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-27 11:35:54 +01:00
moneromooo-monero
b52abd1370
Move txpool to the database
Integration could go further (ie, return_tx_to_pool calls should
not be needed anymore, possibly other things).

poolstate.bin is now obsolete.
2017-05-25 22:23:37 +01:00
moneromooo-monero
b54e19d00e
protocol: fix wrong tx being looked up from fluffy block
Found by smooth
2017-03-13 19:16:25 +00:00
moneromooo-monero
09e060febb
protocol: fix fluffy to normal block dropping txes 2017-03-12 14:14:51 +00:00
moneromooo-monero
4d05955d53
protocol: fix "sync done" message not appearing 2017-02-24 01:28:56 +00:00
Riccardo Spagni
c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
Riccardo Spagni
b252afb0b0
Merge pull request #1736
424b76a4 Fix spurious synchronization status msgs (Howard Chu)
2017-02-21 11:27:49 +02:00
Riccardo Spagni
49efd3add9
Merge pull request #1727
0288310e blockchain_db: add "raw" blobdata getters for block and transaction (moneromooo-monero)
2017-02-21 11:27:15 +02:00
Howard Chu
424b76a4e5
Fix spurious synchronization status msgs
Only update target height if it's actually greater than the current target.
Only display "synchronized" when current height equals target.
2017-02-15 14:41:42 +00:00
moneromooo-monero
0288310e3b
blockchain_db: add "raw" blobdata getters for block and transaction
This speeds up operations such as serving blocks to syncing peers
2017-02-13 21:11:37 +00:00
moneromooo-monero
53f040445f
cryptonote_protocol: tweaks to the syncing speedup
- only pause mining once we've got the lock (in practice, it'll
  already be paused by another thread if we can't get the lock
  at once though)
- do not call prepare_handle_incoming_blocks when we dismissed
  all the blocks, it only causes cleanup_handle_incoming_blocks
  to complain afterwards
2017-02-13 19:36:31 +00:00
Riccardo Spagni
e246dd1443
Merge pull request #1717
8bdc86be protocol: speed up sync by minimizing duplicate work (moneromooo-monero)
61dfa310 epee: fix some log macros not printing context nicely (moneromooo-monero)
2017-02-12 23:28:38 +02:00