After taking a more detailed look at the chunk endorsement tracker module, it turns out a lot of the validation required for chunk endorsements is similar to what we need to partial witness.
This is a complex and sensitive enough topic that it makes sense to share the code between these two modules so that the checks for one can be directly applied to the other.
Current set of checks include things like valid range for "height_created", correct epoch_id, signature validation, etc. These set of checks ensure that a node doesn't get spammed by old or invalid partial witnesses (and in future chunk endorsements).
Right now we rely on having the chunk header before validation of the chunk endorsement that adds a layer of complexity as we may not always have the chunk header while receiving the chunk endorsement.
After taking a more detailed look at the chunk endorsement tracker module, it turns out a lot of the validation required for chunk endorsements is similar to what we need to partial witness.
This is a complex and sensitive enough topic that it makes sense to share the code between these two modules so that the checks for one can be directly applied to the other.
Current set of checks include things like valid range for "height_created", correct epoch_id, signature validation, etc. These set of checks ensure that a node doesn't get spammed by old or invalid partial witnesses (and in future chunk endorsements).
Right now we rely on having the chunk header before validation of the chunk endorsement that adds a layer of complexity as we may not always have the chunk header while receiving the chunk endorsement.
cc @pugachAG @Longarithm @tayfunelmas