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

Allow 3 bytes of padding in the object retriever, not 2 #3324

Closed
teor2345 opened this issue Dec 18, 2024 · 0 comments · Fixed by #3332
Closed

Allow 3 bytes of padding in the object retriever, not 2 #3324

teor2345 opened this issue Dec 18, 2024 · 0 comments · Fixed by #3332
Assignees
Labels
bug Something isn't working networking Subspace networking (DSN)

Comments

@teor2345
Copy link
Member

teor2345 commented Dec 18, 2024

Ah right, I see what you’re saying. When we split an object at the exact length of the segment, we could end up reducing the length of its encoded size. Which would leave padding.

There is no custom logic to handle this padding, it just happens. So even if the encoded size goes down 2 bytes, we don’t try to fit another byte in there.

By the way, this means there’s a bug in the object retrieval code, because it assumes the padding is 2 bytes or less. But the archiver code can generate 3 byte padding if it splits a block that’s 2^14 bytes (or larger), and the length in the first segment is 63 bytes or less.

https://wentelteefje.github.io/parity-scale-codec/encode/#243-four-byte-mode

Originally posted by @teor2345 in #3318 (comment)

@teor2345 teor2345 self-assigned this Dec 18, 2024
@teor2345 teor2345 added bug Something isn't working networking Subspace networking (DSN) labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working networking Subspace networking (DSN)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant