Skip to content

Commit

Permalink
Remove support for initial_routing_sync (#1683)
Browse files Browse the repository at this point in the history
We keep the GetRoutingState API available in the router as it's useful to
query network information locally (or between actors), but we stop sending
that data to remote nodes.
  • Loading branch information
t-bast authored Feb 4, 2021
1 parent 4902362 commit f241ef9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/Configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Note that you can also disable some default features:

```conf
eclair.features {
initial_routing_sync = disabled
option_support_large_channel = disabled
}
```

Expand All @@ -77,7 +77,7 @@ eclair.override-features = [
{
nodeId = "03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f"
features {
initial_routing_sync = disabled
option_support_large_channel = disabled
option_static_remotekey = optional
}
},
Expand Down
1 change: 0 additions & 1 deletion eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ eclair {
trampoline-payments-enable = false // TODO: @t-bast: once spec-ed this should use a global feature flag
// see https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md
features {
initial_routing_sync = optional
option_data_loss_protect = optional
gossip_queries = optional
gossip_queries_ex = optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ object NodeParams extends Logging {
val featuresErr = Features.validateFeatureGraph(features)
require(featuresErr.isEmpty, featuresErr.map(_.message))
require(features.hasFeature(Features.VariableLengthOnion), s"${Features.VariableLengthOnion.rfcName} must be enabled")
require(!features.hasFeature(Features.InitialRoutingSync), s"${Features.InitialRoutingSync.rfcName} is not supported anymore, use ${Features.ChannelRangeQueries.rfcName} instead")
}

val pluginMessageParams = pluginParams.collect { case p: CustomFeaturePlugin => p }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,6 @@ class PeerConnection(keyPair: KeyPair, conf: PeerConnection.Conf, switchboard: A
val flags_opt = if (canUseChannelRangeQueriesEx) Some(QueryChannelRangeTlv.QueryFlags(QueryChannelRangeTlv.QueryFlags.WANT_ALL)) else None
log.info(s"sending sync channel range query with flags_opt=$flags_opt replacePrevious=$replacePrevious")
router ! SendChannelQuery(d.chainHash, d.remoteNodeId, self, replacePrevious, flags_opt)
} else if (d.remoteInit.features.hasFeature(Features.InitialRoutingSync) && replacePrevious) {
// For "old" nodes that don't support channel queries, we send them the full routing table
log.info("peer requested a full routing table dump")
router ! GetRoutingState
}
stay

Expand Down
12 changes: 10 additions & 2 deletions eclair-core/src/test/scala/fr/acinq/eclair/StartupSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class StartupSpec extends AnyFunSuite {

val legalFeaturesConf = ConfigFactory.parseMap(Map(
s"features.${OptionDataLossProtect.rfcName}" -> "optional",
s"features.${InitialRoutingSync.rfcName}" -> "optional",
s"features.${ChannelRangeQueries.rfcName}" -> "optional",
s"features.${ChannelRangeQueriesExtended.rfcName}" -> "optional",
s"features.${VariableLengthOnion.rfcName}" -> "optional",
Expand All @@ -104,18 +103,27 @@ class StartupSpec extends AnyFunSuite {
// var_onion_optin cannot be disabled
val noVariableLengthOnionConf = ConfigFactory.parseMap(Map(
s"features.${OptionDataLossProtect.rfcName}" -> "optional",
s"features.${InitialRoutingSync.rfcName}" -> "optional",
s"features.${ChannelRangeQueries.rfcName}" -> "optional",
s"features.${ChannelRangeQueriesExtended.rfcName}" -> "optional"
).asJava)

// initial_routing_sync cannot be enabled
val initialRoutingSyncConf = ConfigFactory.parseMap(Map(
s"features.${OptionDataLossProtect.rfcName}" -> "optional",
s"features.${InitialRoutingSync.rfcName}" -> "optional",
s"features.${ChannelRangeQueries.rfcName}" -> "optional",
s"features.${ChannelRangeQueriesExtended.rfcName}" -> "optional",
s"features.${VariableLengthOnion.rfcName}" -> "optional"
).asJava)

// basic_mpp without payment_secret
val illegalFeaturesConf = ConfigFactory.parseMap(Map(
s"features.${BasicMultiPartPayment.rfcName}" -> "optional"
).asJava)

assert(Try(makeNodeParamsWithDefaults(finalizeConf(legalFeaturesConf))).isSuccess)
assert(Try(makeNodeParamsWithDefaults(finalizeConf(noVariableLengthOnionConf))).isFailure)
assert(Try(makeNodeParamsWithDefaults(finalizeConf(initialRoutingSyncConf))).isFailure)
assert(Try(makeNodeParamsWithDefaults(finalizeConf(illegalFeaturesConf))).isFailure)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ object TestConstants {
publicAddresses = NodeAddress.fromParts("localhost", 9731).get :: Nil,
features = Features(
Set(
ActivatedFeature(InitialRoutingSync, Optional),
ActivatedFeature(OptionDataLossProtect, Optional),
ActivatedFeature(ChannelRangeQueries, Optional),
ActivatedFeature(ChannelRangeQueriesExtended, Optional),
Expand Down Expand Up @@ -261,7 +260,6 @@ object TestConstants {
color = Color(4, 5, 6),
publicAddresses = NodeAddress.fromParts("localhost", 9732).get :: Nil,
features = Features(Set(
ActivatedFeature(InitialRoutingSync, Optional),
ActivatedFeature(OptionDataLossProtect, Optional),
ActivatedFeature(ChannelRangeQueries, Optional),
ActivatedFeature(ChannelRangeQueriesExtended, Optional),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ abstract class IntegrationSpec extends TestKitBaseClass with BitcoindService wit

val commonFeatures = ConfigFactory.parseMap(Map(
s"eclair.features.${OptionDataLossProtect.rfcName}" -> "optional",
s"eclair.features.${InitialRoutingSync.rfcName}" -> "optional",
s"eclair.features.${ChannelRangeQueries.rfcName}" -> "optional",
s"eclair.features.${ChannelRangeQueriesExtended.rfcName}" -> "optional",
s"eclair.features.${VariableLengthOnion.rfcName}" -> "optional",
Expand Down

0 comments on commit f241ef9

Please sign in to comment.