Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 0 additions & 76 deletions modules/core/src/commonMain/kotlin/fr/acinq/lightning/Features.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,6 @@ sealed class Feature {
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Invoice)
}

// We historically used the following feature bit in our invoices.
// However, the spec assigned the same feature bit to `option_scid_alias` (https://github.com/lightning/bolts/pull/910).
// We're moving this feature bit to 148, but we have to keep supporting it until enough wallet users have migrated, then we can remove it.
// We cannot rename that object otherwise we will not be able to read old serialized data.
@Serializable
object TrampolinePayment : Feature() {
override val rfcName get() = "trampoline_payment_backwards_compat"
override val mandatory get() = 50
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node, FeatureScope.Invoice)
}

@Serializable
object SimpleClose : Feature() {
override val rfcName get() = "option_simple_close"
Expand All @@ -182,14 +171,6 @@ sealed class Feature {
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

/** DEPRECATED: this feature bit should not be used, it is only kept for serialization backwards-compatibility. */
@Serializable
object ZeroConfChannels : Feature() {
override val rfcName get() = "zero_conf_channels"
override val mandatory get() = 130
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

/** This feature bit should be activated when a mobile node supports waking up via push notifications. */
@Serializable
object WakeUpNotificationClient : Feature() {
Expand All @@ -206,54 +187,6 @@ sealed class Feature {
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

/** DEPRECATED: this feature bit was used for the legacy pay-to-open protocol. */
@Serializable
object PayToOpenClient : Feature() {
override val rfcName get() = "pay_to_open_client"
override val mandatory get() = 136
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init)
}

/** DEPRECATED: this feature bit was used for the legacy pay-to-open protocol. */
@Serializable
object PayToOpenProvider : Feature() {
override val rfcName get() = "pay_to_open_provider"
override val mandatory get() = 138
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

/** DEPRECATED: this feature bit should not be used, it is only kept for serialization backwards-compatibility. */
@Serializable
object TrustedSwapInClient : Feature() {
override val rfcName get() = "trusted_swap_in_client"
override val mandatory get() = 140
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init)
}

/** DEPRECATED: this feature bit should not be used, it is only kept for serialization backwards-compatibility. */
@Serializable
object TrustedSwapInProvider : Feature() {
override val rfcName get() = "trusted_swap_in_provider"
override val mandatory get() = 142
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

/** This feature is deprecated but must be kept to allow deserialization of old backups. */
@Serializable
object ChannelBackupClient : Feature() {
override val rfcName get() = "channel_backup_client"
override val mandatory get() = 144
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init)
}

/** This feature is deprecated but must be kept to allow deserialization of old backups. */
@Serializable
object ChannelBackupProvider : Feature() {
override val rfcName get() = "channel_backup_provider"
override val mandatory get() = 146
override val scopes: Set<FeatureScope> get() = setOf(FeatureScope.Init, FeatureScope.Node)
}

// The version of trampoline enabled by this feature bit does not match the latest spec PR: once the spec is accepted,
// we will introduce a new version of trampoline that will work in parallel to this one, until we can safely deprecate it.
@Serializable
Expand Down Expand Up @@ -354,19 +287,11 @@ data class Features(val activated: Map<Feature, FeatureSupport>, val unknown: Se
Feature.ProvideStorage,
Feature.ChannelType,
Feature.PaymentMetadata,
Feature.TrampolinePayment,
Feature.SimpleClose,
Feature.ExperimentalTrampolinePayment,
Feature.ZeroReserveChannels,
Feature.ZeroConfChannels,
Feature.WakeUpNotificationClient,
Feature.WakeUpNotificationProvider,
Feature.PayToOpenClient,
Feature.PayToOpenProvider,
Feature.TrustedSwapInClient,
Feature.TrustedSwapInProvider,
Feature.ChannelBackupClient,
Feature.ChannelBackupProvider,
Feature.ExperimentalSplice,
Feature.OnTheFlyFunding,
Feature.FundingFeeCredit
Expand Down Expand Up @@ -401,7 +326,6 @@ data class Features(val activated: Map<Feature, FeatureSupport>, val unknown: Se
Feature.BasicMultiPartPayment to listOf(Feature.PaymentSecret),
Feature.AnchorOutputs to listOf(Feature.StaticRemoteKey),
Feature.SimpleClose to listOf(Feature.ShutdownAnySegwit),
Feature.TrampolinePayment to listOf(Feature.PaymentSecret),
Feature.ExperimentalTrampolinePayment to listOf(Feature.PaymentSecret),
Feature.OnTheFlyFunding to listOf(Feature.ExperimentalSplice),
Feature.FundingFeeCredit to listOf(Feature.OnTheFlyFunding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ data class NodeParams(
require(features.hasFeature(Feature.RouteBlinding)) { "${Feature.RouteBlinding.rfcName} should be supported" }
require(features.hasFeature(Feature.ShutdownAnySegwit, FeatureSupport.Mandatory)) { "${Feature.ShutdownAnySegwit.rfcName} should be mandatory" }
require(features.hasFeature(Feature.SimpleClose, FeatureSupport.Mandatory)) { "${Feature.SimpleClose.rfcName} should be mandatory" }
require(!features.hasFeature(Feature.ZeroConfChannels)) { "${Feature.ZeroConfChannels.rfcName} has been deprecated: use the zeroConfPeers whitelist instead" }
require(!features.hasFeature(Feature.TrustedSwapInClient)) { "${Feature.TrustedSwapInClient.rfcName} has been deprecated" }
require(!features.hasFeature(Feature.TrustedSwapInProvider)) { "${Feature.TrustedSwapInProvider.rfcName} has been deprecated" }
require(!features.hasFeature(Feature.PayToOpenClient)) { "${Feature.PayToOpenClient.rfcName} has been deprecated" }
require(!features.hasFeature(Feature.PayToOpenProvider)) { "${Feature.PayToOpenProvider.rfcName} has been deprecated" }
Features.validateFeatureGraph(features)
// Verify expiry parameters are consistent with each other.
require((fulfillSafetyBeforeTimeoutBlocks * 2) < minFinalCltvExpiryDelta) { "min_final_expiry_delta must be at least twice as long as fulfill_safety_before_timeout_blocks" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ sealed class ChannelState {
is Offline -> state.run { handleLocalError(cmd, t) }
is Syncing -> state.run { handleLocalError(cmd, t) }
is WaitForRemotePublishFutureCommitment -> Pair(state, emptyList())
is LegacyWaitForFundingConfirmed -> forceClose(state)
is LegacyWaitForFundingLocked -> forceClose(state)
}
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ data class Syncing(val state: PersistedChannelState, val channelReestablishSent:
is ChannelCommand.MessageReceived -> when (cmd.message) {
is ChannelReestablish -> {
val (nextState, actions) = when (state) {
is LegacyWaitForFundingConfirmed -> {
Pair(state, listOf())
}
is WaitForFundingSigned -> {
val actions = buildList {
if (cmd.message.nextFundingTxId == state.signingSession.fundingTx.txId && cmd.message.nextLocalCommitmentNumber == 0L) {
Expand Down Expand Up @@ -117,13 +114,6 @@ data class Syncing(val state: PersistedChannelState, val channelReestablishSent:
actions.add(ChannelAction.Message.Send(channelReady))
Pair(state, actions)
}
is LegacyWaitForFundingLocked -> {
logger.debug { "re-sending channel_ready" }
val nextPerCommitmentPoint = channelKeys().commitmentPoint(1)
val channelReady = ChannelReady(state.commitments.channelId, nextPerCommitmentPoint)
val actions = listOf(ChannelAction.Message.Send(channelReady))
Pair(state, actions)
}
is Normal -> {
when (val syncResult = handleSync(state.commitments, cmd.message)) {
is SyncResult.Failure -> handleSyncFailure(state.commitments, cmd.message, syncResult)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class Peer(
}
launch {
// we don't restore closed channels
val bootChannels = db.channels.listLocalChannels().filterNot { it is Closed || it is LegacyWaitForFundingConfirmed }
val bootChannels = db.channels.listLocalChannels().filterNot { it is Closed }
_bootChannelsFlow.value = bootChannels.associateBy { it.channelId }
val channelIds = bootChannels.map {
logger.info { "restoring channel ${it.channelId} from local storage" }
Expand Down
Loading