Skip to content

Commit d6f88ef

Browse files
committed
minor rewordings
1 parent 3084f7b commit d6f88ef

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

eclair-core/src/main/resources/reference.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ eclair {
8686
fulfill-safety-before-timeout-blocks = 24
8787
min-final-expiry-delta-blocks = 30 // Bolt 11 invoice's min_final_cltv_expiry; must be strictly greater than fulfill-safety-before-timeout-blocks
8888
max-block-processing-delay = 30 seconds // we add a random delay before processing blocks, capped at this value, to prevent herd effect
89-
outdated-commitment-strategy = "always-request-remote-close" // always-request-remote-close or halt-if-just-restarted
90-
unhandled-exception-strategy = "local-force-close" // local-force-close or log-and-stop
89+
90+
outdated-commitment-strategy = "remote-close" // remote-close or stop (NB: the app will only stop if it was recently restarted)
91+
unhandled-exception-strategy = "local-close" // local-close or stop
9192

9293
fee-base-msat = 1000
9394
fee-proportional-millionths = 100 // fee charged per transferred satoshi in millionths of a satoshi (100 = 0.01%)

eclair-core/src/main/scala/fr/acinq/eclair/NodeParams.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ object NodeParams extends Logging {
298298
require(feeBase <= MilliSatoshi(0xFFFFFFFFL), "fee-base-msat must be below 42 mbtc")
299299

300300
val outdatedCommitmentStrategy = config.getString("outdated-commitment-strategy") match {
301-
case "halt-if-just-restarted" => OutdatedCommitmentStrategy.HaltIfJustRestarted
302-
case "always-request-remote-close" => OutdatedCommitmentStrategy.AlwaysRequestRemoteClose
301+
case "remote-close" => OutdatedCommitmentStrategy.RemoteClose
302+
case "stop" => OutdatedCommitmentStrategy.Stop
303303
}
304304

305305
val unhandledExceptionStrategy = config.getString("unhandled-exception-strategy") match {
306-
case "local-force-close" => UnhandledExceptionStrategy.LocalForceClose
307-
case "log-and-stop" => UnhandledExceptionStrategy.LogAndStop
306+
case "local-close" => UnhandledExceptionStrategy.LocalClose
307+
case "stop" => UnhandledExceptionStrategy.Stop
308308
}
309309

310310
val routerSyncEncodingType = config.getString("router.sync.encoding-type") match {

eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ object Channel {
136136
* that we are using an outdated commitment.
137137
* This may be the best choice for smaller loosely administered nodes.
138138
*/
139-
case object AlwaysRequestRemoteClose extends OutdatedCommitmentStrategy
139+
case object RemoteClose extends OutdatedCommitmentStrategy
140140
/**
141141
* If the node was just restarted, just log an error and stop the app. The goal is to prevent unwanted mass
142142
* force-close of channels if we accidentally restarted the node with an outdated backup. After a few minutes, we
143143
* revert to the default behavior of requesting our peer to force close, otherwise this opens a huge attack vector
144144
* where any peer can remotely stop our node.
145145
* This strategy may be better suited for larger nodes, closely administered.
146146
*/
147-
case object HaltIfJustRestarted extends OutdatedCommitmentStrategy
147+
case object Stop extends OutdatedCommitmentStrategy
148148
}
149149
// @formatter:on
150150

@@ -153,9 +153,9 @@ object Channel {
153153
sealed trait UnhandledExceptionStrategy
154154
object UnhandledExceptionStrategy {
155155
/** Ask our counterparty to close the channel. This may be the best choice for smaller loosely administered nodes.*/
156-
case object LocalForceClose extends UnhandledExceptionStrategy
156+
case object LocalClose extends UnhandledExceptionStrategy
157157
/** Just log an error and stop the node. May be better for larger nodes, to prevent unwanted mass force-close.*/
158-
case object LogAndStop extends UnhandledExceptionStrategy
158+
case object Stop extends UnhandledExceptionStrategy
159159
}
160160
// @formatter:on
161161

@@ -2196,9 +2196,9 @@ class Channel(val nodeParams: NodeParams, val wallet: EclairWallet, remoteNodeId
21962196
case _ =>
21972197
// unhandled exception: we apply the configured strategy
21982198
nodeParams.unhandledExceptionStrategy match {
2199-
case UnhandledExceptionStrategy.LocalForceClose =>
2199+
case UnhandledExceptionStrategy.LocalClose =>
22002200
spendLocalCurrent(dd) sending error
2201-
case UnhandledExceptionStrategy.LogAndStop =>
2201+
case UnhandledExceptionStrategy.Stop =>
22022202
log.error("stopping the node (unhandled exception")
22032203
System.exit(1)
22042204
stop(FSM.Shutdown)
@@ -2446,11 +2446,11 @@ class Channel(val nodeParams: NodeParams, val wallet: EclairWallet, remoteNodeId
24462446

24472447
private def handleOutdatedCommitment(channelReestablish: ChannelReestablish, d: HasCommitments) = {
24482448
nodeParams.outdatedCommitmentStrategy match {
2449-
case OutdatedCommitmentStrategy.HaltIfJustRestarted if ManagementFactory.getRuntimeMXBean.getUptime.millis < 10.minutes =>
2449+
case OutdatedCommitmentStrategy.Stop if ManagementFactory.getRuntimeMXBean.getUptime.millis < 10.minutes =>
24502450
log.error("we just restarted and may have an outdated commitment! stopping the node")
24512451
System.exit(1)
24522452
stop(FSM.Shutdown)
2453-
case OutdatedCommitmentStrategy.AlwaysRequestRemoteClose =>
2453+
case OutdatedCommitmentStrategy.RemoteClose =>
24542454
val exc = PleasePublishYourCommitment(d.channelId)
24552455
val error = Error(d.channelId, exc.getMessage)
24562456
goto(WAIT_FOR_REMOTE_PUBLISH_FUTURE_COMMITMENT) using DATA_WAIT_FOR_REMOTE_PUBLISH_FUTURE_COMMITMENT(d.commitments, channelReestablish) storing() sending error

eclair-core/src/test/scala/fr/acinq/eclair/TestConstants.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ object TestConstants {
121121
feeProportionalMillionth = 10,
122122
reserveToFundingRatio = 0.01, // note: not used (overridden below)
123123
maxReserveToFundingRatio = 0.05,
124-
outdatedCommitmentStrategy = OutdatedCommitmentStrategy.AlwaysRequestRemoteClose,
125-
unhandledExceptionStrategy = UnhandledExceptionStrategy.LocalForceClose,
124+
outdatedCommitmentStrategy = OutdatedCommitmentStrategy.RemoteClose,
125+
unhandledExceptionStrategy = UnhandledExceptionStrategy.LocalClose,
126126
db = TestDatabases.inMemoryDb(),
127127
revocationTimeout = 20 seconds,
128128
autoReconnect = false,
@@ -228,8 +228,8 @@ object TestConstants {
228228
feeProportionalMillionth = 10,
229229
reserveToFundingRatio = 0.01, // note: not used (overridden below)
230230
maxReserveToFundingRatio = 0.05,
231-
outdatedCommitmentStrategy = OutdatedCommitmentStrategy.AlwaysRequestRemoteClose,
232-
unhandledExceptionStrategy = UnhandledExceptionStrategy.LocalForceClose,
231+
outdatedCommitmentStrategy = OutdatedCommitmentStrategy.RemoteClose,
232+
unhandledExceptionStrategy = UnhandledExceptionStrategy.LocalClose,
233233
db = TestDatabases.inMemoryDb(),
234234
revocationTimeout = 20 seconds,
235235
autoReconnect = false,

0 commit comments

Comments
 (0)