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

got "Error: Validation: Unknown opcode 252" when setup wasm from assemblyscript #235

Closed
lightszero opened this issue Jan 29, 2024 · 2 comments

Comments

@lightszero
Copy link

lightszero commented Jan 29, 2024

I write a AssemblyScript code like:

@external("env", "wasm_input")
declare function wasm_input(x: i32): i64


@external("env", "require")
declare function require(x: i32): void

export function zkmain(): void {
    //一次性读出n个数据不过分吧。
    var arra: i64[] = [];
    let count = wasm_input(0);
    for (var i = 0; i < count; i++) {
        let v = wasm_input(0);
        arra.push(v);
    }
    var datab = wasm_input(1);
    require(arra[0] == datab);
}

and got a error when setup:
Error: Validation: Unknown opcode 252

@akayi07
Copy link

akayi07 commented May 28, 2024

I write a AssemblyScript code like:

@external("env", "wasm_input")
declare function wasm_input(x: i32): i64


@external("env", "require")
declare function require(x: i32): void

export function zkmain(): void {
    //一次性读出n个数据不过分吧。
    var arra: i64[] = [];
    let count = wasm_input(0);
    for (var i = 0; i < count; i++) {
        let v = wasm_input(0);
        arra.push(v);
    }
    var datab = wasm_input(1);
    require(arra[0] == datab);
}

and got a error when setup: Error: Validation: Unknown opcode 252

Run command such as asc zk.ts -O --noAssert -o ../zk_testc1.wasm --disable bulk-memory --runtime stub --use abort=zk/abort.

@xgaozoyoe
Copy link
Contributor

Closed as solved.

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

No branches or pull requests

3 participants