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

BOLT 04: Add failure code for invalid payload. #627

Open
wants to merge 1 commit into
base: master
from

Conversation

1 participant
@t-bast
Copy link
Collaborator

commented Jul 8, 2019

The specification currently doesn't specify the case where the onion per-hop
payload can't be correctly decoded.

This is somewhat fine with the fixed frames because every field of the payload
can always be interpreted as a numeric value from the input bytes, so it leads
to application errors in upper layers when those values are actually
interpreted (and we realize that for instance we have an invalid
short_channel_id value).

With variable-length tlv streams in the onion payloads, we will encounter
decoding errors (duplicate tlv types, invalid ordering, etc) and the spec
should define the failure code to use in that case.

@t-bast t-bast requested a review from cdecker Jul 8, 2019

@@ -724,6 +724,12 @@ General permanent failure of the processing node.

The processing node has a required feature which was not in this onion.

1. type: BADONION|PERM (`invalid_onion_payload`)

This comment has been minimized.

Copy link
@t-bast

t-bast Jul 8, 2019

Author Collaborator

I treat this as the default BADONION error, but maybe it would make more sense to assign it a specific bit (e.g. BADONION|PERM|1 or BADONION|PERM|7).
Let me know what you think would be best.

@t-bast t-bast added this to Scheduled in Specification Meeting Agenda Jul 8, 2019

@t-bast t-bast changed the title Bolt04: Add failure code for invalid payload. BOLT 04: Add failure code for invalid payload. Jul 8, 2019

Bolt04: Add failure code for invalid payload.
The specification currently doesn't specify the case where the onion per-hop
payload can't be correctly decoded.

This is somewhat fine with the fixed frames because every field of the payload
can always be interpreted as a numeric value from the input bytes, so it leads
to application errors in upper layers when those values are actually
interpreted (and we realize that for instance we have an invalid
short_channel_id` value).

With variable-length tlv streams in the onion payloads, we will encounter
decoding errors (duplicate tlv types, invalid ordering, etc) and the spec
should define the failure code to use in that case.

@t-bast t-bast force-pushed the b4-malformed-onion-failure-message branch from 490bfd2 to 9f8d44e Jul 9, 2019

@t-bast

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 12, 2019

I'm curious to get your feedback on this @cdecker @Roasbeef.
It feels to me that we really need to define this failure code otherwise our implementations will use different errors for that scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.