Skip to content

chore(deps): bump p-some to 8 and cborg to 7 - #1164

Open
hugomrdias wants to merge 3 commits into
masterfrom
claude/project-thread-8iyb7k
Open

hugomrdias wants to merge 3 commits into
masterfrom
claude/project-thread-8iyb7k

Conversation

@hugomrdias

@hugomrdias hugomrdias commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Requested by Hugo · project thread

This PR has one commit per package so release-please can split the changelogs.

  • core: p-some 7.0.0 → 8.0.0. v8 requires Node >=22, which is already our floor. It also tightens the types and marks pending input promises as handled. resolvePieceUrl only calls it with count: 1 and no filter, so behaviour doesn't change.

  • keysmith: cborg ^6.2.1 → ^7.0.0. ⚠️ This changes the bytes of some grants. cborg 7 writes every float16 subnormal as a 3-byte f9 item. cborg 6 wrote the ones that aren't powers of two as a 5-byte f32, for example 3 * 2^-24: fa34400000 in v6, f90003 in v7. decodeGrant and decodeArray only accept the bytes the current encoder writes. That affects a v2 grant whose informational fields hold such a value:

    • if it was written with cborg 6, it no longer opens;
    • if it is written now, it won't open on a reader still on cborg 6.

    Descriptor fields are never floats, so only the unauthenticated informational fields can hit this. We're keeping the change on purpose, because v7's output is RFC 8949 preferred serialization (the shortest float that keeps the exact value). A new regression test in wrap.test.ts pins the new encoding and checks that the cborg 6 bytes are refused. None of the other 7.0.0 breaking changes affect keysmith.

  • encryption: cborg 6.2.1 → 7.0.0. cborg 7 now throws on encode when two map keys encode to equal bytes. The envelope encoder already rejects those with MalformedEnvelopeError before reaching cborg, and it rejects floats entirely, so production behaviour doesn't change. Four decode tests built their malformed fixtures through cborg's encoder and started hitting that throw. They now use a test-only rfc8949AllowDuplicateKeysOptions helper that keeps byte-equal keys, so the duplicates still reach the decoder.

The playwright-test mocha runner stops at the first failure. That one failure was hiding about 400 encryption tests, so I ran the suite with --no-bail to make sure only these four were affected.

Verification

Run locally on Node 26.13.1:

  • pnpm -r --filter './packages/*' run build passes. This builds every package, including test type checks.
  • biome check is clean in core, sdk, keysmith and encryption.
  • Tests, node and browser:
    • filecoin-encryption-envelope: 699 node and 687 browser passing
    • keysmith: 180 and 180 passing
    • synapse-core: 1182 and 1174 passing
    • synapse-sdk: 319 and 319 passing
  • pnpm install --frozen-lockfile passes.
  • CI is green on f2c2007.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B6TcqNQtEWq7PdzUdFitUx

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Nov 24, 2026
@socket-security

socket-security Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedp-some@​7.0.0 ⏵ 8.0.0100 +1100100 +186 +6100
Updatedcborg@​6.2.1 ⏵ 7.0.0100100100 +195100

View full report

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

filecoin-encryption-envelope

npm i https://pkg.pr.new/filecoin-encryption-envelope@1164

@filoz/keysmith

npm i https://pkg.pr.new/@filoz/keysmith@1164

@filoz/synapse-core

npm i https://pkg.pr.new/@filoz/synapse-core@1164

@filoz/synapse-react

npm i https://pkg.pr.new/@filoz/synapse-react@1164

@filoz/synapse-sdk

npm i https://pkg.pr.new/@filoz/synapse-sdk@1164

commit: f2c2007

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview: https://pr-1164-synapse-dev.filoz.workers.dev

Built from f2c2007.

8.0.0 requires Node >=22 (already our floor), tightens the types and marks
pending input promises as handled. resolvePieceUrl only uses count: 1 with
no filter, so behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6TcqNQtEWq7PdzUdFitUx
@hugomrdias
hugomrdias force-pushed the claude/project-thread-8iyb7k branch from d7316c9 to 3dfb554 Compare November 24, 2026 12:09
@hugomrdias
hugomrdias marked this pull request as ready for review November 24, 2026 12:10
@hugomrdias hugomrdias self-assigned this Nov 24, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The Keysmith upgrade makes some previously stored v2 grants unreadable. The core and encryption envelope upgrades can land independently.

Approach: Upgrading each package separately is sound, but Keysmith uses the encoder’s exact output to decide which stored grants it accepts.

Reviewed changes — I checked the three dependency bumps, the lockfile, and the affected runtime paths. The focused resolver tests and the encryption envelope and Keysmith Node suites passed; a separate cross-version check reproduced the grant regression.

  • Synapse Core: p-some 8 matches the Node.js 22 floor and preserves the first-success behavior of resolvePieceUrl.
  • Encryption envelope: The cborg 7 fixture helper emits the same duplicate-key bytes as v6, so the decoder tests still exercise rejection on the wire.
  • Keysmith: Existing fixed vectors pass, but they do not cover informational fields whose numeric encoding changes in cborg 7.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol | 𝕏

"@noble/curves": "^2.4.0",
"@noble/hashes": "^2.4.0",
"cborg": "^6.2.1"
"cborg": "^7.0.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bump makes some stored v2 grants unreadable even though their authenticated fields haven’t changed. Keysmith passes informational values through to the encoder, and decodeGrant rejects any grant whose bytes differ from what the current encoder writes. I verified that a grant with weight: 3 * 2 ** -24 opens with cborg 6 but is rejected as noncanonical with 7; grants newly written with 7 also fail on 6.

Technical details
# Preserve compatibility for serialized v2 grants

## Affected sites
- `packages/keysmith/src/wrap.ts:168–186` — `encodeGrant` passes informational fields through unchanged. With `3 * 2 ** -24`, cborg 6.2.1 writes `fa34400000`, while cborg 7.0.0 writes `f90003` (the shorter float16 encoding).
- `packages/keysmith/src/wrap.ts:124–125,196–207` — `decodeGrant` checks byte equality against the current encoder, and `unwrapWith` calls it for serialized grants.
- `packages/keysmith/src/claims.ts:793–796` — `decodeDelivery` uses the same grant decoder.

## Required outcome
- Previously issued v2 grant bytes must still open after an upgrade. Preserve interoperability with existing v2 readers unless the wire format change is explicitly versioned and migrated.

## Suggested approach
- Keep Keysmith on cborg 6 in this PR. If upgrading separately, add a regression fixture emitted by cborg 6 with this informational value and verify that it still opens.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: 3 * 2 ** -24 encodes as fa34400000 with cborg 6 and f90003 with cborg 7, and decodeGrant rejects the old bytes. We're keeping the bump on purpose. cborg 7's output is RFC 8949 preferred serialization (the shortest float that preserves the value), and only unauthenticated informational fields can hold floats.

Pushed in f2c2007:

  • The keysmith commit subject now names the change, so it shows up in the changelog. The body explains the compatibility impact in both directions.
  • A regression test in wrap.test.ts pins the new f90003 encoding and checks that the cborg 6 bytes are refused as non-canonical.

Generated by Claude Code

…6 subnormals

cborg 7 writes every float16 subnormal as a 3-byte f9 item. cborg 6 wrote
those that are not powers of two (multiples of 2^-24 below 2^-14, e.g.
3 * 2^-24) as a 5-byte f32. decodeGrant and decodeArray only accept the
bytes the current encoder writes, so a v2 grant whose informational fields
hold such a value no longer opens if it was written on cborg 6, and one
written now does not open on a reader still on cborg 6. Descriptor fields
are integers, strings and bytes, so only informational fields can hit this.

Add a regression test pinning the new encoding and the refusal of the
cborg 6 bytes. The other 7.0.0 breaking changes do not touch keysmith: it
does not use strictUtf8, cborg/json, ByteWriter or boxed primitives, and
decoded maps cannot carry duplicate keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6TcqNQtEWq7PdzUdFitUx
cborg 7 throws on encode when two map keys encode to equal bytes. The
envelope encoder already rejects those itself with MalformedEnvelopeError
before reaching cborg, so production behaviour is unchanged.

Four decode tests built their malformed fixtures through cborg's encoder
and now hit that throw. Add an rfc8949AllowDuplicateKeysOptions test helper
that keeps byte-equal keys so the fixtures still put duplicates on the
wire for the decoder to reject. The test runner bails on the first
failure, so this one break was hiding the rest of the suite.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📌 Triage

Development

Successfully merging this pull request may close these issues.

2 participants