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

rlp/rlpgen: RLP encoder code generator #24251

Merged
merged 5 commits into from
Feb 16, 2022
Merged

rlp/rlpgen: RLP encoder code generator #24251

merged 5 commits into from
Feb 16, 2022

Commits on Feb 4, 2022

  1. rlp: externalize struct field processing / validation

    This adds a new package, rlp/internal/rlpstruct, in preparation for the
    RLP encoder generator.
    
    I think the struct field rules are subtle enough to warrant extracting
    this into their own package, even though it means that a bunch of
    adapter code is needed for converting to/from rlpstruct.Type.
    fjl committed Feb 4, 2022
    Configuration menu
    Copy the full SHA
    86cdaca View commit details
    Browse the repository at this point in the history
  2. rlp: add more decoder methods (for rlpgen)

    This adds new methods on rlp.Stream:
    
    - Uint64, Uint32, Uint16, Uint8, BigInt
    - ReadBytes for decoding into []byte
    - MoreDataInList - useful for optional list elements
    fjl committed Feb 4, 2022
    Configuration menu
    Copy the full SHA
    7aae6d2 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2022

  1. rlp: expose encoder buffer (for rlpgen)

    This exposes the internal encoder buffer type for use in EncodeRLP
    implementations.
    
    The new EncoderBuffer type is a sort-of 'opaque handle' for a pointer to
    an internal encBuffer. It is implemented this way to ensure the global
    encBuffer pool is handled correctly.
    fjl committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    2d00b34 View commit details
    Browse the repository at this point in the history
  2. go.mod: add x/tools

    fjl committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    5e7d29b View commit details
    Browse the repository at this point in the history
  3. rlp/rlpgen: RLP encoder code generator

    This is a new tool to generate EncodeRLP (and DecodeRLP) method
    implementations from a struct definition.
    fjl committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    af5b5d3 View commit details
    Browse the repository at this point in the history