-
Notifications
You must be signed in to change notification settings - Fork 29
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
WIP: Create 0000-combine-mmr-roots.md #14
Conversation
Initial input from @tromp in keybase that I need to address:
|
99% certain this is primarily from our PoW validation where we look back over the past 60 (?) blocks. Are there any scenarios where we would need to maintain more than those 60 headers in memory? |
One use case for keeping the kernel MMR root separate - To prevent history being rewritten we need to validate the kernel MMR root against every block height. We can do this for kernels as they are never pruned - we can rewind the kernel MMR to reflect the state at any prior block. If we only stored a single aggregate MMR root (across all 3 MMRs) in each header we would be unable to verify kernel MMR roots for historical blocks. |
Correct, but the deserialization is only really avoidable if you keep the objects in memory.
It's very helpful for many of the node APIs that the wallet uses, for example grin-wallet check does a ton of header lookups.
I never really understood why we validate every kernel root in the past. History can't be rewritten without new PoW. Besides, if someone has the hash power to reorg the chain beyond horizon, we've got much bigger issues. |
Context and reasoning is explained here - mimblewimble/grin#1162
We need to verify -
|
Makes sense. Basically, if a miner had more than 50% hash power, they could mine 2000 blocks in private and completely rewrite the entire history, unlike in bitcoin, where they would need to remine every block to rewrite the entire history. I'll have to think this RFC through some more with this context in mind.
This doesn't make sense. You can't find 2 different sets of kernels that give the exact same root. If you could, your hash function would be broken. mimblewimble/grin#1162 is a valid issue, but unlike what you're suggesting here, it does affect PoW. To pull it off requires mining thousands of malicious blocks. |
Yeah - that was wrong. The issue is in terms of a long fork (beyond the fast sync horizon) rewriting history, not a node silently rewriting history... |
I think this RFC was a bad idea, based on the reasoning @antiochp linked to. Although in practice, I suspect the vulnerability pointed out in mimblewimble/grin#1162 would be too impractical to exploit, it's not a risk I'm willing to ignore. |
Still very much WIP, but submitting a PR to get initial thoughts/feedback.