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.
This commit is contained in:
1 parent
34329c684e
commit
6f49bea52b
7 files changed
+12
-64
No files matched your search
@@ -75,6 +75,10 @@
|
||||
This applies to both funders and fundees, with the ability to override the
|
||||
value during channel opening or acceptance.
|
||||
|
||||
* Rename [experimental endorsement signal](https://github.com/lightning/blips/blob/a833e7b49f224e1240b5d669e78fa950160f5a06/blip-0004.md)
|
||||
to [accountable](https://github.com/lightningnetwork/lnd/pull/10367) to match
|
||||
the latest [proposal](https://github.com/lightning/blips/pull/67).
|
||||
|
||||
## RPC Updates
|
||||
|
||||
## lncli Updates
|
||||
|
||||
@@ -3346,8 +3346,6 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
||||
func (l *channelLink) experimentalAccountability(
|
||||
customUpdateAdd record.CustomSet) fn.Option[byte] {
|
||||
|
||||
// Only relay experimental signal if we are within the experiment
|
||||
// period.
|
||||
if !l.cfg.ShouldFwdExpAccountability() {
|
||||
return fn.None[byte]()
|
||||
}
|
||||
|
||||
@@ -57,31 +57,24 @@ func testAccountability(ht *lntest.HarnessTest, aliceAccountable bool) {
|
||||
FeeLimitMsat: math.MaxInt64,
|
||||
}
|
||||
|
||||
var expectedValue []byte
|
||||
hasAccountability := lntest.ExperimentalAccountabilityActive()
|
||||
|
||||
if hasAccountability {
|
||||
expectedValue := []byte{lnwire.ExperimentalUnaccountable}
|
||||
if aliceAccountable {
|
||||
expectedValue = []byte{lnwire.ExperimentalAccountable}
|
||||
t := uint64(lnwire.ExperimentalAccountableType)
|
||||
sendReq.FirstHopCustomRecords = map[uint64][]byte{
|
||||
t: expectedValue,
|
||||
}
|
||||
} else {
|
||||
expectedValue = []byte{lnwire.ExperimentalUnaccountable}
|
||||
}
|
||||
}
|
||||
|
||||
_ = alice.RPC.SendPayment(sendReq)
|
||||
|
||||
// Validate that our signal (positive or zero) propagates until carol
|
||||
// and then is dropped because she has disabled the feature.
|
||||
// When the accountability experiment is not active, no signal is sent.
|
||||
validateAccountableAndResume(
|
||||
ht, bobIntercept, hasAccountability, expectedValue,
|
||||
ht, bobIntercept, true, expectedValue,
|
||||
)
|
||||
validateAccountableAndResume(
|
||||
ht, carolIntercept, hasAccountability, expectedValue,
|
||||
ht, carolIntercept, true, expectedValue,
|
||||
)
|
||||
validateAccountableAndResume(ht, daveIntercept, false, nil)
|
||||
|
||||
|
||||
@@ -432,25 +432,14 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
|
||||
// We should get another notification about the held HTLC.
|
||||
packet = ht.ReceiveHtlcInterceptor(bobInterceptor)
|
||||
|
||||
// Check the expected number of custom records based on whether the
|
||||
// accountability experiment is still active.
|
||||
expectedLen := 1
|
||||
if lntest.ExperimentalAccountabilityActive() {
|
||||
expectedLen = 2
|
||||
}
|
||||
require.Len(ht, packet.InWireCustomRecords, expectedLen)
|
||||
require.Len(ht, packet.InWireCustomRecords, 2)
|
||||
require.Equal(ht, lntest.CustomRecordsWithUnaccountable(customRecords),
|
||||
packet.InWireCustomRecords)
|
||||
|
||||
// And now we forward the payment at Carol, expecting only an
|
||||
// accountability signal in our incoming custom records (if the experiment
|
||||
// is still active).
|
||||
// accountability signal in our incoming custom records.
|
||||
packet = ht.ReceiveHtlcInterceptor(carolInterceptor)
|
||||
expectedCarolLen := 0
|
||||
if lntest.ExperimentalAccountabilityActive() {
|
||||
expectedCarolLen = 1
|
||||
}
|
||||
require.Len(ht, packet.InWireCustomRecords, expectedCarolLen)
|
||||
require.Len(ht, packet.InWireCustomRecords, 1)
|
||||
err = carolInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
|
||||
IncomingCircuitKey: packet.IncomingCircuitKey,
|
||||
Action: actionResume,
|
||||
|
||||
@@ -7,11 +7,9 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
@@ -290,16 +288,6 @@ func CalcStaticFeeBuffer(c lnrpc.CommitmentType, numHTLCs int) btcutil.Amount {
|
||||
// tests.
|
||||
func CustomRecordsWithUnaccountable(
|
||||
originalRecords lnwire.CustomRecords) map[uint64][]byte {
|
||||
|
||||
if !ExperimentalAccountabilityActive() {
|
||||
// Return nil if there are no records, to match wire encoding.
|
||||
if len(originalRecords) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return originalRecords.Copy()
|
||||
}
|
||||
|
||||
return originalRecords.MergedCopy(map[uint64][]byte{
|
||||
uint64(lnwire.ExperimentalAccountableType): {
|
||||
lnwire.ExperimentalUnaccountable,
|
||||
@@ -307,12 +295,6 @@ func CustomRecordsWithUnaccountable(
|
||||
)
|
||||
}
|
||||
|
||||
// ExperimentalAccountabilityActive returns true if the experimental accountability
|
||||
// window is still open.
|
||||
func ExperimentalAccountabilityActive() bool {
|
||||
return time.Now().Before(lnd.AccountabilityExperimentEnd)
|
||||
}
|
||||
|
||||
// LnrpcOutpointToStr returns a string representation of an lnrpc.OutPoint.
|
||||
func LnrpcOutpointToStr(outpoint *lnrpc.OutPoint) string {
|
||||
return fmt.Sprintf("%s:%d", outpoint.TxidStr, outpoint.OutputIndex)
|
||||
|
||||
+1
-7
@@ -780,13 +780,7 @@ func (r *rpcServer) addDeps(ctx context.Context, s *server,
|
||||
return nil
|
||||
},
|
||||
ShouldSetExpAccountability: func() bool {
|
||||
if s.cfg.ProtocolOptions.NoExpAccountability() {
|
||||
return false
|
||||
}
|
||||
|
||||
return clock.NewDefaultClock().Now().Before(
|
||||
AccountabilityExperimentEnd,
|
||||
)
|
||||
return !s.cfg.ProtocolOptions.NoExpAccountability()
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -139,12 +139,6 @@ var (
|
||||
// TODO(roasbeef): add command line param to modify.
|
||||
MaxFundingAmount = funding.MaxBtcFundingAmount
|
||||
|
||||
// AccountabilityExperimentEnd is the time after which nodes should stop
|
||||
// propagating experimental accountable signals.
|
||||
//
|
||||
// Per blip04: January 1, 2026 12:00:00 AM UTC in unix seconds.
|
||||
AccountabilityExperimentEnd = time.Unix(1767225600, 0)
|
||||
|
||||
// ErrGossiperBan is one of the errors that can be returned when we
|
||||
// attempt to finalize a connection to a remote peer.
|
||||
ErrGossiperBan = errors.New("gossiper has banned remote's key")
|
||||
@@ -4444,13 +4438,7 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
|
||||
AuxTrafficShaper: s.implCfg.TrafficShaper,
|
||||
AuxChannelNegotiator: s.implCfg.AuxChannelNegotiator,
|
||||
ShouldFwdExpAccountability: func() bool {
|
||||
if s.cfg.ProtocolOptions.NoExpAccountability() {
|
||||
return false
|
||||
}
|
||||
|
||||
return clock.NewDefaultClock().Now().Before(
|
||||
AccountabilityExperimentEnd,
|
||||
)
|
||||
return !s.cfg.ProtocolOptions.NoExpAccountability()
|
||||
},
|
||||
NoDisconnectOnPongFailure: s.cfg.NoDisconnectOnPongFailure,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user