Whenever I deploy a contract on Sepolia, there is an additional gas cost I haven't quite figured out. The flow as I understand is:
- 21,000 gas (base)
- 32,000 gas (contract creation)
- 4*(zero-value bytes calldata) gas
- 16*(non-zero value bytes calldata) gas
- Code execution (provided in calldata)
- Return (deployed) code
- 200*(length in bytes of deployed contract code) gas
However before the code provided in calldata is run (confirmed by VM trace), there is an additional cost 5., that is:
length (in words) of calldata * 2 gas
This cost only applies in transactions where the recipient is address(0), and is agnostic to the value of the bytes. This cost isn't related to memory expansion (as that would be in multiples of 3*word_size up to 724 bytes), nor is it a hashing operation.
I can't find in any docs incl. yellow/beige what this cost is. Apart from CREATE, is there any other opcode run before code (originally provided by calldata) is executed?