-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
tlv: add library for new message/payload serialization format #3061
Merged
Commits on Aug 7, 2019
-
tlv/varint: add modified bitcoin varint
This varint has the same serialization as the varint in btcd and bitcoind, but has different behavior wrt returned errors. In order to ensure the inner loop properly detects cleanly written records, ReadVarInt will not only return EOF if it can't read the first byte, as that means the reader has zero bytes left. It also modifies the API to allow the caller to provided a static byte array, which can be reused across all encoding and decoding and increases performance.
Configuration menu - View commit details
-
Copy full SHA for 3afcb1f - Browse repository at this point
Copy the full SHA 3afcb1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 75fcf1c - Browse repository at this point
Copy the full SHA 75fcf1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6773d47 - Browse repository at this point
Copy the full SHA 6773d47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96e0bb1 - Browse repository at this point
Copy the full SHA 96e0bb1View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc1f23d - Browse repository at this point
Copy the full SHA bc1f23dView commit details -
tlv: zero alloc encoding for extended types
This commit adds concrete encoding methods for primitive integral types. When external libs need to create custom encoders, this allows them to do so without incurring an extra allocation on the heap. Previously, the need to pass a pointer to the integer using an interface{} would cause the argument to escape, which we avoid by having them copied directly.
Configuration menu - View commit details
-
Copy full SHA for a0ebaea - Browse repository at this point
Copy the full SHA a0ebaeaView commit details -
Configuration menu - View commit details
-
Copy full SHA for abdcd47 - Browse repository at this point
Copy the full SHA abdcd47View commit details -
tlv/truncated: add truncated integer encodings
This commit adds the truncated integer encodings used in the variable-size onion payloads. The amount and cltv delta both use the truncated encoding to shave bytes in the overall size, and will likely be used in the future for additional extensions where size is a constraint.
Configuration menu - View commit details
-
Copy full SHA for 7c94bbb - Browse repository at this point
Copy the full SHA 7c94bbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3690999 - Browse repository at this point
Copy the full SHA 3690999View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.