kkrt-labs / cairo-vm-ts

A typescript implementation of the Cairo VM
Apache License 2.0
20 stars 13 forks source link

feat: implement Cairo Zero hint processor #96

Closed zmalatrax closed 4 months ago

zmalatrax commented 4 months ago

To implement hints, a few things are needed:

When instantiating the CairoRunner, the constants are extracted and the hints are transformed into an exploitable format to be stored as VirtualMachine attributes.

Some hints are using data from other hints, the ScopeManager is a stack of dictionaries (scopes) which allows sharing data across hints.

There still needs to add JSDoc and a few util methods might be implemented later on if a group of hints needs it. At the moment it works but it might not be following our coding guidelines, parts might/should be refactored

zmalatrax commented 4 months ago

This PR aimed at implementing the Cairo Zero hints with their current format, which forces us to "compile" the hints (parse of references, apply ap tracking and a few other things) that we believe should not be part of the VM.

Therefore, until we have a way to pre-process the current compilation artifacts and provide artifacts which abstract this hint compilation from the VM, I'm closing this PR