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

Bump plonky2 (serialization fix) #729

Merged
merged 8 commits into from
Oct 17, 2024
Merged

Bump plonky2 (serialization fix) #729

merged 8 commits into from
Oct 17, 2024

Conversation

Nashtare
Copy link
Collaborator

@Nashtare Nashtare commented Oct 16, 2024

We are currently having serialization issues due to the addition of DummyProofGenerator on the RootCircuitData, which is causing the prover_state to not be deserializable properly, ruining caching mechanism with persistence mode activated.

This is currently pinned to 07c20447bfcdada6bd479bd8a13af26082923520 on the plonky2 side (i.e. related branch fix), and updates the codebase with all changes related to plonky2 bump, in addition to fixing the range in two_to_one test and adding a serialization check consistency on the empty_tables test.

sibling PR: 0xPolygonZero/plonky2#1634

@Nashtare Nashtare added the bug Something isn't working label Oct 16, 2024
@Nashtare Nashtare self-assigned this Oct 16, 2024
@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Oct 16, 2024
Comment on lines +437 to +439
fn check_num_ctls() {
assert_eq!(all_cross_table_lookups::<F>().len(), NUM_CTLS);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't add such check for the MEMORY_CTL_IDX constant, because the looked_table field within CrossTableLookup is crate-private, though I could change it in the sibling PR if wanted.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can add a comment before ctl_memory(), to indicate we cannot change its position.

@Nashtare Nashtare added this to the Testing and Validation milestone Oct 16, 2024
evm_arithmetization/tests/empty_tables.rs Show resolved Hide resolved
@@ -249,12 +250,16 @@ pub mod testing {

// Extra sums to add to the looked last value.
// Only necessary for the Memory values.
let mut extra_looking_sums = vec![vec![F::ZERO; config.num_challenges]; NUM_TABLES];
let mut extra_looking_sums =
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can use let mut extra_looking_sums = HashMap::new()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This causes the proving jobs to fail (two artifacts blocks) if I don't initialize each individual sum with vec![F::ZERO; config.num_challenges]

Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, the unit tests passed, so why did the proving blocks job fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is only 1 recursive unit test (apart from consistency of constraints) that is ran in CI, it's empty_tables that is not complete (my comment on one of your PRs actually) as it only generates segment proofs.
Initializing the HashMap without specifying routable wires causes the recursive verification (not native one) to fail, which is done at the layer above (segment_aggregation). You can test it on two_to_one test for instance (though it is ignored in the CI).

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why it fails at the layer above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because during verification of the CTLs, we add the extra sum values, which default to virtual wires if we don't specify builder.zero(). These are not part of the permutation argument and hence can have any value.

Copy link
Contributor

@LindaGuiga LindaGuiga left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Nashtare Nashtare merged commit 4f70195 into develop Oct 17, 2024
21 checks passed
@Nashtare Nashtare deleted the bump-plonky2 branch October 17, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants