noir-lang / noir-examples

A repo of example Noir projects.
MIT License
36 stars 13 forks source link

chore: update recursion example for noir v0.25.0 #18

Closed CodeDragonVN closed 6 months ago

CodeDragonVN commented 7 months ago

Description

Problem*

This Pull Request updates the recursion example to be compatible with Noir v0.24.0, addressing breaking changes introduced in the update. It resolves the issue described in: Update recursion to Noir v0.24.0 #16.

Summary*

The PR makes several changes to provide compatibility with Noir v0.24.0:

Additional Context

NEW UI

PR Checklist*

socket-security[bot] commented 7 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/runtime@7.23.2 None 0 247 kB nicolo-ribaudo
npm/@iarna/toml@2.2.5 eval 0 99 kB iarna
npm/@isaacs/cliui@8.0.2 None +7 184 kB isaacs
npm/@jridgewell/resolve-uri@3.1.2 None 0 53.2 kB jridgewell
npm/@ledgerhq/connect-kit-loader@1.1.2 None 0 17.6 kB sergii-shkolin
npm/@nomicfoundation/ethereumjs-block@5.0.2 None +28 6.23 MB fvictorio
npm/@nomicfoundation/ethereumjs-blockchain@7.0.2 None +39 8.77 MB fvictorio
npm/@nomicfoundation/ethereumjs-common@4.0.4 Transitive: network +16 4.36 MB fvictorio
npm/@nomicfoundation/ethereumjs-ethash@3.0.2 None +36 7.02 MB fvictorio
npm/@nomicfoundation/ethereumjs-evm@2.0.2 environment, eval +18 4.46 MB fvictorio
npm/@nomicfoundation/ethereumjs-rlp@5.0.4 None 0 125 kB fvictorio
npm/@nomicfoundation/ethereumjs-statemanager@2.0.2 environment +20 5.5 MB fvictorio
npm/@nomicfoundation/ethereumjs-trie@6.0.2 None +19 4.11 MB fvictorio
npm/@nomicfoundation/ethereumjs-tx@5.0.4 Transitive: network +17 5.01 MB fvictorio
npm/@nomicfoundation/ethereumjs-util@9.0.4 network +15 3.71 MB fvictorio
npm/@nomicfoundation/ethereumjs-vm@7.0.2 environment Transitive: eval +43 11.1 MB fvictorio
npm/@nomicfoundation/hardhat-chai-matchers@2.0.6 Transitive: environment, filesystem, network, shell +87 42.4 MB schaable
npm/@nomicfoundation/hardhat-network-helpers@1.0.10 Transitive: environment, filesystem, network, shell +74 22 MB fvictorio
npm/@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1 None 0 384 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1 None 0 404 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1 None 0 356 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1 None 0 352 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1 None 0 409 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1 None 0 405 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1 None 0 374 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1 None 0 350 kB alcuadrado
npm/@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1 None 0 414 kB alcuadrado
npm/@npmcli/fs@3.1.0 filesystem 0 26.5 kB lukekarrys
npm/@openzeppelin/contracts@5.0.2 None 0 1.7 MB frangio
npm/@pkgjs/parseargs@0.11.0 None 0 74.2 kB oss-bot
npm/@solana/buffer-layout@4.0.1 None +3 305 kB steveluscher
npm/@solana/web3.js@1.87.2 environment, eval, network Transitive: filesystem, shell +30 18.4 MB buffalojoec
npm/@tootallnate/once@2.0.0 None 0 16.3 kB tootallnate
npm/@types/bn.js@5.1.5 None +1 1.96 MB types
npm/@types/chai@4.3.12 None 0 81.3 kB types
npm/@types/connect@3.4.38 None +1 1.96 MB types
npm/@types/mocha@10.0.6 None 0 95.6 kB types
npm/@types/node@17.0.45 None 0 1.68 MB types
npm/@types/node@18.19.23 None 0 1.95 MB types
npm/@types/pbkdf2@3.1.2 None +1 1.95 MB types
npm/@types/prop-types@15.7.11 None 0 6.16 kB types
npm/@types/qs@6.9.12 None 0 6.4 kB types
npm/@types/react@18.2.65 None +3 1.69 MB types
npm/@types/scheduler@0.16.8 None 0 8.25 kB types
npm/@types/secp256k1@4.0.6 None +1 1.96 MB types
npm/@types/ws@7.4.7 None +1 1.97 MB types
npm/abstract-level@1.0.4 None +5 596 kB vweevers
npm/acorn-walk@8.3.2 None 0 52.4 kB marijn
npm/agentkeepalive@4.5.0 network +1 47.4 kB fengmk2
npm/antlr4ts@0.5.0-dev filesystem 0 2.94 MB burt_harris
npm/aproba@2.0.0 None 0 8.05 kB iarna
npm/are-we-there-yet@3.0.1 None +1 21.8 kB lukekarrys
npm/arraybuffer.prototype.slice@1.0.3 Transitive: eval +31 3 MB ljharb
npm/available-typed-arrays@1.0.7 None 0 20.4 kB ljharb
npm/bigint-buffer@1.1.5 Transitive: environment, filesystem +2 75 kB no2chem
npm/bind-decorator@1.0.11 None 0 7.18 kB nohomey
npm/bindings@1.5.0 environment, filesystem +1 19.3 kB tootallnate
npm/borsh@0.7.0 None +2 48.5 kB volovyk-s
npm/bufferutil@4.0.8 None 0 414 kB lpinca
npm/cacache@17.1.4 filesystem Transitive: environment, shell +19 1.74 MB npm-cli-ops
npm/call-bind@1.0.7 Transitive: eval +6 149 kB ljharb
npm/caniuse-lite@1.0.30001597 None 0 1.99 MB caniuse-lite
npm/chai@4.4.1 None +2 777 kB keithamus
npm/check-error@1.0.3 None +1 23 kB keithamus
npm/chokidar@3.6.0 environment, filesystem 0 90.2 kB paulmillr
npm/chownr@2.0.0 filesystem 0 5.75 kB isaacs
npm/classic-level@1.4.1 filesystem +6 6.35 MB vweevers
npm/color-support@1.1.3 None 0 9.23 kB isaacs
npm/console-control-strings@1.1.0 None 0 12.7 kB iarna
npm/csstype@3.1.3 None 0 1.25 MB faddee
npm/define-data-property@1.1.4 Transitive: eval +7 165 kB ljharb
npm/delay@5.0.0 None 0 11.2 kB sindresorhus
npm/delegates@1.0.0 None 0 7.46 kB tjholowaychuk
npm/dotenv@16.4.5 environment, filesystem 0 79.1 kB motdotla
npm/duplexify@4.1.2 None +1 24.5 kB mafintosh
npm/eastasianwidth@0.2.0 None 0 13.6 kB komagata
npm/encoding@0.1.13 None +1 356 kB andris
npm/end-of-stream@1.4.4 None 0 6.23 kB mafintosh
npm/err-code@2.0.3 None 0 12.3 kB achingbrain
npm/es-abstract@1.23.0 Transitive: eval +31 3 MB ljharb
npm/es-set-tostringtag@2.0.3 Transitive: eval +7 158 kB ljharb
npm/es6-promise@4.2.8 None 0 315 kB stefanpenner
npm/es6-promisify@5.0.0 None +1 323 kB digitaldesignlabs
npm/escalade@3.1.2 filesystem 0 11.6 kB lukeed
npm/eth-gas-reporter@0.2.27 environment, filesystem Transitive: network +22 16 MB cgewecke
npm/exponential-backoff@3.1.1 None 0 37.3 kB sssayegh
npm/eyes@0.1.8 None 0 14 kB indexzero
npm/fast-glob@3.3.2 filesystem +4 199 kB mrmlnc
npm/fast-stable-stringify@1.0.0 None 0 125 kB nickyout
npm/fastq@1.17.1 None 0 41.9 kB matteo.collina
npm/fflate@0.8.2 None 0 773 kB 101arrowz
npm/file-uri-to-path@1.0.0 None 0 8.07 kB tootallnate
npm/follow-redirects@1.15.5 network 0 29.4 kB rubenverborgh
npm/foreground-child@3.1.1 shell Transitive: environment, filesystem +3 103 kB isaacs
npm/fs-minipass@3.0.3 filesystem 0 14.4 kB npm-cli-ops
npm/function-bind@1.1.2 None 0 31.4 kB ljharb
npm/function.prototype.name@1.1.6 Transitive: eval +31 3 MB ljharb
npm/gauge@4.0.4 Transitive: environment +5 86.5 kB gar
npm/get-func-name@2.0.2 None 0 8.68 kB keithamus
npm/get-intrinsic@1.2.4 eval +5 127 kB ljharb
npm/get-symbol-description@1.0.2 Transitive: eval +7 163 kB ljharb
npm/hardhat-gas-reporter@1.0.10 filesystem Transitive: environment, network, shell +91 36.1 MB cgewecke
npm/hardhat@2.21.0 environment, filesystem, network, shell +72 21.6 MB fvictorio
npm/has-property-descriptors@1.0.2 None 0 10.9 kB ljharb
npm/has-proto@1.0.3 None 0 12 kB ljharb
npm/has-tostringtag@1.0.2 None +1 38.2 kB ljharb
npm/has-unicode@2.0.1 environment 0 3.44 kB iarna
npm/http-cache-semantics@4.1.1 None 0 35.9 kB kornel
npm/http-proxy-agent@5.0.0 network +2 68 kB tootallnate
npm/humanize-ms@1.2.1 None 0 3.66 kB dead_horse
npm/ignore@5.3.1 None 0 51.5 kB kael
npm/immutable@4.3.5 None 0 679 kB leebyron
npm/imurmurhash@0.1.4 None 0 11.9 kB jensyt
npm/internal-slot@1.0.7 None +3 73.1 kB ljharb
npm/ip@2.0.0 None 0 13.6 kB indutny
npm/is-arguments@1.1.1 Transitive: eval +8 195 kB ljharb
npm/is-array-buffer@3.0.4 Transitive: eval +7 166 kB ljharb
npm/is-generator-function@1.0.10 eval +2 70.1 kB ljharb
npm/is-lambda@1.0.1 None 0 2.94 kB watson
npm/is-negative-zero@2.0.3 None 0 27.1 kB ljharb
npm/is-shared-array-buffer@1.0.3 Transitive: eval +7 168 kB ljharb
npm/is-typed-array@1.1.13 None 0 23.3 kB ljharb
npm/isomorphic-ws@4.0.1 None 0 3.89 kB heineiuo
npm/jackspeak@2.3.6 environment +9 512 kB isaacs
npm/jayson@4.1.0 network Transitive: filesystem, shell +12 3.74 MB tedeh
npm/jsonparse@1.3.1 None 0 36.8 kB creationix
npm/jsonstream@1.3.5 None +1 36.8 kB
npm/string-width@4.2.3 None +4 68 kB sindresorhus
npm/strip-ansi@6.0.1 None +1 9.64 kB sindresorhus
npm/toml@3.0.0 None 0 144 kB binarymuse
npm/ts-node@10.9.1 environment, filesystem, unsafe +18 70.5 MB cspotcode
npm/type-detect@4.0.8 None 0 42.1 kB chaijs
npm/typechain@8.3.1 filesystem Transitive: environment, unsafe +50 81.4 MB ethereum-ts-bot
npm/typescript@4.9.5 None 0 66.8 MB typescript-bot
npm/vitest@0.31.4 environment, eval Transitive: filesystem, network, shell, unsafe +87 222 MB oreanno

🚮 Removed packages: npm/@ethereumjs/util@9.0.0, npm/@nomicfoundation/hardhat-chai-matchers@1.0.6, npm/@nomicfoundation/hardhat-network-helpers@1.0.8, npm/@nomicfoundation/hardhat-toolbox@2.0.2, npm/@nomiclabs/hardhat-ethers@2.2.3, npm/@nomiclabs/hardhat-etherscan@3.1.7, npm/@openzeppelin/contracts@4.9.3, npm/@typechain/hardhat@6.1.6, npm/@types/node@18.17.4, npm/@types/react-dom@18.2.7, npm/@types/react@18.2.19, npm/axios@1.4.0, npm/blake2@5.0.0, npm/dotenv@16.3.1, npm/hardhat-gas-reporter@1.0.9, npm/hardhat@2.17.1, npm/keccak256@1.0.6, npm/next@13.4.19, npm/react-dom@18.2.0, npm/react-loader-spinner@5.3.4, npm/react-toastify@9.1.3, npm/react@18.2.0

View full report↗︎

socket-security[bot] commented 7 months ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package Note
Install scripts npm/bigint-buffer@1.1.5
  • Install script: install
  • Source: npm run rebuild || echo "Couldn't build bindings. Non-native version used."

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/bigint-buffer@1.1.5
signorecello commented 6 months ago

Hey @CodeDragonVN im tried to make this work and was blocked since backend_barretenberg 0.24.0 points to bb.js 0.23.0 which causes serialization issues.

Did you find any such problems?

signorecello commented 6 months ago

Ok so I stopped being lazy and checked this out, indeed I get the same serialization error:

Error: Circuit execution failed: Error: Failed to deserialize circuit. This is likely due to differing serialization formats between ACVM_JS and your compiler

I'm glad to merge this branch though instead of my own branch because this frontend looks sweet! Let's just wait for 0.24.1

CodeDragonVN commented 6 months ago

Hey @signorecello,

I'm running into the serialization error you pointed out, and it's perplexing because it was previously resolved on my end. Testing now with the backend_barretenberg at version 0.24.0 but using the recursion tests from the noir-lang/noir repository, everything still passes without issue however.

I'm finding it perplexing how It's working on my repo here: https://github.com/CodeDragonVN/noir-recursion-v0.24.0, but now it's giving me that serialization issue on this repo. The version of bb.js is also 0.23.0 on my repo.

CodeDragonVN commented 6 months ago

I've reopened the issue about the serialization error since it has resurfaced. I'm encountering it again, similar to before. My repo https://github.com/CodeDragonVN/noir-recursion-v0.24.0 shows no issues, but the serialization error persists in this noir-examples repo. The issue is Issue #4459

