You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
executeFromVar and executeFromReg execute Exprs from context vars/registers. This is implemented by replacing instances of DeserializeContext/DeserializeRegister nodes with exprs during deserialization. In sigma-rust however this is done during evaluation:
let expected_tpe = SType::SColl(SType::SByte.into());
if c.tpe != expected_tpe {
Err(EvalError::UnexpectedExpr(format!(
"DeserializeContext: expected extension value {} with id {} to have type {:?} got {:?}",
c, self.id, expected_tpe, c.tpe
)))
}else{
let bytes = c.v.clone().try_extract_into::<Vec<u8>>()?;
let expr = Expr::sigma_parse_bytes(bytes.as_slice())?;
if expr.tpe() != self.tpe{
returnErr(EvalError::UnexpectedExpr(format!("DeserializeContext: expected deserialized expr from extension value {} with id {} to have type {:?}, got {:?}", c, self.id, self.tpe, expr.tpe())));
}
expr.eval(env, ctx)
}
}
None => Err(EvalError::NotFound(format!(
"DeserializeContext: no value with id {} in context extension map {}",
self.id, ctx.extension
))),
}
}
}
Which makes recursion (and stack overflows) possible:
ExecuteFromVar's implementation should instead match sigmastate-interpreters, Reference. DeserializeContext and DeserializeRegister should also not implement Evaluable
The text was updated successfully, but these errors were encountered:
executeFromVar and executeFromReg execute Exprs from context vars/registers. This is implemented by replacing instances of DeserializeContext/DeserializeRegister nodes with exprs during deserialization. In sigma-rust however this is done during evaluation:
sigma-rust/ergotree-interpreter/src/eval/deserialize_context.rs
Lines 13 to 42 in e56e6fa
Which makes recursion (and stack overflows) possible:
ExecuteFromVar's implementation should instead match sigmastate-interpreters, Reference. DeserializeContext and DeserializeRegister should also not implement Evaluable
The text was updated successfully, but these errors were encountered: