63f8b74026 pyln-client: add patch that fixes plugins (Jonas Nick)
5255c7e8bc pyln-client: remove pkg patch that has become unnecessary (Jonas Nick)
c165836fd1 bitcoind: add "getdeploymentinfo" to public rpc whitelist (Jonas Nick)
623c238b16 clightning-plugins: remove commando pkg and module (Jonas Nick)
33144262ec clightning-plugins: bump ver of pyln-client required by prometheus (Jonas Nick)
9c766df16a Revert "clightning: fix build" (Jonas Nick)
b57e7466fb update nixpkgs (Jonas Nick)

Pull request description:

ACKs for top commit:
  erikarvstedt:
    ACK 63f8b74026

Tree-SHA512: 699ce5179ee202218933424ac3fe746a405700daccad78109d8118013cba6d64d40b07a87430281cbde96438250a05b03be0e44ebb69d85e2d41ec3ae57d6c7e
This commit is contained in:
Jonas Nick 2022-09-07 09:42:13 +00:00
commit 4e63301ac3
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
16 changed files with 64 additions and 123 deletions

View File

@ -71,7 +71,6 @@ NixOS modules ([src](modules/modules.nix))
and [database replication](docs/services.md#setup-clightning-database-replication).\ and [database replication](docs/services.md#setup-clightning-database-replication).\
Available plugins: Available plugins:
* [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager * [clboss](https://github.com/ZmnSCPxj/clboss): automated C-Lightning Node Manager
* [commando](https://github.com/lightningd/plugins/tree/master/commando): control your node over lightning
* [currencyrate](https://github.com/lightningd/plugins/tree/master/currencyrate): currency converter * [currencyrate](https://github.com/lightningd/plugins/tree/master/currencyrate): currency converter
* [helpme](https://github.com/lightningd/plugins/tree/master/helpme): walks you through setting up a fresh c-lightning node * [helpme](https://github.com/lightningd/plugins/tree/master/helpme): walks you through setting up a fresh c-lightning node
* [monitor](https://github.com/lightningd/plugins/tree/master/monitor): helps you analyze the health of your peers and channels * [monitor](https://github.com/lightningd/plugins/tree/master/monitor): helps you analyze the health of your peers and channels

View File

@ -17,11 +17,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1661009065, "lastModified": 1662099760,
"narHash": "sha256-i+Q2ttGp4uOL3j0wEYP3MXLcu/4L/WbChxGQogiNSZo=", "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9a91318fffec81ad009b73fd3b640d2541d87909", "rev": "67e45078141102f45eff1589a831aeaa3182b41e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -33,11 +33,11 @@
}, },
"nixpkgsUnstable": { "nixpkgsUnstable": {
"locked": { "locked": {
"lastModified": 1661008273, "lastModified": 1662096612,
"narHash": "sha256-UpDqsGzUswIHG7FwzeIewjWlElF17UVLNbI2pwlbcBY=", "narHash": "sha256-R+Q8l5JuyJryRPdiIaYpO5O3A55rT+/pItBrKcy7LM4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0cc6444e74cd21e8da8d81ef4cd778492e10f843", "rev": "21de2b973f9fee595a7a1ac4693efff791245c34",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -16,6 +16,7 @@
"getblockstats" "getblockstats"
"getchaintips" "getchaintips"
"getchaintxstats" "getchaintxstats"
"getdeploymentinfo"
"getdifficulty" "getdifficulty"
"getmempoolancestors" "getmempoolancestors"
"getmempooldescendants" "getmempooldescendants"

View File

@ -1,37 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.clightning.plugins.commando; in
{
options.services.clightning.plugins.commando = {
enable = mkEnableOption "commando (clightning plugin)";
readers = mkOption {
type = with types; listOf str;
default = [];
example = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
description = ''
IDs of nodes which can execute read-only commands (list*, get*, ...).
'';
};
writers = mkOption {
type = with types; listOf str;
default = [];
example = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
description = ''
IDs of nodes which can execute any commands.
'';
};
};
config = mkIf cfg.enable {
services.clightning.extraConfig = ''
plugin=${config.nix-bitcoin.pkgs.clightning-plugins.commando.path}
''
+ concatMapStrings (reader: ''
commando_reader=${reader}
'') cfg.readers
+ concatMapStrings (writer: ''
commando_writer=${writer}
'') cfg.writers;
};
}

View File

@ -14,7 +14,6 @@ let
in { in {
imports = [ imports = [
./clboss.nix ./clboss.nix
./commando.nix
./feeadjuster.nix ./feeadjuster.nix
./prometheus.nix ./prometheus.nix
./summary.nix ./summary.nix

View File

@ -61,6 +61,21 @@ in {
"btcpayserver" "btcpayserver"
"rtl" "rtl"
"electrs" "electrs"
]) ++
# 0.0.77
(
let
optionName = [ "services" "clightning" "plugins" "commando" ];
in [
(mkRemovedOptionModule (optionName ++ [ "enable" ]) ''
clightning 0.12.0 ships with a reimplementation of the commando plugin
that is incompatible with the commando module that existed in
nix-bitcoin. The new built-in commando plugin is always enabled. For
information on how to use it, run `lightning-cli help commando` and
`lightning-cli help commando-rune`.
'')
(mkRemovedOptionModule (optionName ++ [ "readers" ]) "")
(mkRemovedOptionModule (optionName ++ [ "writers" ]) "")
]); ]);
config = { config = {

View File

@ -1,12 +0,0 @@
{ clightning, python3 }:
clightning.override {
python3 = python3.override {
packageOverrides = self: super: {
mistune = self.callPackage ./mistune.nix {
version = "0.8.4";
sha256 = "59a3429db53c50b5c6bcc8a07f8848cb00d7dc8bdb431a4ab41920d201d4756e";
};
};
};
}

View File

@ -1,27 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
, version
, sha256
, format ? "setuptools"
, extraMeta ? {}
}:
buildPythonPackage rec {
inherit version format;
pname = "mistune";
src = fetchPypi {
inherit pname version sha256;
};
buildInputs = [ nose ];
pythonImportsCheck = [ "mistune" ];
meta = with lib; {
description = "The fastest markdown parser in pure Python";
homepage = "https://github.com/lepture/mistune";
license = licenses.bsd3;
} // extraMeta;
}

View File

@ -13,10 +13,6 @@ let
version = builtins.substring 0 7 src.rev; version = builtins.substring 0 7 src.rev;
plugins = with nbPython3Packages; { plugins = with nbPython3Packages; {
commando = {
description = "Enable RPC over lightning";
extraPkgs = [ nbPython3Packages.runes ];
};
currencyrate = { currencyrate = {
description = "Currency rate fetcher and converter"; description = "Currency rate fetcher and converter";
extraPkgs = [ requests cachetools ]; extraPkgs = [ requests cachetools ];
@ -36,7 +32,7 @@ let
extraPkgs = [ prometheus_client ]; extraPkgs = [ prometheus_client ];
patchRequirements = patchRequirements =
"--replace prometheus-client==0.6.0 prometheus-client==0.13.1" "--replace prometheus-client==0.6.0 prometheus-client==0.13.1"
+ " --replace pyln-client~=0.9.3 pyln-client~=0.10.1"; + " --replace pyln-client~=0.9.3 pyln-client~=0.11.1";
}; };
rebalance = { rebalance = {
description = "Keeps your channels balanced"; description = "Keeps your channels balanced";

View File

@ -27,14 +27,6 @@ let self = {
fetchNodeModules = pkgs.callPackage ./build-support/fetch-node-modules.nix { }; fetchNodeModules = pkgs.callPackage ./build-support/fetch-node-modules.nix { };
# Fix clightning build by using python package mistune 0.8.4, which is a
# strict requirement. This version is affected by CVE-2022-34749, but this
# is irrelevant in this context.
#
# TODO-EXTERNAL:
# Remove this when the clightning build is fixed upstream.
clightning = pkgs.callPackage ./clightning-mistune-workaround { inherit (pkgs) clightning; };
# Internal pkgs # Internal pkgs
netns-exec = pkgs.callPackage ./netns-exec { }; netns-exec = pkgs.callPackage ./netns-exec { };
krops = import ./krops { inherit pkgs; }; krops = import ./krops { inherit pkgs; };

View File

@ -14,6 +14,7 @@ pkgs: pkgsUnstable:
inherit (pkgsUnstable) inherit (pkgsUnstable)
btcpayserver btcpayserver
charge-lnd charge-lnd
clightning
fulcrum fulcrum
hwi hwi
lightning-loop lightning-loop

View File

@ -3,7 +3,7 @@ let
inherit (self) callPackage; inherit (self) callPackage;
joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; }; joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; };
clightningPkg = pkg: callPackage pkg { inherit (nbPkgs) clightning; }; clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; };
unstable = (import ../nixpkgs-pinned.nix).nixpkgs-unstable; unstable = (import ../nixpkgs-pinned.nix).nixpkgs-unstable;
in { in {

View File

@ -16,12 +16,13 @@ buildPythonPackage rec {
checkInputs = [ pytestCheckHook ]; checkInputs = [ pytestCheckHook ];
postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}";
# Fix version typo in pyproject.toml
# TODO-EXTERNAL: # TODO-EXTERNAL:
# This is already fixed upstream. Remove this after the next clightning release. # This patch is a variant (fixed relative path) of
postPatch = '' # https://github.com/ElementsProject/lightning/pull/5574. This is already
sed -i 's|pyln-bolt7 = "^1.0.186"|pyln-bolt7 = "^1.0.2.186"|' pyproject.toml # fixed upstream. Remove this after the next clightning release.
''; patches = [
./msat-null.patch
];
postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}";
} }

View File

@ -0,0 +1,16 @@
diff --git a/pyln/client/lightning.py b/pyln/client/lightning.py
index 38fc7563f..0013b89a3 100644
--- a/pyln/client/lightning.py
+++ b/pyln/client/lightning.py
@@ -455,6 +455,11 @@ class LightningRpc(UnixDomainSocketRpc):
if k.endswith('msat'):
if isinstance(v, list):
obj[k] = [Millisatoshi(e) for e in v]
+ # FIXME: Deprecated "listconfigs" gives two 'null' fields:
+ # "lease-fee-base-msat": null,
+ # "channel-fee-max-base-msat": null,
+ elif v is None:
+ obj[k] = None
else:
obj[k] = Millisatoshi(v)
else:

View File

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1656928814, "lastModified": 1659877975,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -18,11 +18,11 @@
"nixos-org-configurations": { "nixos-org-configurations": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1659104385, "lastModified": 1660725019,
"narHash": "sha256-Z8tAe2w0CEDabxO4LDleRhPzz0tDpRjKGIUbH62khyo=", "narHash": "sha256-729dr5TzCG3JIYgrcyyZQoG/e+Ugr6r2NB08Izer0q8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-org-configurations", "repo": "nixos-org-configurations",
"rev": "f467c27834fddeb1ffe156c54b637db240bc7273", "rev": "569797100aac69780a12542c2143bb741380d4ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,11 +38,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1660820431, "lastModified": 1661847188,
"narHash": "sha256-HeyLhcWs+ItFxGZiXbUlYbJ7y7sW1gBqyYqnToxGmN0=", "narHash": "sha256-GSA60qVevqN2Q+bbD4O6nbWUCzNtjbEQhYBvcSSRIkI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-search", "repo": "nixos-search",
"rev": "087925bbb24ab717a8033817be64b52fba312619", "rev": "7d1c1046ba918625fef44a204c219188824f46fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,11 +53,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1659713809, "lastModified": 1661450036,
"narHash": "sha256-M4aHuXXVnfprM8xPH2lLkYkkR0fmaG5QmvIc0DT/d4E=", "narHash": "sha256-0/9UyJLtfWqF4uvOrjFIzk8ue1YYUHa6JIhV0mALkH0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "93c57a988470c1948976b1bb70abbd5855c5b810", "rev": "f3d0897be466aa09a37f6bf59e62c360c3f9a6cc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -56,7 +56,9 @@ let
services.clightning.extraConfig = mkIf config.test.noConnections "disable-dns"; services.clightning.extraConfig = mkIf config.test.noConnections "disable-dns";
test.data.clightning-plugins = let test.data.clightning-plugins = let
plugins = config.services.clightning.plugins; plugins = config.services.clightning.plugins;
enabled = builtins.filter (plugin: plugins.${plugin}.enable) (builtins.attrNames plugins); removed = [ "commando" ];
enabled = builtins.filter (plugin: plugins.${plugin}.enable)
(subtractLists removed (builtins.attrNames plugins));
nbPkgs = config.nix-bitcoin.pkgs; nbPkgs = config.nix-bitcoin.pkgs;
pluginPkgs = nbPkgs.clightning-plugins // { pluginPkgs = nbPkgs.clightning-plugins // {
clboss.path = "${nbPkgs.clboss}/bin/clboss"; clboss.path = "${nbPkgs.clboss}/bin/clboss";
@ -158,11 +160,6 @@ let
prometheus.enable = true; prometheus.enable = true;
rebalance.enable = true; rebalance.enable = true;
summary.enable = true; summary.enable = true;
commando = {
enable = true;
readers = [ "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518" ];
writers = [ "0336efaa22b8ba77ae721a25d589e1c5f2486073dd2f041add32a23316150e8b62" ];
};
zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in { zmq = let tcpEndpoint = "tcp://127.0.0.1:5501"; in {
enable = true; enable = true;
channel-opened = tcpEndpoint; channel-opened = tcpEndpoint;