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

Investigate the call of function verify() in contractNipopow.sol #8

Closed
sdaveas opened this issue Dec 12, 2019 · 2 comments
Closed

Investigate the call of function verify() in contractNipopow.sol #8

sdaveas opened this issue Dec 12, 2019 · 2 comments
Labels
Solidity Label issues that are relevant to Solidity Todo Label things that are need to be implemented

Comments

@sdaveas
Copy link
Owner

sdaveas commented Dec 12, 2019

Check if everything is legit in NIPoPow::Verify().

See a32079a.
This is also related to #9
(That was a false alarm, see #8 (comment))

After aae3a12 the gas results for submitting an invalid contesting_contesting_proof() were the following
see #8 (comment)

Case gas with previous implementation gas with current implementation
Block of interest is a common block 6.079.835 2.279.992
Block of interest is only in big chain 6.079.643 2.279.800
@sdaveas sdaveas changed the title Investigate the call of vunction verify() in contractNipopow.sol Investigate the call of function verify() in contractNipopow.sol Dec 19, 2019
@sdaveas sdaveas added Solidity Label issues that are relevant to Solidity Todo Label things that are need to be implemented labels Dec 30, 2019
@sdaveas sdaveas added this to the NiPoPow Verifier milestone Dec 30, 2019
@sdaveas
Copy link
Owner Author

sdaveas commented Jan 4, 2020

verify() calls compare_proofs(Nipopow, bytes32[]) which returns the score of the proof.

Shouldn't this be able to determine the result of verify() directly under certain circumstances?
If the outcome of compare_proofs() is false because the score of existing proof is better than the score of contesting proof, shouldn't the verify() just return false and skip the

    find_ancestors(proof, proof.best_proof[0]);
    return predicate(proof, hash_header(block_of_interest));

part?

@sdaveas
Copy link
Owner Author

sdaveas commented Jan 8, 2020

There is no relation between #8 and #9.
The idea was that in case 1 of #9 a bug was found due to a retrieved result that was different than the expected result. But this is not the case.
The hypothesis of #9 misjudged the following valid scenario: a valid small proof of Ca shouldn't be contested successfully even by a valid proof of chain Cb if Ca is a subset of Cb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solidity Label issues that are relevant to Solidity Todo Label things that are need to be implemented
Projects
None yet
Development

No branches or pull requests

1 participant