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(cli): Log and replay oracle transcript #7417

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
fd4ab05
Add artifact_cli
aakoshh Feb 12, 2025
1fb81c6
Turn artifact_cli into a library/binary combo
aakoshh Feb 13, 2025
9558618
Port fs from acvm_cli
aakoshh Feb 13, 2025
aac1b0f
Remove fs from acvm_cli
aakoshh Feb 13, 2025
10fbcb0
Parse inputs
aakoshh Feb 14, 2025
a568cce
Execute the circuit
aakoshh Feb 14, 2025
88ce449
Show diagnostic
aakoshh Feb 14, 2025
65ed320
Save the witness
aakoshh Feb 14, 2025
aea18c3
Add command docs
aakoshh Feb 14, 2025
7878c25
Merge branch 'master' into 7132-artifact-cli
aakoshh Feb 14, 2025
236e5f1
Reset indent size in Cargo.toml
aakoshh Feb 14, 2025
d36f2b9
Merge branch '7132-artifact-cli' of github.com:noir-lang/noir into 71…
aakoshh Feb 14, 2025
8bf7e61
Normalize paths
aakoshh Feb 14, 2025
ef090a4
Use Artifact in inspector print-acir
aakoshh Feb 14, 2025
7ceee2a
Filter by name in print-acir
aakoshh Feb 14, 2025
5f7c87d
Make inspector info work on Artifact
aakoshh Feb 14, 2025
98850a4
Use PathBuf in profiler
aakoshh Feb 14, 2025
2066359
Update profiler to use noir_artifact_cli::fs
aakoshh Feb 14, 2025
7d820ca
Update profiler to use noir_artifact_cli::fs
aakoshh Feb 14, 2025
1ae7d45
Use artifact_cli::fs in criterion benchmarks
aakoshh Feb 14, 2025
adc71a3
Use artifact_cli::fs in nargo
aakoshh Feb 14, 2025
ce6b763
Remove fs from nargo
aakoshh Feb 14, 2025
642b9b3
Merge branch '7381-use-artifact-fs' of github.com:noir-lang/noir into…
aakoshh Feb 14, 2025
cedb107
Return error if bincode serialization fails
aakoshh Feb 17, 2025
7317a63
Fully qualify call to exec
aakoshh Feb 17, 2025
8c707c2
Use CompiledProgram instead of Circuit
aakoshh Feb 17, 2025
ac3b5ea
Move execution methods into their own module
aakoshh Feb 17, 2025
e19c4b7
Call artifact_cli::execution from nargo
aakoshh Feb 17, 2025
c1ad32b
Use as_deref
aakoshh Feb 17, 2025
66bcf73
Create and run the ExecuteCommand as-is
aakoshh Feb 17, 2025
4ec10a9
Merge branch 'master' into 7132-artifact-cli
aakoshh Feb 17, 2025
6c00259
Merge branch '7132-artifact-cli' into 7381-use-artifact-fs
aakoshh Feb 17, 2025
0615070
Merge branch '7381-use-artifact-fs' into 7380-nargo-exec-fwd
aakoshh Feb 17, 2025
47c7ade
Move ACVM CLI witness functions back
aakoshh Feb 17, 2025
51b1bd7
Remove --oracle-file for now
aakoshh Feb 17, 2025
cff69fa
Add Format::from_ext
aakoshh Feb 17, 2025
98cfd77
Try to make read_inputs_from_file easier to read
aakoshh Feb 17, 2025
c18bb19
Rename to artifact_path
aakoshh Feb 17, 2025
9c2c3d4
Rename binary to noir-executor with no subcommand
aakoshh Feb 17, 2025
6f27ebf
Noir program with oracles
aakoshh Feb 18, 2025
543f6df
Support printing oracle transcript from test
aakoshh Feb 18, 2025
0afd653
Add example and capture oracle transcript
aakoshh Feb 18, 2025
4989921
Move logger to nargo lib
aakoshh Feb 18, 2025
87068a6
Rename to artifact_path
aakoshh Feb 18, 2025
d463395
Rename to Logging
aakoshh Feb 18, 2025
0dc7fef
Add TranscriptForeignCallExecutor
aakoshh Feb 18, 2025
7022c77
Rename script
aakoshh Feb 18, 2025
97abe75
Make --oracle-file public
aakoshh Feb 18, 2025
93a889b
Add the example to CI
aakoshh Feb 18, 2025
cb301b2
Build the noir-execute binary and use it in the script
aakoshh Feb 18, 2025
5f89660
.
TomAFrench Feb 18, 2025
85bdd85
.
TomAFrench Feb 18, 2025
817df4a
.
TomAFrench Feb 18, 2025
51f2e2d
Switch to bin/execute.rs
aakoshh Feb 18, 2025
780cde3
Merge branch '7132-artifact-cli' of github.com:noir-lang/noir into 71…
aakoshh Feb 18, 2025
8a30ce5
Merge branch 'master' into 7132-artifact-cli
aakoshh Feb 18, 2025
3429365
Merge branch '7132-artifact-cli' into 7381-use-artifact-fs
aakoshh Feb 18, 2025
4502655
Merge branch '7381-use-artifact-fs' into 7380-nargo-exec-fwd
aakoshh Feb 18, 2025
c5d993a
Comment about ordering
aakoshh Feb 18, 2025
a7b09c7
Merge remote-tracking branch 'origin/7380-nargo-exec-fwd' into 7379-e…
aakoshh Feb 18, 2025
48556ac
Merge branch 'master' into 7132-artifact-cli
aakoshh Feb 18, 2025
17bed50
Merge remote-tracking branch 'origin/7132-artifact-cli' into 7381-use…
aakoshh Feb 18, 2025
416b563
Merge remote-tracking branch 'origin/7381-use-artifact-fs' into 7380-…
aakoshh Feb 18, 2025
6c16f10
Merge remote-tracking branch 'origin/7380-nargo-exec-fwd' into 7379-e…
aakoshh Feb 18, 2025
474e366
Fix action name
aakoshh Feb 18, 2025
5535321
Use cd
aakoshh Feb 18, 2025
69e64bc
Rename logging to transcript
aakoshh Feb 18, 2025
ba3d6d6
Add `hash` to contract function artifacts
aakoshh Feb 19, 2025
0196e1a
Just use default empty names, the info command won't work on such con…
aakoshh Feb 19, 2025
40dc505
Merge branch '7381-use-artifact-fs' into 7380-nargo-exec-fwd
aakoshh Feb 19, 2025
14fa101
Add ContractFunctionArtifact::into_compiled_program
aakoshh Feb 19, 2025
6c519d0
Add hash? to NoirFunctionEntry
aakoshh Feb 19, 2025
f5592bc
Use string to serialize hash
aakoshh Feb 19, 2025
537b1d9
Fix the Wasm compiler to use deterministic file IDs
aakoshh Feb 19, 2025
c6ed3e0
Merge branch '7381-use-artifact-fs' into 7380-nargo-exec-fwd
aakoshh Feb 19, 2025
2b2e99c
Delete hash for contracts before comparison
aakoshh Feb 19, 2025
49ed538
Backwards compatible parsing of hash in noirc_artifacts
aakoshh Feb 19, 2025
4d61e75
Comments about why the hash doesn't match when there are dependencies
aakoshh Feb 19, 2025
9f5e8d6
Merge remote-tracking branch 'origin/master' into 7381-use-artifact-fs
aakoshh Feb 19, 2025
7f44036
Merge branch '7381-use-artifact-fs' into 7380-nargo-exec-fwd
aakoshh Feb 19, 2025
d078b44
Merge branch '7380-nargo-exec-fwd' into 7379-exec-oracle-transcript
aakoshh Feb 19, 2025
330a07e
Merge remote-tracking branch 'origin/master' into 7380-nargo-exec-fwd
aakoshh Feb 26, 2025
52fb48d
Merge branch '7380-nargo-exec-fwd' into 7379-exec-oracle-transcript
aakoshh Feb 26, 2025
9756837
Fix clippy
aakoshh Feb 26, 2025
3013b0e
Merge remote-tracking branch 'origin/master' into 7379-exec-oracle-tr…
aakoshh Feb 28, 2025
b232e85
Fix formatting
aakoshh Feb 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/download-noir-execute/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Download Nargo
description: Downloads the nargo binary from an artifact and adds it to the path

