NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
82 stars 49 forks source link

`MemcpyContinueCopying` hint is wrongly implemented #436

Closed TAdev0 closed 4 months ago

TAdev0 commented 4 months ago

the hint is

    //> n -= 1
        //> ids.continue_copying = 1 if n > 0 else 0

n is a value stored in the scope.

Currently we do

        newN := new(f.Element)
            newN = newN.Sub(n.(*f.Element), &utils.FeltOne)

            if err := ctx.ScopeManager.AssignVariable("n", newN); err != nil {
                return err
            }

this is not the expected behavior as we store a pointer to n, instead of n in scope

danielcdz commented 4 months ago

Hello @TAdev0! I worked on adding that hint, I think I have enough context to solve the issue, so I will be happy to help!

TAdev0 commented 4 months ago

Hey @danielcdz , someone else is already working on it!