Revert "consensus: Add CompactSize range check to deserialization"#6160
Revert "consensus: Add CompactSize range check to deserialization"#6160bigspider wants to merge 1 commit into
Conversation
This reverts commit 91a6e64.
| /// VarInt was encoded in a non-minimal way. | ||
| NonMinimalVarInt, | ||
| /// VarInt value exceeds the maximum allowed size. | ||
| OversizedVarInt, |
There was a problem hiding this comment.
In 8bd7444:
You cannot delete a variant from a public enum like this.
There was a problem hiding this comment.
Adding is backwards compatible, but not removing. You may just lock the lockfile to the previous version since it seems like you're trying to just undo the commit.
| /// the size is encoded as a CompactSize. | ||
| /// | ||
| /// ref: <https://github.com/bitcoin/bitcoin/blob/a7c29df0e5ace05b6186612671d6103c112ec922/src/serialize.h#L32> | ||
| pub const MAX_COMPACT_SIZE: usize = 0x0200_0000; |
|
It seems I misunderstood the suggestion to revert from the issue, and I am therefore closing the PR and leaving the issue to someone else, if there's interest. I already removed the dependency from I am not an expert in Rust, therefore I am not as well-versed in the best practices. However, here is why I think that a revert would be acceptable in this case:
|
|
That's a reasonable viewpoint, but unfortunately it differs from the Rust semver rules, as forced on users by So in order to revert this, we need to leave the error variant and constant in place, document that they're never used (and deprecate them if possible), and remove the code that produces them. I agree that this sort of "silent" behavior change can be insidious. Hopefully, because we are reverting to the same behavior as an earlier version of the crate, and because this is in a non-central part of the API, it will be okay. |
|
I"ll pick this up. Thanks @bigspider. |
This reverts commit 91a6e64 in the
0.32.xbranch.Closes: #6138