Skip to content

Commit

Permalink
Second run of review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Dec 10, 2024
1 parent 09bbcc1 commit a3d42bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions yarn-project/circuit-types/src/simulation_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class SimulationError extends Error {
this.functionErrorStack.forEach(failingFunction => {
if (
failingFunction.contractAddress.equals(contractAddress) &&
failingFunction.functionSelector != null &&
!!failingFunction.functionSelector &&
failingFunction.functionSelector.equals(functionSelector)
) {
failingFunction.functionName = functionName;
Expand All @@ -176,7 +176,7 @@ export class SimulationError extends Error {
const stackLines: string[] = [
...functionCallStack.map(failingFunction => {
return `at ${failingFunction.contractName ?? failingFunction.contractAddress.toString()}.${
failingFunction.functionName ?? failingFunction.functionSelector?.toString() ?? ''
failingFunction.functionName ?? failingFunction.functionSelector?.toString() ?? 'unknown'
}`;
}),
...noirCallStack.map(errorLocation =>
Expand Down
1 change: 0 additions & 1 deletion yarn-project/simulator/src/avm/avm_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export class AvmContext {
* @param persistableState - Manages world state and accrued substate during execution - (caching, fetching, tracing)
* @param environment - Contains constant variables provided by the kernel
* @param machineState - VM state that is modified on an instruction-by-instruction basis
* @param fnName - The function name which initiated this context.
* @returns new AvmContext instance
*/
constructor(
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/simulator/src/avm/avm_simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class AvmSimulator {
context.machineState.gasLeft.l2Gas <= MAX_L2_GAS_PER_ENQUEUED_CALL,
`Cannot allocate more than ${MAX_L2_GAS_PER_ENQUEUED_CALL} to the AVM for execution of an enqueued call`,
);
this.log = createLogger(`aztec:avm_simulator:core(calldata[0]: ${context.environment.calldata[0]})`);
this.log = createLogger(`simulator:avm(calldata[0]: ${context.environment.calldata[0]})`);
// TODO(palla/log): Should tallies be printed on debug, or only on trace?
if (this.log.isLevelEnabled('debug')) {
this.tallyPrintFunction = this.printOpcodeTallies;
Expand All @@ -63,7 +63,7 @@ export class AvmSimulator {
public static async build(context: AvmContext): Promise<AvmSimulator> {
const simulator = new AvmSimulator(context);
const fnName = await context.persistableState.getPublicFunctionDebugName(context.environment);
simulator.log = createLogger(`aztec:avm_simulator:core(f:${fnName})`);
simulator.log = createLogger(`simulator:avm(f:${fnName})`);

return simulator;
}
Expand Down

0 comments on commit a3d42bc

Please sign in to comment.