bump evm + remove EIP-3607 extension for precompiles#1032
bump evm + remove EIP-3607 extension for precompiles#1032nanocryk wants to merge 3 commits intopolkadot-evm:masterfrom
Conversation
|
I'm super confused. Why is EIP-3607 improbable and how does this relate to evm#157? |
| if is_transactional | ||
| && (!<AccountCodes<T>>::get(source).is_empty() || precompiles.is_precompile(source)) | ||
| { | ||
| if is_transactional && !<AccountCodes<T>>::get(source).is_empty() { |
There was a problem hiding this comment.
is_precompile now takes an extra argument being the remaining gas, and if not OOG will return the bool and the cost of performing that check. This function is used in only 2 places in frontier and evm:
- evm: inside is_cold, which occurs when we interact with a smart contract (getting code, doing a subcall)
- frontier (where this comment is): to know if the
fromaddress is the one of a precompile. EIP-3607 forbidsfromto be the address of a smart contract, and we extended it in frontier so that it cannot be the one of a precompile. The precompile part is NOT part of the EIP.
Now it is required to take into account the cost of calling is_precompile, which is less trivial than the change in the EVM. In this frontier code it is a non trivial change, I thus suggest we get rid of that part to keep things simple (we could maybe deduct the cost from the gas limit or whatever, but it may have unwanted side effects).
|
Replaced by #1058 |
|
@nanocryk Do you need to remove the extension of EIP-3607 again in other PR? |
Follow up to rust-ethereum/evm#157.
Cost of calling is_precompile is now accounted for. To avoid any increase in cost for the top level call, I removed the extension of EIP-3607 which prevented to transact from a precompile (which is very improbable anyway).