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

L2: Differentiate require Errors in OnChainProposer Verification #1164

Open
fborello-lambda opened this issue Nov 13, 2024 · 2 comments
Open
Labels

Comments

@fborello-lambda
Copy link
Contributor

When performing a verify (sending/submitting the zkProof), we may encounter the error block not committed, even though the block has been committed and verified. If it was verified, it would also have been removed from the mapping, which would raise the block not committed requirement.

OnChainProposer.sol:

        require(
            blockCommitments[blockNumber].commitmentHash != bytes32(0),
            "OnChainProposer: block not committed"
        );
        require(
            blockNumber == lastVerifiedBlock + 1,
            "OnChainProposer: block already verified"
        );
@h3lio5
Copy link
Contributor

h3lio5 commented Nov 14, 2024

would rearranging those require statements help?
Because if we submit proof for a block that's already committed and verified and whose commitment was deleted, the require(blockNumber == lastVerifiedBlock + 1, ..) will prevent us saying you can't verify an already verified block.

@fborello-lambda
Copy link
Contributor Author

fborello-lambda commented Nov 14, 2024

would rearranging those require statements help? Because if we submit proof for a block that's already committed and verified and whose commitment was deleted, the require(blockNumber == lastVerifiedBlock + 1, ..) will prevent us saying you can't verify an already verified block.

Yes, you are right, the proposed solution was considered but it may not be sufficient.
A more robust solution will require some research and changes.
We are working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants