Expand description
Bounded decoding policy for untrusted Ethereum wire inputs.
Structs§
- Decode
Accumulator - Stateful budget accounting for one decoder invocation.
- Decode
Limits - Resource limits required by every untrusted decoder.
- RlpInteger
- Borrowed canonical RLP integer.
- RlpList
- Borrowed RLP list payload.
- RlpList
Items - Iterator over immediate child items in a decoded RLP list.
- RlpScalar
- Borrowed RLP scalar byte string.
Enums§
- Decode
Error - Shared decode failure categories.
- Decode
Error Category - Stable high-level decode error categories.
- Resource
Error - Stable resource budget categories.
- RlpDerive
Error - Error used by derive-generated RLP struct encoders and decoders.
- RlpItem
- Borrowed RLP item yielded by
RlpListItems. - RlpList
Form - Canonical RLP list form used by the decoder.
- RlpScalar
Form - 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.