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

Unify MemBefore and MemAfer #84

Conversation

4l0n50
Copy link
Contributor

@4l0n50 4l0n50 commented Mar 5, 2024

MemBeforeStark and MemAfterStark are almost the same thing. The only difference is how they are connected to MemoryStark, using different CTL filters. This PR creates a single MemoryContinuationStark which is instantiated twice in AllStark.

//! It contains (addr, value) pairs. Note that non-padding addresses must be
//! unique.
use crate::memory::VALUE_LIMBS;

/// 1 if this is an actual final value, or 0 if it's a padding row.
/// 1 if and actual value or 0 if it's a padding row.
Copy link
Contributor

Choose a reason for hiding this comment

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

an?

@Nashtare Nashtare added this to the zk-continuations - Q1 2024 milestone Mar 5, 2024
@Nashtare Nashtare added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Mar 6, 2024
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!

pub(crate) fn generate_trace(
&self,
mem_before_values: &MemBeforeValues,
final_values: Vec<Vec<F>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like it can either be mem_before_values or final_values.

Suggested change
final_values: Vec<Vec<F>>,
propagated_values: Vec<Vec<F>>,

);
let mem_after_trace = timed!(
timing,
"generate mem_after trace",
all_stark
.mem_after_stark
.generate_trace(&final_values, timing)
.generate_trace(final_values.clone(), timing)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we now need to clone?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I just noticed there was a clone anyway, so nervemind my comment, sorry!

@LindaGuiga LindaGuiga merged commit a592594 into 0xPolygonZero:continuation_to_zkevm Mar 6, 2024
5 checks passed
@Nashtare Nashtare deleted the memory_continuation branch March 6, 2024 10:56
BGluth pushed a commit that referenced this pull request Jun 17, 2024
* fix: fix compilation with test_only feature

* ci: add job to test script with test_only feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants