Skip to content

feat(acir-simulator): advanced debug formatting for noir + acir simulator#775

Merged
Maddiaa0 merged 8 commits into
masterfrom
db/format-noir-logging
Jun 8, 2023
Merged

feat(acir-simulator): advanced debug formatting for noir + acir simulator#775
Maddiaa0 merged 8 commits into
masterfrom
db/format-noir-logging

Conversation

@dbanks12

@dbanks12 dbanks12 commented Jun 8, 2023

Copy link
Copy Markdown
Contributor

Description

Can now do any of the following:

debug_log("My string of any length");
debug_log_field(my_field);
debug_log_format("My fancy string with arg0 {0}, arg1 {1}...", [arg0, arg1]);` 

Example in set.nr:

debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, notes.0.value, notes.1.value]);

outputs:

aztec:simulator:secret_execution get_2(slot:0x1e2b4bcfbbe8044a065e39d016cca65765cba0c47924f9622ee1e3b261908e10) =>
  aztec:simulator:secret_execution      0:0x1e2b4bcfbbe8044a065e39d016cca65765cba0c47924f9622ee1e3b261908e10
  aztec:simulator:secret_execution      1:0x00000000000000000000000000000000000000000000000000000000000003db!+13s

Note sometimes (even without these fancy changes, just using the old debug_log() that @Maddiaa0 implemented), the ACVM errors with: thrown: "solver opcode resolution error: cannot solve opcode: expression has too many unknowns x155"

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been merged or rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@dbanks12 dbanks12 changed the title Draft: feat(acir-simulator): advanced debug formatting for noir + acir simulator feat(acir-simulator): advanced debug formatting for noir + acir simulator Jun 8, 2023
@dbanks12 dbanks12 requested review from Maddiaa0 and sirasistant and removed request for sirasistant June 8, 2023 02:22
@dbanks12 dbanks12 marked this pull request as ready for review June 8, 2023 02:24
Comment thread yarn-project/noir-contracts/src/contracts/noir-aztec3/src/state_vars/set.nr Outdated
@Maddiaa0

Maddiaa0 commented Jun 8, 2023

Copy link
Copy Markdown
Member

This is hot

@Maddiaa0 Maddiaa0 merged commit 9196bdc into master Jun 8, 2023
@Maddiaa0 Maddiaa0 deleted the db/format-noir-logging branch June 8, 2023 14:58
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