chore(deps): bump @noble/secp256k1 from 2.3.0 to 3.1.0#87
chore(deps): bump @noble/secp256k1 from 2.3.0 to 3.1.0#87dependabot[bot] wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis pull request updates the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/faucet/package.json`:
- Line 14: The signature call in the faucet's signing flow is using
secp.signAsync(msgHash, privKeyBytes) which, with `@noble/secp256k1` v3, will
prehash again and produce invalid signatures; update the sign call in the route
handler that computes msgHash (the lines around signingPayload, msgHash, sig,
sigHex) to pass the option { prehash: false } (and keep any existing options
like lowS if desired) so it signs the already-hashed payload:
secp.signAsync(msgHash, privKeyBytes, { prehash: false }).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d7118895-bb6b-4868-81be-d34bfe9a5739
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
apps/faucet/package.jsonapps/solux/package.json
| "dependencies": { | ||
| "@noble/hashes": "^1.7.2", | ||
| "@noble/secp256k1": "^2.2.3", | ||
| "@noble/secp256k1": "^3.1.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Read-only verification for `@noble/secp256k1` v3 migration readiness.
# Expected: no v2-style usage patterns in active call sites.
set -euo pipefail
echo "1) Locate `@noble/secp256k1` imports/usages"
rg -n --type=ts --type=tsx --type=js --type=mjs --type=cjs \
"(`@noble/secp256k1`|from ['\"]`@noble/secp256k1`['\"]|require\\(['\"]`@noble/secp256k1`['\"]\\))" -C 3
echo
echo "2) Inspect common crypto API call sites with context"
rg -nP --type=ts --type=tsx --type=js --type=mjs \
"\\b(sign|verify|getPublicKey|recoverPublicKey|schnorr|Signature)\\s*\\(" -C 3
echo
echo "3) Heuristic: detect obvious string-literal args passed to crypto funcs (often v2-style hex input)"
rg -nP --type=ts --type=tsx --type=js --type=mjs \
"\\b(sign|verify|getPublicKey|recoverPublicKey)\\s*\\(\\s*['\"`]" -C 2 || trueRepository: Sentriscloud/frontend
Length of output: 153
🏁 Script executed:
#!/bin/bash
# Read-only verification for `@noble/secp256k1` v3 migration readiness.
# Corrected to avoid unsupported file types.
set -euo pipefail
echo "=== 1) Locate `@noble/secp256k1` imports/usages ==="
rg -n "`@noble/secp256k1`" -C 2 || echo " (no imports found)"
echo
echo "=== 2) Find all TypeScript/JavaScript files in faucet and shared ==="
find apps/faucet -name "*.ts" -o -name "*.js" 2>/dev/null | head -20
echo
echo "=== 3) Inspect faucet source files for secp256k1 call sites ==="
if [ -d "apps/faucet/src" ]; then
find apps/faucet/src -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l "sign\|verify\|getPublicKey\|secp256k1" {} \;
else
echo " (apps/faucet/src not found)"
fi
echo
echo "=== 4) Check package.json for secp256k1 dependencies ==="
rg "`@noble/secp256k1`" apps/faucet/package.json || echo " (dependency info)"
echo
echo "=== 5) List shared/workspace packages ==="
if [ -d "packages" ]; then
ls -la packages/ | grep -E "^d" || true
elif [ -d "libs" ]; then
ls -la libs/ | grep -E "^d" || true
fiRepository: Sentriscloud/frontend
Length of output: 4909
🏁 Script executed:
#!/bin/bash
# Inspect actual secp256k1 usage in faucet and solux
echo "=== apps/faucet/src/app/api/faucet/route.ts ==="
cat -n apps/faucet/src/app/api/faucet/route.ts | head -100
echo
echo "=== apps/faucet/src/lib/ws.ts ==="
cat -n apps/faucet/src/lib/ws.ts 2>/dev/null || echo "(file not found or empty)"
echo
echo "=== apps/solux/src/lib/crypto.ts (full file for v3 migration context) ==="
if [ -f apps/solux/src/lib/crypto.ts ]; then
wc -l apps/solux/src/lib/crypto.ts
cat -n apps/solux/src/lib/crypto.ts
else
echo "(file not found)"
fiRepository: Sentriscloud/frontend
Length of output: 20594
🏁 Script executed:
#!/bin/bash
# Find secp256k1 function calls in faucet route
echo "=== Searching for secp.* calls in faucet route ==="
grep -n "secp\." apps/faucet/src/app/api/faucet/route.ts || echo "(no secp.* calls found)"
echo
echo "=== Full faucet route file (line count first) ==="
wc -l apps/faucet/src/app/api/faucet/route.ts
echo
echo "=== Faucet route from line 100 onwards ==="
tail -n +100 apps/faucet/src/app/api/faucet/route.tsRepository: Sentriscloud/frontend
Length of output: 14568
@noble/secp256k1 v3 migration incomplete in faucet — critical signature bug at line 338.
The faucet imports v3 correctly but is missing the breaking API change mitigation. Line 338's secp.signAsync(msgHash, privKeyBytes) must include { prehash: false } to avoid double-hashing:
Current (broken) signature code
// Line 337-339 in apps/faucet/src/app/api/faucet/route.ts
const msgHash = sha256(new TextEncoder().encode(signingPayload))
const sig = await secp.signAsync(msgHash, privKeyBytes) // ❌ missing prehash:false
const sigHex = bytesToHex(sig.toCompactRawBytes())In v3, signAsync defaults to prehashing input, so this signs sha256(sha256(payload)) instead of sha256(payload). Chain verification will reject all transactions.
See apps/solux/src/lib/crypto.ts line 79 for the correct pattern: secp.signAsync(msgHash, keyBytes, { lowS: true, prehash: false }).
Fix: Add { prehash: false } option to line 338's signAsync call.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/faucet/package.json` at line 14, The signature call in the faucet's
signing flow is using secp.signAsync(msgHash, privKeyBytes) which, with
`@noble/secp256k1` v3, will prehash again and produce invalid signatures; update
the sign call in the route handler that computes msgHash (the lines around
signingPayload, msgHash, sig, sigHex) to pass the option { prehash: false } (and
keep any existing options like lowS if desired) so it signs the already-hashed
payload: secp.signAsync(msgHash, privKeyBytes, { prehash: false }).
Bumps [@noble/secp256k1](https://github.com/paulmillr/noble-secp256k1) from 2.3.0 to 3.1.0. - [Release notes](https://github.com/paulmillr/noble-secp256k1/releases) - [Commits](paulmillr/noble-secp256k1@2.3.0...3.1.0) --- updated-dependencies: - dependency-name: "@noble/secp256k1" dependency-version: 3.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
8ff9ddd to
895d3b0
Compare
Bumps @noble/secp256k1 from 2.3.0 to 3.1.0.
Release notes
Sourced from @noble/secp256k1's releases.
Commits
f61f685Release 3.1.0.30841b9Minor fixes943f916Implement changes as per Mar 2026 audit.f982d7dBump typescript to 6.0.24639c0fFix tests7c74a5aAdd docs everywhere. Upgrade to ts 6.0-rc, jsbt 0.5. Add pkg.json scripts.18cf7c0Merge pull request #141 from Zosoled/bugfix/p-documentation0f3c1e9Fix P documentation in .ts3e1e0ceMerge pull request #140 from Zosoled/bugfix/p-documentationf7cb2dcFix P documentationMaintainer changes
This version was pushed to npm by GitHub Actions, a new releaser for
@noble/secp256k1since your current version.Summary by CodeRabbit