Skip to content

Commit 357ca14

Browse files
authored
Merge 952be70 into c441a3b
2 parents c441a3b + 952be70 commit 357ca14

File tree

5 files changed

+42
-6
lines changed

5 files changed

+42
-6
lines changed

docs/release-notes/release-notes-0.8.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
Garbage collection will be executed on every burn, transfer or call to
3939
`AnchorVirtualPsbts`. A new configuration is available to control the sweeping
4040
via the flag `wallet.sweep-orphan-utxos`.
41+
- [PR](https://github.com/lightninglabs/taproot-assets/pull/1899) tapd now
42+
treats HTLC interceptor setup failures as fatal during RFQ subsystem startup.
43+
If the RFQ subsystem cannot install its interceptor, tapd shuts down instead
44+
of continuing in a degraded state. This ensures that any running tapd
45+
instance has a fully functional RFQ pipeline and surfaces configuration or
46+
lnd-level conflicts immediately.
4147

4248
## RPC Updates
4349

itest/addrs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,8 @@ func testUnknownTlvType(t *harnessTest) {
808808
require.NoError(t.t, err)
809809

810810
// We make a new node to import the modified proof.
811-
charlie := setupTapdHarness(t.t, t, bobLnd, t.universeServer)
811+
charlieLnd := t.lndHarness.NewNodeWithCoins("Charlie", nil)
812+
charlie := setupTapdHarness(t.t, t, charlieLnd, t.universeServer)
812813
defer func() {
813814
require.NoError(t.t, charlie.stop(!*noDelete))
814815
}()

itest/addrs_v2_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,13 @@ func testAddressV2WithGroupKeyRestart(t *harnessTest) {
665665

666666
// Now we can create two more tapd nodes that we can start and stop
667667
// independently. To save some time, we'll use the same lnd node.
668-
bobCharlieLnd := t.lndHarness.NewNodeWithCoins("BobAndCharlie", nil)
669-
bobTapd := setupTapdHarness(t.t, t, bobCharlieLnd, t.universeServer)
668+
bobLnd := t.lndHarness.NewNodeWithCoins("Bob", nil)
669+
bobTapd := setupTapdHarness(t.t, t, bobLnd, t.universeServer)
670670
defer func() {
671671
require.NoError(t.t, bobTapd.stop(!*noDelete))
672672
}()
673-
charlieTapd := setupTapdHarness(t.t, t, bobCharlieLnd, t.universeServer)
673+
charlieLnd := t.lndHarness.NewNodeWithCoins("Charlie", nil)
674+
charlieTapd := setupTapdHarness(t.t, t, charlieLnd, t.universeServer)
674675
defer func() {
675676
require.NoError(t.t, charlieTapd.stop(!*noDelete))
676677
}()

rfq/manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ func (m *Manager) startSubsystems(ctx context.Context) error {
264264
SpecifierChecker: m.AssetMatchesSpecifier,
265265
NoOpHTLCs: m.cfg.NoOpHTLCs,
266266
AuxChanNegotiator: m.cfg.AuxChanNegotiator,
267+
ErrChan: m.cfg.ErrChan,
267268
})
268269
if err != nil {
269270
return fmt.Errorf("error initializing RFQ order handler: %w",

rfq/order.go

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,10 @@ type OrderHandlerCfg struct {
707707
// that is encapsulated in the init and reestablish peer messages. This
708708
// helps us communicate custom feature bits with our peer.
709709
AuxChanNegotiator *tapfeatures.AuxChannelNegotiator
710+
711+
// ErrChan is the main error channel that is used to propagate critical
712+
// errors back to the parent manager/server.
713+
ErrChan chan<- error
710714
}
711715

712716
// OrderHandler orchestrates management of accepted quote bundles. It monitors
@@ -928,8 +932,16 @@ func (h *OrderHandler) Start() error {
928932

929933
startErr = h.setupHtlcIntercept(ctx)
930934
if startErr != nil {
931-
log.Errorf("Error setting up HTLC "+
932-
"interception: %v", startErr)
935+
startErr = fmt.Errorf("setting up HTLC "+
936+
"interception: %w", startErr)
937+
938+
// Failing to start HTLC interception is a
939+
// critical error for the order handler, so we
940+
// propagate it upward.
941+
h.ReportMainChanError(
942+
fn.NewCriticalError(startErr),
943+
)
944+
933945
return
934946
}
935947

@@ -954,6 +966,21 @@ func (h *OrderHandler) Start() error {
954966
return startErr
955967
}
956968

969+
// ReportMainChanError sends an error to the main error channel.
970+
func (h *OrderHandler) ReportMainChanError(err error) {
971+
select {
972+
// Send the error to the main error channel.
973+
case h.cfg.ErrChan <- err:
974+
975+
// The service is shutting down, so we'll just return.
976+
case <-h.Quit:
977+
978+
// Otherwise, if the error channel is full, we drop the error to avoid
979+
// blocking.
980+
default:
981+
}
982+
}
983+
957984
// RegisterAssetSalePolicy generates and registers an asset sale policy with the
958985
// order handler. This function takes an outgoing buy accept message as an
959986
// argument.

0 commit comments

Comments
 (0)