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

Failure to split a computation consisting in iterating calls to sha256 #820

Closed
igarnier opened this issue Aug 29, 2023 · 1 comment · Fixed by #844
Closed

Failure to split a computation consisting in iterating calls to sha256 #820

igarnier opened this issue Aug 29, 2023 · 1 comment · Fixed by #844
Assignees
Labels
bug Something isn't working

Comments

@igarnier
Copy link

igarnier commented Aug 29, 2023

One can get the following error when running a long computation iterating calls to sha256:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Cannot expand, max po2 of 20 reached.', host/src/benches/iter_sha2.rs:82:89

This was observed on 0.17.0.

Steps to reproduce:

The guest code is there: https://github.com/igarnier/zk-benchmarking/blob/iter-sha2-failure/risczero/methods/guest/src/bin/iter_sha2.rs

The error was triggered for num_iter = 10_000 (this is an upper bound, didn't try to bisect).

@flaub flaub added the bug Something isn't working label Aug 29, 2023
@SchmErik
Copy link
Contributor

From reading the trace log, it doesn't look like this is setting the is_halted to true at the cycle count for the split. I expect to see this message: log::info!("SPLIT[{cycle}]> pc: 0x{pc:08x}");

@carterbrett carterbrett assigned capossele and unassigned flaub, jbruestle and SchmErik Aug 31, 2023
capossele added a commit that referenced this issue Sep 7, 2023
This PR fixes a bug occurring when calling iteratively sha2, ending up
calling the `expand` function. The fix increases the const `SHA_CYCLES`
from 72 to 73.
It also adds a unit test for that case.

Fixes #820
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

Successfully merging a pull request may close this issue.

5 participants