Update EIP-7997: Switch to Arachnid factory#11783
Conversation
|
✅ All reviewers have approved. |
| A chain may satisfy this requirement by any means that results in the account above: deploying the factory with an ordinary transaction (for example, its keyless creation transaction) where the chain's gas parameters permit it, including the account in the genesis state, or inserting it via an irregular state transition. Regardless of the method used, the resulting `FACTORY_ADDRESS` account MUST have the nonce and runtime code specified above. | ||
|
|
||
| ### Input validation | ||
| This is a contract that invokes the `CREATE2` instruction ([EIP-1014](./eip-1014.md)) with a salt equal to the first 32 bytes of the call's input data, init code equal to the remaining data, and value equal to the call's value. If input data is smaller than 32 bytes, the contract will attempt to copy close to 2^256 bytes of calldata and should revert as a result. If contract creation fails (`CREATE2` outputs `0`), the call reverts with empty return data. When successful, the address is returned in exactly 20 bytes of data with no padding. |
There was a problem hiding this comment.
(it will OOG because of the quadratic memory allocation cost)
| if iszero(result) { revert(0, 0) } | ||
| mstore(0, result) | ||
| return(12, 20) | ||
| ``` |
There was a problem hiding this comment.
I would maybe add somewhere the downsides of this factory (revert does not propagate and the return data is not aligned as the standard alignment (left-pad address to 32 bytes) can be mitigated by using this factory to deploy an updated version. If the initcode choosen does not depend on any external factor then it can always be deployed and the factory code is thus guaranteed to exist or to be able to be deployed via this factory
|
|
||
| ### Not a new transaction type | ||
| ``` | ||
| calldatacopy(0, 32, sub(calldatasize(), 32)) |
There was a problem hiding this comment.
Can we pin this YUL code to state it should target constantinople? The deployed code does not have PUSH0 so the compiler should also not pick this. I think this should be added for clarity (the deployed bytecode being stated before also is fine, but the compiler target should remove any confusion)
|
BTW, this factory also ensures that we can now deploy system contracts via the CREATE2 factory and not via the chain agnostic deployments (keyless) |
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
Pull request was converted to draft
Following consensus in ACDT #82.