signorecello commented 6 months ago

Thanks @CodeDragonVN this is a known problem, caused by feedback loop from aztec-packages repo that wasn't included in 0.24.0 by mistake.

This is resolved in a next version 0.24.1 so it's just a matter of waiting for it. One way to check it will work correctly is just to use nightlies.

Let's hold on this PR until then, I'll let you know once 0.24.1 is out and you can update this PR to reflect that, then we merge 👍

signorecello commented 6 months ago

I get a bit distracted with so many PRs though so please tag me here, or on discord, if I fail to see changes!

CodeDragonVN commented 6 months ago

@signorecello Appreciated. I'll keep a close watch for the 0.24.1 release and update also. For now, I'll close the issue.

CodeDragonVN commented 6 months ago

hey @signorecello,

I've got good news! After updating the packages to v0.25.0 the deserialization issue is gone.

signorecello commented 6 months ago

Yep this one looks good, let's merge :)

signorecello commented 6 months ago

@SocketSecurity ignore npm/bigint-buffer@1.1.5

Savio-Sou commented 6 months ago

When running nargo prove in recursion/packages/noir/recursion on Nargo v0.25.0, I'm getting this error:

The parameter proof is expected to be a Array { length: 93, typ: Field } but found incompatible value Vec([Field(2), Field(10824393579292640276679628408780923644399), Field(245259312760651750434636148266637791), Field(16220608892709085881729549461059840933531), Field(29086728926417763668684368412851575), Field(86960175229511384923347249685703605573976), Field(119632588394922407903828536975742837), Field(8133670842954062125526877195552803097095), Field(77866749597867336167111883273880859), Field(71471231940114255485442979054702681468666), Field(23764813297134295735649906350412067), Field(7995811797098406394649926543277505625825), Field(129596692976341405364457231933926819), Field(42584003987106105622750099282556088552981), Field(83704113108611586325261273358909475), Field(23381474794378998045519623024244166683364), Field(58281244622276626442984716163814997), Field(29804766582689924054821691856432438879238), Field(57444262120063519768548212507957905), Field(16491241657511778684900216372384253634593), Field(41953517797133300127696735937977142), Field(68151564160769547547256134235862571492297), Field(216407266845215061217912493787155913), Field(69207649048610159988269278414443034093515), Field(15807053400682008906696955367456414), Field(10880481356747158641109320953091993808257), Field(2349200668467182599985201040167423), Field(31364921378378437615613880362128784294056), Field(39443454228419067228006125108034268), Field(20581768292632203344331303479038549047339), Field(102061500812406260120526807869958311), Field(24236701373264253026159203273786348563223), Field(7160361939492749527211926769788388), Field(63868105380635015923004029232685365912965), Field(238542531654646981940655082881081771), Field(5090616018687404140975576095173384749885), Field(43017538151095093102124813241236341), Field(4259038585770966974321899586833487122888), Field(114227111701630081242643662775400230), Field(68251179676788864790405053043314937453270), Field(9692402620334585232468065140487021), Field(2847735185949821907881170022267580238807), Field(120156717726338775729839371898339058), Field(14121884846476890623069165971469385506920), Field(83592227982249769367956318927602374), Field(10989296828477066965048323571107898543133799215759153574795593757312752813519), Field(1692002355413023306367267213642771784531727362864458766547849688766899694066), Field(3798529920491737195625363558999108934776211473679815282888537467136909974482), Field(-256275798624413393622062906902542915583317396439971975433346841900939843487), Field(8322388201023808012870399100180878830759974505798980413797440919580578045873), Field(-331192619096629662370620122212819689390196235627555437196146139630222834199), Field(2326251939241883614051705621367670708421552049794746171429699716122070839702), Field(-7868490775523227390360146959476593742454345219540388306194662761959805805275), Field(-4837239561612933720655417249630881609435728158302830702586561038269749529928), Field(-7059937854679246682309316952465684718563777857501408377784875648693204430077), Field(6421501004493454161172102601980226091172351583430306948019244908204961232450), Field(4852473425435083078587353700659053667116259568488230291627352583170990936124), Field(5433448795313040042239951003824916154714225490913731149207937064525935516374), Field(-3142739218127369117205097167650835598608566413466050106336386581732664370231), Field(8562001339324605548229470135973634788229802111240409264025659877606614976600), Field(9632251506740181241758153902970339136758527375145460422028867362307441848675), Field(10702501674155756935286837669967043485287252639050511580032074847008268720750), Field(-6875404873706023841285549468457545876118998885813823945980951136710009668145), Field(-2194778855981724790525730095918588475642910296457745123471813052655564156776), Field(3246089640769931248471626203364017474211177134741223905869740628722309947987), Field(8017291352040390036011586600418057224606339042029062360308162719474465628451), Field(-9045240862852366899902200541296822906203661233555420447659714370165886030717), Field(-7974990695436791206373516774300118557674935969650369289656506885465059158642), Field(-6904740528021215512844833007303414209146210705745318131653299400764232286567), Field(-5834490360605639819316149240306709860617485441840266973650091916063405414492), Field(11772751841571332628815521436963747833815977902955562738035282331709095592825), Field(2⁴×515015349249856027793884090616948420426494535406831519958183777312496410329), Field(-655027780306546841755476148175915721013996680692586176295616779147906181421), Field(-8176815891054077554202674580291235244747826429980231733892916755568034816733), Field(148798921886863903132781229482758217694), Field(62863334824747313451323085736833590057545117208672818611185365657622432422), Field(-9062027930855658129182172085881471197837145603556764231416228119122676787706), Field(4388110873538727912125896417094102125704040646884279841003347343229956208498), Field(-5850461569401064351417303611077900569291818716207946797419492139347994041222), Field(3842724590614690011918435231717575290652682634947443304006488952910782196646), Field(-8698646621100834496777834498192652591855389177989914219131719387988111437188), Field(4473383684656860969041250902476789967434903924167511947768870312280571111410), Field(-8784184561544884307705408906719145657180879950466192276174921944567370067929), Field(-2⁴×24756171567120416088220245109700615107341757051980874332202939304670668776), Field(7991987071397030992882361063208725973745943724802804297544427886817908667097), Field(-5508169983971286579070159697084613299339008837978731759294101384065260461007), Field(36992940453337112128528440701242819743352), Field(117689838452265778650879227913523939), Field(64927607873248691436990295648907245579578), Field(241691637338611060083000632953347194), Field(17880647516323685297027980762545736722513), Field(199138603335721403350161534864642739), Field(83146432756370824696010155233778509844385), Field(2⁴×7388079081685829759436069250324641)])

Is that expected?