Skip to content

Conversation

@VolodymyrBg
Copy link
Contributor

This change replaces the tuple RLP encoders in crates/common/rlp/encode.rs to use structs::Encoder instead of summing element lengths via .length() and then re-encoding each element, which previously caused every tuple element to be encoded into a temporary Vec just to determine its size and then encoded again into the output buffer. The new approach pre-encodes all tuple elements into a single temporary buffer and writes the list prefix and payload once, matching the pattern already used by Vec::encode and structs::Encoder elsewhere in the codebase. This removes avoidable allocations and CPU overhead while preserving identical RLP output and API behavior.

@VolodymyrBg VolodymyrBg requested a review from a team as a code owner November 13, 2025 15:52
Copy link
Collaborator

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@mpaulucci mpaulucci added this pull request to the merge queue Nov 13, 2025
Merged via the queue into lambdaclass:main with commit ff1442f Nov 13, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants