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

Try to use Deno to run zkAsm #210

Closed
wants to merge 1 commit into from
Closed

Try to use Deno to run zkAsm #210

wants to merge 1 commit into from

Conversation

aborg-dev
Copy link

@aborg-dev aborg-dev commented Feb 7, 2024

This PR attempts to rework tests/zkasm/run-tests-zkasm.js to make it runnable with Deno, which should allow us to embed it into Rust binaries. It doesn't work yet as it fails to download the dependency from this line:

import smMain from "https://esm.sh/gh/0xPolygonHermez/zkevm-proverjs/src/sm/sm_main/sm_main.js";

I'm not yet sure why, but the request to this URL fails with:

/* esm.sh - error */
throw new Error("[esm.sh] " + "pnpm add :  ERROR  Command failed with exit code 128: git ls-remote --refs git+ssh://git@github.com/hermeznetwork/zkevm-commonjs.git v1.0.0
Host key verification failed.\r
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This error happened while installing the dependencies of @0xpolygonhermez/zkevm-proverjs@3.0.0
 at @0xpolygonhermez/zkevm-commonjs@3.0.0
 at @polygon-hermez/vm@5.7.36

pnpm: Command failed with exit code 128: git ls-remote --refs git+ssh://git@github.com/hermeznetwork/zkevm-commonjs.git v1.0.0
Host key verification failed.\r
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
    at makeError (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:24230:17)
    at handlePromise (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:24801:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getRepoRefs (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:110651:23)
    at async resolveRef (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:110663:20)
    at async resolveGit (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:110614:24)
    at async Object.resolve (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:113185:173)
    at async run (/esmd/nodejs/lib/node_modules/pnpm/dist/pnpm.cjs:124970:23)
");
export default null;

In contrast, https://esm.sh/gh/0xPolygonHermez/zkasmcom@v1.0.0 succeeds with:

/* esm.sh - gh/0xPolygonHermez/zkasmcom@v1.0.0 */
import "/v135/path-browserify@1.0.1/es2022/path-browserify.mjs";
import "/v135/node_fs.js";
import "/v135/node_process.js";
import "/v135/ffjavascript@0.2.63/es2022/ffjavascript.mjs";
export * from "/v135/gh/0xPolygonHermez/zkasmcom@v1.0.0/es2022/zkasmcom.mjs";
export { default } from "/v135/gh/0xPolygonHermez/zkasmcom@v1.0.0/es2022/zkasmcom.mjs";

@aborg-dev
Copy link
Author

I was able to load the necessary modules by removing the dependency on @polygon-hermez/vm that contains a circular dependency on zkevm-commonjs @ v1.0.0:

This still fails deeper in the import:

error: Import 'https://esm.sh/v135/@0xpolygonhermez/zkevm-commonjs@3.0.0/denonext/zkevm-commonjs.mjs' failed: 500 Internal Server Error
    at https://esm.sh/gh/akashin/zkevm-proverjs@90f05fb7ef/src/sm/sm_main/sm_main.js:4:8

@aborg-dev
Copy link
Author

Closing as I don't intend to submit this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant