RLP: remove allocations, replace buff with pooled buff#12869
Merged
Conversation
AskAlexSharov
approved these changes
Nov 26, 2024
Contributor
Author
|
Replacing stack allocated slice with sync.Pool does not reduce the speed for sure and in some cases increase the speed of encoding. As an example, |
yperbasis
reviewed
Dec 3, 2024
erigon-lib/rlp/encode.go
Outdated
| _, err := w.Write(buffer[:1]) | ||
| return err | ||
| } | ||
| nBytes := byte((nBits + 7) / 8) |
yperbasis
approved these changes
Dec 3, 2024
Member
|
@racytech Please back-port to |
somnergy
added a commit
that referenced
this pull request
Jan 27, 2025
…3574) A recent [RLP related commit](https://github.com/erigontech/erigon/pull/12869/files#diff-ec3e5ec81bd7c4746ee5d895260767e2282f268684ffc0de73d4a7018975493c) created a uint256 encoding that assumes len = 32 for the passed in buffered byte array. However, this PR doesn't fix any inherent issues with [that approach](#12869) itself. This PR fixes one issue found in `pectra_devnet_5` that creates a mismatched recovered signer address.
yperbasis
added a commit
that referenced
this pull request
Jan 27, 2025
somnergy
added a commit
that referenced
this pull request
Jan 28, 2025
…3574) A recent [RLP related commit](https://github.com/erigontech/erigon/pull/12869/files#diff-ec3e5ec81bd7c4746ee5d895260767e2282f268684ffc0de73d4a7018975493c) created a uint256 encoding that assumes len = 32 for the passed in buffered byte array. However, this PR doesn't fix any inherent issues with [that approach](#12869) itself. This PR fixes one issue found in `pectra_devnet_5` that creates a mismatched recovered signer address.
somnergy
added a commit
that referenced
this pull request
Jan 28, 2025
…3574) A recent [RLP related commit](https://github.com/erigontech/erigon/pull/12869/files#diff-ec3e5ec81bd7c4746ee5d895260767e2282f268684ffc0de73d4a7018975493c) created a uint256 encoding that assumes len = 32 for the passed in buffered byte array. However, this PR doesn't fix any inherent issues with [that approach](#12869) itself. This PR fixes one issue found in `pectra_devnet_5` that creates a mismatched recovered signer address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preparation for RLP gen package. For now replacing stack allocations with pooled buff, and removing other allocations in RLP encoding logic