Skip to content

Test is provided for lightning gossip not showing up #4

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

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
84fe3dc
build: more 32-bit printf fixes.
rustyrussell Aug 6, 2023
f64aaaf
add script to sync rpc commands
adi-shankara Aug 3, 2023
be829a1
add workflow to sync rpc commands
adi-shankara Aug 3, 2023
49acafe
random doc changes to test.
adi-shankara Aug 3, 2023
5faaa39
docs: try to fix up readthedocs.io, so it has the latest man pages, b…
rustyrussell Aug 3, 2023
aa2df28
splicing: Update documentation
ddustin Aug 3, 2023
f56ba46
meta: Remove ZmnSCPxj from codeowners
cdecker Aug 3, 2023
0bf5ee6
meta: Add the VLS team as codeowners of hsmd/hsmd_wire.csv
cdecker Aug 3, 2023
91a58a0
channeld: don't send splice TLV fields unless negotiated.
rustyrussell Aug 7, 2023
248b34a
docker: bitcoin and elements version update
ShahanaFarooqui Aug 5, 2023
2042b50
plugins/bcli: update minimum required bitcoind version.
rustyrussell Jul 24, 2023
f556be5
renepay: allow it to die gracefully without crashing lightningd.
rustyrussell Aug 7, 2023
d4ed1c7
pytest: test that we close connection if adding an HTLC times out.
rustyrussell Aug 7, 2023
91ea85b
lightningd: close connection when HTLC addition times out.
rustyrussell Aug 7, 2023
7a88900
pytest: test for listsendpays and lightning: prefix crash.
rustyrussell Aug 7, 2023
54bcb10
lightningd: fix bolt11 parsing in preapproveinvocie, sendonion, lists…
rustyrussell Aug 7, 2023
98c805e
fix flake8 errors in the script file (#6528)
adi-shankara Aug 7, 2023
1fbe87f
lightningd: use fsync not fdatasync.
rustyrussell Aug 7, 2023
29fea55
doc: Fix typo in the description of fields `private`
nepet Jun 18, 2023
32b88a2
Fix: Remove Sync requirements on Futures returned in the Rust plugin …
junderw Aug 3, 2023
d95cfc0
hsmd: rename "capabilities" flags for hsm fds to "permissions"
rustyrussell Aug 7, 2023
ac092c0
hsmd: fix capability check for signing splices.
rustyrussell Aug 7, 2023
dabd6c6
pytest: run splicing test on every run.
rustyrussell Aug 8, 2023
961ad21
renepay: add help for renepay & renepaystatus
Aug 7, 2023
5f8b774
plugins: fix error report from bitcoin-cli exec failure.
rustyrussell Aug 7, 2023
c50e93d
splice: Move splice to experimental feature bit
ddustin Aug 10, 2023
0281111
common: restore OPT_SPLICE definition for the day it's ratified.
rustyrussell Aug 10, 2023
846cec4
gossipd: ignore redundant node_announcement in gossip_store.
rustyrussell Aug 10, 2023
4b533f5
CHANNELD_AWAITING_SPLICE provided in listpeerchannel state history
litch Aug 11, 2023
990b2b4
Failing test is provided
litch Aug 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ contrib/msggen/ @cdecker
contrib/pyln-client/ @cdecker
contrib/pyln-testing/ @cdecker
# Needed to ensure hsmd wire compatibility between releases
hsmd/hsmd_wire.csv @cdecker

wallet/invoices.* @ZmnSCPxj
plugins/multifundchannel.c @ZmnSCPxj
doc/BACKUP.md @ZmnSCPxj
hsmd/hsmd_wire.csv @cdecker @ksedgwic @devrandom

# See https://help.github.com/articles/about-codeowners/ for more
# information
92 changes: 92 additions & 0 deletions .github/scripts/sync-rpc-cmds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import os
from time import sleep
import requests
import re

# readme url
URL = "https://dash.readme.com/api/v1/docs"
# category id for API reference
CATEGORY_ID = "63e4e160c60b2e001dd1cc4e"


def checkIfDocIsPresent(title, headers):

check_url = URL + "/" + title
response = requests.get(check_url, headers=headers)

if response.status_code == 200:
return True
else:
return False


def publishDoc(title, body, order):
key = os.environ.get("README_API_KEY")
payload = {
"title": title,
"type": "basic",
"body": body,
"category": CATEGORY_ID,
"hidden": False,
"order": order,
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Basic " + key,
}

isDocPresent = checkIfDocIsPresent(title, headers)
if isDocPresent:
# update doc
update_url = URL + "/" + title # title == slug
response = requests.put(update_url, json=payload, headers=headers)
if response.status_code != 200:
print(response.text)
else:
print("Updated ", title)
else:
# create doc
response = requests.post(URL, json=payload, headers=headers)
if response.status_code != 201:
print(response.text)
else:
print("Created ", title)


def extract_rpc_commands(rst_content):
manpages_block = re.search(
r"\.\. block_start manpages(.*?)" r"\.\. block_end manpages",
rst_content,
re.DOTALL,
)
if manpages_block:
commands = re.findall(
r"\b([a-zA-Z0-9_-]+)" r"\s+<([^>]+)>\n", manpages_block.group(1)
)
return commands
return []


def main():
# path to the rst file from where we fetch all the RPC commands
path_to_rst = "doc/index.rst"
with open(path_to_rst, "r") as file:
rst_content = file.read()

commands = extract_rpc_commands(rst_content)
if commands:
order = 0
for name, file in commands:
print(f"{name}\t\t{file}")
with open("doc/" + file) as f:
body = f.read()
publishDoc(name, body, order)
order = order + 1
sleep(3)
else:
print("No commands found in the Manpages block.")


if __name__ == "__main__":
main()
28 changes: 28 additions & 0 deletions .github/workflows/readme-rpc-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ReadMe RPC Sync

on:
push:
branches:
- 'master'
paths:
- 'doc/**.md'

jobs:
rdme-rpc-sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install requests module
run: python -m pip install requests

- name: Set environment variable and run
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
run: python .github/scripts/sync-rpc-cmds.py
22 changes: 14 additions & 8 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,15 +1486,21 @@ static u8 *send_commit_part(struct peer *peer,
const struct htlc **htlc_map;
struct wally_tx_output *direct_outputs[NUM_SIDES];
struct penalty_base *pbase;

status_debug("send_commit_part(splice: %d, remote_splice: %d)",
(int)splice_amnt, (int)remote_splice_amnt);


struct tlv_commitment_signed_tlvs *cs_tlv
= tlv_commitment_signed_tlvs_new(tmpctx);
cs_tlv->splice_info = tal(cs_tlv, struct channel_id);
derive_channel_id(cs_tlv->splice_info, funding);

/* In theory, peer will ignore TLV 1 as unknown, but while
* spec is in flux this is dangerous, as it may change: so don't
* send unless negotiated */
if (feature_negotiated(peer->our_features,
peer->their_features,
OPT_EXPERIMENTAL_SPLICE)) {
status_debug("send_commit_part(splice: %d, remote_splice: %d)",
(int)splice_amnt, (int)remote_splice_amnt);

cs_tlv->splice_info = tal(cs_tlv, struct channel_id);
derive_channel_id(cs_tlv->splice_info, funding);
}

txs = channel_splice_txs(tmpctx, funding, funding_sats, &htlc_map,
direct_outputs, &funding_wscript,
Expand Down Expand Up @@ -3349,7 +3355,7 @@ static void resume_splice_negotiation(struct peer *peer,

if (tal_count(inws) > current_psbt->num_inputs)
peer_failed_warn(peer->pps, &peer->channel_id,
"%lu too many witness elements received",
"%zu too many witness elements received",
tal_count(inws) - current_psbt->num_inputs);

/* We put the PSBT + sigs all together */
Expand Down
39 changes: 39 additions & 0 deletions common/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ static const struct feature_style feature_styles[] = {
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT} },
{ OPT_EXPERIMENTAL_SPLICE,
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT} },
};

struct dependency {
Expand Down Expand Up @@ -491,6 +495,41 @@ const char *feature_name(const tal_t *ctx, size_t f)
NULL,
NULL,
NULL, /* 100/101 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 110/111 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 120/121 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 130/131 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 140/141 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 150/151 */
NULL,
NULL,
NULL,
NULL,
NULL, /* 160/161 */
"option_experimental_splice", /* https://github.com/lightning/bolts/pull/863 */
NULL,
NULL,
NULL,
NULL, /* 170/171 */
};

if (f / 2 >= ARRAY_SIZE(fnames) || !fnames[f / 2])
Expand Down
5 changes: 5 additions & 0 deletions common/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
#define OPT_SHUTDOWN_ANYSEGWIT 26
#define OPT_CHANNEL_TYPE 44
#define OPT_PAYMENT_METADATA 48

/* BOLT-splice #9:
* | 62/63 | `option_splice` | ... IN ...
*/
#define OPT_SPLICE 62
#define OPT_EXPERIMENTAL_SPLICE 162

/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #9:
* | 28/29 | `option_dual_fund` | ... IN9 ...
Expand Down
1 change: 1 addition & 0 deletions common/hsm_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* v4 with sign_anchorspend: 8a30722e38b56e82af566b9629ff18da01fcebd1e80ec67f04d8b3a2fa66d81c
* v4 with sign_htlc_tx_mingle: b9247e75d41ee1b3fc2f7db0bac8f4e92d544ab2f017d430ae3a000589c384e5
* v4 with splicing: 06f21012936f825913af289fa81af1512c9ada1cb97c611698975a8fd287edbb
* v4 with capabilities called permissions: 7c5bf8ec7cf30302740db85260a9d1ac2c5b0323a2376c28df6b611831f91655
*/
#define HSM_MIN_VERSION 3
#define HSM_MAX_VERSION 4
Expand Down
4 changes: 2 additions & 2 deletions common/test/run-codex32.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ int main(int argc, char *argv[])
for (size_t i = 0; i < ARRAY_SIZE(addr_invalid1); i++) {
parts = codex32_decode(tmpctx, NULL, addr_invalid1[i], &fail);
if (parts) {
printf("payload == %ld\n", tal_bytelen(parts->payload));
printf("payload == %zu\n", tal_bytelen(parts->payload));
abort();
} else {
assert(streq(fail, "Invalid checksum!") ||
Expand Down Expand Up @@ -473,7 +473,7 @@ int main(int argc, char *argv[])
for (size_t i = 0; i < ARRAY_SIZE(addr_invalid2); i++) {
parts = codex32_decode(tmpctx, NULL, addr_invalid2[i], &fail);
if (parts) {
printf("payload %ld\n", tal_bytelen(parts->payload));
printf("payload %zu\n", tal_bytelen(parts->payload));
abort();
} else {
assert(streq(fail, "Invalid payload!") ||
Expand Down
30 changes: 15 additions & 15 deletions contrib/docker/Dockerfile.tester
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:18.04
MAINTAINER Christian Decker <[email protected]>
FROM ubuntu:22.04
LABEL mantainer="Christian Decker <[email protected]>"

ENV DEBIAN_FRONTEND noninteractive
ENV BITCOIN_VERSION 0.20.1
ENV ELEMENTS_VERSION 0.18.1.8
ENV BITCOIN_VERSION 22.0
ENV ELEMENTS_VERSION 22.0.2

RUN useradd -ms /bin/bash tester
RUN mkdir /build /bolts && chown tester -R /build /bolts
Expand Down Expand Up @@ -62,16 +62,16 @@ RUN echo "tester ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/tester && \
chmod 0440 /etc/sudoers.d/tester

RUN cd /tmp/ && \
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2 && \
wget -q https://storage.googleapis.com/c-lightning-tests/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 && \
tar -xjf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2 && \
tar -xjf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 && \
mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin && \
mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin && \
rm -rf \
bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \
bitcoin-$BITCOIN_VERSION \
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 \
elements-$ELEMENTS_VERSION
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz && \
wget https://github.com/ElementsProject/elements/releases/download/elements-$ELEMENTS_VERSION/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz && \
tar -xzf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz && \
tar -xzf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz && \
mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin && \
mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin && \
rm -rf \
bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \
bitcoin-$BITCOIN_VERSION \
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz \
elements-$ELEMENTS_VERSION

USER tester
15 changes: 7 additions & 8 deletions contrib/docker/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
export BITCOIN_VERSION=0.20.1
export ELEMENTS_VERSION=0.18.1.8
export BITCOIN_VERSION=22.0
export ELEMENTS_VERSION=22.0.2
export RUST_VERSION=nightly
export TZ="Europe/London"

Expand Down Expand Up @@ -50,19 +50,18 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
xsltproc \
zlib1g-dev


(
cd /tmp/ || exit 1
wget https://storage.googleapis.com/c-lightning-tests/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
wget -q https://storage.googleapis.com/c-lightning-tests/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
tar -xjf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.bz2
tar -xjf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2
wget https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
wget https://github.com/ElementsProject/elements/releases/download/elements-$ELEMENTS_VERSION/elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz
tar -xzf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
tar -xzf elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz
sudo mv bitcoin-$BITCOIN_VERSION/bin/* /usr/local/bin
sudo mv elements-$ELEMENTS_VERSION/bin/* /usr/local/bin
rm -rf \
bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz \
bitcoin-$BITCOIN_VERSION \
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.bz2 \
elements-$ELEMENTS_VERSION-x86_64-linux-gnu.tar.gz \
elements-$ELEMENTS_VERSION
)

Expand Down
1 change: 1 addition & 0 deletions contrib/pyln-client/pyln/client/gossmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class LnFeatureBits(object):
OPTION_PROPOSED_UPFRONT_FEE = 56 # IN9 #1052
OPTION_PROPOSED_CLOSING_REJECTED = 60 # IN #1016
OPTION_PROPOSED_SPLICE = 62 # IN #863
OPTION_PROPOSED_EXPERIMENTAL_SPLICE = 162 # IN #863


def _parse_features(featurebytes):
Expand Down
843 changes: 421 additions & 422 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-preapproveinvoice.7 \
doc/lightning-preapprovekeysend.7 \
doc/lightning-recoverchannel.7 \
doc/lightning-renepay.7 \
doc/lightning-renepaystatus.7 \
doc/lightning-reserveinputs.7 \
doc/lightning-sendinvoice.7 \
doc/lightning-sendonion.7 \
Expand All @@ -98,6 +100,9 @@ MANPAGES := doc/lightning-cli.1 \
doc/lightning-sendcustommsg.7 \
doc/lightning-signinvoice.7 \
doc/lightning-signmessage.7 \
doc/lightning-splice_init.7 \
doc/lightning-splice_update.7 \
doc/lightning-splice_signed.7 \
doc/lightning-staticbackup.7 \
doc/lightning-txprepare.7 \
doc/lightning-txdiscard.7 \
Expand Down
2 changes: 2 additions & 0 deletions doc/developers-guide/tracing-cln-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ Attaching 1 probe...





Notice that due to a [limitation](https://github.com/iovisor/bpftrace/issues/305) in `bpftrace` you'll at most get the first 200 bytes of the payload. If you write your own exporter you'll be able to specify the size of the buffer that is being used, and can extract the entire span.
Loading