smite: add tu32/tu64 truncated integer wire types - #166
Merged
Conversation
NishantBansal2003
approved these changes
Jul 28, 2026
erickcestari
force-pushed
the
bolt-truncated-integers
branch
from
July 28, 2026 17:01
d69ae03 to
fabeea3
Compare
Contributor
Author
|
Thanks for the review @NishantBansal2003 . I've addressed your nits! |
morehouse
reviewed
Jul 30, 2026
erickcestari
force-pushed
the
bolt-truncated-integers
branch
from
July 31, 2026 13:55
fabeea3 to
3c84efb
Compare
BOLT 1 truncated integers show up as TLV values in BOLT 4 hop payloads (amt_to_forward, outgoing_cltv_value, total_msat). They are big-endian with leading zero bytes stripped, so their width is only recoverable from the enclosing TLV record: read consumes all remaining bytes, which makes them usable with TlvStream::get_as but not as a field in the middle of a message. Non-minimal encodings and values wider than the integer are rejected.
erickcestari
force-pushed
the
bolt-truncated-integers
branch
from
July 31, 2026 14:02
3c84efb to
f66eb9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This will be needed for BOLT 4 hop payloads, which use
tu32andtu64to encode fields.