Skip to content
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

Fix struct fields order #66

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

crisdut
Copy link
Member

@crisdut crisdut commented Jan 10, 2023

I tried open a channel between two lnp nodes, but this error occurs:

[2023-01-10T08:59:31Z ERROR microservices::esb::controller] ESB request processing error: message serialization or structure error. Details: Data integrity problem during strict decoding operation: encoded values are not deterministically ordered: value `Type(10995120572727296)` should go before `Type(10995120572727302)`

After invetigate, I found the reason:

For some reason, the type tvl::Stream (BTreeMap<Type, RawValue>) need the last field of the struct when we uses strict encode/decode.

Copy link
Contributor

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4f81745

@dr-orlovsky
Copy link
Contributor

It is very impressive that you was able to figure out the reason of the issue. From your results it becomes clear that indeed TLV stream has to be the last data in the structure, so if emedded structures have TLV stream and they are not the last field they would not work! This is a logical bug in lightning/strict encoding crates, opening an issues for that:

@dr-orlovsky dr-orlovsky merged commit e7e589a into LNP-WG:master Jan 17, 2023
@crisdut crisdut deleted the fix/strict-decode-order branch January 26, 2023 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants