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

Feat/debug tests functions #8

Draft
wants to merge 27 commits into
base: feat/5208-debug-tests-2025
Choose a base branch
from

Conversation

anaPerezGhiglia
Copy link
Member

@anaPerezGhiglia anaPerezGhiglia commented Feb 26, 2025

Description

Expand debugger funcionality to support debugging test functions and configure an external oracle-resolver url.
This will allow to debug contract tests that hit the TXE

Problem*

Resolves noir-lang#5208

Summary*

  • Add the possibility to compile and debug a test function
    • this involved knowing how to compile a specific function that's not the main function
    • it also implied analyzing the execution result (once the debugger finishes) to analyze wether the execution matches the test expectations (some test may be marked to should_fail)
  • Add the possibility of configuring an external oracle resolver when debugging
  • Move the execution of the debugger to a separate thread from REPL
    • this involved that the repl no longer has a context instance and that instead is spawining a new thread and communicating with the debugger through two channels (one for sending commands and the other for receiving the response)

Additional Context

  • instrument contract functions in addition to top-level functions
  • extract execution_error_from function into nargo/errors and use it in debugger and nargo/ops/execute
  • expose test functions to be able to use it from debugger
  • add --test-name and --oracle-resolver arg options to debugger_cmd

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link

Thank you for your contribution to the Noir language.

Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch.

Thanks for your understanding.

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.

1 participant