Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwinter: after a block rewind, syncing to the correct branch can fail, and reindex is required #3100

Closed
bitcartel opened this issue Mar 19, 2018 · 1 comment
Labels
C-bug Category: This is a bug M-has-pr To-be-removed (GitHub has linked:pr filter)
Milestone

Comments

@bitcartel
Copy link
Contributor

We found an issue in a recent test of activating Overwinter on Testnet, specifically with block rewinding.

Background:

Testnet

  • Sprout nodes (running 1.0.15)
  • Overwinter nodes (running custom 1.0.15 called 'Federer' set to activate at block 200000 instead of the scheduled 207500)

Test 1 (Success)
Both branches of the fork mine blocks successfully. We stop a Sprout
node and launch a Federer node using the datadir of the Sprout node. As
expected we see a message asking us to perform a reindex since the
Sprout chain is >= 100 blocks ahead of the fork point.

Test 2 (Failed)
Both branches of the fork mine blocks successfully but we stop the
Federer mining early (it was around 25 blocks). We stop and launch a
Sprout node using the datadir of the Federer node. It rewinds to block
199999 but cannot sync with the Sprout chain, because block 200000 was
previously invalidated by the Federer node and assigned the state:
BLOCK_FAILED_VALID | BLOCK_VALID_TREE.

We believe this issue is because we have not changed the block header
format from Sprout and the Overwinter network upgrade. So peers
advertising the same protocol version stay connected and send block
headers to each other which validate fine, but the blocks are not valid
as they use different transaction formats.

See here for more info:

https://chat.zcashcommunity.com/channel/zcash-dev?msg=29QaGdz9nSFZsmDQy

https://chat.zcashcommunity.com/channel/zcash-dev?msg=z4ph6M5GgJkdea4FC

@bitcartel bitcartel added this to the v1.1.0 milestone Mar 19, 2018
@bitcartel bitcartel added the C-bug Category: This is a bug label Mar 19, 2018
@bitcartel bitcartel added this to Work Queue in Network Upgrade 0 via automation Mar 19, 2018
@str4d str4d added the M-has-pr To-be-removed (GitHub has linked:pr filter) label Apr 3, 2018
@str4d
Copy link
Contributor

str4d commented Apr 3, 2018

This is now closed by #3132.

zkbot added a commit that referenced this issue Apr 3, 2018
When rewinding, remove insufficiently-validated blocks

If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).

Closes #3100.
Network Upgrade 0 automation moved this from Work Queue to Complete Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug M-has-pr To-be-removed (GitHub has linked:pr filter)
Projects
No open projects
Network Upgrade 0
  
Complete
Development

No branches or pull requests

2 participants