This commit fixes LND RPC authentication by switching from raw gRPC
clients to lndclient wrappers that provide proper macaroon authentication.
Changes:
- Update LNDClients to use lndclient.LightningClient and
lndclient.RouterClient instead of raw gRPC clients
- Add getRawLightningClient() and getRawRouterClient() helpers that use
RawClientWithMacAuth() for authenticated raw client access
- Update all 21 LND builtin methods to use the new pattern
- Add InMemoryStore implementation for testing
- Wire up LND clients in terminal.go after LND connects
- Fix integration test function signatures
All 7 scripts integration tests now pass:
- scripts_basic_crud
- scripts_validation
- scripts_execution
- scripts_kv_store
- scripts_lnd_access
- scripts_builtins
- scripts_kv_builtins
This commit introduces a comprehensive Starlark scripting system that
enables custom automation with access to all subdaemon RPCs (lnd, loop,
pool, faraday, taproot-assets). Scripts use native LND macaroons for
permission enforcement.
Key features:
- Starlark execution engine with sandboxed resource limits
- Standard builtins: print, log, sleep, now, json_encode/decode
- HTTP GET requests with URL allowlisting
- Persistent KV store with bucket-based permissions
- LND event subscriptions for long-running daemon scripts
- Script CRUD operations with macaroon baking
- Execution history and running script tracking
- Complete CLI commands (litcli scripts ...)
Database schema:
- scripts: Store script definitions with macaroon permissions
- script_executions: Audit trail for script runs
- script_kv_store: Persistent key-value storage for scripts
- running_scripts: Track currently running scripts
Security model:
- Each script has an LND macaroon baked with specific permissions
- RPC calls from scripts include this macaroon in the header
- LND/subdaemons validate permissions natively
- URL and bucket allowlists validated at runtime
From other repos, we have seen that it can get quite spammy. So removing
for now. Users can instead comment `@claude review this` once the PR is
ready for review.
Prior to this commit, logs were not correctly uploaded on failure as the
logs were being written under itest/.logs, but the workflow zipped only
itest/ **/*.log. Because .logs is a hidden directory, the glob doesn’t
match it, so 7z creates an empty archive.
We also move the logs to a non-hidden directory when being uploaded to
avoid that the logs are downloaded as a hidden directory.
Add --match 'v*' to the VERSION_TAG git describe command to exclude
non-version tags like perms/*, litrpc/*, and autopilotserverrpc/*. These
tags contain forward slashes which cause the release script to fail when
constructing output filenames.
Adds a separate 'build-itest' job that builds the itest binaries prior
to the actual itest jobs being kicked off. With this change we'll
rebuild the itest binaries at most once, instead of at most four times.
The setup-go@v5 action caches GOMODCACHE and GOCACHE by default when
there's a go.sum file present. The cache is immutable, and keys have the
form:
setup-go-{os}-{arch}-{os-version}-go-{version}-{hash}
where 'hash' comes from go.sum. These keys don't take build tags into
account, and whichever job finishes first writes to the cache.
Consider the 'main' workflow, in which a bunch of jobs are kicked off to
run concurrently. A job like 'lint', which runs quickly, gets privileges
to write to the cache, but an issue is that its artifacts are built with
different tags than are e.g. the itest jobs. Thus, when an itest job
later gets a cache hit, the cached entry doesn't actually contain the Go
archive files that the itest needs.
The changes introduced in this commit use the existing 'key-prefix'
argument to avoid this problem. Setting 'key-prefix' bypasses the
default setup-go cache, using a separate cache with keys that depend
on the supplied prefix.
The full keys in this case are:
{key_prefix}-go-{os}-{arch}-{go-version}-{hash}
For the itest jobs, key-prefix is simply set to 'itest', so itest
artifacts will be cached with keys prefixed by 'itest' that won't be
preempted with irrelevant entries from faster-running jobs like 'lint'.
The -test.run pattern was missing the tranche prefix, so terminal and
custom_channels tests weren't actually running. The fix simply grafts
the pattern used in taproot-assets to ensure the tests are run.
Here we fix a nil pointer panic that is caused by an 'err' var being
deferenced before first checking that it is not nil. This was caused by
an oversite in a refactor commit that was attempting to improve line
length.
- Replace occurrences of `// nolint:lll` with `// nolint:ll` across
files for consistency.
- Reformat multiline strings, comments, and function parameters to
improve clarity and adhere to style guidelines.
- Add `// nolint:ll` comments where necessary to prevent linter
warnings.
- Replace the default `lll` with a custom `ll` linter, enabling
configurable exclusions for specific `S` log lines.
- Integrate custom `ll` linter into the build system and `Makefile`.
- Include relevant test cases and configuration for `golangci-lint`.
- add tranche splitting/shuffling flags to the itest harness
- add itest-parallel target and scripts to run tranches concurrently
- write per-tranche logs under .logs/trancheN and tail failures for
clarity
Move the LiT/LND compatibility matrix into docs/compatibility.md for
archival so future releases no longer require README updates to adjust
the table.
Update README to direct users to release notes for minimum lnd versions
and fall back to the archived table when not specified.
This information is now available in the GitHub release notes for each
release. Removing it from the README simplifies the project release
procedure (no need to update) and avoids unnecessary duplication,
reducing the risk of inconsistencies.