-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the number of RPC calls to bitcoind during force-close (#2902)
* Don't spawn anchor tx publisher if commit is confirmed It is inefficient to spawn a tx publisher for anchor txs if we already know that the commit tx is confirmed: we will make calls to our bitcoin node that can easily be avoided. This can matter when force-closing a large number of channels with frequent disconnections (e.g. wallets). * Improve `TxTimeLocksMonitor` performance When publishing a transaction that has CSV delays, we previously used the watcher and set a `minDepth` on the parent transaction matching the CSV delay of the child transaction. While this was very simple, it was unnecessarily expensive for large CSV delays: the watcher would check for tx confirmations at every block, even when the CSV delay is very large. When we force-close a large number of channels, it results in a very large number of RPC calls to our `bitcoind` node. We don't use the watcher in the `TxTimeLocksMonitor` anymore: instead we check the parent confirmations once, and then we check again after the CSV delay. * Add relative delay hints to `ZmqWatcher` When we tell the `ZmqWatcher` to watch for confirmations on transactions that have a relative delay, it is highly inefficient to call our bitcoin node at every new block to check for confirmations (especially when the parent transaction isn't even confirmed). We now tell the watcher about the relative delay, which lets it check for confirmations only at block heights where we expect the transaction to reach its minimum depth. This is especially useful to improve performance for delayed transactions that usually use a CSV of at least 720 blocks.
- Loading branch information
Showing
15 changed files
with
314 additions
and
194 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
Oops, something went wrong.