Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RLP.decode #1307

Merged
merged 11 commits into from
Aug 20, 2024
Merged

Fix RLP.decode #1307

merged 11 commits into from
Aug 20, 2024

Conversation

ClementWalter
Copy link
Member

@ClementWalter ClementWalter commented Jul 25, 2024

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

RLP.decode doesn't check that the result is consistent with the given len prefix.
In other words, given two encoded items b1 and b2, RLP.decode(b1 + b2) will actually decode
b1 and b2 while it should raise because b1 + b2 is not a valid RLP (it's a list with missing prefix).

Resolves #1306

What is the new behavior?


This change is Reviewable

@ClementWalter ClementWalter marked this pull request as draft July 25, 2024 11:44
@ClementWalter ClementWalter marked this pull request as ready for review July 25, 2024 13:54
enitrat
enitrat previously approved these changes Jul 25, 2024
src/utils/eth_transaction.cairo Show resolved Hide resolved
src/utils/eth_transaction.cairo Outdated Show resolved Hide resolved
tests/src/utils/test_rlp.py Show resolved Hide resolved
@ClementWalter ClementWalter merged commit 211410a into kkrt-labs:main Aug 20, 2024
6 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.

bug: RLP assertions and test
2 participants