core/vm: optimize opSload using uint256.Int.SetBytes32

This commit is contained in:
cuiweixie 2025-10-19 00:35:31 +08:00
parent 0ec63272bf
commit 8d5cd0b30f
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -513,7 +513,7 @@ func opSload(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) {
loc := scope.Stack.peek() loc := scope.Stack.peek()
hash := common.Hash(loc.Bytes32()) hash := common.Hash(loc.Bytes32())
val := evm.StateDB.GetState(scope.Contract.Address(), hash) val := evm.StateDB.GetState(scope.Contract.Address(), hash)
loc.SetBytes(val.Bytes()) loc.SetBytes32(val.Bytes())
return nil, nil return nil, nil
} }