Skip to content

Commit

Permalink
Merge branch 'master' into tf/remove-redundant-abi-validation
Browse files Browse the repository at this point in the history
* master:
  chore(noir_js)!: Rename inner and outer proof methods (#2845)
  chore: remove unnecessary `AcirValue`s (#2823)
  fix: Conditionally run the "Create or Update PR" step in acir artifacts rebuild workflow (#2849)
  fix: lack of cjs package version (#2848)
  chore: delete unnecessary nix files (#2840)
  chore!: `generateWitness` now returns a serialized witness file (#2842)
  chore: fix `acvm_js` linting and tests (#2834)
  • Loading branch information
TomAFrench committed Sep 26, 2023
2 parents c0a915e + 71dbbb8 commit 12faf30
Show file tree
Hide file tree
Showing 22 changed files with 230 additions and 554 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/acvm-test-acvm-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,9 @@ jobs:

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm-repo/acvm_js

- name: Run node tests
working-directory: ./acvm-repo/acvm_js
run: |
yarn
yarn test
run: yarn workspace @noir-lang/acvm_js test

test-acvm_js-browser:
needs: [build-acvm-js-package]
Expand All @@ -81,17 +76,12 @@ jobs:

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm-repo/acvm_js

- name: Install playwright deps
working-directory: ./acvm-repo/acvm_js
run: |
npx playwright install
npx playwright install-deps
- name: Run browser tests
working-directory: ./acvm-repo/acvm_js
run: |
yarn
yarn test:browser
run: yarn workspace @noir-lang/acvm_js test:browser
11 changes: 7 additions & 4 deletions .github/workflows/auto-pr-rebuild-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ jobs:
run: |
chmod +x ./rebuild.sh
./rebuild.sh
- name: Discard changes in nargo directory
run: git restore --source=HEAD --staged --worktree -- nargo/

- name: Check for changes in acir_artifacts directory
id: check_changes
run: |
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true"
- name: Create or Update PR
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.NOIR_REPO_TOKEN }}
Expand Down
20 changes: 0 additions & 20 deletions acvm-repo/.envrc

This file was deleted.

1 change: 0 additions & 1 deletion acvm-repo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
# Cargo.lock
result
outputs/
.direnv
18 changes: 1 addition & 17 deletions acvm-repo/acvm_js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
rules: {
"comma-spacing": ["error", { before: false, after: true }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"prettier/prettier": "error",
},
extends: ["../../.eslintrc.js"],
};
22 changes: 11 additions & 11 deletions acvm-repo/acvm_js/test/browser/execute_circuit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ it("successfully executes circuit and extracts return value", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

// Solved witness should be consistent with initial witness
Expand All @@ -50,7 +50,7 @@ it("successfully processes simple brillig foreign call opcodes", async () => {
let observedInputs: string[][] = [];
const foreignCallHandler: ForeignCallHandler = async (
name: string,
inputs: string[][]
inputs: string[][],
) => {
// Throwing inside the oracle callback causes a timeout so we log the observed values
// and defer the check against expected values until after the execution is complete.
Expand All @@ -63,7 +63,7 @@ it("successfully processes simple brillig foreign call opcodes", async () => {
const solved_witness: WitnessMap = await executeCircuit(
bytecode,
initialWitnessMap,
foreignCallHandler
foreignCallHandler,
);

// Check that expected values were passed to oracle callback.
Expand All @@ -89,7 +89,7 @@ it("successfully processes complex brillig foreign call opcodes", async () => {
let observedInputs: string[][] = [];
const foreignCallHandler: ForeignCallHandler = async (
name: string,
inputs: string[][]
inputs: string[][],
) => {
// Throwing inside the oracle callback causes a timeout so we log the observed values
// and defer the check against expected values until after the execution is complete.
Expand All @@ -102,7 +102,7 @@ it("successfully processes complex brillig foreign call opcodes", async () => {
const solved_witness: WitnessMap = await executeCircuit(
bytecode,
initialWitnessMap,
foreignCallHandler
foreignCallHandler,
);

// Check that expected values were passed to oracle callback.
Expand All @@ -124,7 +124,7 @@ it("successfully executes a Pedersen opcode", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -140,7 +140,7 @@ it("successfully executes a FixedBaseScalarMul opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -156,7 +156,7 @@ it("successfully executes a SchnorrVerify opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -172,7 +172,7 @@ it("successfully executes a MemoryOp opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -194,7 +194,7 @@ it("successfully executes two circuits with same backend", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness0).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -205,7 +205,7 @@ it("successfully executes two circuits with same backend", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);
expect(solvedWitness1).to.be.deep.eq(expectedWitnessMap);
});
24 changes: 12 additions & 12 deletions acvm-repo/acvm_js/test/node/execute_circuit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ it("successfully executes circuit and extracts return value", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

// Solved witness should be consistent with initial witness
Expand All @@ -43,7 +43,7 @@ it("successfully processes simple brillig foreign call opcodes", async () => {
let observedInputs: string[][] = [];
const foreignCallHandler: ForeignCallHandler = async (
name: string,
inputs: string[][]
inputs: string[][],
) => {
// Throwing inside the oracle callback causes a timeout so we log the observed values
// and defer the check against expected values until after the execution is complete.
Expand All @@ -56,7 +56,7 @@ it("successfully processes simple brillig foreign call opcodes", async () => {
const solved_witness: WitnessMap = await executeCircuit(
bytecode,
initialWitnessMap,
foreignCallHandler
foreignCallHandler,
);

// Check that expected values were passed to oracle callback.
Expand All @@ -82,7 +82,7 @@ it("successfully processes complex brillig foreign call opcodes", async () => {
let observedInputs: string[][] = [];
const foreignCallHandler: ForeignCallHandler = async (
name: string,
inputs: string[][]
inputs: string[][],
) => {
// Throwing inside the oracle callback causes a timeout so we log the observed values
// and defer the check against expected values until after the execution is complete.
Expand All @@ -95,7 +95,7 @@ it("successfully processes complex brillig foreign call opcodes", async () => {
const solved_witness: WitnessMap = await executeCircuit(
bytecode,
initialWitnessMap,
foreignCallHandler
foreignCallHandler,
);

// Check that expected values were passed to oracle callback.
Expand All @@ -118,7 +118,7 @@ it("successfully executes a Pedersen opcode", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -134,7 +134,7 @@ it("successfully executes a FixedBaseScalarMul opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -150,7 +150,7 @@ it("successfully executes a SchnorrVerify opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -166,7 +166,7 @@ it("successfully executes a MemoryOp opcode", async () => {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -190,7 +190,7 @@ it("successfully executes two circuits with same backend", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

const solvedWitness1 = await executeCircuitWithBlackBoxSolver(
Expand All @@ -199,7 +199,7 @@ it("successfully executes two circuits with same backend", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness0).to.be.deep.eq(expectedWitnessMap);
Expand All @@ -225,7 +225,7 @@ it("successfully executes 500 circuits with same backend", async function () {
initialWitnessMap,
() => {
throw Error("unexpected oracle");
}
},
);

expect(solvedWitness).to.be.deep.eq(expectedWitnessMap);
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm_js/test/shared/schnorr_verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ export const initialWitnessMap = new Map([

export const expectedWitnessMap = new Map(initialWitnessMap).set(
77,
"0x0000000000000000000000000000000000000000000000000000000000000001"
"0x0000000000000000000000000000000000000000000000000000000000000001",
);
Loading

0 comments on commit 12faf30

Please sign in to comment.