Skip to content

Commit 6f49bea

Browse files
committed
server: remove accountability signal experiment period
In the previous iteration with endorsement signaling, the recommendation was for the sender to set it to 1 and that could have had privacy concerns when first deploying given that the default was to downgrade the signal to 0. In the latest proposal the recommended default for both sending and forwarding nodes is to set `accountable` to 0. As a result, the dates have been removed given that there are no privacy risks associated with relaying the signal with zero values.
1 parent 34329c6 commit 6f49bea

File tree

7 files changed

+17
-69
lines changed

7 files changed

+17
-69
lines changed

docs/release-notes/release-notes-0.21.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
This applies to both funders and fundees, with the ability to override the
7676
value during channel opening or acceptance.
7777

78+
* Rename [experimental endorsement signal](https://github.com/lightning/blips/blob/a833e7b49f224e1240b5d669e78fa950160f5a06/blip-0004.md)
79+
to [accountable](https://github.com/lightningnetwork/lnd/pull/10367) to match
80+
the latest [proposal](https://github.com/lightning/blips/pull/67).
81+
7882
## RPC Updates
7983

8084
## lncli Updates

htlcswitch/link.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,8 +3346,6 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
33463346
func (l *channelLink) experimentalAccountability(
33473347
customUpdateAdd record.CustomSet) fn.Option[byte] {
33483348

3349-
// Only relay experimental signal if we are within the experiment
3350-
// period.
33513349
if !l.cfg.ShouldFwdExpAccountability() {
33523350
return fn.None[byte]()
33533351
}

itest/lnd_experimental_accountability.go

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,24 @@ func testAccountability(ht *lntest.HarnessTest, aliceAccountable bool) {
5757
FeeLimitMsat: math.MaxInt64,
5858
}
5959

60-
var expectedValue []byte
61-
hasAccountability := lntest.ExperimentalAccountabilityActive()
62-
63-
if hasAccountability {
64-
if aliceAccountable {
65-
expectedValue = []byte{lnwire.ExperimentalAccountable}
66-
t := uint64(lnwire.ExperimentalAccountableType)
67-
sendReq.FirstHopCustomRecords = map[uint64][]byte{
68-
t: expectedValue,
69-
}
70-
} else {
71-
expectedValue = []byte{lnwire.ExperimentalUnaccountable}
60+
expectedValue := []byte{lnwire.ExperimentalUnaccountable}
61+
if aliceAccountable {
62+
expectedValue = []byte{lnwire.ExperimentalAccountable}
63+
t := uint64(lnwire.ExperimentalAccountableType)
64+
sendReq.FirstHopCustomRecords = map[uint64][]byte{
65+
t: expectedValue,
7266
}
7367
}
7468

7569
_ = alice.RPC.SendPayment(sendReq)
7670

7771
// Validate that our signal (positive or zero) propagates until carol
7872
// and then is dropped because she has disabled the feature.
79-
// When the accountability experiment is not active, no signal is sent.
8073
validateAccountableAndResume(
81-
ht, bobIntercept, hasAccountability, expectedValue,
74+
ht, bobIntercept, true, expectedValue,
8275
)
8376
validateAccountableAndResume(
84-
ht, carolIntercept, hasAccountability, expectedValue,
77+
ht, carolIntercept, true, expectedValue,
8578
)
8679
validateAccountableAndResume(ht, daveIntercept, false, nil)
8780

itest/lnd_forward_interceptor_test.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -432,25 +432,14 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
432432
// We should get another notification about the held HTLC.
433433
packet = ht.ReceiveHtlcInterceptor(bobInterceptor)
434434

435-
// Check the expected number of custom records based on whether the
436-
// accountability experiment is still active.
437-
expectedLen := 1
438-
if lntest.ExperimentalAccountabilityActive() {
439-
expectedLen = 2
440-
}
441-
require.Len(ht, packet.InWireCustomRecords, expectedLen)
435+
require.Len(ht, packet.InWireCustomRecords, 2)
442436
require.Equal(ht, lntest.CustomRecordsWithUnaccountable(customRecords),
443437
packet.InWireCustomRecords)
444438

445439
// And now we forward the payment at Carol, expecting only an
446-
// accountability signal in our incoming custom records (if the experiment
447-
// is still active).
440+
// accountability signal in our incoming custom records.
448441
packet = ht.ReceiveHtlcInterceptor(carolInterceptor)
449-
expectedCarolLen := 0
450-
if lntest.ExperimentalAccountabilityActive() {
451-
expectedCarolLen = 1
452-
}
453-
require.Len(ht, packet.InWireCustomRecords, expectedCarolLen)
442+
require.Len(ht, packet.InWireCustomRecords, 1)
454443
err = carolInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
455444
IncomingCircuitKey: packet.IncomingCircuitKey,
456445
Action: actionResume,

lntest/utils.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import (
77
"os"
88
"strconv"
99
"strings"
10-
"time"
1110

1211
"github.com/btcsuite/btcd/btcutil"
1312
"github.com/btcsuite/btcd/wire"
14-
"github.com/lightningnetwork/lnd"
1513
"github.com/lightningnetwork/lnd/input"
1614
"github.com/lightningnetwork/lnd/lnrpc"
1715
"github.com/lightningnetwork/lnd/lntest/wait"
@@ -290,29 +288,13 @@ func CalcStaticFeeBuffer(c lnrpc.CommitmentType, numHTLCs int) btcutil.Amount {
290288
// tests.
291289
func CustomRecordsWithUnaccountable(
292290
originalRecords lnwire.CustomRecords) map[uint64][]byte {
293-
294-
if !ExperimentalAccountabilityActive() {
295-
// Return nil if there are no records, to match wire encoding.
296-
if len(originalRecords) == 0 {
297-
return nil
298-
}
299-
300-
return originalRecords.Copy()
301-
}
302-
303291
return originalRecords.MergedCopy(map[uint64][]byte{
304292
uint64(lnwire.ExperimentalAccountableType): {
305293
lnwire.ExperimentalUnaccountable,
306294
}},
307295
)
308296
}
309297

310-
// ExperimentalAccountabilityActive returns true if the experimental accountability
311-
// window is still open.
312-
func ExperimentalAccountabilityActive() bool {
313-
return time.Now().Before(lnd.AccountabilityExperimentEnd)
314-
}
315-
316298
// LnrpcOutpointToStr returns a string representation of an lnrpc.OutPoint.
317299
func LnrpcOutpointToStr(outpoint *lnrpc.OutPoint) string {
318300
return fmt.Sprintf("%s:%d", outpoint.TxidStr, outpoint.OutputIndex)

rpcserver.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -780,13 +780,7 @@ func (r *rpcServer) addDeps(ctx context.Context, s *server,
780780
return nil
781781
},
782782
ShouldSetExpAccountability: func() bool {
783-
if s.cfg.ProtocolOptions.NoExpAccountability() {
784-
return false
785-
}
786-
787-
return clock.NewDefaultClock().Now().Before(
788-
AccountabilityExperimentEnd,
789-
)
783+
return !s.cfg.ProtocolOptions.NoExpAccountability()
790784
},
791785
}
792786

server.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ var (
139139
// TODO(roasbeef): add command line param to modify.
140140
MaxFundingAmount = funding.MaxBtcFundingAmount
141141

142-
// AccountabilityExperimentEnd is the time after which nodes should stop
143-
// propagating experimental accountable signals.
144-
//
145-
// Per blip04: January 1, 2026 12:00:00 AM UTC in unix seconds.
146-
AccountabilityExperimentEnd = time.Unix(1767225600, 0)
147-
148142
// ErrGossiperBan is one of the errors that can be returned when we
149143
// attempt to finalize a connection to a remote peer.
150144
ErrGossiperBan = errors.New("gossiper has banned remote's key")
@@ -4444,13 +4438,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
44444438
AuxTrafficShaper: s.implCfg.TrafficShaper,
44454439
AuxChannelNegotiator: s.implCfg.AuxChannelNegotiator,
44464440
ShouldFwdExpAccountability: func() bool {
4447-
if s.cfg.ProtocolOptions.NoExpAccountability() {
4448-
return false
4449-
}
4450-
4451-
return clock.NewDefaultClock().Now().Before(
4452-
AccountabilityExperimentEnd,
4453-
)
4441+
return !s.cfg.ProtocolOptions.NoExpAccountability()
44544442
},
44554443
NoDisconnectOnPongFailure: s.cfg.NoDisconnectOnPongFailure,
44564444
}

0 commit comments

Comments
 (0)