-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode ChannelType causes DataIntegrityError #3
Comments
So basically the issue is the fact that |
So so, the situation occurs in others parts too. I was thinking of modifying the ln encode/decode so that it detects when the buffer EOF and ends the operation instead of return a Error. But I'm not sure if this is correct approach. What's your opnion? |
For me it looks like the whole Lightning encode traits need a redesign. But I need a bit more time to figure out the best way forward - maybe we can avoid such dramatic changes. |
Sure. For now, I will open a PR with some "workarounds" and minor issues. I have a goal to finish the LN review in end of mounth. |
Ok, I figured out the source of the issue and a fix: #5 The issue was caused by a TLV with 0 bytes, which must be handled as a default FlagVec. The approach you proposed in the comments is invalid leading to failing parsing length values in all lightning-encoded data inproperly. |
Hi @dr-orlovsky,
I tried to decode a
ChannelType
usinglightning_deserialize
from message open channel by clightning, but it occurred an error:According to the BOLT-2 spec, this occurs because some situations are not necessary
channel_type
information in the message.You can test this by adding the bellow test in bolt2.rs, in
lnp-core
repo:Expected Result:
PS: I bypassed this issue changing this code to:
And made other change in ChannelType (
lnp-core
repo):I known this not correct approach, but I couldn't solve this problem.
I hope this help.
Thanks
The text was updated successfully, but these errors were encountered: