koinos / koinos-p2p

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

Gossip Spam #135

Closed mvandeberg closed 3 years ago

mvandeberg commented 3 years ago

Because gossip is always enabled for all nodes, when a node is syncing, it will spam old blocks via gossip.

This then attempts to send old blocks to a current node, which inadvertently DOSes chain. My block producer was having problems getting RPC responses when a node was syncing.

A simple fix would be to have the block gossip check the block against the node's LIB and reject the block if it is newer than the LIB because we know the block will be rejected by chain, preventing the majority of failed block applications.

2021-06-24 09:51:20.244670 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: 0XUpFj9UR8Hn6CrLAt6l6ZwNKqOYubeL, within 1000ms
2021-06-24 09:51:22.248491 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: VVbmTLT20SPupAS1XxASH4sWMUb63X8M, within 2000ms
2021-06-24 09:51:26.251840 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: vrymGIifWeTwIWIzcsSwkSc17bC0NQkW, within 4000ms
2021-06-24 09:51:34.252052 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: MBi0na5yBZN0MzrzeuBtYWdg9XDQfMVQ, within 8000ms
2021-06-24 09:51:43.381043 (block_producer.Koinos) [block_producer.cpp:120] <info>: Produced block - Height: 17486, ID: "zQmPQs5L3Zdi1HswUhNh3rSTSzKxNCyPEMBPR1rvidxRz3x"
2021-06-24 09:51:44.382588 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: hIQQW0c0nFv76rwyiQ1ijWkh84xdfwpZ, within 1000ms
2021-06-24 09:51:46.386458 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: xXlXbQ5PWUMscQRxWQtbZAbS6RgYC4NC, within 2000ms
2021-06-24 09:51:50.388653 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: XbwpfxvMEoWZ4ixql5hqr569C6yCuenw, within 4000ms
2021-06-24 09:51:58.393596 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: M8b7SGsJIxKWGQoB7e403KTTBMsC5Fis, within 8000ms
2021-06-24 09:52:14.918616 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: JNjHkk4Sw5MsLGXIG1Bxj1Ea1ELHfcok, within 1000ms
2021-06-24 09:52:16.918970 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: hOEBKsCrsEPBrCsP1tMx00Wa9woU7vqK, within 2000ms
2021-06-24 09:52:20.923509 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: nF1WCT0M4acEOBAVNW237RLK0d78l9Vm, within 4000ms
2021-06-24 09:52:28.927691 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: 3FJi4E96RxnD5fmAnpTDbubYCuCk7O5B, within 8000ms
2021-06-24 09:52:44.932691 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: 3xucYyqNKKQ94rcoTOP84Um43lvf0VVF, within 16000ms
2021-06-24 09:53:08.155324 (block_producer.Koinos) [pow_producer.cpp:134] <info>: Received difficulty: 672525532919200882978053732410924661572670892979780271203968876149490
2021-06-24 09:53:08.155464 (block_producer.Koinos) [pow_producer.cpp:178] <info>: Block is stale, retrieving new head
2021-06-24 09:53:09.156970 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: fqHx3x8gM3HhnXK0r6t1eUdnABaQNeWm, within 1000ms
2021-06-24 09:53:11.157374 (block_producer.Koinos) [client.cpp:256] <warning>: No response to message with correlation ID: 11JdnKjqMJlKBNiihHFLgmMtS80Phjra, within 2000ms