Fix future unknown Event variant backwards compatibility#1087
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1087 +/- ##
=======================================
Coverage 90.72% 90.72%
=======================================
Files 65 65
Lines 34212 34212
=======================================
Hits 31039 31039
Misses 3173 3173 Continue to review full report at Codecov.
|
|
Will squash + land after #997. |
In 8ffc2d1, in 0.0.100, we added a backwards compatibility feature to the reading of `Event`s - if the type was unknown and odd, we'd simply ignore the event and treat it as no event. However, we failed to read the length-prefixed TLV stream when doing so, resulting in us reading some of the skipped-event data as the next event or other data in the ChannelManager. We fix this by reading the varint length prefix written, then skipping that many bytes when we come across an unknown odd event type.
94875fa to
71e0173
Compare
|
Squashed and rebased with no other changes. grammar fixup commit was: Range-diff is |
In 8ffc2d1, in 0.0.100, we added
a backwards compatibility feature to the reading of
Events - ifthe type was unknown and odd, we'd simply ignore the event and
treat it as no event. However, we failed to read the
length-prefixed TLV stream when doing so, resulting in us reading
some of the skipped-event data as the next event or other data in
the ChannelManager.
We fix this by reading the varint length prefix written, then
skipping that many bytes when we come across an unknown odd event
type.
We really need a good test framework for reading new or old data with old or new channelmanagers/etc, but for 0.0.101 it doesn't make sense to try to build one.