Skip to content

Upgrading snforge #2569

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

Open
iossocket opened this issue Apr 8, 2025 · 3 comments
Open

Upgrading snforge #2569

iossocket opened this issue Apr 8, 2025 · 3 comments

Comments

@iossocket
Copy link

iossocket commented Apr 8, 2025

We are working on a lending protocol that integrates pyth on Starknet and would like to use the latest versions of snforge and scarb. During the upgrading process, we found two tests failed

pyth_integrationtest::pyth::test_upgrade_works
pyth_integrationtest::pyth::test_upgrade_rejects_wrong_magic

with error message:

Failure data:
    Got an exception while executing a hint: Hint Error: Error at pc=0:20839:
Got an exception while executing a hint: Class with hash 0x042cc93b4142052d0ec7a21b6746e5fc4055a850e67881ad8590dbf9bcfb4bc7 is not declared.

The class hash in encoded in data::pyth_upgrade_fake1() and data::pyth_upgrade_wrong_magic() are not matched.

According to the README, I try to regenerate the tests/data.cairo, but the result does not include pyth_upgrade_fake1 and pyth_upgrade_wrong_magic. Did I miss something?

the repo is forked here. Thanks

@Riateche
Copy link
Contributor

Riateche commented Apr 8, 2025

I think what happened is generate_test_data crashed so it didn't generate all data for data.cairo. Looks like generate_test_data fails when it executes scarb. scarb tries to build a plugin and fails because the Rust version override for generate_test_data applies to the plugin build as well. You can fix it by updating Rust toolchain version in target_chains/starknet/tools/test_vaas/rust-toolchain from 1.78.0 to 1.86.0. After that you can run generate_test_data again and check that it finishes successfully.

@iossocket
Copy link
Author

Thanks a lot for your help, the test data can be generated correctly, and all tests pass.

@iossocket
Copy link
Author

iossocket commented Apr 8, 2025

Hi @Riateche, I created a pr #2570, looks like need some member to authorize it. Thanks

@iossocket iossocket reopened this Apr 8, 2025
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

2 participants