-
Notifications
You must be signed in to change notification settings - Fork 32
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
Bitcoin header chain verification per network #1637
Bitcoin header chain verification per network #1637
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done
One thing I realized is that, we actually don't need total work. We just store it, and add to it, no checks whatsoever. Should we remove it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented all functionalities in a single function, did not seperate according to the network since we can decide it in compile time, see the pull request and the file. It would also be a good double check for me.
Due to our current code structure, it is hard and ugly for us to decide this on compile-time. Also, this makes it a bit more testable with the unit and integration tests, not limiting us to e2e tests where we compile each target accordingly and test. Hence, I tried to get away with one match statement in runtime and no other overhead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Description
Implements different header chain verification for each type of bitcoin networks: mainnet, testnet4, signet, regtest.
The only work remaining is to decide on the initial DA blocks for mainnet, testnet4, and signet.
Linked Issues
Testing
Describe how these changes were tested. If you've added new features, have you added unit tests?
Docs
Describe where this code is documented. If it changes a documented interface, have the docs been updated?