-
Notifications
You must be signed in to change notification settings - Fork 266
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: Initial trazability of ACIR #1701
Conversation
@@ -35,7 +35,7 @@ | |||
"@aztec/circuits.js": "workspace:^", | |||
"@aztec/foundation": "workspace:^", | |||
"@aztec/types": "workspace:^", | |||
"acvm_js": "github:noir-lang/acvm-js-wasm#db/init-sim-backend", | |||
"acvm_js": "github:noir-lang/acvm-js-wasm#arv/0.22+init-pedersen", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the dependency from 0.21 + init pedersen to 0.22 + init pedersen. Init pedersen will eventually be released as part of 0.23, let's hope that lands soon!
@@ -145,7 +145,7 @@ function generateAbiGetter(name: string) { | |||
function generateAbiStatement(name: string, abiImportPath: string) { | |||
const stmts = [ | |||
`import ${name}ContractAbiJson from '${abiImportPath}' assert { type: 'json' };`, | |||
`export const ${name}ContractAbi = ${name}ContractAbiJson as ContractAbi;`, | |||
`export const ${name}ContractAbi = ${name}ContractAbiJson as unknown as ContractAbi;`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed because having a Record<> inside breaks automatic inference of the type from the JSON
yarn-project/acir-simulator/src/client/private_execution.test.ts
Outdated
Show resolved
Hide resolved
Seems like the test was expecting the old format of error messages |
|
||
// The ACVM only lets string errors pass through so we need to throw a string at the execution level. | ||
// We should probably update the ACVM to let proper errors through. | ||
throw `Assertion failed: '${callStack.pop()?.assertionText ?? 'Unknown'}'`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the first if
throws the error when it's not a string. Should we convert that to a string or is it actually ok to throw new Error(str)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the acvm js only lets error strings through, so if we emitted new Error(str), if the execution of this ACVM was child of another ACVM, when passing through it'd get transformed to Error in oracle call: unknown or something like that ):
Maybe we can ignore the ACVM error completely if there was an error in a nested call...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might try that so we have proper errors from the simulator executions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work!! So excited we can display better errors now 😃
* Attempt to fix production deployment (#1683) * Add stefan to mainframe. Deployment publishes bb.js and blockchain to npm. * Fix block scanning (#1692) * Attempt to fix deploy. * Fix dai-permit issues. Providers did not offset `v` properly (#1698) * fix: perform offset to `sig.v if 0 or 1 for `signTypedData` * fix: remove git-submodules * Force to -O2 with binaryen installed to prevent aes bug. * Updated fork block number (#1685) * Updated fork block number * Updated fork block and element test tranche * Removed no longer used env variable * Updated Faucet index page amounts * [zk-money] Jcf/aave (#1642) * Configure aave defi cards * copy-paste error * Increase test timeout Co-authored-by: PhilWindle <[email protected]> * fix aave token addresses (#1701) * Fuzzer-found bugs that are not related to bigfield (#1605) * Added a regression test to detect original parallelized asm bugs * FIxed parallelized SQR asm bugs * Added comment that Emerson wanted * Fix for create_range_constraint in the constant case * Various safe_uint bug fixes having to do with not handling constant cases * Fixed the comparison issue for the point at infinity * Added regression tests and fixed 3 more missing flags in optimized SQR * Fixed tabulation in asm_macros.hpp * Fixed Montgomery Issue that Adrian Found * Fixed issue with negative zero found by Guido * FIxed same self_neg bug found by Guido * Renamed 1 test * Fixed one more SQR bug * Added extra regression tests * Slightly moved one test * Added TODO comments into field_impl for potential optimisations * Addressed Zac's comments Co-authored-by: zac-williamson <[email protected]> * Fixing errors in addition and subtraction of field elements with moduli > 254 bits (#1702) * Added test * Added bugfixes * Added comments * Use 400k gas bridge for aave (#1705) * Add versioning to falafel status endpoint. Refresh zk-money on version mismatch. (#1674) * all get/post reqs from sdk to falafel now include header * falafel expects all endpoint requests to be given a 'version' header. SDK now gives all reqs a version. If falafel sees a req with version that does not match falafel version, it responds with error 402. ServerRollupProvider now emits versionMismatch whenever one occurs. zk-money promotes this event and forces refresh of browser. * cleanup new FALAFEL_VERSION constant in falafel - using configurator everywhere instead of using constant directly * fix prettier errors * prettier server.ts * sdk version to 0 * version is now a str like 2.1.0 in falafel and sdk. moved getRollupProviderStatus into SDK so that it doesn't need to accept sdk_version as arg * prettier sdk index.ts * zk-money alerts on version mismatch. Falafel allows requests without version header, but if version header is present it enforces a match. * server rollup provider and block source shouldn't NEED a to interact with falafel. * prettier rollup provider ts * block source / provider fix version default undefined changed to '' Co-authored-by: joss-aztec <[email protected]> Co-authored-by: Charlie Lye <[email protected]> Co-authored-by: Lasse Herskind <[email protected]> Co-authored-by: Innokentii Sennovskii <[email protected]> Co-authored-by: zac-williamson <[email protected]> Co-authored-by: David Banks <[email protected]>
Working towards #1224
This PR adds trazability of errors for ACIR opcodes when the debug data is available. Future work will enable this in brillig, and also will add assertion messages embedded in the bytecode itself.
Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.