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

bug in rewindHeaderState triggered by EBBs #1690

Closed
nfrisby opened this issue Feb 24, 2020 · 2 comments · Fixed by #1691
Closed

bug in rewindHeaderState triggered by EBBs #1690

nfrisby opened this issue Feb 24, 2020 · 2 comments · Fixed by #1691
Assignees
Labels
bug Something isn't working consensus issues related to ouroboros-consensus
Milestone

Comments

@nfrisby
Copy link
Contributor

nfrisby commented Feb 24, 2020

https://github.com/input-output-hk/ouroboros-network/blob/599afc730af5f8d64accc6ab1c8d05bdb27ee7d8/ouroboros-consensus/src/Ouroboros/Consensus/HeaderValidation.hs#L200-L209

If p is an EBB with a proper block in the same slot, then the annTipPoint t > p is correct only half of the time: it will either correctly rewind the tips to the EBB or it will incorrectly also retain the proper block, depending on how the hashes happen to compare.

@nfrisby nfrisby added bug Something isn't working consensus issues related to ouroboros-consensus labels Feb 24, 2020
@edsko
Copy link
Contributor

edsko commented Feb 25, 2020

#@!%!@#!@%!@ EBBs @#!#@^#!@#!@%!@#u@$*&@#*@&!#!

I'm thinking maybe there is an easier solution here. Rewinding is only allowed to rewind to a point previously applied right? So perhaps we can just say

    rolledBack :: AnnTip blk -> Bool
    rolledBack t = annTipPoint  t /= p

instead? We are dropping from the right after all. @nfrisby , @mrBliss , what do you think?

@mrBliss mrBliss added this to the S7 2020-02-27 milestone Feb 25, 2020
@mrBliss
Copy link
Contributor

mrBliss commented Feb 25, 2020

I like Edsko's proposed fix, it's simple.

@iohk-bors iohk-bors bot closed this as completed in 3d2f492 Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working consensus issues related to ouroboros-consensus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants