Skip to content

Commit

Permalink
instructions: only add JUMP(I) targets if we are not deploying a cont…
Browse files Browse the repository at this point in the history
…ract

Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Jan 6, 2025
1 parent 9b476e9 commit f7d80fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func opJump(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt
return nil, errStopToken
}
pos := scope.Stack.pop()
if interpreter.evm.chainRules.IsEIP4762 {
if interpreter.evm.chainRules.IsEIP4762 && !scope.Contract.IsDeployment {
statelessGas, wanted := interpreter.evm.TxContext.Accesses.TouchCodeChunksRangeAndChargeGas(scope.Contract.CodeAddr[:], pos.Uint64(), 1, uint64(len(scope.Contract.Code)), false, scope.Contract.Gas)
scope.Contract.UseGas(statelessGas)
if statelessGas < wanted {
Expand All @@ -604,7 +604,7 @@ func opJumpi(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
}
pos, cond := scope.Stack.pop(), scope.Stack.pop()
if !cond.IsZero() {
if interpreter.evm.chainRules.IsEIP4762 {
if interpreter.evm.chainRules.IsEIP4762 && !scope.Contract.IsDeployment {
statelessGas, wanted := interpreter.evm.TxContext.Accesses.TouchCodeChunksRangeAndChargeGas(scope.Contract.CodeAddr[:], pos.Uint64(), 1, uint64(len(scope.Contract.Code)), false, scope.Contract.Gas)
scope.Contract.UseGas(statelessGas)
if statelessGas < wanted {
Expand Down

0 comments on commit f7d80fc

Please sign in to comment.