-
Notifications
You must be signed in to change notification settings - Fork 34
Lightning Polish #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
martindale
wants to merge
54
commits into
feature/v0.1.0-RC1
Choose a base branch
from
feature/lightning-update
base: feature/v0.1.0-RC1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lightning Polish #161
Changes from 4 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
661f8ca
General sweep of Lightning updates
martindale 5f2af9b
Build lightningd from source on Ubuntu
martindale 3dbb7db
Add mako to test action
martindale d996787
Add numerous lightningd dependencies
martindale 474e6f6
Update Lightning service test
martindale de3f1f7
Add 2s delay to allow lightningd to perform update
martindale bedcb2a
Add Rust toolchain to GitHub test action
martindale d0e585a
Add new network-specific tests
martindale 808c59b
Add bitcoin-cli to GitHub test action
martindale 8399201
Correctly update bitcoin test
martindale b2c7a8f
Rework GitHub test action
martindale fbf1591
Compute walletName from rootKey
martindale a107ee1
Add rpcallowip to Bitcoin configuration
martindale 5070fb8
Use latest packages, fix Bitcoin wallet management
martindale fefcdd1
Fix several deprecations, add mako to GitHub test action
martindale 80dfb44
Upgrade ZeroMQ
martindale 7c1b153
Update Lightning tests and GitHub action to verify binary
martindale 477e306
Streamline lightning tests, add oxfordJoin function
martindale e1b6a60
Use latest packages, update install report
martindale 4458ecd
Add PATCH message type
martindale 7373d95
Use latest packages
martindale 58b2308
Use latest packages
martindale f140fcb
Update a number of dependencies
martindale 98c2657
General snapshot
martindale 1ed4e0c
Add errors.h
martindale 108ced2
Add threads.h
martindale 0df8404
Add scoring.h
martindale 3e26b2f
Add timing_protection.h
martindale df5834d
Fix peer test failures: prevent double peer event emission and improv…
martindale d600c23
Add settings/local.js to .gitignore
martindale 472de91
Add secp256k1 to GitHub test action
martindale e054a0b
Update API.md
martindale 85009a5
Update package-lock.json
martindale a30fb3b
Add threads.c
martindale 99a98db
Add scoring.c
martindale 1260a2f
Remove extraneous stream definition
martindale 179d23b
Update install report
martindale 55bf5b4
Update return value for threads
martindale 07bbeb4
Cast to void
martindale 5904eee
Simplify implementation
martindale c31e3cb
Add callback to error macros
martindale 07ba48a
Add protocol.h
martindale 63d246b
Add noise.h
martindale 9dd2f55
Add secure_random.h
martindale 0add481
Add secure_memory.h
martindale bfbe0c3
Add validation.h
martindale 86bf123
Add datadir.h
martindale 38840ac
Update install report
martindale 5c1d625
Update install report
martindale 22787c2
Begin adding Lightning Message types
martindale 4397339
Revert to ecpair 2.1.0
martindale e342ae9
Add correct package.json
martindale e8204f5
Correct package-lock.json for ecpair change
martindale 4c6e58b
Update API
martindale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| const { execSync } = require('child_process'); | ||
| const path = require('path'); | ||
| const fs = require('fs'); | ||
|
|
||
| // Get current dependencies from package.json | ||
| function getCurrentDependencies () { | ||
| const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8')); | ||
| const deps = new Set(); | ||
|
|
||
| // Combine both regular dependencies and devDependencies | ||
| Object.keys(packageJson.dependencies || {}).forEach(dep => deps.add(dep)); | ||
| Object.keys(packageJson.devDependencies || {}).forEach(dep => deps.add(dep)); | ||
|
|
||
| return deps; | ||
| } | ||
|
|
||
| // Get all commits that modified package-lock.json | ||
| function getPackageLockCommits () { | ||
| const cmd = 'git log --format="%H" -- package-lock.json'; | ||
| return execSync(cmd, { encoding: 'utf-8' }) | ||
| .trim() | ||
| .split('\n'); | ||
| } | ||
|
|
||
| // Get package-lock.json content at a specific commit | ||
| function getPackageLockAtCommit (commit) { | ||
| try { | ||
| const cmd = `git show ${commit}:package-lock.json`; | ||
| const content = execSync(cmd, { encoding: 'utf-8' }); | ||
| return JSON.parse(content); | ||
| } catch (err) { | ||
| // Skip if package-lock.json didn't exist at this commit | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| // Extract all package versions from package-lock | ||
| function extractPackageVersions (lockfile) { | ||
| if (!lockfile || !lockfile.packages) return new Map(); | ||
|
|
||
| const versions = new Map(); | ||
| for (const [pkg, info] of Object.entries(lockfile.packages)) { | ||
| if (pkg === '') continue; // Skip root package | ||
| const name = pkg.replace('node_modules/', ''); | ||
| versions.set(name, info.version); | ||
| } | ||
| return versions; | ||
| } | ||
|
|
||
| // Track version changes between commits | ||
| function analyzePackageUpdates () { | ||
| const commits = getPackageLockCommits(); | ||
| const updates = new Map(); // package -> update count | ||
| let prevVersions = new Map(); | ||
| const currentDeps = getCurrentDependencies(); | ||
|
|
||
| for (const commit of commits) { | ||
| const lockfile = getPackageLockAtCommit(commit); | ||
| if (!lockfile) continue; | ||
|
|
||
| const currentVersions = extractPackageVersions(lockfile); | ||
|
|
||
| // Compare with previous versions | ||
| for (const [pkg, version] of currentVersions) { | ||
| // Only track updates for current dependencies | ||
| if (!currentDeps.has(pkg)) continue; | ||
|
|
||
| const prevVersion = prevVersions.get(pkg); | ||
| if (prevVersion && prevVersion !== version) { | ||
| updates.set(pkg, (updates.get(pkg) || 0) + 1); | ||
| } | ||
| } | ||
|
|
||
| prevVersions = currentVersions; | ||
| } | ||
|
|
||
| return updates; | ||
| } | ||
|
|
||
| // Main execution | ||
| try { | ||
| console.log('Analyzing package update frequency...\n'); | ||
|
|
||
| const updates = analyzePackageUpdates(); | ||
|
|
||
| // Sort packages by update frequency | ||
| const sortedUpdates = [...updates.entries()] | ||
| .sort(([, a], [, b]) => b - a) | ||
| .slice(0, 25); // Get top 25 | ||
|
|
||
| if (sortedUpdates.length === 0) { | ||
| console.log('No updates found for current dependencies.'); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| // Calculate max lengths for formatting | ||
| const maxNameLength = Math.max(...sortedUpdates.map(([name]) => name.length)); | ||
| const maxCountLength = Math.max(...sortedUpdates.map(([, count]) => String(count).length)); | ||
|
|
||
| // Print header | ||
| console.log('Most Frequently Updated Current Dependencies:'); | ||
| console.log('═'.repeat(maxNameLength + maxCountLength + 7)); | ||
|
|
||
| // Print results in a formatted table | ||
| sortedUpdates.forEach(([pkg, count], index) => { | ||
| const position = `${index + 1}.`.padEnd(3); | ||
| const name = pkg.padEnd(maxNameLength); | ||
| const updates = String(count).padStart(maxCountLength); | ||
| console.log(`${position} ${name} │ ${updates} updates`); | ||
| }); | ||
| } catch (error) { | ||
| console.error('Error analyzing package updates:', error.message); | ||
| process.exit(1); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider extracting magic default values like
32and2000into named constants or configuration options to improve readability and ease future adjustments.