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

handle the HF invalid header scenario safely during chain init #2912

Closed
wants to merge 1 commit into from

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Jun 23, 2019

Replaces #2910.

[tbd - description of why this necessary with some context around the floonet HF]

This PR -

  • txhashset extension and header_extension how take a head (chain tip) and not a header
  • build the head MMR in parallel with the sync MMR (if we increase total work)
  • refactor, pull out setup_genesis_head
  • cleanup and simplify update_head and update_header_head
  • make setup_head more robust in terms of rewinding if we cannot read header from db
  • input_pos_to_rewind (to rewind "spent" UTXO pos) now takes a height and can operate over a set of input_pos without needing to read headers from the db
  • reader header hashes from the header (and sync) MMR so we can determine which headers we need to rewind without necessarily needing to read/deserialize them from the db

TODO -

  • clean up error! logging

This got too big and unwieldy again.
Related - #2918 (which should go a long way toward making this fix simpler to impl).

@antiochp
Copy link
Member Author

Closing - will replace with smaller PRs.

@antiochp antiochp closed this Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant