diff --git a/core/state/access_witness.go b/core/state/access_witness.go index 39a1d7674a77..54224b3cec3f 100644 --- a/core/state/access_witness.go +++ b/core/state/access_witness.go @@ -131,11 +131,8 @@ func (aw *AccessWitness) TouchTxOriginAndComputeGas(originAddr []byte) uint64 { } func (aw *AccessWitness) TouchTxExistingAndComputeGas(targetAddr []byte, sendsValue bool) uint64 { - aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, false) + aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, sendsValue) aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.CodeHashLeafKey, false) - if sendsValue { - aw.touchAddressAndChargeGas(targetAddr, zeroTreeIndex, utils.BasicDataLeafKey, true) - } // Kaustinen note: we're currently experimenting with stop chargin gas for the origin address // so simple transfer still take 21000 gas. This is to potentially avoid breaking existing tooling. diff --git a/trie/verkle.go b/trie/verkle.go index ed34deebc3e2..7ba85f574c6f 100644 --- a/trie/verkle.go +++ b/trie/verkle.go @@ -128,10 +128,6 @@ func (t *VerkleTrie) GetAccount(addr common.Address) (*types.StateAccount, error return nil, nil } - if len(values[utils.BasicDataLeafKey]) > 0 { - acc.Nonce = binary.BigEndian.Uint64(values[utils.BasicDataLeafKey][utils.BasicDataNonceOffset:]) - } - // if the account has been deleted, then values[10] will be 0 and not nil. If it has // been recreated after that, then its code keccak will NOT be 0. So return `nil` if // the nonce, and values[10], and code keccak is 0. @@ -142,6 +138,8 @@ func (t *VerkleTrie) GetAccount(addr common.Address) (*types.StateAccount, error return nil, nil } } + + acc.Nonce = binary.BigEndian.Uint64(values[utils.BasicDataLeafKey][utils.BasicDataNonceOffset:]) var balance [16]byte copy(balance[:], values[utils.BasicDataLeafKey][utils.BasicDataBalanceOffset:]) acc.Balance = new(big.Int).SetBytes(balance[:])