Skip to content

Commit

Permalink
Added NewChannel and ReadyChannel support. Added warmstart flag to Init.
Browse files Browse the repository at this point in the history
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. (ElementsProject#11)

Fix remote-hsmd CI (ElementsProject#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. (ElementsProject#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. (ElementsProject#14)

Converted remotesigner.PubKey from 64 byte raw to 33 byte compressed DER. (ElementsProject#15)

Updated to channel_nonce0. (ElementsProject#17)

Replaced option_static_remotekey w/ CommitmentType. (ElementsProject#18)

* Replaced option_static_remotekey w/ CommitmentType.

* Improved NOTES

Upgraded SignFundingTxRequest KeyIndex to KeyPath. (ElementsProject#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 (ElementsProject#20)
  • Loading branch information
ksedgwic committed May 2, 2021
1 parent ca959b1 commit 9ec670a
Show file tree
Hide file tree
Showing 15 changed files with 986 additions and 503 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pip3 install --user -U \
git clone https://github.com/lightningnetwork/lightning-rfc.git ../lightning-rfc
git submodule update --init --recursive

wget -q --directory-prefix=contrib/remote_hsmd https://gitlab.com/lightning-signer/rust-lightning-signer/-/raw/master/src/server/remotesigner.proto

./configure CC="$CC"
cat config.vars

Expand Down
1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def env(name, default=None):
TIMEOUT = int(env("TIMEOUT", 180 if SLOW_MACHINE else 60))
SUBDAEMON = env("SUBDAEMON", "")


def wait_for(success, timeout=TIMEOUT):
start_time = time.time()
interval = 0.25
Expand Down
6 changes: 4 additions & 2 deletions contrib/remote_hsmd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ RMTHSMD_COMMON_OBJS := \
common/amount.o \
common/bigsize.o \
common/bip32.o \
common/channel_id.o \
common/daemon.o \
common/daemon_conn.o \
common/derive_basepoints.o \
Expand All @@ -48,6 +49,7 @@ RMTHSMD_COMMON_OBJS := \
common/msg_queue.o \
common/node_id.o \
common/permute_tx.o \
common/setup.o \
common/status.o \
common/status_wire.o \
common/subdaemon.o \
Expand All @@ -58,8 +60,8 @@ RMTHSMD_COMMON_OBJS := \
common/withdraw_tx.o

# For checking
LIGHTNINGD_RMTHSM_ALLSRC_NOGEN := $(filter-out contrib/remote_hsmd/gen_%, $(LIGHTNINGD_RMTHSM_SRC) $(LIGHTNINGD_RMTHSM_SRC))
LIGHTNINGD_RMTHSM_ALLHEADERS_NOGEN := $(filter-out contrib/remote_hsmd/gen_%, $(LIGHTNINGD_RMTHSM_HEADERS))
LIGHTNINGD_RMTHSM_ALLSRC_NOGEN := $(filter-out contrib/remote_hsmd/gen_% contrib/remote_hsmd/remotesigner.%, $(LIGHTNINGD_RMTHSM_SRC) $(LIGHTNINGD_RMTHSM_SRC))
LIGHTNINGD_RMTHSM_ALLHEADERS_NOGEN := $(filter-out contrib/remote_hsmd/gen_% contrib/remote_hsmd/remotesigner.%, $(LIGHTNINGD_RMTHSM_HEADERS))

$(LIGHTNINGD_RMTHSM_OBJS): $(LIGHTNINGD_HEADERS)

Expand Down
31 changes: 7 additions & 24 deletions contrib/remote_hsmd/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ c-lightning

Setup

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

Building

make distclean
./configure --enable-developer
make

Expand All @@ -19,6 +20,10 @@ https://github.com/golemfactory/golem/issues/2168 for background.
pip3 install --user base58
pip3 install --user bitstring
pip3 install --user secp256k1
pip3 install --user mrkd

# in c-lightning root:
pip3 install --user -r requirements.txt

Run all of the integration tests:

Expand Down Expand Up @@ -82,25 +87,3 @@ rust-lightning-signer
----------------------------------------------------------------

cargo run --bin server |& tee log3


Signing Formats
```
rust-lightning c-lightning rust-lightning-signer
p2pkh P2PKH
p2sh
p2wpkh p2wpkh P2WPKH
p2shwpkh p2sh-p2wpkh P2SH_P2WPKH
p2wsh
p2shwsh
```


Failing tests after removing seed from hsmd:
```
export THETEST=tests/test_misc.py::test_blockchaintrack
export THETEST=tests/test_misc.py::test_new_node_is_mainnet
export THETEST=tests/test_misc.py::test_getsharedsecret
export THETEST=tests/test_wallet.py::test_hsm_secret_encryption
export THETEST=tests/test_wallet.py::test_hsmtool_secret_decryption
```
6 changes: 3 additions & 3 deletions contrib/remote_hsmd/capabilities.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LIGHTNING_HSMD_CAPABILITIES_H
#define LIGHTNING_HSMD_CAPABILITIES_H
#ifndef LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H
#define LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H

#define HSM_CAP_ECDH 1
#define HSM_CAP_SIGN_GOSSIP 2
Expand All @@ -9,4 +9,4 @@
#define HSM_CAP_SIGN_CLOSING_TX 32

#define HSM_CAP_MASTER 1024
#endif /* LIGHTNING_HSMD_CAPABILITIES_H */
#endif /* LIGHTNING_CONTRIB_REMOTE_HSMD_CAPABILITIES_H */
Loading

0 comments on commit 9ec670a

Please sign in to comment.