cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
remove static lifetime for name str parameter requirement for constant getter
Description
Hey!
I noticed get_constant_from_var_name has a different signature from other hint_utils helper functions, namely that it has a bound of static lifetime on the name parameter. I noticed it mainly comes from the error signature HintError::MissingConstant.
I changed the signature of MissingConstant to match other errors: from Box<'static &str> to Box using the same util you use around the hint error codebase: var_name.to_string().into_boxed_str().
In doing this, one no longer needs to have 'static strings for constant getting -> this will allow me in next PRs to have dynamic constant name getting, i.e., in garaga there are constant limbs of Prime P of the BN Curve.
And depending on N_LIMBS, we'll get P_i.
remove static lifetime for name str parameter requirement for constant getter
Description
Hey! I noticed
get_constant_from_var_name
has a different signature from other hint_utils helper functions, namely that it has a bound of static lifetime on the name parameter. I noticed it mainly comes from the error signatureHintError::MissingConstant
.I changed the signature of using the same util you use around the hint error codebase:
MissingConstant
to match other errors: from Box<'static &str> to Boxvar_name.to_string().into_boxed_str()
.In doing this, one no longer needs to have 'static strings for constant getting -> this will allow me in next PRs to have dynamic constant name getting, i.e., in garaga there are constant limbs of Prime P of the BN Curve. And depending on
N_LIMBS
, we'll getP_i
.Let me know if this works!