ethereumjs / ethereumjs-devp2p

Project is in active development and has been moved to the EthereumJS VM monorepo.
https://github.com/ethereumjs/ethereumjs-vm/tree/master/packages/devp2p
141 stars 62 forks source link

More logger improvements #75

Closed holgerd77 closed 4 years ago

holgerd77 commented 4 years ago

Some more logger improvements:

  1. Added number of peers to refillConnections() debug message
  2. Replaced try/catch logic for EIP-8 auth check to avoid side-effects and get rid of misleading wrong-ecies-header debug output
  3. Moved debug output in BanList.add() after the set operation to get the correct size output
  4. Added debug message for DISCONNECT reason from peer (this was always some constant re-debug reason, and at the end it's mostly TOO_MANY_PEERS)

Number 2. gets rid of these constant errors which always caused irritation and triggers some unnecessary debugging:

  devp2p:rlpx:peer Received body 191.234.162.198:30303 01c104 +1ms
  devp2p:rlpx:peer Received DISCONNECT (message code: 1 - 0 = 1) 191.234.162.198:30303 +0ms
  devp2p:rlpx refill connections.. queue size: 0, peers: 3, open slots: 22 +1ms
  devp2p:rlpx:peer [ERROR]  wrong ecies header (possible cause: EIP8 upgrade): 01 / 04 +142ms
  devp2p:rlpx:peer Received ack (EIP8) from 18.138.108.67:30303 +4ms
  devp2p:rlpx:peer Send HELLO to 18.138.108.67:30303 +0ms
  devp2p:rlpx:peer Received header 18.138.108.67:30303 +2ms
  devp2p:rlpx:peer Received body 18.138.108.67:30303 01c104 +1ms
  devp2p:rlpx:peer Received DISCONNECT (message code: 1 - 0 = 1) 18.138.108.67:30303 +0ms
  devp2p:rlpx refill connections.. queue size: 0, peers: 2, open slots: 23 +1ms
  devp2p:rlpx:peer [ERROR]  wrong ecies header (possible cause: EIP8 upgrade): 01 / 04 +0ms
  devp2p:rlpx:peer Received ack (EIP8) from 52.187.207.27:30303 +7ms
  devp2p:rlpx:peer Received header 52.187.207.27:30303 +0ms
  devp2p:rlpx:peer Send HELLO to 52.187.207.27:30303 +2ms

Gave this a final test run in the client.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.2%) to 87.329% when pulling 58b8211bf0eb881e8d28bdf8c0856adcbee444c7 on logger-improvements into c8cdb447517858eb464468b285236c8917929c7c on master.