core/vm: don't include contract deployer bytecode in AccessWitness or charge witness access costs for it (#54)

This commit is contained in:
jwasinger
2022-01-12 23:08:22 -10:00
committed by GitHub
parent 4428439fdf
commit d761880fd2
3 changed files with 6 additions and 1 deletions

View File

@ -191,7 +191,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
logged, pcCopy, gasCopy = false, pc, contract.Gas
}
if in.evm.TxContext.Accesses != nil {
if in.evm.TxContext.Accesses != nil && !contract.IsDeployment {
// if the PC ends up in a new "page" of verkleized code, charge the
// associated witness costs.
contract.Gas -= touchEachChunksAndChargeGas(pc, 1, contract.Address().Bytes()[:], contract, in.evm.TxContext.Accesses)