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

VirtualMachine error when using Felt252Dict<T> #1788

Closed
catusax opened this issue Jun 12, 2024 · 2 comments
Closed

VirtualMachine error when using Felt252Dict<T> #1788

catusax opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@catusax
Copy link
Contributor

catusax commented Jun 12, 2024

Describe the bug
when using Felt252Dict in cairo1, vm reports an error:

Error: VirtualMachine(DiffAssertValues((RelocatableValue(Relocatable { segment_index: 13, offset: 0 }), RelocatableValue(Relocatable { segment_index: 14, offset: 3 }))))

To Reproduce
Steps to reproduce the behavior:

please go to this repo for a full example: https://github.com/catusax/cairovm-felt252dict-error

when i use this source code, compile to serria, and run with --print_output --proof_mode --layout all_cairo, the error occurs:

fn main(input:Array<felt252>) -> Array<felt252> {
    let elements: Felt252Dict<Nullable<Span<u8>>> = Default::default();
    input
}

but if i remove the function params ,it works fine

fn main() -> Array<felt252> {
    let elements: Felt252Dict<Nullable<Span<u8>>> = Default::default();
    array![1]
}

Expected behavior
this should has same result as the scarb cairo-run, which works fine

What version/commit are you on?
3f9428e

Additional context
Add any other context about the problem here.
https://github.com/catusax/cairovm-felt252dict-error

@catusax catusax added the bug Something isn't working label Jun 12, 2024
@catusax
Copy link
Contributor Author

catusax commented Jun 12, 2024

this was introduced by #1759

@fmoletta
Copy link
Contributor

fmoletta commented Jun 12, 2024

Hello! Thank you for reporting this! #1789 should fix it once merged

@catusax catusax closed this as completed Jun 13, 2024
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