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

RLP Length in Bits Rather Than Bytes (OBOL-13) #2076

Closed
1 task
xenowits opened this issue Apr 10, 2023 · 0 comments
Closed
1 task

RLP Length in Bits Rather Than Bytes (OBOL-13) #2076

xenowits opened this issue Apr 10, 2023 · 0 comments
Assignees
Labels
protocol Protocol Team tickets

Comments

@xenowits
Copy link
Contributor

xenowits commented Apr 10, 2023

🎯 Problem to be solved

RLP decoding validates that the length is not more than 64 bits before passing this value to fromBigEndian() which expects bytes.

The function fromBigEndian() expects length to be in units of bytes rather than bits. It is therefore possible to have a length larger than uint64 .

🛠️ Proposed solution

For these cases, ensure that length is less than or equal to 8 rather than 64 and encode values in bytes rather than bits.

🧪 Tests

  • Tested by new automated unit/integration/smoke tests
@xenowits xenowits self-assigned this Apr 10, 2023
@github-actions github-actions bot added the protocol Protocol Team tickets label Apr 10, 2023
obol-bulldozer bot pushed a commit that referenced this issue Apr 12, 2023
Fixes bug in RLP `decodeLength()` by ensuring that calculations of length should use units of bytes instead of bits.

category: bug 
ticket: #2076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protocol Protocol Team tickets
Projects
None yet
Development

No branches or pull requests

1 participant