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

bug: Cairo 0 syscalls fail #413

Open
apoorvsadana opened this issue Oct 21, 2024 · 2 comments
Open

bug: Cairo 0 syscalls fail #413

apoorvsadana opened this issue Oct 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@apoorvsadana
Copy link
Contributor

SNOS version:

662d170

Current behavior:

SNOS fails when running on Cairo 0 contract. This is the error message

tx.hash_value: 2745021216243222200639607065518946078091807191717680760070227238600043900493, transaction_hash: 2745021216243222200639607065518946078091807191717680760070227238600043900493
thread 'test_prove_selected_blocks::case_1_local_block' panicked at crates/bin/prove_block/tests/prove_block.rs:78:14:
OS generate Cairo PIE: SnOsError(Runner(VmException(VmException { pc: Relocatable { segment_index: 107, offset: 170 }, inst_location: None, inner_exc: Hint((0, MissingConstant("MAX_HIGH"))), error_attr_value: None, traceback: Some("Cairo traceback (most recent call last):\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_entry_point.cairo:219:46: (pc=0:5029)\n        let (retdata_size, retdata: felt*) = deprecated_execute_entry_point(\n                                             ^*****************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_entry_point.cairo:194:5: (pc=0:5011)\n    call_execute_deprecated_syscalls(\n    ^*******************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:542:16: (pc=0:5488)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:529:16: (pc=0:5467)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:440:16: (pc=0:5327)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:440:16: (pc=0:5327)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:484:16: (pc=0:5397)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:440:16: (pc=0:5327)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:484:16: (pc=0:5397)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:500:16: (pc=0:5422)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:440:16: (pc=0:5327)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:500:16: (pc=0:5422)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:440:16: (pc=0:5327)\n        return execute_deprecated_syscalls(\n               ^**************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:475:9: (pc=0:5389)\n        execute_contract_call_syscall(\n        ^****************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:156:12: (pc=0:5114)\n    return contract_call_helper(\n           ^*******************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_syscalls.cairo:98:55: (pc=0:5064)\n        let (retdata_size, retdata, _is_deprecated) = select_execute_entry_point_func(\n                                                      ^******************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_entry_point.cairo:219:46: (pc=0:5029)\n        let (retdata_size, retdata: felt*) = deprecated_execute_entry_point(\n                                             ^*****************************^\n/Users/apoorvsadana/Documents/GitHub/snos/cairo-lang/src/starkware/starknet/core/os/execution/deprecated_execute_entry_point.cairo:168:5: (pc=0:4982)\n    call abs contract_entry_point;\n    ^***************************^\nUnknown location (pc=107:26045)\nUnknown location (pc=107:25950)\n") })))

Expected behavior:

SNOS is able to run Cairo 0 blocks. Ideally for Madara, if we can run SNOS on Sepolia blocks 0->10, that almost ensures Madara boostrapper works fine because a lot of what we do in the bootstrapper is linked to this.

Steps to reproduce:

Run SNOS on Sepolia block 248706

@apoorvsadana apoorvsadana added the bug Something isn't working label Oct 21, 2024
@HermanObst
Copy link
Collaborator

Hey @apoorvsadana this issue was addressed by #410

Im curious why do you generalize it as SNOS not being able to run Cairo 0 syscalls (vs a failure in this one specifically)

@apoorvsadana
Copy link
Contributor Author

apoorvsadana commented Oct 30, 2024

Oh interesting. The reason I generalised it was because when I tried running SNOS on Madara with Cairo 0 Eth token, it failed with a similar error. However, upgrading Eth token to Cairo 1 resolved the issue.

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

No branches or pull requests

2 participants