Skip to content

Commit

Permalink
addr instead of ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Jul 24, 2023
1 parent 1c4261f commit 30de64d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions EIPS/eip-7377.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requires: 170, 1559, 2718

## Abstract

Introduce a new [EIP-2718](./eip-2718.md) transaction type with the format `0x04 || rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codePtr, storage, data, value, accessList, yParity, r, s])` which sets the sending account's `code` field in the state trie to the `code` value at `codePtr` and applies the storage tuples to the sender's storage trie.
Introduce a new [EIP-2718](./eip-2718.md) transaction type with the format `0x04 || rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codeAddr, storage, data, value, accessList, yParity, r, s])` which sets the sending account's `code` field in the state trie to the `code` value at `codeAddr` and applies the storage tuples to the sender's storage trie.

## Motivation

Expand All @@ -40,7 +40,7 @@ At the fork block `X`, introduce the migration transaction type.
| `maxFeePerGas` | `int256` |
| `maxPriorityFeePerGas` | `int256` |
| `gasLimit` | `uint64` |
| `codePtr` | `address` |
| `codeAddr` | `address` |
| `storage` | `List[Tuple[uint256, uint256]]` |
| `data` | `bytes` |
| `value` | `int256` |
Expand All @@ -49,17 +49,17 @@ At the fork block `X`, introduce the migration transaction type.
| `v` | `uint256` |
| `r` | `uint256` |

The EIP-2718 `TransactionType` is `0x04` and the `TransactionPayload` is `rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codePtr, storageTuples, data, value, accessList, yParity, r, s])`.
The EIP-2718 `TransactionType` is `0x04` and the `TransactionPayload` is `rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codeAddr, storageTuples, data, value, accessList, yParity, r, s])`.

The transaction's signature hash is `keccak256(0x04 || rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codePtr, storageTuples, data, value, accessList])`
The transaction's signature hash is `keccak256(0x04 || rlp([chainId, nonce, maxFeePerGas, maxPriorityFeePerGas, gasLimit, codeAddr, storageTuples, data, value, accessList])`

#### Validation

A migration transaction is considered valid if the follow properties hold:

* all [EIP-1559](./eip-1559.md) properties, unless specified otherwise
* the code at `codePtr` is less than the [EIP-170](./eip-170.md) limit of `24576`
* the code at `codePtr` must not have size `0`
* the code at `codeAddr` is less than the [EIP-170](./eip-170.md) limit of `24576`
* the code at `codeAddr` must not have size `0`

The intrinsic gas calculation modified from [EIP-1559](./eip-1559.md) to be `21000 + 16 * non-zero calldata bytes + 4 * zero calldata bytes + 1900 * access list storage key count + 2400 * access list address count + 15000 * length of storage`.

Expand All @@ -71,7 +71,7 @@ Executing a migration transaction transaction has two parts.

Unlike standard contract deployment, a migration transaction directly specifies what `code` value the sender's account should be set to.

As the first step of processing the transaction, set the sender's `code` to `state[tx.codePtr].code`. Next, for each tuple in `tx.storage` and the sender's storage trie, set `storage[t.first] = t.second`.
As the first step of processing the transaction, set the sender's `code` to `state[tx.codeAddr].code`. Next, for each tuple in `tx.storage` and the sender's storage trie, set `storage[t.first] = t.second`.

##### Transaction Execution

Expand Down

0 comments on commit 30de64d

Please sign in to comment.