From 6359639f7f4c38e4969477b55eb292d72514bffa Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Mon, 19 May 2025 17:30:50 +0200 Subject: [PATCH] core/state: reduce allocations in updateStateObject --- core/state/statedb.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 2453d67f3e..51453055c3 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -562,9 +562,8 @@ func (s *StateDB) GetTransientState(addr common.Address, key common.Hash) common // updateStateObject writes the given object to the trie. func (s *StateDB) updateStateObject(obj *stateObject) { // Encode the account and update the account trie - addr := obj.Address() - if err := s.trie.UpdateAccount(addr, &obj.data, len(obj.code)); err != nil { - s.setError(fmt.Errorf("updateStateObject (%x) error: %v", addr[:], err)) + if err := s.trie.UpdateAccount(obj.Address(), &obj.data, len(obj.code)); err != nil { + s.setError(fmt.Errorf("updateStateObject (%x) error: %v", obj.Address(), err)) } if obj.dirtyCode { s.trie.UpdateContractCode(obj.Address(), common.BytesToHash(obj.CodeHash()), obj.code)