Skip to content

Commit

Permalink
Fixing not passing tests + sonar cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerTaule committed Mar 11, 2024
1 parent eeda670 commit 2477556
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 147,531 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check PR

on:
pull_request:
branches: [master, develop]
branches: [main, develop]

jobs:
circuits-tests:
Expand All @@ -13,6 +13,7 @@ jobs:
with:
node-version: '16.17.0'
check-latest: true
node-options: '--max-old-space-size=230000'
cache: "npm"

- name: "Install circom"
Expand Down Expand Up @@ -101,6 +102,7 @@ jobs:
with:
node-version: '16.17.0'
check-latest: true
node-options: '--max-old-space-size=230000'
cache: "npm"

- name: "Install circom"
Expand Down Expand Up @@ -129,6 +131,7 @@ jobs:
with:
node-version: '16.17.0'
check-latest: true
node-options: '--max-old-space-size=230000'
cache: "npm"

- name: "Install circom"
Expand Down
6 changes: 0 additions & 6 deletions src/stark/chelpers/old_compile_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ module.exports.compileCode = function compileCode(functionName, starkInfo, code,
body.push(` Goldilocks3::add(${lexp}, ${src[0]}, ${src[1]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::add(${lexp}, ${src[1]}, ${src[0]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::add(${lexp}, ${src[0]}, ${src[1]});`)
} else {
throw new Error("Invalid dimension")
}
Expand All @@ -48,8 +46,6 @@ module.exports.compileCode = function compileCode(functionName, starkInfo, code,
body.push(` Goldilocks3::sub(${lexp}, ${src[0]}, ${src[1]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::sub(${lexp}, ${src[0]}, ${src[1]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::sub(${lexp}, ${src[0]}, ${src[1]});`)
} else {
throw new Error("Invalid dimension")
}
Expand All @@ -69,8 +65,6 @@ module.exports.compileCode = function compileCode(functionName, starkInfo, code,
body.push(` Goldilocks3::mul(${lexp}, ${src[0]}, ${src[1]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::mul(${lexp}, ${src[1]}, ${src[0]});`)
} else if (((r.src[0].dim == 3) || r.src[1].dim == 1)) {
body.push(` Goldilocks3::mul(${lexp}, ${src[0]}, ${src[1]});`)
} else {
throw new Error("Invalid dimension")
}
Expand Down
8 changes: 5 additions & 3 deletions src/stark/stark_gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ function compileCode(ctx, code, dom, ret) {
function calculateExps(ctx, code, dom) {
ctx.tmp = new Array(code.tmpUsed);

cCode = new Function("ctx", "i", compileCode(ctx, code.code, dom));
const compiledCode = compileCode(ctx, code.code, dom)
const cCode = new Function("ctx", "i", `"use strict"; ${compiledCode}`);

const N = dom=="n" ? ctx.N : ctx.Next;

Expand All @@ -566,9 +567,10 @@ function calculateExps(ctx, code, dom) {
}
}

function calculateExpAtPoint(ctx, code, i) {
function calculateExpAtPoint(ctx = {}, code = {}, i = 0) {
ctx.tmp = new Array(code.tmpUsed);
cCode = new Function("ctx", "i", compileCode(ctx, code, "n", true));
const compiledCode = compileCode(ctx, code, "n", true);
const cCode = new Function("ctx", "i", `"use strict"; ${compiledCode}`);

const pCtx = ctxProxy(ctx);
return cCode(pCtx, i);
Expand Down
Loading

0 comments on commit 2477556

Please sign in to comment.