-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ack htlc settlement commands after writing state (#1615)
There are two issues: 1. because we forward commands *before* writing to disk in `PendingRelayDb.safeSend` in order to reduce latency, there is a race where the channel can process and acknowledge the command before the db write. As a result, the command stays in the pending relay db and will be cleaned up by the post-restart-htlc-cleaner at next restart. 2. in the general case, the channel acknowledges commands *before* it writes its state to disk, which opens a window for losing the command if we stop eclair at that exact time. In order to fix 2., we introduce a new `acking` transition method, which will be called after `storing`. This method adds a delay before actually acknowledging the commands, which should be more than enough to solve 1. I'm not sure we need that additional delay, because now that we acknowledge the commands *after* storing the state, the channel should lose the race most of the time.
- Loading branch information
Showing
4 changed files
with
64 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters