172 Commits

Author SHA1 Message Date
Zahary Karadjov
dbf7d8b3ff Embed protocol metadata within the p2p trace; Placeholder for the traffic visualization plugin 2018-11-26 19:50:13 +02:00
deme
4792e18c56 Add addPeer proc and more comments 2018-11-13 14:18:59 +02:00
deme
f62ca5607d Fix segfault when there is no peer_pool (no connectToNetwork() ran).
e.g. tserver test would segfault.
2018-11-13 14:18:59 +02:00
deme
19cd8201b0 Resolving several connection issues:
- Adding peers to peer pool on incoming connection
- Exclude bootnodes from nodes to connect to
- Check if peer is already connected to before adding to peer pool
- Check if peer is still connected to before removing from peer pool
2018-11-13 14:18:59 +02:00
Zahary Karadjov
58d6c9c208 Fix a tricky handshake ordering issue reported by kdeme 2018-11-11 14:07:02 +02:00
Zahary Karadjov
eca93509b4 Support for creating JSON dumps of all P2P network traffic
Enable by compiling with -d:p2pdump. A chronicles log file named
p2p_messages.json will be created in the working directory. This
file will be consumed by the upcoming Chronicles Tail GUI (more
details will be provided on the wiki of this repo).

Other changes:

* Removes the use of package_visible_types (only partially so far)
* Simplifies the new Snappy code a little bit
2018-11-10 02:18:00 +02:00
andri lim
7787e27427 cosmetics changes 2018-11-09 14:45:35 +02:00
andri lim
c3a49d187d fixes wrong logic 2018-11-09 14:45:35 +02:00
andri lim
e8bd614021 improve readability 2018-11-09 14:45:35 +02:00
andri lim
21105f1558 cosmetics changes 2018-11-09 14:45:35 +02:00
andri lim
f590bf0154 add snappy compression 2018-11-09 14:45:35 +02:00
deme
f91091de44 Fix import of shh_protocol 2018-11-04 12:31:03 +02:00
cheatfate
84184221ad Fix #47. 2018-10-22 11:52:14 +03:00
Zahary Karadjov
8b4bbd29af Adopt to the latest version of RLPx 2018-10-21 01:40:00 +03:00
Jacek Sieka
7342c46fd9 whisper: updates
* add some logging
* add some error and bounds checking
* move tests where they belong
* add symmetric encryption
* add signature public key recovery
2018-10-21 01:35:35 +03:00
Zahary Karadjov
3c97296ef8 Working definition of an SHH RLPX protocol 2018-10-21 01:35:35 +03:00
Jacek Sieka
7fdd574a37 whisper: add primitives (WIP)
Work-in-progress dump of initial whisper support

* payload encoding / decoding (missing 256-bit GCM mode)
* missing tests
* missing p2p integration
2018-10-21 01:35:35 +03:00
Zahary Karadjov
7828ef0481 Initial implementation of the LES protocol and its flow control.
This also restores the old module structure of having separate
`peer_pool` and `rlpx` modules. This is made possible by the
new Nim package `package_visible_types` (please refer to its
README for an explanation).

Also introduces more error handling in the low-level RLPx routines.
All detected errors will result in immediate disconnection of the
corresponding peer, which may be detected in the protocols though
the `onPeerDisconnected` event handler.
2018-10-16 02:52:11 +03:00
Zahary Karadjov
b38804f873 This commit only moves files around (no need for review)
In the next commit, I'm going to squash all the changes in the LES.
This commit just sets the directory tree to its final state, so the
diffs in the follow up commits are easier to review.

