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 PCS verifier #173

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Add PCS verifier #173

merged 1 commit into from
Nov 18, 2024

Conversation

andrewmilson
Copy link
Contributor

@andrewmilson andrewmilson commented Nov 17, 2024

This change is Reviewable

Copy link
Contributor Author

andrewmilson commented Nov 17, 2024

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @andrewmilson)


stwo_cairo_verifier/src/pcs/verifier.cairo line 109 at r1 (raw file):

        if channel.trailing_zeros() < *self.config.pow_bits {
            return Result::Err(VerificationError::ProofOfWork);
        }

Can you change that to your new channel api?

Code quote:

        if channel.trailing_zeros() < *self.config.pow_bits {
            return Result::Err(VerificationError::ProofOfWork);
        }

stwo_cairo_verifier/src/pcs/verifier.cairo line 275 at r1 (raw file):

    pub proof_of_work: u64,
    pub fri_proof: FriProof,
}

Can we move this struct declaration to top of file?
Also, can you explain the difference between sampled_values, queried_values? (I don't recall)

Code quote:

#[derive(Drop)]
pub struct CommitmentSchemeProof {
    pub sampled_values: TreeArray<ColumnArray<Array<QM31>>>,
    pub decommitments: TreeArray<MerkleDecommitment<PoseidonMerkleHasher>>,
    pub queried_values: TreeArray<ColumnArray<Array<M31>>>,
    pub proof_of_work: u64,
    pub fri_proof: FriProof,
}

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @andrewmilson)


stwo_cairo_verifier/src/pcs/verifier.cairo line 61 at r1 (raw file):

    }

    // TODO(andrew): Introduce ColumnArray and TreeArray to make types less confusing.

You can remove this TODO, right?

Code quote:

// TODO(andrew): Introduce ColumnArray and TreeArray to make types less confusing.

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @andrewmilson)


stwo_cairo_verifier/src/pcs/verifier.cairo line 109 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Can you change that to your new channel api?

I see it is in the next pr

@andrewmilson andrewmilson force-pushed the 11-17-Add_PCS_verifier branch 2 times, most recently from 0ed2e38 to d353b98 Compare November 18, 2024 17:46
Copy link
Contributor Author

@andrewmilson andrewmilson left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)


stwo_cairo_verifier/src/pcs/verifier.cairo line 61 at r1 (raw file):

Previously, shaharsamocha7 wrote…

You can remove this TODO, right?

Done.


stwo_cairo_verifier/src/pcs/verifier.cairo line 109 at r1 (raw file):

Previously, shaharsamocha7 wrote…

I see it is in the next pr

Done.


stwo_cairo_verifier/src/pcs/verifier.cairo line 275 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Can we move this struct declaration to top of file?
Also, can you explain the difference between sampled_values, queried_values? (I don't recall)

Done. Added docs.

Copy link
Contributor

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 5 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @andrewmilson)

Base automatically changed from 11-17-Add_PoW_check_to_channel to main November 18, 2024 17:54
@andrewmilson andrewmilson merged commit 038b46c into main Nov 18, 2024
5 checks passed
@andrewmilson andrewmilson deleted the 11-17-Add_PCS_verifier branch November 18, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants