Closed arvidn closed 10 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/serde/tools.rs | 119 | 122 | 97.54% | ||
<!-- | Total: | 119 | 122 | 97.54% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/serde/tools.rs | 4 | 97.18% | ||
<!-- | Total: | 4 | --> |
Totals | |
---|---|
Change from base Build 7261384226: | 0.03% |
Covered Lines: | 5405 |
Relevant Lines: | 5762 |
This PR adds an implementation of
serialized_length_from_bytes()
where any back-references are validated. Rename the existing function to indicate that the input is trusted (i.e. not fully validated).In support of this, it also adds:
serialized_length_from_bytes()
also parses correctlyobjective
The objective is to ensure that the buffer is a valid serialization if it passes this function. That way, an invalid CLVM program fails early, at parse-time, rather than time-of-use. Currently, the
Program
class inchia_rs
(the counterpart toSerializedProgram
) is parsed in a relaxed manner, and so might fail later, inrun()
.This can also tie into trusted- and untrusted parsing of
Streamable
. So trusted programs don't need to be validated to the same extent.benchmarks: