Skip to main content

Crate eth_valkyoth_codec

Crate eth_valkyoth_codec 

Source
Expand description

Bounded decoding policy for untrusted Ethereum wire inputs.

Structs§

DecodeAccumulator
Stateful budget accounting for one decoder invocation.
DecodeLimits
Resource limits required by every untrusted decoder.
RlpInteger
Borrowed canonical RLP integer.
RlpList
Borrowed RLP list payload.
RlpListItems
Iterator over immediate child items in a decoded RLP list.
RlpScalar
Borrowed RLP scalar byte string.

Enums§

DecodeError
Shared decode failure categories.
DecodeErrorCategory
Stable high-level decode error categories.
ResourceError
Stable resource budget categories.
RlpDeriveError
Error used by derive-generated RLP struct encoders and decoders.
RlpItem
Borrowed RLP item yielded by RlpListItems.
RlpListForm
Canonical RLP list form used by the decoder.
RlpScalarForm
Canonical RLP scalar form used by the decoder.

Constants§

MAX_RLP_LIST_TRAVERSAL_DEPTH
Hard cap on RLP list traversal depth regardless of the active decode limits.
MAX_RLP_U256_BYTES
Ethereum U256 maximum byte width in bytes.

Traits§

RlpDecode
RLP decoding contract for derive-generated and hand-written domains.
RlpEncode
RLP encoding contract for derive-generated and hand-written domains.

Functions§

checked_encoded_len_add
Adds two encoded lengths with overflow checking.
checked_len_add
Adds two decoded lengths and rejects integer overflow.
checked_range_end
Computes the end offset for a decoded range and rejects overflow.
decode_rlp_integer
Decodes exactly one canonical RLP integer.
decode_rlp_integer_partial
Decodes one canonical RLP integer from the start of input.
decode_rlp_list
Decodes exactly one canonical RLP list.
decode_rlp_list_partial
Decodes one canonical RLP list from the start of input.
decode_rlp_scalar
Decodes exactly one canonical RLP scalar byte string.
decode_rlp_scalar_partial
Decodes one canonical RLP scalar byte string from the start of input.
decode_rlp_u64
Decodes exactly one canonical RLP integer and converts it to u64.
decode_rlp_u128
Decodes exactly one canonical RLP integer and converts it to u128.
decode_rlp_u256_bytes
Decodes exactly one canonical RLP integer as unsigned 256-bit bytes.
encode_decoded_integer
Re-encodes a decoded canonical integer into output.
encode_decoded_item
Re-encodes a decoded canonical RLP item into output.
encode_decoded_list
Re-encodes a decoded canonical list into output.
encode_decoded_scalar
Re-encodes a decoded canonical scalar into output.
encode_rlp_integer
Canonically encodes an Ethereum integer payload into output.
encode_rlp_list_header
Encodes only the RLP list header for a known payload length.
encode_rlp_list_payload
Canonically encodes a list payload into output.
encode_rlp_scalar
Canonically encodes a scalar byte-string payload into output.
encoded_rlp_integer_len
Returns the encoded RLP byte length for a canonical integer payload.
encoded_rlp_list_header_len
Returns the RLP list-header length for a known list payload length.
encoded_rlp_list_len
Returns the encoded RLP byte length for a list payload.
encoded_rlp_scalar_len
Returns the encoded RLP byte length for a scalar byte-string payload.
require_exact_consumption
Ensures a decoder consumed the whole input.
require_range_in_bounds
Ensures a decoded range is inside an input buffer and returns its end.
rlp_integer_payload_to_u64
Converts canonical Ethereum RLP integer payload bytes to u64.
rlp_integer_payload_to_u128
Converts canonical Ethereum RLP integer payload bytes to u128.
rlp_integer_payload_to_u256_bytes
Converts canonical Ethereum RLP integer payload bytes to right-aligned U256.
validate_rlp_integer_payload
Validates canonical Ethereum RLP integer payload bytes.