Skip to content
Draft
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ server=1
rpcuser=foo
rpcpassword=bar
txindex=1
txospenderindex=1
addresstype=bech32m
changetype=bech32m
zmqpubhashblock=tcp://127.0.0.1:29000
Expand Down Expand Up @@ -303,6 +304,7 @@ so you can easily run your Bitcoin node on both mainnet and testnet. For example
```conf
server=1
txindex=1
txospenderindex=1
addresstype=bech32
changetype=bech32
Expand Down
14 changes: 12 additions & 2 deletions docs/release-notes/eclair-vnext.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@

## Major changes

<insert changes>
### Update minimal version of Bitcoin Core

With this release, eclair requires using Bitcoin Core 32.x.
Newer versions of Bitcoin Core may be used, but have not been extensively tested.

:warning: the new Bitcoin Core `txospenderindex` must be enabled, see instructions below.

### Faster scanning for spending transactions with Bitcoin Core's txospenderindex

Eclair now uses Bitcoin Core's `txospenderindex` (available in Bitcoin Core 31.0 and newer) to find channel spending transactions, which is much faster and less expensive than scanning blocks. This index must be enabled on your Bitcoin Core
node: start Bitcoin Core with `-txospenderindex` or add `txospenderindex=1` to your `bitcoin.conf`.

### Configuration changes

<insert changes>
`channel.max-channel-spent-rescan-blocks` has been removed, with `txospenderindex` we don't need to scan the blockchain for channel transaction spenders anymore.

### API changes

Expand Down
12 changes: 6 additions & 6 deletions eclair-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-31.1/bitcoin-31.1-x86_64-linux-gnu.tar.gz</bitcoind.url>
<bitcoind.sha256>b80d9c3e04da78fb6f0569685673418cf686fadba9042d926d13fb87ff503f9e</bitcoind.sha256>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-32.1/bitcoin-32.1-x86_64-linux-gnu.tar.gz</bitcoind.url>
<bitcoind.sha256>61545c17c3120fb7412f896d248b11993af04ec8817aad3649c55b2afb044963</bitcoind.sha256>
</properties>
</profile>
<profile>
Expand All @@ -97,8 +97,8 @@
</os>
</activation>
<properties>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-31.1/bitcoin-31.1-x86_64-apple-darwin.tar.gz</bitcoind.url>
<bitcoind.sha256>bc506958d0f387c1ea770bdc7c7192a505fa645ff62cabcc7761fa7eb89e867e</bitcoind.sha256>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-32.1/bitcoin-32.1-x86_64-apple-darwin.tar.gz</bitcoind.url>
<bitcoind.sha256>53b1e6ffd92843ca82ef4a737d7a53cb0a9fab15816a417a41f12fc954071447</bitcoind.sha256>
</properties>
</profile>
<profile>
Expand All @@ -109,8 +109,8 @@
</os>
</activation>
<properties>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-31.1/bitcoin-31.1-win64.zip</bitcoind.url>
<bitcoind.sha256>c99ef173471c58e6766d9eebd12e6c35349082eeed3939bc99eed58ef57db587</bitcoind.sha256>
<bitcoind.url>https://bitcoincore.org/bin/bitcoin-core-32.1/bitcoin-32.1-win64.zip</bitcoind.url>
<bitcoind.sha256>b5b0c2cd007d69e96880907c79f9ae19ae82728f95fc8c923b4a07dab795b45d</bitcoind.sha256>
</properties>
</profile>
</profiles>
Expand Down
4 changes: 0 additions & 4 deletions eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ eclair {
max-restart-watch-delay = 60 seconds // we add a random delay before watching funding transactions after restart
max-block-processing-delay = 30 seconds // we add a random delay before processing blocks, capped at this value, to prevent herd effect
max-tx-publish-retry-delay = 60 seconds // we add a random delay before retrying failed transaction publication
// When a channel has been spent while we were offline, we limit how many blocks in the past we scan, otherwise we
// may scan the entire blockchain (which is very costly). It doesn't make sense to scan too far in the past, as an
// attacker will already have swept the funds if we didn't detect a channel close that happened a long time ago.
max-channel-spent-rescan-blocks = 720
// When a new block is found, we will analyze its transactions to see if some of our channels were spent.
// We also scan previous blocks if we missed them, which may happen during reorgs: this parameter should be larger
// than the longest reorg expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ object NodeParams extends Logging {
maxBlockProcessingDelay = FiniteDuration(config.getDuration("channel.max-block-processing-delay").getSeconds, TimeUnit.SECONDS),
maxTxPublishRetryDelay = FiniteDuration(config.getDuration("channel.max-tx-publish-retry-delay").getSeconds, TimeUnit.SECONDS),
scanPreviousBlocksDepth = config.getInt("channel.scan-previous-blocks-depth"),
maxChannelSpentRescanBlocks = config.getInt("channel.max-channel-spent-rescan-blocks"),
unhandledExceptionStrategy = unhandledExceptionStrategy,
revocationTimeout = FiniteDuration(config.getDuration("channel.revocation-timeout").getSeconds, TimeUnit.SECONDS),
requireConfirmedInputsForDualFunding = config.getBoolean("channel.require-confirmed-inputs-for-dual-funding"),
Expand Down
5 changes: 4 additions & 1 deletion eclair-core/src/main/scala/fr/acinq/eclair/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class Setup(val datadir: File,
await(getBitcoinStatus(bitcoinClient), 30 seconds, "bitcoind did not respond after 30 seconds")
}
logger.info(s"bitcoind version=${bitcoinStatus.version}")
assert(bitcoinStatus.version >= 310000, "Eclair requires Bitcoin Core 31 or higher")
assert(bitcoinStatus.version >= 320000, "Eclair requires Bitcoin Core 32 or higher")
bitcoinStatus.unspentAddresses.foreach { address =>
val isSegwit = addressToPublicKeyScript(bitcoinStatus.chainHash, address).map(script => Script.isNativeWitnessScript(script)).getOrElse(false)
assert(isSegwit, s"Your wallet contains non-segwit UTXOs (e.g. address=$address). You must send those UTXOs to a segwit address to use Eclair (check out our README for more details).")
Expand Down Expand Up @@ -296,6 +296,9 @@ class Setup(val datadir: File,
}
}
_ = if (bitcoinClient.useEclairSigner) logger.info("using eclair to sign bitcoin core transactions")
indexInfos <- bitcoinClient.getIndexInfo()
_ = if (!indexInfos.get("txindex").exists(_.synced)) throw new RuntimeException("txindex is disabled or not synchronized")
_ = if (!indexInfos.get("txospenderindex").exists(_.synced)) throw new RuntimeException("txospenderindex is disabled or not synchronized")
// We use the default address type configured on the Bitcoin Core node.
initialPubkeyScript <- bitcoinClient.getReceivePublicKeyScript(addressType_opt = None)
_ = finalPubkeyScript.set(initialPubkeyScript)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ trait OnChainChannelFunder {
* Note that if this function returns false, that doesn't mean the output cannot be spent. The output could be unknown
* (not in the blockchain nor in the mempool) but could reappear later and be spendable at that point.
*/
def isTransactionOutputSpendable(txid: TxId, outputIndex: Int, includeMempool: Boolean)(implicit ec: ExecutionContext): Future[Boolean]
def isTransactionOutputSpendable(outPoint: OutPoint, includeMempool: Boolean)(implicit ec: ExecutionContext): Future[Boolean]

/** Rollback a transaction that we failed to commit: this probably translates to "release locks on utxos". */
def rollback(tx: Transaction)(implicit ec: ExecutionContext): Future[Boolean]
Expand Down
Loading
Loading