Repository navigation
Reject unrepresentable sequence tree sizes - #307
Merged
Merged
Conversation
lukevalenta
requested review from
a team,
bwesterb,
cjpatton,
lbaquerofierro and
mendess
as code owners
October 16, 2026 15:18
lukevalenta
added this pull request to stack #309
October 16, 2026 15:27
lukevalenta
force-pushed
the
lvalenta/tree-size-bounds
branch
from
October 19, 2026 12:30
b408fdb to
a2bfcf4
Compare
lbaquerofierro
approved these changes
Oct 20, 2026
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.
Why
The pool uses the prospective tree size to decide whether a batch crosses a tile boundary. Unchecked addition can wrap at
u64::MAX, making that scheduling decision inconsistent with the size later used for storage. Even without arithmetic overflow, some large sizes cannot be represented by the hash-storage index encoding.This change validates the prospective size before tile planning and sequencing. It rejects arithmetic overflow, an optional application maximum, and sizes rejected by
tlog_core::stored_hash_count, returning a non-fatal sequencing error rather than constructing invalid paths or panicking.Compatibility
No on-wire representation changes. Valid logs continue to publish the same RFC 6962 hashes and current versionless
c2sp.org/tlog-tilestile and entry-bundle resources. The check enforces the implementation bounds needed to produce those resources; it is stacked on #299 because the fallible storage-index API originates there.