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-145: fix typo #7958

Merged
merged 7 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion EIPS/eip-145.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---

Check failure on line 1 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble is missing header(s): `description`, `discussions-to`

error[preamble-req]: preamble is missing header(s): `description`, `discussions-to` --> EIPS/eip-145.md | | = help: see https://ethereum.github.io/eipw/preamble-req/
eip: 145
title: Bitwise shifting instructions in EVM
author: Alex Beregszaszi (@axic), Paweł Bylica (@chfast)
type: Standards Track

Check failure on line 5 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `type` is out of order

error[preamble-order]: preamble header `type` is out of order --> EIPS/eip-145.md | 5 | type: Standards Track | = help: `type` should come after `status` = help: see https://ethereum.github.io/eipw/preamble-order/
category: Core
status: Final
created: 2017-02-13
---

Check failure on line 10 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body is missing section(s): `Security Considerations`

error[markdown-req-section]: body is missing section(s): `Security Considerations` --> EIPS/eip-145.md | | = help: must be at the second level (`## Heading`) = help: see https://ethereum.github.io/eipw/markdown-req-section/
## Simple Summary

Check failure on line 11 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

error[markdown-order-section]: body has extra section(s) --> EIPS/eip-145.md | 11 | ## Simple Summary | ::: EIPS/eip-145.md | 358 | ## Implementation | ::: EIPS/eip-145.md | 366 | ## Tests | = help: see https://ethereum.github.io/eipw/markdown-order-section/

To provide native bitwise shifting with cost on par with other arithmetic operations.

Expand All @@ -33,7 +33,7 @@
```

Notes:
- The value (`arg2`) is interpreted as an unsigned number.

Check failure on line 36 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]

EIPS/eip-145.md:36 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]
- The shift amount (`arg1`) is interpreted as an unsigned number.
- If the shift amount (`arg1`) is greater or equal 256 the result is 0.
- This is equivalent to `PUSH1 2 EXP MUL`.
Expand All @@ -47,7 +47,7 @@
```

Notes:
- The value (`arg2`) is interpreted as an unsigned number.

Check failure on line 50 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]

EIPS/eip-145.md:50 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]
- The shift amount (`arg1`) is interpreted as an unsigned number.
- If the shift amount (`arg1`) is greater or equal 256 the result is 0.
- This is equivalent to `PUSH1 2 EXP DIV`.
Expand All @@ -61,7 +61,7 @@
```

Notes:
- The value (`arg2`) is interpreted as a signed number.

Check failure on line 64 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]

EIPS/eip-145.md:64 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- The value (`arg2`) is interp..."]
- The shift amount (`arg1`) is interpreted as an unsigned number.
- If the shift amount (`arg1`) is greater or equal 256 the result is 0 if `arg2` is non-negative or -1 if `arg2` is negative.
- This is **not** equivalent to `PUSH1 2 EXP SDIV`, since it rounds differently. See `SDIV(-1, 2) == 0`, while `SAR(-1, 1) == -1`.
Expand All @@ -70,7 +70,7 @@

## Rationale

Instruction operands were chosen to fit the more natural use case of shifting a value already on the stack. This means the operand order is swapped compared to most arithmetic insturctions.
Instruction operands were chosen to fit the more natural use case of shifting a value already on the stack. This means the operand order is swapped compared to most arithmetic instructions.

## Backwards Compatibility

Expand All @@ -86,28 +86,28 @@
SHL
---
0x0000000000000000000000000000000000000000000000000000000000000001
```

Check failure on line 89 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "```"]

EIPS/eip-145.md:89 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
2. ```

Check failure on line 90 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "2. ```"]

EIPS/eip-145.md:90 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "2. ```"]
PUSH 0x0000000000000000000000000000000000000000000000000000000000000001
PUSH 0x01
SHL
---
0x0000000000000000000000000000000000000000000000000000000000000002
```

Check failure on line 96 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "```"]

EIPS/eip-145.md:96 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
3. ```

Check failure on line 97 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "3. ```"]

EIPS/eip-145.md:97 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "3. ```"]
PUSH 0x0000000000000000000000000000000000000000000000000000000000000001
PUSH 0xff
SHL
---
0x8000000000000000000000000000000000000000000000000000000000000000
```

Check failure on line 103 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "```"]

EIPS/eip-145.md:103 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
4. ```

Check failure on line 104 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "4. ```"]

EIPS/eip-145.md:104 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "4. ```"]
PUSH 0x0000000000000000000000000000000000000000000000000000000000000001
PUSH 0x0100
SHL
---
0x0000000000000000000000000000000000000000000000000000000000000000
```

Check failure on line 110 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Fenced code blocks should be surrounded by blank lines [Context: "```"]

EIPS/eip-145.md:110 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
5. ```
PUSH 0x0000000000000000000000000000000000000000000000000000000000000001
PUSH 0x0101
Expand Down Expand Up @@ -358,19 +358,19 @@
## Implementation

Client support:
- cpp-ethereum: https://github.com/ethereum/cpp-ethereum/pull/4054

Check failure on line 361 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-145.md | 361 | - cpp-ethereum: https://github.com/ethereum/cpp-ethereum/pull/4054 | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

Compiler support:
- Solidity/LLL: https://github.com/ethereum/solidity/pull/2541

Check failure on line 364 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-145.md | 364 | - Solidity/LLL: https://github.com/ethereum/solidity/pull/2541 |

## Tests

Sources:
- https://github.com/ethereum/tests/tree/develop/src/GeneralStateTestsFiller/stShift

Check failure on line 369 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-145.md | 369 | - https://github.com/ethereum/tests/tree/develop/src/GeneralStateTestsFiller/stShift |

Filled Tests:
- https://github.com/ethereum/tests/tree/develop/GeneralStateTests/stShift

Check failure on line 372 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-145.md | 372 | - https://github.com/ethereum/tests/tree/develop/GeneralStateTests/stShift |
- https://github.com/ethereum/tests/tree/develop/BlockchainTests/GeneralStateTests/stShift

Check failure on line 373 in EIPS/eip-145.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-145.md | 373 | - https://github.com/ethereum/tests/tree/develop/BlockchainTests/GeneralStateTests/stShift |

## Copyright

Expand Down
Loading