Open veigajoao opened 2 years ago
transferring the issue to nearcore
. We are just exporting the host function and haven't built a higher-level API for it or tested it yet. I'll track this as it should influence how we build out API
@veigajoao is there perhaps some repository with reproduction? I'd like to poke at it. I think it's read_register_g1
which might be at fault here -- slice lenght 64
is what the result here is, so it looks like something tries to read 65 bytes out of that.
Also, sorry for the absence of a stacktrace, I'll see if we can fix that...
For the curious: the Rust bug that the panic message points to core, rather than user's code, is fixed here: https://github.com/rust-lang/rust/pull/100759
I'm currently developing a zero knowledge application on NEAR, which requires the use of some near-sys features such as alt_bn128_g1_multiexp.
Per the decumentation in nearcore, alt_bn128_g1_multiexp should be called with the following parameters:
Basically the input should be a total of 96 bytes long, comprising 3 different little endian 32 bytes numbers.
The listed errors are:
However, in my implementation, I am receiving a completely different error. I am implementing a method on a G1Point struct to multiplicate it by a scalar:
However, I am getting the following error precisely at the alt_bn128_g1_multiexp function call:
I have already verified the slice input being passed which is correct, it is exactly 96 bytes long and correctly serializes the numbers.
Since it has not been possible to compile unit tests for the code given that some libs only compile to wasm I am stuck running simulation tests on workspaces-rs and cannot get further down on the contract's stack trace.
Does anyone have an idea of what is causing this error and possible fixes/workarrounds?
Thanks in advance guys