Open majecty opened 5 years ago
We may block the peer for a few hours.
Go Ethereum discussed a similar issue. https://github.com/ethereum/go-ethereum/issues/17935
I discussed this issue with @kseo before. @HoOngEe @joojis @Remagpie @sgkim126 What do you think about banning a peer that sent an invalid block for a hour? We may expose the ban time through configuration.
Bitcoin Satoshi client bans IP addresses that misbehave for 24 hours.(link)
I want to add the "Good first issue" label in this issue after deciding the policy.
@majecty I agree on the policy, but I'm not sure blocking one hour is easy to implement.
I think it's good enough. Are we going to handle only the peers that sent an invalid block? or are we going to handle other misbehaviors(e.g. too late response) too?
@sgkim126 I considered adding duration in the blacklist that is used in the network code. Since we already have the blacklist feature, I thought that adding duration in the list is not that hard.
@Remagpie I intend to ban only the peers that sent invalid blocks. We may ban other peers who do different misbehaviors later.
Okay. Let's try it.
@sgkim126 I remember you had some plan about "scoring" the peers for managing the connections. Is that still valid? and would it be related to this issue?
@Remagpie Yes, I still had, but it needs some more discussion yet. I think timed-blocking would work well for now.
A CodeChain node downloads child blocks of an invalid block. Since the parent block is invalid, verifying the child blocks always fails.