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.
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.

Functions§

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.
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.