Closed raphaelDkhn closed 9 months ago
Hello, we can definitely fetch the arrays from memory when fetching the return values to show the full arrays instead of their start and end addresses, but I find the expected format a bit confusing. I would suggest serializing it as [2 2] [1 2 3 4]
instead to match the convention used for input args and we don't mix up the amount of elements on the array with the actual array elements
Hello, we can definitely fetch the arrays from memory when fetching the return values to show the full arrays instead of their start and end addresses, but I find the expected format a bit confusing. I would suggest serializing it as
[2 2] [1 2 3 4]
instead to match the convention used for input args and we don't mix up the amount of elements on the array with the actual array elements
I was following the same serialization than Cairo (if I'm not mistaken). But your suggestion sounds good as well.
Describe the bug
I'm encountering an issue with struct serialization when running a Cairo1 program with
cairo1-run
. When a struct is returned from the program, the serialized return does not match the expected output. Here's the Cairo program I'm testing:Here is the cairo program I'm testing:
After running
cargo run ../cairo_programs/cairo-1-programs/tensor.cairo --layout all_cairo --args '[2 2] [1 2 3 4]'
it returns:However, I expected it to return:
The discrepancy suggests an issue with how the struct is being serialized upon return.
What version/commit are you on? Current Version/Commit: Branch
cairo-1-input-args
From this PR: https://github.com/lambdaclass/cairo-vm/pull/1551