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

Update EIP-2935: restrict contract input to 8 bytes to prevent overflow in checks #8514

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions EIPS/eip-2935.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
Exact evm assembly that can be used for the contract to resolve `BLOCKHASH`

```
// check if inputsize>32 revert
push1 0x20
// check if inputsize>8 revert
push1 0x08
calldatasize
gt
push1 0x31
Expand All @@ -88,7 +88,7 @@
push1 0x29
jumpi

// check if blocknumber > input + 8192 then return 0
// check if blocknumber > input + 8192 then return 0, no overflow expected for input of 8 bytes
push0
calldataload
push2 0x2000
Expand Down Expand Up @@ -130,6 +130,8 @@
stop
```

<!-- TODO: bytecode is based off on first version and will be updated once assembley is locked down as it changes contract sender and address -->

Check warning on line 133 in EIPS/eip-2935.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> EIPS/eip-2935.md | 133 | <!-- TODO: bytecode is based off on first version and will be updated once assembley is locked down as it changes contract sender and address --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

Check warning on line 133 in EIPS/eip-2935.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> EIPS/eip-2935.md | 133 | <!-- TODO: bytecode is based off on first version and will be updated once assembley is locked down as it changes contract sender and address --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

Check warning on line 133 in EIPS/eip-2935.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn`

warning[markdown-html-comments]: HTML comments are only allowed while `status` is one of: `Draft`, `Withdrawn` --> EIPS/eip-2935.md | 133 | <!-- TODO: bytecode is based off on first version and will be updated once assembley is locked down as it changes contract sender and address --> | = help: see https://ethereum.github.io/eipw/markdown-html-comments/

Corresponding bytecode:
`60203611603157600143035f35116029575f356120000143116029576120005f3506545f5260205ff35b5f5f5260205ff35b5f5ffd00`

Expand Down
Loading