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

Consider removing reserved bytes from the first compact share #36

Open
rootulp opened this issue Dec 19, 2022 · 0 comments
Open

Consider removing reserved bytes from the first compact share #36

rootulp opened this issue Dec 19, 2022 · 0 comments

Comments

@rootulp
Copy link
Collaborator

rootulp commented Dec 19, 2022

Context

Since the location of the first unit (e.g. transaction) in a share is known for the first compact share in a sequence, the reserved bytes are predictable: they always contain the index immediately after the prefix. Given this observation, @cmwaters shared a great idea: it is possible to remove reserved bytes for the first compact share in a sequence. This implies that a compact share either has a sequence length (if first share) or reserved bytes (if continuation share) but never both. Given we are adopting option D in ADR 12 this has the benefit that the prefix always occupies the same number of bytes (13).

Proposal

First compact share

first-compact-share (1)

Continuation compact share

compact_continuation_share (1)

Consequences

Pros

  • four fewer bytes of wasted space in every compact share sequence. Currently transactions are the only compact share sequence in use so this results in the marginal benefit of four fewer bytes of wasted space per block.
@rootulp rootulp transferred this issue from celestiaorg/celestia-app Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants