Skip to content

sat: packet: accept any payload length up to the max#238

Draft
buckleypaul wants to merge 1 commit into
HubbleNetwork:mainfrom
buckleypaul:sat-packet-flexible-payload-length
Draft

sat: packet: accept any payload length up to the max#238
buckleypaul wants to merge 1 commit into
HubbleNetwork:mainfrom
buckleypaul:sat-packet-flexible-payload-length

Conversation

@buckleypaul

Copy link
Copy Markdown
Collaborator

Callers had to size satellite payloads to one of the exact wire sizes (0, 4, 9, 13) or the call was rejected, pushing padding decisions onto every caller. Round the length up to the next supported size and zero-pad instead, so callers can pass their data as-is. The supported sizes and their derived symbol/ECC counts now live in a single table rather than three parallel lookups that had to stay in sync.

Callers had to size satellite payloads to one of the exact wire sizes
(0, 4, 9, 13) or the call was rejected, pushing padding decisions onto
every caller. Round the length up to the next supported size and
zero-pad instead, so callers can pass their data as-is. The supported
sizes and their derived symbol/ECC counts now live in a single table
rather than three parallel lookups that had to stay in sync.

Signed-off-by: Paul Buckley <paul@hubble.com>
@HongNguyen635

HongNguyen635 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

I believe we discussed this before, and the problem is that we don't know if the customer could be using 0 to indicate something.

So if they send 3 bytes for example, does the backend returns 4 bytes as decoded, including the 0 padded? Or does the backend stripped all the 0s?

The latter case won't work, and the former case cause confusion. They will need to handle the padded 0s anyway. The argument here is that they know the number of payload they handed in from the application, versus us doing the rounding. So they have to figure out which size if the right one.

But I don't make the call on these, so we can definitely change if this is intended / works better than allow fixed size payload.

@ceolin

ceolin commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Yeah, we have discussed it. Padding introduce ambiguity and unless we have a way to avoid it is better to have this protocol requirement explicitly.

@ceolin ceolin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting -1 to avoid it getting mistakenly merged.

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.

3 participants