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
+17
-69
No files matched your search
@@ -75,6 +75,10 @@
|
|||||||
This applies to both funders and fundees, with the ability to override the
|
This applies to both funders and fundees, with the ability to override the
|
||||||
value during channel opening or acceptance.
|
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
|
## RPC Updates
|
||||||
|
|
||||||
## lncli Updates
|
## lncli Updates
|
||||||
|
|||||||
@@ -3346,8 +3346,6 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
|||||||
func (l *channelLink) experimentalAccountability(
|
func (l *channelLink) experimentalAccountability(
|
||||||
customUpdateAdd record.CustomSet) fn.Option[byte] {
|
customUpdateAdd record.CustomSet) fn.Option[byte] {
|
||||||
|
|
||||||
// Only relay experimental signal if we are within the experiment
|
|
||||||
// period.
|
|
||||||
if !l.cfg.ShouldFwdExpAccountability() {
|
if !l.cfg.ShouldFwdExpAccountability() {
|
||||||
return fn.None[byte]()
|
return fn.None[byte]()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,18 +57,12 @@ func testAccountability(ht *lntest.HarnessTest, aliceAccountable bool) {
|
|||||||
FeeLimitMsat: math.MaxInt64,
|
FeeLimitMsat: math.MaxInt64,
|
||||||
}
|
}
|
||||||
|
|
||||||
var expectedValue []byte
|
expectedValue := []byte{lnwire.ExperimentalUnaccountable}
|
||||||
hasAccountability := lntest.ExperimentalAccountabilityActive()
|
if aliceAccountable {
|
||||||
|
expectedValue = []byte{lnwire.ExperimentalAccountable}
|
||||||
if hasAccountability {
|
t := uint64(lnwire.ExperimentalAccountableType)
|
||||||
if aliceAccountable {
|
sendReq.FirstHopCustomRecords = map[uint64][]byte{
|
||||||
expectedValue = []byte{lnwire.ExperimentalAccountable}
|
t: expectedValue,
|
||||||
t := uint64(lnwire.ExperimentalAccountableType)
|
|
||||||
sendReq.FirstHopCustomRecords = map[uint64][]byte{
|
|
||||||
t: expectedValue,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
expectedValue = []byte{lnwire.ExperimentalUnaccountable}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,12 +70,11 @@ func testAccountability(ht *lntest.HarnessTest, aliceAccountable bool) {
|
|||||||
|
|
||||||
// Validate that our signal (positive or zero) propagates until carol
|
// Validate that our signal (positive or zero) propagates until carol
|
||||||
// and then is dropped because she has disabled the feature.
|
// and then is dropped because she has disabled the feature.
|
||||||
// When the accountability experiment is not active, no signal is sent.
|
|
||||||
validateAccountableAndResume(
|
validateAccountableAndResume(
|
||||||
ht, bobIntercept, hasAccountability, expectedValue,
|
ht, bobIntercept, true, expectedValue,
|
||||||
)
|
)
|
||||||
validateAccountableAndResume(
|
validateAccountableAndResume(
|
||||||
ht, carolIntercept, hasAccountability, expectedValue,
|
ht, carolIntercept, true, expectedValue,
|
||||||
)
|
)
|
||||||
validateAccountableAndResume(ht, daveIntercept, false, nil)
|
validateAccountableAndResume(ht, daveIntercept, false, nil)
|
||||||
|
|
||||||
|
|||||||
@@ -432,25 +432,14 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
|
|||||||
// We should get another notification about the held HTLC.
|
// We should get another notification about the held HTLC.
|
||||||
packet = ht.ReceiveHtlcInterceptor(bobInterceptor)
|
packet = ht.ReceiveHtlcInterceptor(bobInterceptor)
|
||||||
|
|
||||||
// Check the expected number of custom records based on whether the
|
require.Len(ht, packet.InWireCustomRecords, 2)
|
||||||
// accountability experiment is still active.
|
|
||||||
expectedLen := 1
|
|
||||||
if lntest.ExperimentalAccountabilityActive() {
|
|
||||||
expectedLen = 2
|
|
||||||
}
|
|
||||||
require.Len(ht, packet.InWireCustomRecords, expectedLen)
|
|
||||||
require.Equal(ht, lntest.CustomRecordsWithUnaccountable(customRecords),
|
require.Equal(ht, lntest.CustomRecordsWithUnaccountable(customRecords),
|
||||||
packet.InWireCustomRecords)
|
packet.InWireCustomRecords)
|
||||||
|
|
||||||
// And now we forward the payment at Carol, expecting only an
|
// And now we forward the payment at Carol, expecting only an
|
||||||
// accountability signal in our incoming custom records (if the experiment
|
// accountability signal in our incoming custom records.
|
||||||
// is still active).
|
|
||||||
packet = ht.ReceiveHtlcInterceptor(carolInterceptor)
|
packet = ht.ReceiveHtlcInterceptor(carolInterceptor)
|
||||||
expectedCarolLen := 0
|
require.Len(ht, packet.InWireCustomRecords, 1)
|
||||||
if lntest.ExperimentalAccountabilityActive() {
|
|
||||||
expectedCarolLen = 1
|
|
||||||
}
|
|
||||||
require.Len(ht, packet.InWireCustomRecords, expectedCarolLen)
|
|
||||||
err = carolInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
|
err = carolInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
|
||||||
IncomingCircuitKey: packet.IncomingCircuitKey,
|
IncomingCircuitKey: packet.IncomingCircuitKey,
|
||||||
Action: actionResume,
|
Action: actionResume,
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcutil"
|
"github.com/btcsuite/btcd/btcutil"
|
||||||
"github.com/btcsuite/btcd/wire"
|
"github.com/btcsuite/btcd/wire"
|
||||||
"github.com/lightningnetwork/lnd"
|
|
||||||
"github.com/lightningnetwork/lnd/input"
|
"github.com/lightningnetwork/lnd/input"
|
||||||
"github.com/lightningnetwork/lnd/lnrpc"
|
"github.com/lightningnetwork/lnd/lnrpc"
|
||||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||||
@@ -290,16 +288,6 @@ func CalcStaticFeeBuffer(c lnrpc.CommitmentType, numHTLCs int) btcutil.Amount {
|
|||||||
// tests.
|
// tests.
|
||||||
func CustomRecordsWithUnaccountable(
|
func CustomRecordsWithUnaccountable(
|
||||||
originalRecords lnwire.CustomRecords) map[uint64][]byte {
|
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{
|
return originalRecords.MergedCopy(map[uint64][]byte{
|
||||||
uint64(lnwire.ExperimentalAccountableType): {
|
uint64(lnwire.ExperimentalAccountableType): {
|
||||||
lnwire.ExperimentalUnaccountable,
|
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.
|
// LnrpcOutpointToStr returns a string representation of an lnrpc.OutPoint.
|
||||||
func LnrpcOutpointToStr(outpoint *lnrpc.OutPoint) string {
|
func LnrpcOutpointToStr(outpoint *lnrpc.OutPoint) string {
|
||||||
return fmt.Sprintf("%s:%d", outpoint.TxidStr, outpoint.OutputIndex)
|
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
|
return nil
|
||||||
},
|
},
|
||||||
ShouldSetExpAccountability: func() bool {
|
ShouldSetExpAccountability: func() bool {
|
||||||
if s.cfg.ProtocolOptions.NoExpAccountability() {
|
return !s.cfg.ProtocolOptions.NoExpAccountability()
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return clock.NewDefaultClock().Now().Before(
|
|
||||||
AccountabilityExperimentEnd,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,12 +139,6 @@ var (
|
|||||||
// TODO(roasbeef): add command line param to modify.
|
// TODO(roasbeef): add command line param to modify.
|
||||||
MaxFundingAmount = funding.MaxBtcFundingAmount
|
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
|
// ErrGossiperBan is one of the errors that can be returned when we
|
||||||
// attempt to finalize a connection to a remote peer.
|
// attempt to finalize a connection to a remote peer.
|
||||||
ErrGossiperBan = errors.New("gossiper has banned remote's key")
|
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,
|
AuxTrafficShaper: s.implCfg.TrafficShaper,
|
||||||
AuxChannelNegotiator: s.implCfg.AuxChannelNegotiator,
|
AuxChannelNegotiator: s.implCfg.AuxChannelNegotiator,
|
||||||
ShouldFwdExpAccountability: func() bool {
|
ShouldFwdExpAccountability: func() bool {
|
||||||
if s.cfg.ProtocolOptions.NoExpAccountability() {
|
return !s.cfg.ProtocolOptions.NoExpAccountability()
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return clock.NewDefaultClock().Now().Before(
|
|
||||||
AccountabilityExperimentEnd,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
NoDisconnectOnPongFailure: s.cfg.NoDisconnectOnPongFailure,
|
NoDisconnectOnPongFailure: s.cfg.NoDisconnectOnPongFailure,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user