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

Add proofsize check in pow verification #2805

Merged
merged 1 commit into from
May 5, 2019

Conversation

tromp
Copy link
Contributor

@tromp tromp commented May 5, 2019

Currently, the only way that solutions are enforced to have length 42 is by function Proof::read at https://github.com/mimblewimble/grin/blob/master/core/src/pow/types.rs#L394-L428
This is rather fragile, and could cause problems if proofs are constructed by other means than deserialization through Proof::read.
A more robust way to check it would be in the core PoW verification functions CuckarooContext::verify and CuckatooContext::verify, which is what this PR adds.
The change has been tested to sync the mainnet chain from scratch.

Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hashmap hashmap merged commit 4ad2ed4 into mimblewimble:master May 5, 2019
de1acr0ix pushed a commit to btccom/grin that referenced this pull request May 6, 2019
@antiochp antiochp added this to the 1.1.0 milestone Jun 5, 2019
@antiochp antiochp added the release notes To be included in release notes (of relevant milestone). label Jun 5, 2019
@antiochp antiochp changed the title add proofsize check in pow verification Add proofsize check in pow verification Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes To be included in release notes (of relevant milestone).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants