Receiving new blocks with same block number but different block hash

Hi, I use websocket to subscribe to the new block. In my application, I query the block information by the height of the new block, but sometimes I will get different block hashes, which will make my application miss the correct block, how should I solve to avoid such a problem, Please

Hi @hzxiao are you exclusively using Infura to get this data or using a self-hosted node as well?

Hi, I am using Infura to get this data

My application log:
diffirent block hash {“number”: 10271288, “recv_hash”: “0xec3f7bb7dd148b3651766acae698c7de271d2e57c3e6d8680f513da4d7e78913”, “query_hash”: “0x52c585cd6690972579e7bb739bdab038d730444f8e89ad3093e363cf901a894c”}

Thanks for the added info. Are you using an HTTP request or a WSS connection to get your new block information?

I am using WSS connection to get new block information

Perfect, our WSS connection was upgraded last year to specifically handle re-orgs. What you will need to do is monitor for a repeated block number. If this occurs you will know there has been a re-org and your application can react accordingly. Here’s some additional info on re-orgs in Ethereum, https://forum.openzeppelin.com/t/what-is-chain-reorganization/1559/2.

Let us know if this helps!