Commit Graph

126 Commits

Author SHA1 Message Date
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
Zahary Karadjov 96cf717778 WIP outline of the Blockchain sync procedure using the ETH wire protocol 2018-07-09 01:26:14 +03:00
Zahary Karadjov 4d17ab1ee5 Added various smaller features
* Perform per-protocol handshakes after connecting

* Initialize the per-protocol Peer and Network states properly

* Add an `EthereumNode` object that can be configured with specific
  capabilities and connected to a specific network.
2018-07-09 01:17:00 +03:00
Zahary Karadjov f1001c45d2 implement the new nextMsg semantics 2018-07-08 19:12:06 +03:00
Zahary Karadjov 9057d18abe Implemented the request/response future resolving logic 2018-07-08 17:25:10 +03:00
Zahary Karadjov 72016046fb Merge peer_pool and server into rlpx
This was done because a cycle was formed between the structures
of the three modules:

- A Peer holds a reference to its Network
- The Network holds a reference to its PeerPool
- The PeerPool keeps a table of connected Peers

I could have resolved the issue by introducing a new types module,
but it would have required all of the currently private fields to
become public (due to lack of package-level visibility in Nim).

Instead I decided to merge the modules because they were relatively
small anyway. Please note that the former `P2PServer` type is now
called `NetworkConnection`. There are slight changes in the APIs
that will be carried out in Nimbus when merging this.
2018-07-06 15:25:21 +03:00
Zahary Karadjov fac8bbd917 WIP refactor the rlpxProtocol macro
* Make all handlers async

* Added a new `requestResponse` construct that allows you to wait
  for the results of a particular request

* Introduced an optional `NetworkState` type for the protocol

* The semantics of `nextMsg` has changed. See the notes in the README
2018-07-06 13:24:01 +03:00
cheatfate 66ff278f33 Fix server.nim was not exported. 2018-06-20 14:41:04 +03:00
Yuriy Glukhov c7d155b24b
Merge pull request #27 from status-im/clientid
Move clientId from constant.
2018-06-19 18:40:16 +03:00
cheatfate 28759422bc Move clientId from constant. 2018-06-19 14:16:36 +03:00
Zahary Karadjov 7b1fc33d59 disable an inappropriate test that was left enabled by accident 2018-06-18 12:28:02 +03:00
Zahary Karadjov 6bd09b1bba remove some dead code 2018-06-18 12:05:38 +03:00
Zahary Karadjov 41d022b7fa fix a compilation errors and some GcSafe warnings 2018-06-18 12:05:38 +03:00
cheatfate 6a961ce0b4 Fix nimble dependency on asyncdispatch2. 2018-06-18 12:05:38 +03:00
cheatfate 24d762da34 Moved eth_p2p to asyncdispatch2.
Fix some warnings at rlpx.nim.
Commented debug echo in rlpx.nim.
2018-06-18 12:05:38 +03:00
Zahary Karadjov 812c6284c0 rename package to eth_p2p to make it consistent with our naming scheme 2018-06-16 21:58:41 +03:00
alexm-status a06bd8789e
Update README.md 2018-05-30 14:35:02 -07:00
alexm-status 50a9caa1b2
Update README.md 2018-05-27 14:14:01 -07:00
alexm-status 23e394748b
Update README.md 2018-05-23 17:40:08 -07:00
Yuriy Glukhov d0b1ef6a7c Rlpx fixes 2018-05-22 15:02:03 +03:00
Yuriy Glukhov 42ad1e7fdd
Merge pull request #23 from status-im/hide-append
Hide discovery append helpers for now, to not interfere with rlpx
2018-05-18 12:55:23 +03:00
Yuriy Glukhov 5421a9874c Hide discovery append helpers for now, to not interfere with rlpx 2018-05-18 12:06:43 +03:00
Yuriy Glukhov 6e6262b318
Merge pull request #22 from data-man/fix_hexdump
Remove unused hexdump module
2018-05-17 16:35:30 +03:00
data-man b6b511c1ad Fix tests 2018-05-17 15:49:22 +03:00
data-man 02ea6cea08 Remove unused hexdump module 2018-05-17 15:32:52 +03:00
Yuriy Glukhov 84ac86cc94
Merge pull request #21 from status-im/expectedLength2
Fix ack/auth message handling.
2018-05-17 14:37:39 +03:00
data-man d484c2ff6b Fixes hexDump's bug 2018-05-17 13:32:50 +03:00
Your Name 407e6c43ef Added magic constant. 2018-05-17 11:39:10 +03:00
Your Name b715adae7d Fix ack/auth message handling. 2018-05-17 10:26:36 +03:00
Yuriy Glukhov fa4be1ebc9
Merge pull request #18 from status-im/eip8-auth
Eip8 auth
2018-05-16 18:16:27 +03:00
Yuriy Glukhov 6ec49cea9c Raise disconnect exception in fullRecvInto 2018-05-16 11:25:23 +03:00
Yuriy Glukhov 98cf6376c8 No hard limit for auth msg, rlpx encoding corrected, cosmetics. 2018-05-16 11:20:30 +03:00
Yuriy Glukhov 74f0b705f0 Eip8 auth 2018-05-16 07:31:35 +03:00
Yuriy Glukhov d22c8251dc
Merge pull request #17 from status-im/server-updates
Server updates
2018-05-15 12:25:02 +03:00
Yuriy Glukhov 8ada7e716b Removed GC_ref/GC_unref 2018-05-11 15:25:16 +03:00
Yuriy Glukhov e53daf31f7 Dont use asyncCheck 2018-05-11 13:11:57 +03:00
Yuriy Glukhov e7959ee19d burnMem(secret) 2018-05-11 13:08:55 +03:00
Yuriy Glukhov 5523cb44db Fixed potential crash 2018-05-11 13:00:25 +03:00
Yuriy Glukhov 128460099a Fixed rlpx send, perform handshake in a test. ENode allows zero ports now. 2018-05-10 22:02:12 +03:00
Zahary Karadjov e43fa613b6 Refactored the RlpxConnect procs to reduce code duplication 2018-05-10 17:03:37 +03:00
Yuriy Glukhov 5ac3163920 Server updates 2018-05-10 15:51:33 +03:00
Yuriy Glukhov b3e0df26b6
Merge pull request #16 from status-im/discotest
Fixed findNode msg handling, minor optimization, added a test
2018-05-09 11:47:06 +03:00
Yuriy Glukhov 45886d2a16 Fixed findNode msg handling, minor optimization, added a test 2018-05-08 20:58:45 +03:00
mratsim 0b02864b9d Revert 3467243 + test tdiscovery uses C backend by default 2018-05-08 18:02:17 +02:00
Mamy Ratsimbazafy a7e8cb7bdf
Revert "setCommand"
setCommand only executes the last command actually (works in other repo because there was only one test command to execute)
2018-05-08 16:58:24 +02:00
Yuriy Glukhov 4c23020d8e Removed misleading comment 2018-05-08 17:34:15 +03:00
Yuriy Glukhov e823ee6b47
Merge pull request #15 from status-im/update-test-proc
Update test proc
2018-05-08 17:32:27 +03:00