nervosnetwork / ckb

The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.
https://www.nervos.org
MIT License
1.15k stars 228 forks source link

chore(test): Fix the unstable spec ForksContainSameUncle caused by block hash collision #4611

Closed chenyukang closed 3 weeks ago

chenyukang commented 3 weeks ago

What problem does this PR solve?

ForksContainSameUncle has the chance of 1/10 to fail in my local machine with error Uncles(DoubleInclusion), after debugging I found the uncle block hash is same with new block hash in node_b.mine(1).

This issue was fixed in https://github.com/nervosnetwork/ckb/commit/0dc63c2c0cc947b0f1916579a15a27f3d2054421

But it's reverted in the following changes, I believe it is unintentional.

What is changed and how it works?

Make sure the uncle block timestamp is different from the next block timestamp in main fork

What's Changed:

Related changes

Check List

Tests

Release note

None: Exclude this PR from the release note.