Skip to content

Commit

Permalink
Start counting at 17 for EIP-663
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Nov 28, 2022
1 parent 3ca9eaf commit e27ebf3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EIPS/eip-663.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If the code is legacy bytecode, both of these instructions result in an *excepti

If the code is valid EOF1, the following execution rules apply:

1. These instructions are followed by an 8-bit immediate value, which we call `imm`, and can have a value of 0 to 255. We introduce the variable `n` which equals to `imm + 1`.
1. These instructions are followed by an 8-bit immediate value, which we call `imm`, and can have a value of 0 to 255. We introduce the variable `n` which equals to `imm + 17`.

2. For `DUPN`:
- If the current stack depth is less than `n`, then a stack underflow exception is issued.
Expand All @@ -53,7 +53,7 @@ The gas cost for both instructions is set at 3.

## Rationale

TBA
The offset 17 was chosen to avoid these new instructions overlapping with the existing `DUP?` and `SWAP?` instructions, which are cheaper to deploy because they take a single byte. Having the overlap provides little benefit, and likely would see very little use.

## Backwards Compatibility

Expand All @@ -65,7 +65,7 @@ TBA

## Security Considerations

The authors are not aware of any additional risks introduced here. The EVM stack is fixed at 1024 items and most implementations keep that in memory at all times. This change will increase the easy-to-access number of items from 16 to 256.
The authors are not aware of any additional risks introduced here. The EVM stack is fixed at 1024 items and most implementations keep that in memory at all times. This change will increase the easy-to-access number of items from 16 to 274.

## Copyright

Expand Down

0 comments on commit e27ebf3

Please sign in to comment.