koinos / koinos-p2p

The p2p microservice orchestrates the distribution of blocks and transactions between peers.
MIT License
6 stars 4 forks source link

[BUG]: Error score reconnect threshold #243

Closed sgerbino closed 1 year ago

sgerbino commented 1 year ago

Is there an existing issue for this?

Current behavior

When the error threshold is met (100000) we disconnect, but when we decay just under the threshold we immediately reconnect.

Expected behavior

When the disconnect threshold is met (100000) the node should wait until the score has decayed to half (50000) before attempting to reconnect with the peer.

Steps to reproduce

No response

Environment

- OS: macOS

Anything else?

koinos-p2p-1                  | 2022-10-05 20:56:50.713503 (p2p.Koinos) [p2p/error_handler.go:97] <info>: Encountered peer error: QmeQ39HdgAiEiQGv97XAeQsL1HUWopKhSVCXupG8EmwqEi, peer RPC error, GetAncestorBlockID, peer RPC request timed out, GetAncestorBlockID, context deadline exceeded. Current error score: 100051
koinos-p2p-1                  | 2022-10-05 20:56:50.714766 (p2p.Koinos) [p2p/connection_manager.go:201] <info>: Disconnected from peer: /ip4/45.79.175.16/tcp/8888/p2p/QmeQ39HdgAiEiQGv97XAeQsL1HUWopKhSVCXupG8EmwqEi
koinos-p2p-1                  | 2022-10-05 20:56:55.728087 (p2p.Koinos) [p2p/error_handler.go:97] <info>: Encountered peer error: QmQTeLp4gE9xGoDheun2oshm1aHvqu4SE8hZBwejCtdfeg, peer RPC error, GetChainID, peer RPC request timed out, GetChainID, context deadline exceeded. Current error score: 72146
koinos-p2p-1                  | 2022-10-05 20:56:59.384737 (p2p.Koinos) [p2p/connection_manager.go:166] <info>: Connected to peer: /ip4/45.79.175.16/tcp/8888/p2p/QmeQ39HdgAiEiQGv97XAeQsL1HUWopKhSVCXupG8EmwqEi
koinos-p2p-1                  | 2022-10-05 20:57:00.244544 (p2p.Koinos) [node/node.go:352] <info>: My address:
koinos-p2p-1                  | 2022-10-05 20:57:00.245304 (p2p.Koinos) [node/node.go:353] <info>:  - /ip4/192.168.240.10/tcp/8888/p2p/QmVQWpMzmXynLCaeXax7UqDLXBaYpe6MATTZ27pkCqFKA6
koinos-p2p-1                  | 2022-10-05 20:57:00.245851 (p2p.Koinos) [node/node.go:354] <info>: Connected peers:
koinos-p2p-1                  | 2022-10-05 20:57:00.246666 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/144.91.72.52/tcp/8888/p2p/QmaePsPBY71RhTueGGLLbvRNnRBcC3B6ZXN66rpFgTpcMi
koinos-p2p-1                  | 2022-10-05 20:57:00.247203 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/194.13.80.81/tcp/8888/p2p/QmYat2DMoTRndEejADZCVostCiiDQME4kUxnrJLCV12kEN
koinos-p2p-1                  | 2022-10-05 20:57:00.247696 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/139.144.17.121/tcp/8888/p2p/QmcGiTpSm6YrmYo3rWoqrCPez2aJY4VdraBQsGsZKwFRuG
koinos-p2p-1                  | 2022-10-05 20:57:00.248190 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/185.130.47.36/tcp/8888/p2p/QmQTeLp4gE9xGoDheun2oshm1aHvqu4SE8hZBwejCtdfeg
koinos-p2p-1                  | 2022-10-05 20:57:00.248727 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/64.62.202.13/tcp/8888/p2p/QmXMqyby668eujPWSmy6w4WEjVhJgh89PqrbVDCiQTpqy6
koinos-p2p-1                  | 2022-10-05 20:57:00.249250 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/118.69.194.69/tcp/8888/p2p/QmQxdGDZ5GSjMhNK8R8AH2mqhxzZDK281ER6ATKmD6U9oV
koinos-p2p-1                  | 2022-10-05 20:57:00.249866 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/45.79.175.16/tcp/8888/p2p/QmeQ39HdgAiEiQGv97XAeQsL1HUWopKhSVCXupG8EmwqEi
koinos-p2p-1                  | 2022-10-05 20:57:00.250681 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/95.216.15.80/tcp/8888/p2p/QmS7eLZei46Y7CZZZWib49G3ojuRDr16GSQW6FS5xFYRZk
koinos-p2p-1                  | 2022-10-05 20:57:00.251161 (p2p.Koinos) [node/node.go:356] <info>:  - /ip4/144.76.219.133/tcp/8888/p2p/QmYGwR34dRHqaU3ctpB2zmXZ3PJcUSGbE7mB3WyxkcsigH