Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

Historically c-lightning and eclair have always sent
channel_update messages inside the onion error packets with the
two message type bytes (0x0102 for channel_update messages) but
lnd and us skipped those bytes. We only supported decoding messages
matching our own encoding - decoding a bogus channel_update if
the extra bytes were included.

Here we detect the type bytes and, if they're present, start
reading at offset 2.

We also take this opportunity to improve loging and make the
severity more accurate for the previous error.

Fixes #1450.

This really needs tests and we need to change the encoding end as well - THIS IS UP FOR GRABS IF SOMEONE WANTS TO WRITE TESTS and change the encoding end, otherwise I'll get to it eventually, but I run this code locally.

Historically c-lightning and eclair have always sent
`channel_update` messages inside the onion error packets with the
two message type bytes (`0x0102` for `channel_update` messages) but
lnd and us skipped those bytes. We only supported decoding messages
matching our own encoding - decoding a bogus `channel_update` if
the extra bytes were included.

Here we detect the type bytes and, if they're present, start
reading at offset 2.

We also take this opportunity to improve loging and make the
severity more accurate for the previous error.

Fixes lightningdevkit#1450.
@TheBlueMatt
Copy link
Collaborator Author

Superseded by #1465.

@TheBlueMatt TheBlueMatt closed this May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Onion failure update_channel message type bytes

1 participant