Skip to content

Commit 9ec670a

Browse files
committed
Added NewChannel and ReadyChannel support. Added warmstart flag to Init.
Changed "warmstart" to "coldstart" (inverted semantic). Modified all satoshi variable names to have "_sat" suffixes. Removed deprecated Phase 1 fields. Added push_value to hsm_ready_channel. Added sanity checking to hsm_ready_channel stub. Fixed issues w/ rebase onto upstream/master. Replaced tx->input_amounts and tx->output_witscripts with tx->psbt. Fixed redeemscript confusion. (#11) Fix remote-hsmd CI (#12) * adding g++, protobuf, grpc++ * add libgrpc++-dev to .travis.yml * wget remotesigner.proto * added libprotobuf-dev * fixed compilation warnings/errors * use Get instead of [] in protobuf seq * fixed include sort order * added protobuf generated files to skip nogen checks * fixed gensrc pattern * added libstdc++6 * fixed python spacing * added specified inclusion guards * renamed c++ header extensions to hpp to avoid c checks * guard satoshi amount calculations * libstdc++-6-dev * added `ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so` Enable handle_sign_withdrawal_tx signing of PSBT. (#13) * Converted debug logging to json format. * Switched status_debug to STATUS_DEBUG macro. Skip two integration tests which mutate channel_nonce. fixed nit w/ run-one-test Added NodeConfig::NATIVE to InitReq. (#14) Converted remotesigner.PubKey from 64 byte raw to 33 byte compressed DER. (#15) Updated to channel_nonce0. (#17) Replaced option_static_remotekey w/ CommitmentType. (#18) * Replaced option_static_remotekey w/ CommitmentType. * Improved NOTES Upgraded SignFundingTxRequest KeyIndex to KeyPath. (#19) Adapted to CloseInfo moving into KeyLocator TxOut was replaced in API w/ it's only field. Adapted to remotesigner api-doc mods. Set input to 0 explicitly. SignCounterpartyHtlcToUs -> SignCounterpartyHtlcSweep SignJusticeTxToUs -> SignJusticeSweep SignDelayedPaymentToUs -> SignDelayedSweep (#20)
1 parent ca959b1 commit 9ec670a

File tree

15 files changed

+986
-503
lines changed

15 files changed

+986
-503
lines changed

.github/scripts/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ pip3 install --user -U \
3636
git clone https://github.com/lightningnetwork/lightning-rfc.git ../lightning-rfc
3737
git submodule update --init --recursive
3838

39+
wget -q --directory-prefix=contrib/remote_hsmd https://gitlab.com/lightning-signer/rust-lightning-signer/-/raw/master/src/server/remotesigner.proto
40+
3941
./configure CC="$CC"
4042
cat config.vars
4143

contrib/pyln-testing/pyln/testing/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def env(name, default=None):
8181
TIMEOUT = int(env("TIMEOUT", 180 if SLOW_MACHINE else 60))
8282
SUBDAEMON = env("SUBDAEMON", "")
8383

84+
8485
def wait_for(success, timeout=TIMEOUT):
8586
start_time = time.time()
8687
interval = 0.25

contrib/remote_hsmd/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ RMTHSMD_COMMON_OBJS := \
3737
common/amount.o \
3838
common/bigsize.o \
3939
common/bip32.o \
40+
common/channel_id.o \
4041
common/daemon.o \
4142
common/daemon_conn.o \
4243
common/derive_basepoints.o \
@@ -48,6 +49,7 @@ RMTHSMD_COMMON_OBJS := \
4849
common/msg_queue.o \
4950
common/node_id.o \
5051
common/permute_tx.o \
52+
common/setup.o \
5153
common/status.o \
5254
common/status_wire.o \
5355
common/subdaemon.o \
@@ -58,8 +60,8 @@ RMTHSMD_COMMON_OBJS := \
5860
common/withdraw_tx.o
5961

6062
# For checking
61-
LIGHTNINGD_RMTHSM_ALLSRC_NOGEN := $(filter-out contrib/remote_hsmd/gen_%, $(LIGHTNINGD_RMTHSM_SRC) $(LIGHTNINGD_RMTHSM_SRC))
62-
LIGHTNINGD_RMTHSM_ALLHEADERS_NOGEN := $(filter-out contrib/remote_hsmd/gen_%, $(LIGHTNINGD_RMTHSM_HEADERS))
63+
LIGHTNINGD_RMTHSM_ALLSRC_NOGEN := $(filter-out contrib/remote_hsmd/gen_% contrib/remote_hsmd/remotesigner.%, $(LIGHTNINGD_RMTHSM_SRC) $(LIGHTNINGD_RMTHSM_SRC))
64+
LIGHTNINGD_RMTHSM_ALLHEADERS_NOGEN := $(filter-out contrib/remote_hsmd/gen_% contrib/remote_hsmd/remotesigner.%, $(LIGHTNINGD_RMTHSM_HEADERS))
6365

6466
$(LIGHTNINGD_RMTHSM_OBJS): $(LIGHTNINGD_HEADERS)
6567

contrib/remote_hsmd/NOTES.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ c-lightning
33

44
Setup
55

6-
cd contrib/remote_hsmd && \
7-
ln -s /path/to/rust-lightning-signer/src/server/remotesigner.proto
6+
(cd contrib/remote_hsmd && \
7+
ln -s ../../../rust-lightning-signer/src/server/remotesigner.proto)
88

99
Building
1010

11+
make distclean
1112
./configure --enable-developer
1213
make
1314

@@ -19,6 +20,10 @@ https://github.com/golemfactory/golem/issues/2168 for background.
1920
pip3 install --user base58
2021
pip3 install --user bitstring
2122
pip3 install --user secp256k1
23+
pip3 install --user mrkd
24+
25+
# in c-lightning root:
26+
pip3 install --user -r requirements.txt
2227

2328
Run all of the integration tests:
2429

@@ -82,25 +87,3 @@ rust-lightning-signer
8287
----------------------------------------------------------------
8388

8489
cargo run --bin server |& tee log3
85-
86-
87-
Signing Formats
88-
```
89-
rust-lightning c-lightning rust-lightning-signer
90-
p2pkh P2PKH
91-
p2sh
92-
p2wpkh p2wpkh P2WPKH
93-
p2shwpkh p2sh-p2wpkh P2SH_P2WPKH
94-
p2wsh
95-
p2shwsh
96-
```
97-
98-
99-
Failing tests after removing seed from hsmd:
100-
```
101-
export THETEST=tests/test_misc.py::test_blockchaintrack
102-
export THETEST=tests/test_misc.py::test_new_node_is_mainnet
103-
export THETEST=tests/test_misc.py::test_getsharedsecret
104-
export THETEST=tests/test_wallet.py::test_hsm_secret_encryption
105-
export THETEST=tests/test_wallet.py::test_hsmtool_secret_decryption
106-
```

contrib/remote_hsmd/capabilities.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef LIGHTNING_HSMD_CAPABILITIES_H
2-
#define LIGHTNING_HSMD_CAPABILITIES_H
1+
#ifndef LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H
2+
#define LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H
33

44
#define HSM_CAP_ECDH 1
55
#define HSM_CAP_SIGN_GOSSIP 2
@@ -9,4 +9,4 @@
99
#define HSM_CAP_SIGN_CLOSING_TX 32
1010

1111
#define HSM_CAP_MASTER 1024
12-
#endif /* LIGHTNING_HSMD_CAPABILITIES_H */
12+
#endif /* LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H */

0 commit comments

Comments
 (0)