Skip to content

Reject unrepresentable sequence tree sizes - #307

Merged
lukevalenta merged 2 commits into
mainfrom
lvalenta/tree-size-bounds
Oct 20, 2026
Merged

lukevalenta merged 2 commits into
mainfrom
lvalenta/tree-size-bounds

Conversation

@lukevalenta

@lukevalenta lukevalenta commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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-tiles tile 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.

@lukevalenta
lukevalenta added this pull request to stack #309 October 16, 2026 15:27
@lukevalenta lukevalenta self-assigned this Oct 16, 2026
Comment thread crates/generic_log_worker/src/log_ops.rs
Base automatically changed from lvalenta/mtc-subtree-vectors to main October 19, 2026 12:30
@lukevalenta
lukevalenta force-pushed the lvalenta/tree-size-bounds branch from b408fdb to a2bfcf4 Compare October 19, 2026 12:30
@lukevalenta
lukevalenta merged commit 9e2b28c into main Oct 20, 2026
13 checks passed
@lukevalenta
lukevalenta deleted the lvalenta/tree-size-bounds branch October 20, 2026 12:11
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.

2 participants