Draft implementation in geth: [wip] core: implement eip-7623: increase calldata cost by MariusVanDerWijden · Pull Request #29040 · ethereum/go-ethereum · GitHub
One issue I came across is that the EIP is kinda underspecified wrt. the gas costs for contract creation vs normal transactions. A normal transaction costs 21000 + Tokencost * Tokens + evm_gas
, a contract creation costs 53000 + Tokencost * Tokens + 2 * Initcode_Wordsize + evm_gas
.
I’ve interpreted the EIP as follows:
tx.gasUsed = {
21000 + 32000 * isContractCreation // 21000 or 53000
+
max (
STANDARD_TOKEN_COST * tokens_in_calldata + IsContractCreation * (InitCodeWordGas * words(len(calldata))) + evm_gas_used,
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata
)
)
Where IsContractCreation is 1 if the transaction is a contract creation and 0 otherwise.