ergoplatform / ergoplatform/sigma-rust
Unsafe unwrap in constant substitution
Open
- Dominant language
- Rust
- Stars
- 78
- Forks
- 63
- Avg merge
- 22h 5m
- Merged PRs (30d)
- 3
Description
I don't think calling unwrap is safe here. It's quite easy to create ergo tree that references nonexistent constant
https://github.com/ergoplatform/sigma-rust/blob/3e09084d7acbe1cabd7424e5c31c69a1bf09ffa1/ergotree-ir/src/serialization/expr.rs#L92-L96
Also why constant substitution is even needed? It breaks roundtrip property. If constants are substituted it's no longer possible to serialize script back.
Contributor guide
Assessment
This issue has not been assessed yet.