Repository navigation
feat(core)!: remove unused Piece merkle, fr32 and sizing exports - #1163
Conversation
PieceCID hashing goes through commp-wasm, so nothing outside the tests used these exports or the internals behind them. BREAKING CHANGE: these are no longer exported from `@filoz/synapse-core/piece`: `merkle` (`computeNode`, `truncate`, `zeroRoot`), `fr32` (`expand`, `reduce`), `paddedSizeFor`, `heightFor`, `paddedSizeAtHeight`, `MIN_SIZE`, `MAX_SIZE`, `MAX_HEIGHT` and `BYTES_PER_QUAD`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
filecoin-encryption-envelope
@filoz/keysmith
@filoz/synapse-core
@filoz/synapse-react
@filoz/synapse-sdk
commit: |
|
Docs preview: https://pr-1163-synapse-dev.filoz.workers.dev Built from 41a4d8d. |
|
@pullfrog review |
There was a problem hiding this comment.
✅ No new issues found.
Approach: Sound as a breaking release — removing the unused JavaScript helpers narrows the public API without changing the WASM hashing or upload validation paths.
Reviewed changes — I checked the full diff against the published API, in-repo callers, and CI results.
- Public exports: The removal affects both
@filoz/synapse-core/pieceand the rootpiecenamespace. I found no remaining in-repo callers of the removed exports.PieceCID.paddedSizestill works for an existing CID, but it is not a replacement forpaddedSizeForwhen only the raw size is known. - Internal cleanup: The unused FR32, Merkle, and sizing code is gone; the digest and size logic used by
PieceCIDis unchanged. - Coverage: The shared test fixture preserves checks at the 64 GiB padded upload boundary and one raw byte above it. GitHub CI passed the core and SDK test jobs, lint, and the docs build.
gpt-6.2-sol | 𝕏

What
Removes public exports from
@filoz/synapse-core/piecethat nothing uses, and the internals that only existed for them.Breaking: no longer exported
Piece.merkle:computeNode,truncate,zeroRootPiece.fr32:expand,reducepaddedSizeFor,heightFor,paddedSizeAtHeight,MIN_SIZE,MAX_SIZE,MAX_HEIGHT,BYTES_PER_QUADInternal cleanup in
piece/internalmerkle.ts,zero-comm.ts,fr32.tsanduint64.ts.size.ts,digest.tsandconstants.ts, and made constants private where nothing else imports them.Why
PieceCID hashing goes through
commp-wasm, so these were leftovers from the old JS implementation. No package, example or app in this repo used them outsidesynapse-core's own tests. A public GitHub code search for most of these names found no outside users either, though it can't see private code.Reviewer notes
MAX_SIZEandMAX_HEIGHT, and this one removes them. If both ship in the same release, the changelog will list the fix and the removal.paddedSizeFor: callers can no longer get a piece's padded size without hashing.PieceCID.paddedSizestill works once there is a PieceCID. Upload validation is unaffected because it usesSIZE_CONSTANTS.MULTIHASH_CODE,MULTIHASH_NAMEandCODEC_CODEstay public.pieceCidWithRawSizehelper is now shared intest/utils/piece-cid.tswith its own height calculation.Testing
synapse-coreand its dependents, including the docs build.synapse-coretests pass in Node (1156) and the browser (1148).🤖 Generated with Claude Code