runs:
using: composite
steps:
- name: Download noir-execute binary
uses: actions/download-artifact@v4
with:
name: noir-execute
path: ./noir-execute

- name: Set noir-execute on PATH
shell: bash
run: |
noir_binary="${{ github.workspace }}/noir-execute/noir-execute"
chmod +x $noir_binary
echo "$(dirname $noir_binary)" >> $GITHUB_PATH
54 changes: 47 additions & 7 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,39 @@ jobs:
path: ./dist/*
retention-days: 3

build-noir-execute:
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: Checkout Noir repo
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/[email protected]

- uses: Swatinem/rust-cache@v2
with:
key: x86_64-unknown-linux-gnu
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}

- name: Build noir-execute
run: cargo build --package noir_artifact_cli --release

- name: Package artifacts
run: |
mkdir dist
cp ./target/release/noir-execute ./dist/noir-execute
7z a -ttar -so -an ./dist/* | 7z a -si ./noir-execute-x86_64-unknown-linux-gnu.tar.gz

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: noir-execute
path: ./dist/*
retention-days: 3

build-noirc-abi:
runs-on: ubuntu-22.04
timeout-minutes: 30
Expand Down Expand Up @@ -457,7 +490,7 @@ jobs:
test-examples:
name: Example scripts
runs-on: ubuntu-22.04
needs: [build-nargo]
needs: [build-nargo, build-noir-execute]
timeout-minutes: 30

steps:
Expand All @@ -477,6 +510,9 @@ jobs:
- name: Download nargo binary
uses: ./.github/actions/download-nargo

- name: Download noir-execute binary
uses: ./.github/actions/download-noir-execute

- name: Run `prove_and_verify`
working-directory: ./examples/prove_and_verify
run: ./test.sh
Expand All @@ -485,6 +521,10 @@ jobs:
working-directory: ./examples/codegen_verifier
run: ./test.sh

- name: Run `oracle_transcript`
working-directory: ./examples/oracle_transcript
run: ./test.sh

external-repo-checks:
needs: [build-nargo, critical-library-list]
runs-on: ubuntu-22.04
Expand All @@ -493,7 +533,7 @@ jobs:
fail-fast: false
matrix:
project: ${{ fromJson( needs.critical-library-list.outputs.libraries )}}

name: Check external repo - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
- name: Checkout
Expand Down Expand Up @@ -541,7 +581,7 @@ jobs:
fi
env:
NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true

- name: Check test time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/${{ steps.test_report.outputs.test_report_name }}.json)
Expand Down Expand Up @@ -576,7 +616,7 @@ jobs:
uses: actions/checkout@v4
with:
path: noir-repo

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -595,13 +635,13 @@ jobs:

- name: Run nargo compile
working-directory: ./test-repo/noir-projects/noir-contracts
run: nargo compile --inliner-aggressiveness 0
run: nargo compile --inliner-aggressiveness 0

upload_critical_library_report:
name: Upload critical library report
name: Upload critical library report
needs: [external-repo-checks]
# We want this job to run even if one variation of the matrix in `external-repo-checks` fails
if: always()
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
Expand Down
29 changes: 28 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"tooling/noirc_abi",
"tooling/noirc_abi_wasm",
"tooling/acvm_cli",
"tooling/artifact_cli",
"tooling/profiler",
"tooling/inspector",
# ACVM
Expand All @@ -40,6 +41,7 @@ members = [
default-members = [
"tooling/nargo_cli",
"tooling/acvm_cli",
"tooling/artifact_cli",
"tooling/profiler",
"tooling/inspector",
]
Expand Down Expand Up @@ -91,6 +93,7 @@ noir_debugger = { path = "tooling/debugger" }
noirc_abi = { path = "tooling/noirc_abi" }
noirc_artifacts = { path = "tooling/noirc_artifacts" }
noirc_artifacts_info = { path = "tooling/noirc_artifacts_info" }
noir_artifact_cli = { path = "tooling/artifact_cli" }

# Arkworks
ark-bn254 = { version = "^0.5.0", default-features = false, features = [
Expand Down
1 change: 1 addition & 0 deletions acvm-repo/acir/src/circuit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ impl<F: for<'a> Deserialize<'a>> Program<F> {
.map_err(|err| std::io::Error::new(std::io::ErrorKind::InvalidInput, err))
}

/// Deserialize bytecode.
pub fn deserialize_program(serialized_circuit: &[u8]) -> std::io::Result<Self> {
Program::read(serialized_circuit)
}
Expand Down
20 changes: 16 additions & 4 deletions acvm-repo/acir/src/native_types/witness_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ use super::WitnessMap;
enum SerializationError {
#[error(transparent)]
Deflate(#[from] std::io::Error),

#[error(transparent)]
BincodeError(#[from] bincode::Error),
}

#[derive(Debug, Error)]
Expand Down Expand Up @@ -57,26 +60,35 @@ impl<F> From<WitnessMap<F>> for WitnessStack<F> {
}
}

impl<F: Serialize> TryFrom<WitnessStack<F>> for Vec<u8> {
impl<F: Serialize> TryFrom<&WitnessStack<F>> for Vec<u8> {
type Error = WitnessStackError;

fn try_from(val: WitnessStack<F>) -> Result<Self, Self::Error> {
let buf = bincode::serialize(&val).unwrap();
fn try_from(val: &WitnessStack<F>) -> Result<Self, Self::Error> {
let buf = bincode::serialize(val).map_err(|e| WitnessStackError(e.into()))?;
let mut deflater = GzEncoder::new(buf.as_slice(), Compression::best());
let mut buf_c = Vec::new();
deflater.read_to_end(&mut buf_c).map_err(|err| WitnessStackError(err.into()))?;
Ok(buf_c)
}
}

impl<F: Serialize> TryFrom<WitnessStack<F>> for Vec<u8> {
type Error = WitnessStackError;

fn try_from(val: WitnessStack<F>) -> Result<Self, Self::Error> {
Self::try_from(&val)
}
}

impl<F: for<'a> Deserialize<'a>> TryFrom<&[u8]> for WitnessStack<F> {
type Error = WitnessStackError;

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
let mut deflater = GzDecoder::new(bytes);
let mut buf_d = Vec::new();
deflater.read_to_end(&mut buf_d).map_err(|err| WitnessStackError(err.into()))?;
let witness_stack = bincode::deserialize(&buf_d).unwrap();
let witness_stack =
bincode::deserialize(&buf_d).map_err(|e| WitnessStackError(e.into()))?;
Ok(witness_stack)
}
}
1 change: 1 addition & 0 deletions compiler/noirc_errors/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ pub fn report_all<'files>(
}

impl FileDiagnostic {
/// Print the report; return true if it was an error.
pub fn report<'files>(
&self,
files: &'files impl Files<'files, FileId = fm::FileId>,
Expand Down
7 changes: 7 additions & 0 deletions examples/oracle_transcript/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "oracle_transcript"
type = "bin"
authors = [""]
compiler_version = ">=0.23.0"

[dependencies]
5 changes: 5 additions & 0 deletions examples/oracle_transcript/Oracle.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"call":{"function":"void_field","inputs":[]},"result":{"values":["000000000000000000000000000000000000000000000000000000000000000a"]}}
{"call":{"function":"void_field","inputs":[]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000014"]}}
{"call":{"function":"field_field","inputs":["0000000000000000000000000000000000000000000000000000000000000002"]},"result":{"values":["000000000000000000000000000000000000000000000000000000000000001e"]}}
{"call":{"function":"field_field","inputs":["0000000000000000000000000000000000000000000000000000000000000003"]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000028"]}}
{"call":{"function":"struct_field","inputs":["000000000000000000000000000000000000000000000000000000000000012c","0000000000000000000000000000000000000000000000000000000000000320",["000000000000000000000000000000000000000000000000000000000000000a","0000000000000000000000000000000000000000000000000000000000000014","000000000000000000000000000000000000000000000000000000000000001e","0000000000000000000000000000000000000000000000000000000000000028"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000064"]}}
20 changes: 20 additions & 0 deletions examples/oracle_transcript/Oracle.test.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{"call":{"function":"create_mock","inputs":[["0000000000000000000000000000000000000000000000000000000000000076","000000000000000000000000000000000000000000000000000000000000006f","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000064","000000000000000000000000000000000000000000000000000000000000005f","0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000000"]}}
{"call":{"function":"set_mock_returns","inputs":["0000000000000000000000000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000000000000000000a"]},"result":{"values":[]}}
{"call":{"function":"set_mock_times","inputs":["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001"]},"result":{"values":[]}}
{"call":{"function":"create_mock","inputs":[["0000000000000000000000000000000000000000000000000000000000000076","000000000000000000000000000000000000000000000000000000000000006f","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000064","000000000000000000000000000000000000000000000000000000000000005f","0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000001"]}}
{"call":{"function":"set_mock_returns","inputs":["0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000014"]},"result":{"values":[]}}
{"call":{"function":"set_mock_times","inputs":["0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000001"]},"result":{"values":[]}}
{"call":{"function":"create_mock","inputs":[["0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064","000000000000000000000000000000000000000000000000000000000000005f","0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000002"]}}
{"call":{"function":"set_mock_params","inputs":["0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000002"]},"result":{"values":[]}}
{"call":{"function":"set_mock_returns","inputs":["0000000000000000000000000000000000000000000000000000000000000002","000000000000000000000000000000000000000000000000000000000000001e"]},"result":{"values":[]}}
{"call":{"function":"create_mock","inputs":[["0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064","000000000000000000000000000000000000000000000000000000000000005f","0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000003"]}}
{"call":{"function":"set_mock_params","inputs":["0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000003"]},"result":{"values":[]}}
{"call":{"function":"set_mock_returns","inputs":["0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000028"]},"result":{"values":[]}}
{"call":{"function":"create_mock","inputs":[["0000000000000000000000000000000000000000000000000000000000000073","0000000000000000000000000000000000000000000000000000000000000074","0000000000000000000000000000000000000000000000000000000000000072","0000000000000000000000000000000000000000000000000000000000000075","0000000000000000000000000000000000000000000000000000000000000063","0000000000000000000000000000000000000000000000000000000000000074","000000000000000000000000000000000000000000000000000000000000005f","0000000000000000000000000000000000000000000000000000000000000066","0000000000000000000000000000000000000000000000000000000000000069","0000000000000000000000000000000000000000000000000000000000000065","000000000000000000000000000000000000000000000000000000000000006c","0000000000000000000000000000000000000000000000000000000000000064"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000004"]}}
{"call":{"function":"set_mock_params","inputs":["0000000000000000000000000000000000000000000000000000000000000004","000000000000000000000000000000000000000000000000000000000000012c","0000000000000000000000000000000000000000000000000000000000000320",["000000000000000000000000000000000000000000000000000000000000000a","0000000000000000000000000000000000000000000000000000000000000014","000000000000000000000000000000000000000000000000000000000000001e","0000000000000000000000000000000000000000000000000000000000000028"]]},"result":{"values":[]}}
{"call":{"function":"set_mock_returns","inputs":["0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000064"]},"result":{"values":[]}}
{"call":{"function":"void_field","inputs":[]},"result":{"values":["000000000000000000000000000000000000000000000000000000000000000a"]}}
{"call":{"function":"void_field","inputs":[]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000014"]}}
{"call":{"function":"field_field","inputs":["0000000000000000000000000000000000000000000000000000000000000002"]},"result":{"values":["000000000000000000000000000000000000000000000000000000000000001e"]}}
{"call":{"function":"field_field","inputs":["0000000000000000000000000000000000000000000000000000000000000003"]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000028"]}}
{"call":{"function":"struct_field","inputs":["000000000000000000000000000000000000000000000000000000000000012c","0000000000000000000000000000000000000000000000000000000000000320",["000000000000000000000000000000000000000000000000000000000000000a","0000000000000000000000000000000000000000000000000000000000000014","000000000000000000000000000000000000000000000000000000000000001e","0000000000000000000000000000000000000000000000000000000000000028"]]},"result":{"values":["0000000000000000000000000000000000000000000000000000000000000064"]}}
6 changes: 6 additions & 0 deletions examples/oracle_transcript/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[input]
x = 2
y = 3

return = 100
23 changes: 23 additions & 0 deletions examples/oracle_transcript/log_and_exec_transcript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -eu

dir=$(dirname $0)

# Execute the test to capture oracle calls.
NARGO_TEST_FOREIGN_CALL_LOG=$dir/Oracle.test.jsonl \
nargo --program-dir $dir test

# Get rid of the mock setup calls
cat $dir/Oracle.test.jsonl \
| jq --slurp -r -c '.[] | select(.call.function | contains("mock") | not)' \
> $dir/Oracle.jsonl

# Execute `main` with the Prover.toml and Oracle.jsonl files.
nargo execute --skip-underconstrained-check --oracle-file $dir/Oracle.jsonl

# Also execute through `noir-execute`
noir-execute \
--artifact-path $dir/target/oracle_transcript.json \
--oracle-file $dir/Oracle.jsonl \
--prover-file $dir/Prover.toml \
--output-dir $dir/target
Loading
Loading