rlp: add RawList for working with un-decoded lists#33755
Merged
fjl merged 1 commit intoethereum:masterfrom Feb 4, 2026
Merged
Conversation
This adds a new type wrapper that decodes as a list, but does not actually decode the contents of the list. The type parameter exists as a marker, and enables decoding the elements lazily. RawList can also be used for building a list incrementally.
rjl493456442
reviewed
Feb 4, 2026
| } | ||
|
|
||
| // EncodeRLP writes the encoded list to the writer. | ||
| func (r RawList[T]) EncodeRLP(w io.Writer) error { |
Member
There was a problem hiding this comment.
Any particular reason to use struct instead of the pointer of struct?
Contributor
Author
There was a problem hiding this comment.
I used non-pointer receiver because most uses are like this:
type packet struct{
List rlp.RawList[item]
}and there is a lot of code in tests that attempts to encode packet{}.
gzliudan
pushed a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Feb 10, 2026
This adds a new type wrapper that decodes as a list, but does not actually decode the contents of the list. The type parameter exists as a marker, and enables decoding the elements lazily. RawList can also be used for building a list incrementally.
19 tasks
AnilChinchawale
pushed a commit
to XinFinOrg/XDPoSChain
that referenced
this pull request
Feb 28, 2026
… (#2040) This adds a new type wrapper that decodes as a list, but does not actually decode the contents of the list. The type parameter exists as a marker, and enables decoding the elements lazily. RawList can also be used for building a list incrementally. Co-authored-by: Felix Lange <fjl@twurst.com>
sduchesneau
pushed a commit
to streamingfast/go-ethereum
that referenced
this pull request
Apr 7, 2026
This adds a new type wrapper that decodes as a list, but does not actually decode the contents of the list. The type parameter exists as a marker, and enables decoding the elements lazily. RawList can also be used for building a list incrementally.
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.
This adds a new type wrapper that decodes as a list, but does not actually decode the contents of the list. The type parameter exists as a marker, and enables decoding the elements lazily. RawList can also be used for building a list incrementally.