Skip to content

fix(rlp): modernisation, hardening, and perforance improvements#13555

Merged
rvagg merged 3 commits intomasterfrom
rvagg/rlp
Mar 30, 2026
Merged

fix(rlp): modernisation, hardening, and perforance improvements#13555
rvagg merged 3 commits intomasterfrom
rvagg/rlp

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Mar 26, 2026

With input validation & canonical encoding checks, pulling in some learnings and test vectors from go-ethereum: https://github.com/ethereum/go-ethereum/tree/master/rlp

@rvagg rvagg requested review from Copilot and wjmelements March 26, 2026 06:46
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Mar 26, 2026
@rvagg rvagg added the skip/changelog This change does not require CHANGELOG.md update label Mar 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes and hardens the ethtypes RLP codec used by Ethereum transaction parsing/encoding by adding stricter input validation (size/depth/canonical encoding) and improving some internal implementations.

Changes:

  • Added decoder safety limits (max input length, max list depth) and canonical RLP encoding checks.
  • Refactored length encoding/decoding and introduced clearer sentinel errors for common invalid cases.
  • Expanded RLP test coverage with canonical/non-canonical, truncation/trailing-bytes, and roundtrip vectors (including go-ethereum-derived cases).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
chain/types/ethtypes/rlp.go Adds decoding limits and canonical checks; refactors length handling and error plumbing.
chain/types/ethtypes/rlp_test.go Adds/updates tests for the new validation and canonicalization behavior, plus roundtrip vectors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread chain/types/ethtypes/rlp_test.go Outdated
Comment thread chain/types/ethtypes/rlp_test.go Outdated
Comment thread chain/types/ethtypes/rlp.go Outdated
Comment thread chain/types/ethtypes/rlp.go
Comment thread chain/types/ethtypes/rlp.go
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting Review in FilOz Mar 26, 2026
Copy link
Copy Markdown
Contributor

@wjmelements wjmelements left a comment

Choose a reason for hiding this comment

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

tests look great

Comment thread chain/types/ethtypes/rlp.go
Comment thread chain/types/ethtypes/rlp.go
Comment thread chain/types/ethtypes/rlp.go Outdated
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting Review to ✔️ Approved by reviewer in FilOz Mar 27, 2026
@rvagg rvagg merged commit 6c318c2 into master Mar 30, 2026
98 checks passed
@rvagg rvagg deleted the rvagg/rlp branch March 30, 2026 00:28
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Mar 30, 2026
@rjan90 rjan90 mentioned this pull request Mar 30, 2026
39 tasks
rjan90 added a commit that referenced this pull request Mar 30, 2026
* fix(rlp): modernisation, hardening, and perforance improvements (#13555)

* chore: bump go-paramfetch to latest version (#13559)

chore: bump go-paramfetch to latest version

* fix(api): `StateSearchMsg` should respect `lookbackLimit` when using index (#13562)

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: hanabi1224 <harlowmoo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants