rust-lightning/fuzz
Matt Corallo 5e43070ef4 Move pending-HTLC-updated ChannelMonitor from ManyChannelMonitor
This is important for a number of reasons:
 * Firstly, I hit this trying to implement rescan in the demo
   bitcoinrpc client - if individual ChannelMonitors are out of
   sync with each other, we cannot add them all into a
   ManyChannelMonitor together and then rescan, but need to rescan
   them individually without having to do a bunch of manual work.
   Of the three return values in ChannelMonitor::block_connected,
   only the HTLCsource stuff that is moved here makes no sense to
   be exposed to the user.
 * Secondly, the logic currently in ManyChannelMonitor cannot be
   reproduced by the user! HTLCSource is deliberately an opaque
   type but we use its data to decide which things to keep when
   inserting into the HashMap. This would prevent a user from
   properly implementing a replacement ManyChannelMonitor, which is
   unacceptable.
 * Finally, by moving the tracking into ChannelMonitor, we can
   serialize them out, which prevents us from forgetting them when
   loading from disk, though there are still other races which need
   to be handled to make this fully safe (see TODOs in
   ChannelManager).

This is safe as no two entries can have the same HTLCSource across
different channels (or, if they did, it would be a rather serious
bug), though note that, IIRC, when this code was added, the
HTLCSource field in the values was not present.

We also take this opportunity to rename the fetch function to match
our other event interfaces, makaing it clear that by calling the
function the set of HTLCUpdates will also be cleared.
2020-02-20 20:31:51 -05:00
..
src Move pending-HTLC-updated ChannelMonitor from ManyChannelMonitor 2020-02-20 20:31:51 -05:00
.gitignore Move fuzz to top level. 2019-11-25 15:42:07 -05:00
Cargo.toml Bump bitcoin dep to 0.21 2019-12-11 18:17:54 -05:00
targets.h Refactor fuzzing to be a C-callable library plus rust binaries 2019-12-11 15:13:14 -05:00
travis-fuzz.sh Skip lto on travis when building fuzz targets as it takes 30 min 2020-02-20 20:02:26 -05:00