Skip to content

fix(zk-tls): pin one checked witness commit and reinstall when it changes - #294

Merged
lolaaimar merged 1 commit into
mainfrom
fix/zk-tls-witness-pin
Nov 25, 2026
Merged

lolaaimar merged 1 commit into
mainfrom
fix/zk-tls-witness-pin

Conversation

@nicolasLuduena

@nicolasLuduena nicolasLuduena commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Part of #211, split out of #248. Stack: #291 → #292 → #293 → #294; merge in that order. Based on #293. Developer tooling only; nothing here ships to dApps.

start-witnesses.sh installed the witness clone's dependencies once, so changing WITNESS_REF or PINNED_REF ran the new commit's source on the old node_modules. It now records the commit it installed for:

 start-witnesses.sh
   check out PINNED_REF (or WITNESS_REF)
-  if node_modules/re2 is missing
+  if node_modules/.thoth-installed-ref != HEAD
     npm install
+    write HEAD to the stamp          # only after the install succeeds

The attestor guide's manual setup cloned upstream's default branch with --depth 1. It now checks out the script's commit:

git clone --filter=blob:none https://github.com/reclaimprotocol/attestor-core
cd attestor-core
git checkout --detach f451eb3c3038efcf7c11b2497d7540d8f1e95752

witness-pin.test.ts gets a VERIFIED_PINS table: attestor-core version → the commit verified with the live check. The test fails unless the script's PINNED_REF is that commit, no two versions share a commit, and the guide checks the same commit out.

Evidence

  • Before: start-witnesses.test.ts's new reinstall test fails against main's script. The script checks out the new commit, skips the install, and starts witnesses without that commit's new dependency.
    After: these pass:

    start-witnesses.sh > reinstalls the dependencies when the pinned commit changes
    witness pin > pins the full commit verified for that version
    witness pin > checks out the script's commit in the attestor guide's manual setup
    witness pin > moves the commit with every version
    

The guide's clone and checkout, run against upstream:

HEAD is now at f451eb3 [FIX] update TLS lib (#124)
package.json version at the pin: 5.1.4

5.1.4 is expected: upstream never bumped package.json, and this commit is the source of the npm 5.1.6 release.

Build, types, Biome and the full suite pass with the stack up to this PR: 774 passed, 4 skipped (the opt-in live checks).

No verification skill in this repo.

Merge Danger

Door: two-way

Blast Radius: local dev

Existing witness clones have no stamp, so the first npm run witnesses after this merges reinstalls once.

@nicolasLuduena nicolasLuduena left a comment

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.

lgtm

@lolaaimar

Copy link
Copy Markdown
Contributor

lgtm

Base automatically changed from fix/zk-tls-empty-redaction to main November 25, 2026 19:49
@lolaaimar
lolaaimar force-pushed the fix/zk-tls-witness-pin branch from 1812e84 to 66d829c Compare November 25, 2026 19:49
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 489e2def-a6c8-4021-bc31-a54adadaa312
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@lolaaimar
lolaaimar force-pushed the fix/zk-tls-witness-pin branch from 66d829c to 79161d4 Compare November 25, 2026 20:47
@lolaaimar
lolaaimar merged commit 84750ee into main Nov 25, 2026
3 checks passed
@lolaaimar
lolaaimar deleted the fix/zk-tls-witness-pin branch November 25, 2026 20:50
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.

(zk-tls): witness guide installs the newest witness version

2 participants