Please note that eth.nim was renamed to eth_protocol.nim, because
it's not advisable to have a module name that shares the name of
a protocol identifier (this creates hard to figure out ambiguity
errors)
2018-10-15 16:49:49 +03:00
Yuriy Glukhov
e5ff8aea2a
Merge pull request #42 from status-im/sync
Proper sync part 1
2018-10-04 11:03:11 +03:00
Yuriy Glukhov
e64ab468ae Blocks ordering 2018-10-02 14:40:08 +03:00
Yuriy Glukhov
7f14c435d6 Proper sync part 1 2018-10-01 14:33:59 +03:00
Zahary Karadjov
badc616be8 Deal with the refactoring in status-im/nim-rlp#20 2018-09-26 17:21:49 +03:00
Yuriy Glukhov
d808d9dc1a P2P fixes, optional discovery 2018-09-25 17:42:10 +03:00
Yuriy Glukhov
f89d2eee5f Specify debug enode through env var. Fail less often in discovery 2018-09-20 22:28:53 +03:00
Zahary Karadjov
2785dcdd19 Don't use HTTP dependencies in Nimble due to nim-lang/nimble#543 2018-09-15 23:52:15 +03:00
Zahary Karadjov
d30dce9d53 Fix compilation issues when using peer.networkState 2018-09-12 18:28:50 +03:00
Yuriy Glukhov
f815c73963 Reply empty nodeData 2018-09-10 19:22:31 +03:00
Yuriy Glukhov
b5c898dc1e Fixed requested block range, more reliable block downloader 2018-09-07 13:37:11 +03:00
Yuriy Glukhov
573ca08643 Fixed occasional assertion failure on bonding 2018-09-07 13:37:11 +03:00
Yuriy Glukhov
892467b5a8 Less verbosity about some errors 2018-09-07 13:37:11 +03:00
Jacek Sieka
9392ae1d53
appveyor: fix version check 2018-09-06 12:02:24 -06:00
Jacek Sieka
98df7916b2
readme: update license 2018-09-05 12:47:38 -06:00
Jacek Sieka
0909540a92
ci: update
readme: fix license, badges
2018-09-04 22:24:14 -06:00
Jacek Sieka
819d021fa2
travis: use cached nim instead of docker 2018-09-02 09:41:09 -06:00
Yuriy Glukhov
0eda6bc91a Download block bodies 2018-08-29 23:34:21 +03:00
Yuriy Glukhov
2c3a183445 Compatibility with newer nim 2018-08-29 18:28:01 +03:00
Yuriy Glukhov
4b5cda9233 Temporary workaround to experimental problem 2018-08-29 18:28:01 +03:00
Yuriy Glukhov
847fac0635 Fixed msg len encoding 2018-08-29 18:28:01 +03:00
Zahary Karadjov
20033b499b Use chronicles instead of 'echo'; Cosmetic renames 2018-08-14 16:45:08 +03:00
Yuriy Glukhov
253bea9c8e More fixes. Block headers download works! 2018-08-14 16:45:08 +03:00
Yuriy Glukhov
7fac4cbf68
Merge pull request #31 from status-im/fix-autobuild
Added eth_common to dependencies
2018-07-31 01:08:04 +03:00
Yuriy Glukhov
695331737a Added eth_common to dependencies 2018-07-31 00:37:56 +03:00
Zahary Karadjov
11fbe60ba4 add some reference links 2018-07-24 00:41:40 +03:00
Zahary Karadjov
be7ca479b3 more fleshed out implementation of the blockchain sync procedure 2018-07-24 00:39:41 +03:00
Zahary Karadjov
6351fc38b9 type in eth_common has been renamed to avoid a naming collission in nimbus's gas_costs module 2018-07-23 13:44:56 +03:00
Zahary Karadjov
41e92ca8df The ETH and LES protocols now compile as part of nimbus 2018-07-23 00:32:45 +03:00
Zahary Karadjov
4335052e9f Move the code from rlpx.nim in the base module as it now represents
a wider set of APIs.
2018-07-12 14:14:22 +03:00
Yuriy Glukhov
cf6b4d3084 Some fixes 2018-07-10 12:54:27 +03:00
Zahary Karadjov
6ac6397d33 Added documentation 2018-07-09 20:00:34 +03:00