diff --git a/core/state/statedb_hooked.go b/core/state/statedb_hooked.go index c4596f9215..3d1ef15031 100644 --- a/core/state/statedb_hooked.go +++ b/core/state/statedb_hooked.go @@ -85,10 +85,6 @@ func (s *hookedStateDB) GetRefund() uint64 { return s.inner.GetRefund() } -func (s *hookedStateDB) GetCommittedState(addr common.Address, hash common.Hash) common.Hash { - return s.inner.GetCommittedState(addr, hash) -} - func (s *hookedStateDB) GetStateAndCommittedState(addr common.Address, hash common.Hash) (common.Hash, common.Hash) { return s.inner.GetStateAndCommittedState(addr, hash) } diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go index 89208bbc55..c7c1274bf2 100644 --- a/core/vm/gas_table.go +++ b/core/vm/gas_table.go @@ -98,8 +98,8 @@ var ( func gasSStore(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) { var ( - y, x = stack.Back(1), stack.Back(0) - current = evm.StateDB.GetState(contract.Address(), x.Bytes32()) + y, x = stack.Back(1), stack.Back(0) + current, original = evm.StateDB.GetStateAndCommittedState(contract.Address(), x.Bytes32()) ) // The legacy gas metering only takes into consideration the current state // Legacy rules should be applied if we are in Petersburg (removal of EIP-1283) @@ -139,7 +139,6 @@ func gasSStore(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySi if current == value { // noop (1) return params.NetSstoreNoopGas, nil } - original := evm.StateDB.GetCommittedState(contract.Address(), x.Bytes32()) if original == current { if original == (common.Hash{}) { // create slot (2.1.1) return params.NetSstoreInitGas, nil diff --git a/core/vm/interface.go b/core/vm/interface.go index 2890865469..42a72db482 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -50,7 +50,6 @@ type StateDB interface { SubRefund(uint64) GetRefund() uint64 - GetCommittedState(common.Address, common.Hash) common.Hash GetStateAndCommittedState(common.Address, common.Hash) (common.Hash, common.Hash) GetState(common.Address, common.Hash) common.Hash SetState(common.Address, common.Hash, common.Hash) common.Hash