nim-eth/eth/p2p
Jordan Hrycaj 00ed6ad312
Dedicated RLP reader for `DisconnectionReason` (#507)
* Provide dedicated `DisconnectionReason` enum type RLP reader

why:
  Without this reader, the program communicating via RLPX will crash when
  receiving out of bound reason codes disconnect message.

  Out of bound value assignments to an enum causes a `RangeError`defect
  and consequently the program to terminate. This `RangeError` is avoided
  here and a `MalformedRlpError` catchable error raised.

* Using default exception type in bespoke `read(DisconnectionReason)`

why:
  This should not differ from the default enum parser. The particular
  message is different and more targeted, here.

  Note: The default RLP parser was not used because `
  `array[1,DisconnectionReason]` is currently not properly handled and
  should give a siliar error message as a `DisconnectionReason` error.

* De-clutter, custom read() was not needed

Co-authored-by: jordan <jordan@curd.mjh-it.com>
2022-05-26 10:23:40 +01:00
..
discoveryv5 Add discv5 max packet size limit (#505) 2022-05-02 16:49:19 +02:00
private Dedicated RLP reader for `DisconnectionReason` (#507) 2022-05-26 10:23:40 +01:00
rlpx_protocols remove bzz protocol (#506) 2022-05-07 13:50:43 +02:00
auth.nim Handle the decodeAuthMessage error case separatly and log to trace (#498) 2022-04-04 22:31:09 +02:00
blockchain_sync.nim Remove inline pragmas 2021-05-11 09:59:58 +02:00
blockchain_utils.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
bootnodes.nim add bootnodes test 2022-02-27 11:53:11 +07:00
discovery.nim Handle the decodeAuthMessage error case separatly and log to trace (#498) 2022-04-04 22:31:09 +02:00
ecies.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
enode.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
kademlia.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
mock_peers.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
p2p_backends_helpers.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
p2p_protocol_dsl.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
p2p_tracing.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
p2p_tracing_ctail_plugin.nim Moved eth-p2p to eth 2019-02-05 17:40:29 +02:00
peer_pool.nim Add bind ip and bind port for eth1 rlpx and discovery protocols (#485) 2022-03-15 18:08:15 +01:00
rlpx.nim Dedicated RLP reader for `DisconnectionReason` (#507) 2022-05-26 10:23:40 +01:00
rlpxcrypt.nim Support obsolete chunked RLPx wire protocol 2022-03-22 16:25:05 +00:00
sync.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
whispernodes.nim Add Status test nodes (#216) 2020-04-08 15:21:48 +02:00