nearprotocol / stakewars

Stake Wars leaderboard and place to report issues
53 stars 242 forks source link

[TEST] Hard to sync new block due to many invalid block Header and DB Not Found Error #43

Closed marco-sundsk closed 4 years ago

marco-sundsk commented 4 years ago

Describe the bug or test When some nodes are running with old genesis file and old code, others are running with new genesis and new code, log will show many info about receive invalid block Header and .Error processing sync blocks due to DB Not Found Error.

Although it seems correct according to chain runtime logic, but it consumes nodes resource, let node confused about peer which should or should not to connect, and stucked at some height waiting downloading some block header.

My suggestion is,

How to Reproduce Steps to reproduce the behavior:

  1. As a genesis validator which use a new genesis file and new codes.

Expected behavior OR Outcome of test Node can only establish p2p connection with node which has same code and same genesis.

Specs (please complete the following information):

Additional context log shows: V/11 4/1/40 peers ⬇ 0.8kiB/s ⬆ 0.7kiB/s 0.00 bps 0 gas/s CPU: 0%, Mem: 304.1 MiB [2019-11-20T03:08:33Z ERROR near_client::client_actor] Error processing sync blocks: Old Block Cause: Unknown Backtrace: [2019-11-20T03:08:33Z WARN near_client::client_actor] Banning node for sending invalid block headers [2019-11-20T03:08:39Z INFO near_client::info] # 55752 Downloading headers 74% V/11 4/1/40 peers ⬇ 0.8kiB/s ⬆ 0.7kiB/s 0.00 bps 0 gas/s CPU: 1%, Mem: 304.1 MiB [2019-11-20T03:08:48Z ERROR near_client::client_actor] Error processing sync blocks: Old Block Cause: Unknown Backtrace: [2019-11-20T03:08:48Z WARN near_client::client_actor] Banning node for sending invalid block headers

Screenshots Optional If applicable, add screenshots to help explain your problem. bug3_1

bowenwang1996 commented 4 years ago

We do use genesis hash to distinguish between nodes. Two nodes with two different genesis hash cannot connect to each other. However, we do want to allow two different client with different code to talk to each other. For as long as neither of them is malicious, they should be able to communicate with each other.