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

tlv: add library for new message/payload serialization format #3061

Merged
merged 9 commits into from
Aug 7, 2019

Commits on Aug 7, 2019

  1. 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.
    cfromknecht committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    3afcb1f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    75fcf1c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6773d47 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    96e0bb1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bc1f23d View commit details
    Browse the repository at this point in the history
  6. 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.
    cfromknecht committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    a0ebaea View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    abdcd47 View commit details
    Browse the repository at this point in the history
  8. 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.
    cfromknecht committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    7c94bbb View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3690999 View commit details
    Browse the repository at this point in the history