nim-eth/eth
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
..
common EIP-4399 changes: random -> prevRandao 2022-02-27 11:40:15 +07:00
db move rocksdb to nimbus-eth1 (#460) 2022-04-04 13:46:57 +02:00
keyfile Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
net nat: getPublicRoutePrefSrcOrExternalIP() (#496) 2022-03-31 16:07:28 +02:00
p2p Dedicated RLP reader for `DisconnectionReason` (#507) 2022-05-26 10:23:40 +01:00
rlp Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
trie Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
utp Adjust uTP log levels to be more user focused (#502) 2022-04-12 21:11:01 +02:00
async_utils.nim awaitWithTimeout for Future[void] 2021-02-04 16:45:50 +02:00
bloom.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
common.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
keyfile.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
keys.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
p2p.nim Add bind ip and bind port for eth1 rlpx and discovery protocols (#485) 2022-03-15 18:08:15 +01:00
rlp.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
trie.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00