Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

banderwagon: fix bytes uncompressed #71

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented Feb 23, 2024

This PR fixes a situation found by @advaita-saha.

The situation is that BytesUncompressed() returns serialized bytes in a "trusted" fashion -- that is, simply the X and Y coordinates to be deserialized later. That's fine, but in SetBytesUncompressed(..., trusted bool) we allow both trusted and untrusted deserialization. So if you call SetBytesUncompressed(...) with the wrong trusted flag then it will fail.

The reality is that we don't use uncompressed bytes serialization from untrusted sources in any place in geth (at least for now), so what I do here is to be a bit more clear about expectations in the API.

Concretely, rename to BytesUncompressedTrusted() which gives a clear signal that in the future those bytes can be deserialized with SetBytesUncompressed(..., true).

I added a test that shows this case.

Signed-off-by: Ignacio Hagopian <[email protected]>
@jsign jsign marked this pull request as ready for review February 23, 2024 12:25
@jsign jsign requested a review from kevaundray February 23, 2024 12:42
@kevaundray kevaundray merged commit b1e8a79 into master Feb 23, 2024
2 checks passed
@jsign jsign deleted the jsign-bytes-uncompressed branch February 23, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants