Merge pull request #4701 from carlaKC/4581-removeexperimential

multi: remove experimential build flag for assumechanvalid
This commit is contained in:
Olaoluwa Osuntokun 2020-11-03 17:34:50 -08:00 committed by GitHub
commit 297c614126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 30 deletions

@ -269,12 +269,12 @@ vendor:
ios: vendor mobile-rpc
@$(call print, "Building iOS framework ($(IOS_BUILD)).")
mkdir -p $(IOS_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=ios -tags="mobile $(DEV_TAGS) autopilotrpc experimental" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
$(GOMOBILE_BIN) bind -target=ios -tags="mobile $(DEV_TAGS) autopilotrpc" $(LDFLAGS) -v -o $(IOS_BUILD) $(MOBILE_PKG)
android: vendor mobile-rpc
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
mkdir -p $(ANDROID_BUILD_DIR)
$(GOMOBILE_BIN) bind -target=android -tags="mobile $(DEV_TAGS) autopilotrpc experimental" $(LDFLAGS) -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
$(GOMOBILE_BIN) bind -target=android -tags="mobile $(DEV_TAGS) autopilotrpc" $(LDFLAGS) -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
mobile: ios android

@ -286,7 +286,7 @@ type Config struct {
GcCanceledInvoicesOnTheFly bool `long:"gc-canceled-invoices-on-the-fly" description:"If true, we'll delete newly canceled invoices on the fly."`
Routing *routing.Conf `group:"routing" namespace:"routing"`
Routing *lncfg.Routing `group:"routing" namespace:"routing"`
Workers *lncfg.Workers `group:"workers" namespace:"workers"`

6
lncfg/routing.go Normal file

@ -0,0 +1,6 @@
package lncfg
// Routing holds the configuration options for routing.
type Routing struct {
AssumeChannelValid bool `long:"assumechanvalid" description:"Skip checking channel spentness during graph validation. This speedup comes at the risk of using an unvalidated view of the network for routing. (default: false)"`
}

@ -1,12 +0,0 @@
// +build !experimental
package routing
// Conf provides the command line routing configuration. There are no fields in
// the production build so that this section is hidden by default.
type Conf struct{}
// UseAssumeChannelValid always returns false when not in experimental builds.
func (c *Conf) UseAssumeChannelValid() bool {
return false
}

@ -1,14 +0,0 @@
// +build experimental
package routing
// Conf exposes the experimental command line routing configurations.
type Conf struct {
AssumeChannelValid bool `long:"assumechanvalid" description:"Skip checking channel spentness during graph validation. (default: false)"`
}
// UseAssumeChannelValid returns true if the router should skip checking for
// spentness when processing channel updates and announcements.
func (c *Conf) UseAssumeChannelValid() bool {
return c.AssumeChannelValid
}

@ -408,6 +408,15 @@ bitcoin.node=btcd
; Used to help identify ourselves to other bitcoin peers (default: 0.11.0-beta).
; neutrino.useragentversion=0.11.0-beta
; Skip checking channel spentness and existence during graph validation for
; neutrino. Enabling this option means that neutrino nodes will not need to
; perform long rescans which block initial usage of the daemon, but comes at
; the cost of not validating channels in your routing graph. Skipping this
; validation means that your node may have an incorrect view of the network
; if it receives updates for closed or non-existent channels. This could affect
; routing, but funds are safu.
; --routing.assumechanvalid=true
[Btcd]
; The base directory that contains the node's data, logs, configuration file,

@ -761,7 +761,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
ChannelPruneExpiry: routing.DefaultChannelPruneExpiry,
GraphPruneInterval: time.Duration(time.Hour),
QueryBandwidth: queryBandwidth,
AssumeChannelValid: cfg.Routing.UseAssumeChannelValid(),
AssumeChannelValid: cfg.Routing.AssumeChannelValid,
NextPaymentID: sequencer.NextID,
PathFindingConfig: pathFindingConfig,
Clock: clock.NewDefaultClock(),