Skip to content

More robust publics implementation for WriteOnceMemory #2600

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

Open
wants to merge 3 commits into
base: update-public-examples
Choose a base branch
from

Conversation

georgwiese
Copy link
Collaborator

A suggestion to #2572.

The previous implementation assumed that only the instance of WriteOnceMemory has publics. Here, we detect the WriteOnceMemoryWith8Publics case more explicitly.

@georgwiese georgwiese marked this pull request as ready for review March 27, 2025 17:40
@georgwiese georgwiese requested review from qwang98 and Copilot March 27, 2025 17:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the robustness of the publics handling in the WriteOnceMemory machine by explicitly detecting the WriteOnceMemoryWith8Publics case. Key changes include:

  • Adding new fields (exposes_8_publics and namespace) to drive the special publics behavior.
  • Refactoring witness value retrieval into a new get_witness_values() method.
  • Updating the take_public_values() logic to handle the WriteOnceMemoryWith8Publics case.

.iter()
.enumerate()
.map(|(value_index, poly)| {
let column = self.fixed_data.witness_cols[poly]
Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

The get_witness_values() method references 'self.fixed_data', but 'fixed_data' is no longer stored in the WriteOnceMemory struct. Consider either adding 'fixed_data' as a field in the struct or passing it as an argument to get_witness_values() to avoid a potential compile error.

Suggested change
let column = self.fixed_data.witness_cols[poly]
let column = fixed_data.witness_cols[poly]

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@leonardoalt
Copy link
Member

@georgwiese do we still want to merge this?

@georgwiese
Copy link
Collaborator Author

Depends on whether we merge #2572

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