2017-01-10 06:07:51 +01:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
LIGHTNINGD_SRC := \
|
|
|
|
lightningd/bitcoind.c \
|
|
|
|
lightningd/chaintopology.c \
|
|
|
|
lightningd/channel.c \
|
|
|
|
lightningd/channel_control.c \
|
|
|
|
lightningd/closing_control.c \
|
|
|
|
lightningd/coin_mvts.c \
|
2021-03-12 01:19:40 +01:00
|
|
|
lightningd/dual_open_control.c \
|
2020-08-31 03:13:25 +02:00
|
|
|
lightningd/connect_control.c \
|
|
|
|
lightningd/onion_message.c \
|
|
|
|
lightningd/gossip_control.c \
|
|
|
|
lightningd/hsm_control.c \
|
|
|
|
lightningd/htlc_end.c \
|
|
|
|
lightningd/htlc_set.c \
|
|
|
|
lightningd/invoice.c \
|
|
|
|
lightningd/io_loop_with_timers.c \
|
|
|
|
lightningd/json.c \
|
|
|
|
lightningd/jsonrpc.c \
|
|
|
|
lightningd/lightningd.c \
|
|
|
|
lightningd/log.c \
|
|
|
|
lightningd/log_status.c \
|
|
|
|
lightningd/memdump.c \
|
|
|
|
lightningd/notification.c \
|
|
|
|
lightningd/onchain_control.c \
|
2020-09-09 09:20:53 +02:00
|
|
|
lightningd/opening_common.c \
|
2020-08-31 03:13:25 +02:00
|
|
|
lightningd/opening_control.c \
|
|
|
|
lightningd/options.c \
|
|
|
|
lightningd/pay.c \
|
|
|
|
lightningd/peer_control.c \
|
2022-01-11 02:13:59 +01:00
|
|
|
lightningd/peer_fd.c \
|
2020-08-31 03:13:25 +02:00
|
|
|
lightningd/peer_htlcs.c \
|
|
|
|
lightningd/plugin.c \
|
|
|
|
lightningd/plugin_control.c \
|
|
|
|
lightningd/plugin_hook.c \
|
2020-09-08 06:57:53 +02:00
|
|
|
lightningd/routehint.c \
|
2020-08-31 03:13:25 +02:00
|
|
|
lightningd/subd.c \
|
|
|
|
lightningd/watch.c
|
2017-01-10 06:07:51 +01:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
LIGHTNINGD_SRC_NOHDR := \
|
2021-08-25 04:50:12 +02:00
|
|
|
lightningd/datastore.c \
|
2022-01-29 04:31:32 +01:00
|
|
|
lightningd/ping.c \
|
2021-01-13 09:58:38 +01:00
|
|
|
lightningd/offer.c \
|
2020-08-31 03:13:25 +02:00
|
|
|
lightningd/signmessage.c
|
2017-07-05 07:33:40 +02:00
|
|
|
|
2021-12-16 20:07:33 +01:00
|
|
|
include wallet/Makefile
|
|
|
|
|
|
|
|
LIGHTNINGD_HDRS := \
|
2020-08-31 03:13:25 +02:00
|
|
|
$(LIGHTNINGD_SRC:.c=.h) \
|
|
|
|
lightningd/channel_state.h \
|
2021-12-16 20:07:33 +01:00
|
|
|
lightningd/channel_state_names_gen.h \
|
|
|
|
$(WALLET_HDRS)
|
2017-08-28 18:11:01 +02:00
|
|
|
|
2020-11-24 02:44:02 +01:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
LIGHTNINGD_OBJS := $(LIGHTNINGD_SRC:.c=.o) $(LIGHTNINGD_SRC_NOHDR:.c=.o)
|
2021-12-16 20:07:33 +01:00
|
|
|
$(LIGHTNINGD_OBJS): $(LIGHTNINGD_HDRS) $(LIGHTNINGD_CONTROL_HEADERS)
|
2017-01-10 06:07:51 +01:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
# Make sure these depend on everything.
|
2020-10-22 15:55:27 +02:00
|
|
|
ALL_C_SOURCES += $(LIGHTNINGD_SRC) $(LIGHTNINGD_SRC_NOHDR)
|
2021-12-16 20:07:33 +01:00
|
|
|
ALL_C_HEADERS += $(LIGHTNINGD_HDRS)
|
2020-08-31 03:13:25 +02:00
|
|
|
ALL_PROGRAMS += lightningd/lightningd
|
2017-01-10 06:07:51 +01:00
|
|
|
|
2017-08-28 18:02:01 +02:00
|
|
|
# Common source we use.
|
|
|
|
LIGHTNINGD_COMMON_OBJS := \
|
2019-05-22 23:20:14 +02:00
|
|
|
common/addr.o \
|
2019-02-21 01:45:57 +01:00
|
|
|
common/amount.o \
|
2021-09-21 09:23:10 +02:00
|
|
|
common/autodata.o \
|
2018-05-10 01:18:19 +02:00
|
|
|
common/base32.o \
|
2019-11-15 09:44:22 +01:00
|
|
|
common/base64.o \
|
2017-11-22 01:25:01 +01:00
|
|
|
common/bech32.o \
|
2018-04-23 16:20:55 +02:00
|
|
|
common/bech32_util.o \
|
2019-07-30 07:25:03 +02:00
|
|
|
common/bigsize.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/bip32.o \
|
2021-09-21 23:17:30 +02:00
|
|
|
common/blindedpath.o \
|
2020-04-11 05:22:40 +02:00
|
|
|
common/blinding.o \
|
2021-06-22 20:25:59 +02:00
|
|
|
common/blockheight_states.o \
|
2017-11-22 01:25:39 +01:00
|
|
|
common/bolt11.o \
|
2021-01-07 19:47:47 +01:00
|
|
|
common/bolt11_json.o \
|
2021-01-13 09:58:38 +01:00
|
|
|
common/bolt12.o \
|
|
|
|
common/bolt12_merkle.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/channel_config.o \
|
2021-09-09 07:29:35 +02:00
|
|
|
common/channel_id.o \
|
|
|
|
common/channel_type.o \
|
2020-03-19 00:35:59 +01:00
|
|
|
common/coin_mvt.o \
|
2017-08-28 18:04:01 +02:00
|
|
|
common/configdir.o \
|
2018-03-29 04:06:45 +02:00
|
|
|
common/daemon.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/derive_basepoints.o \
|
2020-04-03 05:21:22 +02:00
|
|
|
common/ecdh_hsmd.o \
|
2018-01-12 14:35:52 +01:00
|
|
|
common/features.o \
|
2019-12-12 18:18:25 +01:00
|
|
|
common/fee_states.o \
|
2020-08-25 04:19:38 +02:00
|
|
|
common/peer_status_wiregen.o \
|
2020-10-12 07:33:36 +02:00
|
|
|
common/status_levels.o \
|
2020-08-25 04:19:38 +02:00
|
|
|
common/status_wiregen.o \
|
2019-09-06 08:09:36 +02:00
|
|
|
common/gossip_rcvd_filter.o \
|
2017-10-26 05:04:19 +02:00
|
|
|
common/hash_u5.o \
|
2020-03-20 02:29:24 +01:00
|
|
|
common/hmac.o \
|
2021-01-03 12:32:43 +01:00
|
|
|
common/hsm_encryption.o \
|
2017-08-28 18:04:01 +02:00
|
|
|
common/htlc_state.o \
|
2019-05-31 09:30:32 +02:00
|
|
|
common/htlc_trim.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/htlc_wire.o \
|
|
|
|
common/key_derive.o \
|
2020-05-07 02:51:43 +02:00
|
|
|
common/keyset.o \
|
2017-08-28 18:04:01 +02:00
|
|
|
common/json.o \
|
2019-01-15 04:54:27 +01:00
|
|
|
common/json_helpers.o \
|
2020-01-20 10:23:55 +01:00
|
|
|
common/json_stream.o \
|
2018-12-08 01:39:28 +01:00
|
|
|
common/json_tok.o \
|
2021-06-08 23:42:45 +02:00
|
|
|
common/lease_rates.o \
|
2017-12-15 11:17:54 +01:00
|
|
|
common/memleak.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/msg_queue.o \
|
common/node_id: new type.
Node ids are pubkeys, but we only use them as pubkeys for routing and checking
gossip messages. So we're packing and unpacking them constantly, and wasting
some space and time.
This introduces a new type, explicitly the SEC1 compressed encoding
(33 bytes). We ensure its validity when we load from the db, or get it
from JSON. We still use 'struct pubkey' for peer messages, which checks
validity.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39475-39572(39518+/-36),2880732,41.150000-41.390000(41.298+/-0.085),2.260000-2.550000(2.336+/-0.11),44.390000-65.150000(58.648+/-7.5),32.740000-33.020000(32.89+/-0.093),44.130000-45.090000(44.566+/-0.32)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 08:34:06 +02:00
|
|
|
common/node_id.o \
|
2019-12-05 11:06:28 +01:00
|
|
|
common/onion.o \
|
2020-01-23 00:38:04 +01:00
|
|
|
common/onionreply.o \
|
2018-12-08 01:39:28 +01:00
|
|
|
common/param.o \
|
2020-05-07 02:43:42 +02:00
|
|
|
common/penalty_base.o \
|
2019-06-03 20:11:25 +02:00
|
|
|
common/per_peer_state.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/permute_tx.o \
|
2021-12-23 21:03:56 +01:00
|
|
|
common/psbt_keypath.o \
|
2020-10-08 23:40:25 +02:00
|
|
|
common/psbt_open.o \
|
2017-08-28 18:04:01 +02:00
|
|
|
common/pseudorand.o \
|
2020-08-11 07:05:56 +02:00
|
|
|
common/random_select.o \
|
2020-05-16 00:13:22 +02:00
|
|
|
common/setup.o \
|
2021-02-19 05:22:01 +01:00
|
|
|
common/shutdown_scriptpubkey.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/sphinx.o \
|
2018-02-08 02:25:12 +01:00
|
|
|
common/status_wire.o \
|
2017-08-28 18:04:01 +02:00
|
|
|
common/timeout.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/utxo.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/version.o \
|
2019-06-07 11:38:20 +02:00
|
|
|
common/wallet.o \
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
common/wire_error.o \
|
2017-10-23 06:17:38 +02:00
|
|
|
common/wireaddr.o \
|
2022-01-03 19:45:35 +01:00
|
|
|
db/bindings.o \
|
|
|
|
db/exec.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
|
2021-12-16 20:07:33 +01:00
|
|
|
$(LIGHTNINGD_OBJS): $(LIGHTNINGD_HDRS)
|
2022-01-03 19:45:35 +01:00
|
|
|
$(WALLET_OBJS): $(LIGHTNINGD_HDRS) $(DB_HEADERS)
|
2017-01-12 14:15:30 +01:00
|
|
|
|
2020-07-30 08:04:59 +02:00
|
|
|
# Only the plugin component needs to depend on this header.
|
2020-10-22 01:51:08 +02:00
|
|
|
lightningd/plugin.o: plugins/list_of_builtin_plugins_gen.h
|
2020-07-30 08:04:59 +02:00
|
|
|
|
2020-10-22 01:51:08 +02:00
|
|
|
lightningd/channel_state_names_gen.h: lightningd/channel_state.h ccan/ccan/cdump/tools/cdump-enumstr
|
2018-02-19 02:06:14 +01:00
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr lightningd/channel_state.h > $@
|
2017-05-22 13:24:59 +02:00
|
|
|
|
2022-01-03 19:45:35 +01:00
|
|
|
lightningd/lightningd: $(LIGHTNINGD_OBJS) $(WALLET_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(LIGHTNINGD_CONTROL_OBJS) $(HSMD_CLIENT_OBJS) $(DB_OBJS)
|
2017-01-10 06:07:51 +01:00
|
|
|
|
2017-01-10 06:08:33 +01:00
|
|
|
include lightningd/test/Makefile
|