-
Notifications
You must be signed in to change notification settings - Fork 597
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
bug: "Internal error, cycle detected" with recursive struct in 2.3.0 but not in 2.3.0-rc0 #4314
Comments
Hi, I tried running this locally. Steps:
Then:
❯ scarb test -p utils
Running cairo-test utils
Compiling test(utils_unittest) utils v0.1.0 (/Users/eliastazartes/code/kkrt-labs/kakarot-ssj/crates/utils/Scarb.toml)
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salsa-0.16.1/src/lib.rs:490:48:
Internal error, cycle detected:
DatabaseKeyIndex { group_index: 2, query_index: 29, key_index: 754 }
DatabaseKeyIndex { group_index: 2, query_index: 29, key_index: 755 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: `scarb metadata` exited with error |
Recursive structs are still supported - this is possibly not related. |
Not sure I understand. I tried again on the branch linked by @Quentash to:
Then, Running cairo-test utils
Compiling test(utils_unittest) utils v0.1.0 (/Users/eliastazartes/code/kkrt-labs/kakarot-ssj/crates/utils/Scarb.toml)
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salsa-0.16.1/src/lib.rs:490:48:
Internal error, cycle detected:
DatabaseKeyIndex { group_index: 2, query_index: 29, key_index: 754 }
DatabaseKeyIndex { group_index: 2, query_index: 29, key_index: 755 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: `scarb metadata` exited with error |
Managed to run it now - and it seems to work. |
Even |
Oh - it fails now - checking it out. |
Found the basic culprit basic information - it is about call cycle detection and auto addition of gas withdrawal. |
What does that mean:)? |
We have some algorithm for finding SCCs for adding |
Thanks 🙏 |
Found and fixed. |
It's blocking us for decoding eth transactions, we could really use the earlier option if that's okay with you |
Thanks a lot, Ser @orizi !! |
@orizi We can use scarb nightlies that are main-based in the meantime, so there shouldn't be a need for a release |
in any case, we are doing a 2.3.1 for some small fixes - this one is included - so this will be available hopefully later today. |
Bug Report
Cairo version:
2.3.0
Current behavior:
We need to be able to handle recursive structures in Kakarot for the RLP decoding.
The tests were running correctly in version 2.3.0-rc0 but are failing in 2.3.0 with this error :
If I modify the struct and the tests so that they don't use struct recursion, the tests will run.
Expected behavior:
To be able to use struct recursion in 2.3.0 as well.
Steps to reproduce:
Ironically, I couldn't reproduce the bug in a MRE so I might only be able to link you the related PR : kkrt-labs/kakarot-ssj#457 (comment)
Once pulled, you should be able to run
scarb test -f test_rlp
.Once using cairo 2.3.0-rc0 and assert that the tests run.
And once using cairo 2.3.0 and assert that the tests panic with the error mentionned above.
(Do not forget to modify the Scarb.toml as well)
Here is the related struct found in
rlp.cairo
:Any tests calling the decode() function will trigger the error.
Other information:
I tried to reproduce the bug in a brand new scarb project but it is running smoothly. I will keep updated if I manage to reproduce the bug in a smaller setup. This is confusing.
The text was updated successfully, but these errors were encountered: