-
Notifications
You must be signed in to change notification settings - Fork 245
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
Update CHT root automatically using GetHeaderProofs (Fixes #320) #476
Conversation
Thank you very much for such a valuable to us contribution! I'll try to review it asap but it might take a while. Please, be patient. |
You're welcome! Understood, no worries. Look forward to your review. :) |
Added 2 minor commits |
@pacamara looks interesting! Two moments from brief diff overview:
Regarding |
@divan Thanks for the review! I'll do (2) now, and reach out to you folks on Riot re. best way to proceed with (1). |
Hi @pacamara! First off, thanks - you rock. Second, I think that you should submit this as a PR to go-ethereum and let them review it as that is better for almost everyone. However, it will mean that the bounty does not automatically get paid and your GH name won't show up in the hunters list. This is unfortunate and something we are currently working on. As a solution, we can manually pay you half the bounty after any other team reviews, and then the other half once you convince the go-ethereum guys to merge the fix. Sound good? |
@andytudhope Thanks man! Your suggested split on the bounty is fine by me. I've already updated my SNT receiving address in openbounty. I'll get working on the go-ethereum PR now, and will update it with any changes from the review here as needed. See you on Riot :) |
Hi @andytudhope @divan @tiabc I've ported the changes to go-ethereum. The handling is quite different now, go-ethereum has "trusted checkpoints" which include both CHT and Bloom Trie roots. So it seemed better to use a cleaner approach and add a new request GetCheckpoint to LES. This PR is against my own fork's master for now so you can take a look before I submit it to go-ethereum: |
The relevant PR against upstream is now ethereum/go-ethereum#15673 |
Closing since the actual PR is opened against upstream. |
Fixes #320 : "Devise how to update CHT automatically"
Superseded by ethereum/go-ethereum#15673
Retrieve the most recent CHT root from a peer by sending a single GetHeaderProofs message at startup.
A change has been made to ChtRequest.Validate so that in this case where no ChtRoot is supplied in the ChtRequest, it's pulled out of the proof.
Tested and appears to work fine. As a sanity check, after the CHT root has been set, an old header is retrieved and verified.
Sample output: