chore!: Remove deprecated_serialize_commitment
from API
#85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
TLDR: Imagine you were using a cryptography library which exposed two methods
hash1
andhash2
where the difference between the two of them is thathash1
uses keccak256 andhash2
usessha256
. From the callers perspective you get a 32 byte slice regardless, so having both of these in the API does not add any extra functionality. We can therefore remove one.The existence of
deprecated_serialize_commitment
on the API allows downstream users to serialize a commitment to a 32 byte array.hash_commitment
holds the same functionality, with the exception that the 32 byte array represents a field element. From the perspective of the verkle trie library, these two methods provide the same functionality.Having two ways to convert a commitment to a 32 byte array, where they are used in different places in the code allows for footguns and confusions especially when trying to decide which one to use. Using one in place of the other in the public API, makes it seem like one of them is more special than the other.
See #86