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

feat: verify shard transitions + fixes #482

Merged
merged 17 commits into from
Apr 17, 2024
Merged

feat: verify shard transitions + fixes #482

merged 17 commits into from
Apr 17, 2024

Conversation

ctian1
Copy link
Member

@ctian1 ctian1 commented Apr 5, 2024

  • verify shard transitions in core verifier
    • verify now returns (PublicValuesDigest, DeferredDigest)
  • add pc_start to VerifyingKey
  • fix ProgramMemoryChip so it can't be ignored in favor of normal MemoryInit

@ctian1 ctian1 changed the base branch from main to kevjue/shard_transition_public_values April 5, 2024 23:13
@ctian1 ctian1 force-pushed the chris/full-verify branch 2 times, most recently from a0f2549 to 2165e2a Compare April 6, 2024 23:58
Base automatically changed from kevjue/shard_transition_public_values to main April 8, 2024 21:29
@ctian1 ctian1 closed this Apr 16, 2024
@ctian1 ctian1 reopened this Apr 16, 2024
@ctian1 ctian1 force-pushed the chris/full-verify branch from 2165e2a to 288b940 Compare April 16, 2024 18:23
@ctian1 ctian1 marked this pull request as ready for review April 17, 2024 00:12
@ctian1 ctian1 changed the title wip: verify shard transitions feat: verify shard transitions Apr 17, 2024
@ctian1 ctian1 changed the title feat: verify shard transitions feat: verify shard transitions + fixes Apr 17, 2024
@@ -527,6 +527,7 @@ mod tests {
// reduce steps to prove that the witnessed challenger was correct.
let mut sp1_challenger = sp1_machine.config().challenger();
sp1_challenger.observe(vk.commit);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just have a method that gets all the vkey fields? this feels a bit unsafe?

Copy link
Contributor

Choose a reason for hiding this comment

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

also I feel lke you have to do this everywhere where you observe all the fields and manually add it. what about sp1_challenger.observe(vk.as_elements()) or something liek that

@@ -279,13 +291,97 @@ impl<SC: StarkGenericConfig, A: MachineAir<Val<SC>>> MachineStark<SC, A> {

// Verify the segment proofs.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "Verify the shard proofs"

));
}
// Digests and exit code should be the same in all shards.
if public_values.committed_value_digest
Copy link
Contributor

Choose a reason for hiding this comment

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

wait I feel like don't we just need to check all this stuff in the last shard? or is there an edge case because it could be one of the last 2 shards? either way it feels a bit weird to me that we have to check it in here? cc @tamirhemo as well

Copy link
Member Author

Choose a reason for hiding this comment

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

The digests are committed with a syscall that does one word at a time so it has to be committed in multiple shards

@@ -574,17 +574,6 @@ impl CpuChip {
builder.index_word_array(&commit_digest, &ecall_columns.index_bitmap);

let digest_word = local.op_c_access.prev_value();
// Verify b and c do not change during commit syscall.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can we just delete this? Doesn't we need this?

Copy link
Member Author

@ctian1 ctian1 Apr 17, 2024

Choose a reason for hiding this comment

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

I think it's read cols so there's no point even checking it? Also we actually check it in other places in the same file as well lol

@ctian1 ctian1 merged commit f81fac0 into main Apr 17, 2024
4 checks passed
@ctian1 ctian1 deleted the chris/full-verify branch April 17, 2024 22:22
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