cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

bug: issue in self referencing struct

Open greged93 opened this issue 1 year ago • 1 comments

I am seeing an issue in the Kakarot RLP decoding step of the transaction. I can't really pinpoint the exact problem but basically what happens is:

  • The value I pass to decode should decode to RLPItem::List([RLPItem::String(a), RLPItem::String(b), RLPItem::String(c)]). https://github.com/kkrt-labs/kakarot-ssj/blob/ecbbb90e718b68dcbff780af14f1acdbd517776d/crates/utils/src/rlp.cairo#L21
  • When I try to decode the transaction in the decode function, all the inputs seem to be read correctly for each recursive call. https://github.com/kkrt-labs/kakarot-ssj/blob/ecbbb90e718b68dcbff780af14f1acdbd517776d/crates/utils/src/rlp.cairo#L167
  • However, when printing the result, all I get are a bunch of RLPItem::String and the RLPItem::List seems to have disappeared.
  • Additionally, each RLPItem::String should normally contain some value Span. When printing them, all values have a length of 0.

I don't know if this is linked but I wrote a very basic recursive program with a self referencing struct which compile and runs on the cairo-vm but crashes on native (see https://github.com/lambdaclass/cairo_native/pull/550).

Let me know if you need more information, I can try to provide whatever more you need.

greged93 avatar Apr 25 '24 17:04 greged93

Hi, i will like to take up this issue.

vibenedict avatar May 20 '24 20:05 vibenedict

This issue is fixed on main, the test is unignored there, closing!

edg-l avatar May 23 '24 06:05 edg-l