Comments (4)
Another case that's unhandled is in contractcourt/chain_watcher.go
closeObserver()
method. It notifies once on the spend (which requires only 1-confirmation), and then exits out after "handling" the confirmed commit tx. If the commit tx gets re-orged out, the chain_watcher will be unaware, and the contractcourt subsystem will not properly handle this event.
from lnd.
Other call-sites that use RegisterSpendNtfn
:
breacharbiter.go
contractcourt/commit_sweep_resolver.go
contractcourt/htlc_outgoing_contest_resolver.go
sweep/sweeper.go
I haven't checked if the ones listed above properly handle re-orgs. I can update this issue once I check.
from lnd.
Sub-systems are not re-org safe:
- Sub-system grabs current-height after acquiring mutex
- chainntnfs receives: disconnected block, disconnected block, block (confirm/spend), block, block
- chainntnfs backend puts the blocks in a buffered channel
- Sub-system calls
RegisterConfirmationsNtfn
with the original height. - Historical dispatch occurs from [height, height+1]
- The desired confirmation has occurred at height-1
- Sub-system grabs the blocks from its
BlockEpochRegistration
channel, finally updating its height toheight+1
.
The blocks are received before the call to txnotifier.RegisterConf
, so they will not notify on the confirmation. This requires a 2-block re-org. Re-orgs are a global event, so while this race is unlikely, one re-org could affect one very unlucky user out of the thousands on the network.
from lnd.
Additionally, the onus seems to be on the sub-system or caller to handle re-orgs.
from lnd.
Related Issues (20)
- lnd+config: add config options for inbound fee discount HOT 2
- [bug]: InboundFees are overwritten if they were not explicitly specified in lncli HOT 2
- invoice+rpc: add exit hop `InvoiceAcceptor` sub-systems and RPC calls
- routing: add custom sender-sider bandwidth hint selection as a top level config option
- routing+rpc: enable senders to set a custom first-hop TLV blob for `update_add_htlc` HOT 2
- rpc+htlcswitch: add HTLC transformation capabilities to the interceptor HOT 8
- [bug]: use docker compose, lnd can not start HOT 5
- Problem with update_channel gossip propagation across LND nodes (wrongly marked as zombie channels?). HOT 9
- [bug]: lnd let's me force close a channel that is already being cooperatively closed and fails to broadcast tx HOT 3
- [bug]: Remote Signer: FundPsbt: change output lacking master fingerprint (XFP) HOT 8
- HTLCs stuck in limbo for months after force close HOT 10
- [arch]: move the exit hop processing logic from the link to the switch
- [feature]: allow setting to_self_delay with OpenChannel HOT 2
- [feature]: require Channel Acceptor to be registered before accepting channels HOT 1
- [feature]: add more parameters to Channel Acceptor HOT 5
- [bug]: LND panics when calling `kvdb.lastCompactionDate`. HOT 6
- [bug]: FAILURE_REASON_NO_ROUTE to a local channel - not fee related HOT 21
- [feature]: Add start_height to lnd.conf to manually set node "birthday" HOT 1
- [bug]: Remote Signer: ImportAccount: incorrect coin type in derivation path on testnet HOT 2
- [bug]: "failed to connect to all addresses - Connection refused; grpc_status:14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lnd.