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

Trace to Prover Refactor #23

Merged
merged 8 commits into from Jun 5, 2023
Merged

Trace to Prover Refactor #23

merged 8 commits into from Jun 5, 2023

Conversation

MauroToscano
Copy link
Collaborator

@MauroToscano MauroToscano commented Jun 5, 2023

  • Add a function to create public inputs from registers and memory
  • Add documentation
  • Add a call to the Cairo VM Runner in integration to get memory and trace from it, remove the need to use intermediate files for it
  • Remove unused test files
  • Made layouts an Enum so they are easy to pick
  • Removed ignored tests that were not runned because of proving time
  • Removed call test, since it was tested indirectly by other programs

We need another refactor, and after optimization make a bigger test suite to be run in the CI

program.push(memory.get(&i).unwrap().clone());
}
// This should be auto calculated
let padded_trace_length = next_power_of_two(memory.len() as u64) as usize;
Copy link
Member

Choose a reason for hiding this comment

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

The stdlib already gives us a method to find the next power of 2;

Suggested change
let padded_trace_length = next_power_of_two(memory.len() as u64) as usize;
let padded_trace_length = memory.len().next_power_of_two();

/// Uses [cairo-rs](https://github.com/lambdaclass/cairo-rs/) project to run the program.
///
/// # Params
///
/// `entrypoint_function` - the name of the entrypoint function tu run. If `None` is provided, the default value is `main`.
/// `layout` - type of layout of Cairo.
/// `layout` - type of layout of Cairo. ``
Copy link
Member

Choose a reason for hiding this comment

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

The trailing quotes look strange here.

Copy link
Member

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

Very nice!

@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2023

Codecov Report

Merging #23 (5195b5b) into main (7feef38) will decrease coverage by 0.56%.
The diff coverage is 84.28%.

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   98.48%   97.92%   -0.56%     
==========================================
  Files          31       33       +2     
  Lines        4818     4872      +54     
==========================================
+ Hits         4745     4771      +26     
- Misses         73      101      +28     
Impacted Files Coverage Δ
src/cairo_run/cairo_layout.rs 38.46% <38.46%> (ø)
src/cairo_vm/cairo_mem.rs 93.61% <50.00%> (-2.98%) ⬇️
src/air/example/cairo.rs 99.42% <100.00%> (+0.01%) ⬆️
src/cairo_run/run.rs 97.12% <100.00%> (-0.03%) ⬇️
src/cairo_run/vec_writer.rs 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@pablodeymo pablodeymo left a comment

Choose a reason for hiding this comment

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

🎉

@entropidelic entropidelic added this pull request to the merge queue Jun 5, 2023
Merged via the queue into main with commit b58c913 Jun 5, 2023
3 of 5 checks passed
@entropidelic entropidelic deleted the trace_to_prover_refactor branch June 5, 2023 20:26
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.

None yet

5 participants