Closed rach-id closed 3 weeks ago
So I am wondering if it makes sense to remove the proof verification from the Validate method, and keep it only doing basic checks. And putting the responsibility of verifying the proof on Verify.
That makes sense to me and aligns with how I would interpret Validate
vs. Verify
.
The issue is that it will be a breaking change... Should we just create a PR for it in main
and leave it there until someday?
Hmm yea I think it's still worth fixing. Separately we also need to figure out how we're going to release celestia-core breaking changes (cc: @evan-forbes because figuring that out seems like it falls into the maintenance workstream).
Currently, in the implementation of
ShareProof
andRowProof
, we haveValidate()
andVerify()
methods. Now I am looking at the implementation, both of them seem to be doing the same thing.https://github.com/celestiaorg/celestia-core/blob/b67d79ecbdb8ebb046131a1f733356fa915dc192/types/row_proof.go#L24-L52
and,
https://github.com/celestiaorg/celestia-core/blob/b67d79ecbdb8ebb046131a1f733356fa915dc192/types/share_proof.go#L66-L133
Validate
: runs some basic checks on the proof, then attempts to verify the proof against the rootVerify
: goes straight to verifying the proof against a rootI am thinking that if a
proof.Verify
returnstrue
, then it's a valid proof. Similarly, if aproof.Validate
returnstrue
, there is no need to callVerify
. So they're basically the same methods.So I am wondering if it makes sense to remove the proof verification from the
Validate
method, and keep it only doing basic checks. And putting the responsibility of verifying the proof onVerify
.What do you think?