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

Allow querying the gates in a Program in a single request to the backend. #4851

Closed
Tracked by #4426
TomAFrench opened this issue Apr 20, 2024 · 2 comments
Closed
Tracked by #4426
Assignees

Comments

@TomAFrench
Copy link
Member

We've taken on some tech debt here as part of the folding epic as we need to pass a separate program to the backend for each function within a program.

fn count_opcodes_and_gates_in_program(
backend: &Backend,
compiled_program: CompiledProgram,
package: &Package,
expression_width: ExpressionWidth,
) -> Result<ProgramInfo, CliError> {
let functions = compiled_program
.program
.functions
.into_par_iter()
.enumerate()
.map(|(i, function)| -> Result<_, BackendError> {
Ok(FunctionInfo {
name: compiled_program.names[i].clone(),
acir_opcodes: function.opcodes.len(),
// Unconstrained functions do not matter to a backend circuit count so we pass nothing here
circuit_size: backend.get_exact_circuit_size(&Program {
functions: vec![function],
unconstrained_functions: Vec::new(),
})?,
})
})
.collect::<Result<_, _>>()?;
Ok(ProgramInfo { name: package.name.to_string(), expression_width, functions })
}

@TomAFrench TomAFrench added this to Noir Apr 20, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Apr 20, 2024
@TomAFrench TomAFrench changed the title Allow querying the gates in a Program in a single request the the backend. Allow querying the gates in a Program in a single request to the backend. Apr 20, 2024
@vezenovm
Copy link
Contributor

vezenovm commented May 2, 2024

Closing in favor of #4962

@TomAFrench
Copy link
Member Author

TomAFrench commented May 2, 2024

I've opened AztecProtocol/aztec-packages#6168 to track the changes we need to make to bb. This is still something which we need to address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants