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

No-op foreign curve program fails to compile #1916

Open
mitschabaude opened this issue Nov 21, 2024 · 1 comment
Open

No-op foreign curve program fails to compile #1916

mitschabaude opened this issue Nov 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mitschabaude
Copy link
Collaborator

mitschabaude commented Nov 21, 2024

The code below fails with an error from Pickles that seems to be some consistency check regarding custom gates.

The error occurs when the zkprogram has a ForeignCurve point public input, but doesn't do any actual operations on that point. The error goes away when adding a single operation like point.double() to the circuit.

Failing line in wrap_main.ml:

assert_consistent range_check0_comm range_check0 ;

Reproduction code:

import { createForeignCurve, Crypto, ZkProgram } from "o1js";

class Secp256k1 extends createForeignCurve(Crypto.CurveParams.Secp256k1) {}

const Failing = ZkProgram({
  name: "failing-program",
  publicInput: Secp256k1,

  methods: {
    test: {
      privateInputs: [],

      async method(p: Secp256k1) {
        // if this is commented in, compiling works
        // p.double();
      },
    },
  },
});

await Failing.compile();
@mitschabaude mitschabaude added the bug Something isn't working label Nov 21, 2024
@mitschabaude
Copy link
Collaborator Author

Discovered by @egemengol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant