-
Notifications
You must be signed in to change notification settings - Fork 895
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
Split the TLV payload processing into parsing and validation #3278
Split the TLV payload processing into parsing and validation #3278
Commits on Nov 21, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6ce68c6 - Browse repository at this point
Copy the full SHA 6ce68c6View commit details -
tlv: Add typesafe fromwire codegen for TLV namespaces
We were weaving in and out of generic code through `fromwire_tlvs` with custom parameters defining the types in that namespace. This hard-wires the parser with the namespace's types. Slowly trying to deprecate `fromwire_tlvs` in favor of this typesafe variant.
Configuration menu - View commit details
-
Copy full SHA for 482f914 - Browse repository at this point
Copy the full SHA 482f914View commit details -
tlv: Add validity check codegen for the tlv namespaces
Since the parser itself just parses and doesn't include validation anymore we need to put that functionality somewhere. The validation consists of enforcing that the types are in monotonically increasing order without duplicates and that for the even types we know how to handle it.
Configuration menu - View commit details
-
Copy full SHA for 02fb929 - Browse repository at this point
Copy the full SHA 02fb929View commit details -
sphinx: Use the new
fromwire_tlv_payload
functionWe wire in the code-generated function, which removes the upfront validation and add the validation back after the `htlc_accepted` hook returns. If a plugin wanted to handle the onion in a special way it'll not have told us to just continue.
Configuration menu - View commit details
-
Copy full SHA for 0799d4a - Browse repository at this point
Copy the full SHA 0799d4aView commit details -
sphinx: Decode payload and place shortcuts in the route-step
We'll need to pass them around anyway, so just make them easier to access by doing a bit more to `process_onionpacket`.
Configuration menu - View commit details
-
Copy full SHA for af37d6e - Browse repository at this point
Copy the full SHA af37d6eView commit details -
htlcs: Make necessary payload fields optional and derfer validation
We make the fields in `htlc_accepted_payload` optional (NULL if not present in the payload) and defer validation till after the hook call.
Configuration menu - View commit details
-
Copy full SHA for cc484fa - Browse repository at this point
Copy the full SHA cc484faView commit details -
htlc: Consolidate validation after the htlc_accepted hook returns
This now enforces all rules for validity, both for the TLV format and checking that the required fields have been provided.
Configuration menu - View commit details
-
Copy full SHA for 98e7c0f - Browse repository at this point
Copy the full SHA 98e7c0fView commit details -
sphinx: Cleanup route_step_decode_* functions
We have consolidated the two functions into a single `route_step_decode` function, and made it static since we call it in the `process_onionpacket` function. We remove the two exposed functions since they're no longer useful.
Configuration menu - View commit details
-
Copy full SHA for 2feb28e - Browse repository at this point
Copy the full SHA 2feb28eView commit details -
htlc: Add a checker function tellung us whether we can continue
Configuration menu - View commit details
-
Copy full SHA for df4c187 - Browse repository at this point
Copy the full SHA df4c187View commit details