From 01fe4fcabcd542f707247469ef3c01fd163eeed8 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Wed, 15 Oct 2025 19:29:58 +0800 Subject: [PATCH] core/vm: optimize opCreate and opCreate2 by not copy memory --- core/vm/instructions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 44d3e81a9cf..1f1220c7273 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -659,7 +659,7 @@ func opCreate(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { var ( value = scope.Stack.pop() offset, size = scope.Stack.pop(), scope.Stack.pop() - input = scope.Memory.GetCopy(offset.Uint64(), size.Uint64()) + input = scope.Memory.GetPtr(offset.Uint64(), size.Uint64()) gas = scope.Contract.Gas ) if evm.chainRules.IsEIP150 { @@ -703,7 +703,7 @@ func opCreate2(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { endowment = scope.Stack.pop() offset, size = scope.Stack.pop(), scope.Stack.pop() salt = scope.Stack.pop() - input = scope.Memory.GetCopy(offset.Uint64(), size.Uint64()) + input = scope.Memory.GetPtr(offset.Uint64(), size.Uint64()) gas = scope.Contract.Gas )