Files
palladum-lightning/hsmd/Makefile
Rusty Russell daf1560eb4 hsmd: make our private utxo type, to ensure binary compatibility.
I'm about to update our utxo type, but Christian spotted that this is
part of the ABI for the hsm.  So make that a private "hsm_utxo" type,
to insulate it from changes.

In particular, the HSM versions only contain the fields that the
hsm cares about, and the wire format is consistent (even though that
*did* include some of those fields, they are now dummies).

In the long term, this should be removed from the ABI: once we
no longer have "close_info" utxos, this information should already be
in the PSBT.

I tested this hadn't accidentally changed the wire format by disabling
version checks and using an old hsmd with the altered daemons and
running the test suite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2025-05-06 12:27:53 +09:30

67 lines
1.7 KiB
Makefile

#! /usr/bin/make
HSMD_SRC := hsmd/hsmd.c \
hsmd/hsmd_wiregen.c \
hsmd/hsm_utxo.c \
hsmd/libhsmd.c
HSMD_HEADERS := hsmd/hsmd_wiregen.h hsmd/permissions.h
HSMD_OBJS := $(HSMD_SRC:.c=.o)
$(HSMD_OBJS): $(HSMD_HEADERS)
# Other programs which use the hsm need this.
HSMD_CLIENT_OBJS := \
hsmd/hsmd_wiregen.o \
hsmd/hsm_utxo.o \
common/htlc_wire.o
# Make sure these depend on everything.
ALL_C_SOURCES += $(HSMD_SRC)
ALL_C_HEADERS += $(HSMD_HEADERS)
ALL_PROGRAMS += lightningd/lightning_hsmd
# Common source we use.
HSMD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bigsize.o \
common/bip32.o \
common/bolt12_id.o \
common/bolt12_merkle.o \
common/channel_id.o \
common/daemon.o \
common/daemon_conn.o \
common/derive_basepoints.o \
common/hash_u5.o \
common/hsm_encryption.o \
common/htlc_wire.o \
common/key_derive.o \
common/lease_rates.o \
common/memleak.o \
common/msg_queue.o \
common/node_id.o \
common/onionreply.o \
common/permute_tx.o \
common/psbt_open.o \
common/pseudorand.o \
common/setup.o \
common/status.o \
common/status_wire.o \
common/status_wiregen.o \
common/subdaemon.o \
common/utils.o \
common/version.o \
common/wireaddr.o
lightningd/lightning_hsmd: $(HSMD_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)
check-source: check-hsm-versions
# common/hsm_version.h should at least *mention* this!
check-hsm-versions: hsmd/hsmd_wire.csv common/hsm_version.h
@SUM=`grep -vE '^(#| *$$)' hsmd/hsmd_wire.csv | sha256sum | cut -c1-64`; if ! grep -q "$$SUM" common/hsm_version.h; then echo "*** hsmd_wire.csv changed to $$SUM without update to common/hsm_version.h">&2; exit 1; fi
-include hsmd/test/Makefile