Skip to content

c0mpute edge: mirror c0mpute 0.3.7 site size limits in verified reads - #36

Merged
ralyodio merged 1 commit into
mainfrom
fix/c0mpute-verify-size-limits
Nov 9, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/c0mpute-verify-size-limits

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

lib/c0mpute-verify.ts (#35) mirrors c0mpute hosting/site.rs, whose limits changed in profullstack/c0mpute#222 (v0.3.7). Until now the edge refused any site over 1 GiB from an untrusted gateway.

  • MAX_SITE_BYTES 1 GiB -> 4 TiB: v2 record size, v1 inline manifest total, v2 root bytes
  • v1 records capped at MAX_FREE_SITE_BYTES (64 GiB), matching SiteRecord::check_fields (cap = v >= 2 ? MAX_SITE_BYTES : MAX_FREE_SITE_BYTES)
  • MAX_PARTS = ceil(MAX_FILES/PART_FILES) + 2*ceil((MAX_SITE_BYTES/FILE_CHUNK_BYTES)/PART_CHUNKS) + 2 = 2630 (was 2500), since parts now also close at PART_CHUNKS = 65536 chunks

Checked the rest of the #222 diff to site.rs: MAX_FILE_BYTES (128 GiB), MAX_SMALL_SITE_BYTES and STRIPE_ABOVE are publish/encode-time only, not parse or verification rules, so they are not mirrored. site.rs is unchanged since #222 (v0.3.8 did not touch it).

Tests: a 3 GiB v2 site verifies end to end; a root at 2630 parts verifies and 2631 is refused; a v2 record at 4 TiB passes, 4 TiB + 1 fails; a v1 record at 64 GiB passes, +1 fails. npm test: 134/134 pass.

🤖 Generated with Claude Code

c0mpute #222 (v0.3.7) raised site.rs limits for media-size sites; the edge still refused anything over 1 GiB from an untrusted gateway.

- MAX_SITE_BYTES 1 GiB -> 4 TiB (v2 record size, inline total, parted root)
- v1 records capped at MAX_FREE_SITE_BYTES (64 GiB), as check_fields does
- MAX_PARTS = ceil(MAX_FILES/PART_FILES) + 2*ceil((MAX_SITE_BYTES/FILE_CHUNK_BYTES)/PART_CHUNKS) + 2 = 2630

MAX_FILE_BYTES (128 GiB) is a publish-time check only, not a parse rule, so it is not mirrored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit e040d5d into main Nov 9, 2026
3 checks passed
@ralyodio
ralyodio deleted the fix/c0mpute-verify-size-limits branch November 9, 2026 13:54
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.

1 participant