From 58efdaf5ccaf7716037f4f7645017e224ccbe2b6 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Sun, 19 Oct 2025 00:32:45 +0800 Subject: [PATCH] core/vm: optimize opRandom using uint256.Int.SetBytes32 --- core/vm/instructions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 44d3e81a9c..62d5404d91 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -475,7 +475,7 @@ func opDifficulty(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { } func opRandom(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { - v := new(uint256.Int).SetBytes(evm.Context.Random.Bytes()) + v := new(uint256.Int).SetBytes32(evm.Context.Random.Bytes()) scope.Stack.push(v) return nil, nil }