This file has been truncated. show original
* `READ_ADDRESS_GAS`: 2000
* `READ_BYTE_GAS`: 3
* `EXPAND_BYTE_GAS`: 300
* `ACCOUNT_EDIT_COST`: 8000
* Accounts no longer have a storage tree. Instead, the `storage_root` field of an account is replaced by a `storage_hash`, which is the hash of a storage byte array (empty by default)
* In each transaction, we add two fields: `read_address_list` and `write_address_list`. We charge extra gas: `READ_ADDRESS_GAS * len(union(read_address_list, write_address_list)) + READ_BYTE_GAS * sum([len(code(x)) + len(storage(x)) for x in union(read_address_list, write_address_list)])`
* A transaction is only allowed to access accounts that are in the `read_address_list` or are precompiles; it is only allowed to modify accounts that are in the `write_address_list`. Violations immediately throw an exception.
* While executing a transaction, the EVM keeps track of the set of accounts that have already been modified via SSTORE. The gas cost of SSTORE is now as follows:
* Let `ACCESS_COST` = `ACCOUNT_EDIT_COST` if the account has not yet been SSTORE'd, otherwise 100
* Let `EXPANSION_COST` = 0 if `sstore_arg <= len(storage) - 32`, else `EXPAND_BYTE_GAS * (sstore_arg - (len(storage) - 32))`
* The total cost is `ACCESS_COST + EXPANSION_COST`
* `SLOAD` and `SSTORE` read and write to the storage byte array much like `MLOAD` and `MSTORE`, though `SLOAD` does not expand storage (only `SSTORE` does)
* The `CREATE` opcode is removed; only `CREATE2` is available. We also add `CREATE_COPY`, which is equal to `CREATE2` with one modification: it expects as output exactly 32 bytes (throwing an exception if return data size is not 32 bytes), of which the last 20 are parsed as an address, and code is copied from this address. 0 gas is charged at return time for creating the contract.
* Introduces an opcode SCOPY (similar in form to CALLDATACOPY except copying memory to storage), which costs the same as `SSTORE` minus 3 gas, but adding 3 gas per 32 bytes copied (rounding up to the nearest 32 if the size is not an even multiple). `EXPANSION_COST` is equal to 0 if `SCOPY` copies zero bytes or if the copy operation copies into storage space that already exists; otherwise it is equal to `EXPAND_BYTE_GAS * (new_storage_length - old_storage_length)`