Closed JesperTreetop closed 2 years ago
Really good observation! Bencode integers are unlimited, so in the binary encoding we are completely future-proof, but in practice implementations should use signed 64 bit integers. See the two PRs linked to this issue.
Quick turnaround! I know that bencoded integers are ASCII decimal digits, it was more about the explicit mention of "32-bit"-ness, which some people may build into deserialization invariants. The test clarifies what the expected behavior is though.
With those 2 PRs merged, I believe this issue is now addressed.
Item 4 in the specification mentions:
If the integer is signed, this allows only a further ~16 years until UNIX epoch timestamp wraparound, which for a purposely long-term format I assume is an issue. (If it's an unsigned integer, it extends it until 2106, which may give "sufficient" additional time for the life of the format.)