Open G8XSU opened 6 months ago
Outlined approach in https://github.com/orgs/lightningdevkit/discussions/3050
++
counterparty_claimable_outpoints
will not have ClaimInfo
. We don't want to treat missing ClaimInfo
as acceptable, hence we need to write empty ClaimInfo
so that user can always provide us with Some() ClaimInfo
after ClaimInfoRequest
.
Problem: After every commitment signed,
counterparty_claimable_outpoints
keeps on growing without bounds within a channel_monitor, with a new hashmap entry for each commitment_tx.It poses two problems mainly:
We don't want to keep on storing outpoints which will only be used for revoked_tx / funding_spend, instead we would like to store them in cold storage and read them only when required.
Ideal outcome: After doing this, Ldk's memory footprint should be drastically decreased owing to removed in-memory hashmap entries of
counterparty_claimable_outpoints
counterparty_claimable_outpoints
by re-using existing get calls and refactors [#3057 ]PersistClaimInfo
andRequestClaimInfo
[#3067]check_spend_counterparty_transaction
andcancel_prev_commitment_claims
to act after we receiveClaimInfo
ClaimInfo
, Re-insertClaimInfo
incounterparty_claimable_outpoints
, so thatget_claimable_balances
can account for it. (Done as part of handle events functions.)