Skip to content

Commit

Permalink
fix: Export brillig names in contract functions (#8212)
Browse files Browse the repository at this point in the history
We need to export brillig_names in contract functions (same as regular
artifacts) so they are convertible back to a regular noir artifact for
profiling purposes.
  • Loading branch information
sirasistant authored Aug 27, 2024
1 parent 708e4e5 commit 4745741
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function main() {
debug_symbols: func.debug_symbols,
file_map: contractArtifact.file_map,
names: ["main"],
brillig_names: func.brillig_names,
};

const outputDir = path.dirname(contractArtifactPath);
Expand Down
3 changes: 3 additions & 0 deletions noir/noir-repo/compiler/noirc_driver/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ pub struct ContractFunction {

/// Names of the functions in the program. These are used for more informative debugging and benchmarking.
pub names: Vec<String>,

/// Names of the unconstrained functions in the program.
pub brillig_names: Vec<String>,
}
1 change: 1 addition & 0 deletions noir/noir-repo/compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ fn compile_contract_inner(
debug: function.debug,
is_unconstrained: modifiers.is_unconstrained,
names: function.names,
brillig_names: function.brillig_names,
});
}

Expand Down
3 changes: 3 additions & 0 deletions noir/noir-repo/tooling/noirc_artifacts/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub struct ContractFunctionArtifact {
deserialize_with = "ProgramDebugInfo::deserialize_compressed_base64_json"
)]
pub debug_symbols: ProgramDebugInfo,

pub brillig_names: Vec<String>,
}

impl From<ContractFunction> for ContractFunctionArtifact {
Expand All @@ -82,6 +84,7 @@ impl From<ContractFunction> for ContractFunctionArtifact {
custom_attributes: func.custom_attributes,
abi: func.abi,
bytecode: func.bytecode,
brillig_names: func.brillig_names,
debug_symbols: ProgramDebugInfo { debug_infos: func.debug },
}
}
Expand Down

0 comments on commit 4745741

Please sign in to comment.