diff --git a/core/parallel_processor.go b/core/parallel_processor.go index 6786a8d8f3..28f6348751 100644 --- a/core/parallel_processor.go +++ b/core/parallel_processor.go @@ -124,18 +124,6 @@ func collectDeclaredAddressSets(txs []*types.Transaction, signer types.Signer) ( return sets, nil } -func declaredStorageSlotsOverlap(a, b map[storageAccessPair]struct{}) bool { - if a == nil || b == nil { - return false - } - for pair := range a { - if _, ok := b[pair]; ok { - return true - } - } - return false -} - func declaredAddressSetsOverlap(a, b map[common.Address]struct{}) bool { for addr := range a { if _, ok := b[addr]; ok { diff --git a/core/state/statedb.go b/core/state/statedb.go index 6e8fc88f0b..776a9760f4 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -743,38 +743,38 @@ func (s *StateDB) SetDeferTrieFlush(v bool) { // MergeParallelChildInto merges one transaction's effects from child onto parent. // Child should be a Copy() of the same pre-wave state, executed with // SetDeferTrieFlush(true). Log indices are reassigned to follow parent.logSize. -func (parent *StateDB) MergeParallelChildInto(child *StateDB, txHash common.Hash) { +func (s *StateDB) MergeParallelChildInto(child *StateDB, txHash common.Hash) { if child.dbErr != nil { - parent.setError(child.dbErr) + s.setError(child.dbErr) } if logs := child.logs[txHash]; len(logs) > 0 { cpy := make([]*types.Log, len(logs)) for i, l := range logs { cpy[i] = new(types.Log) *cpy[i] = *l - cpy[i].Index = uint(parent.logSize) - parent.logSize++ + cpy[i].Index = s.logSize + s.logSize++ } - parent.logs[txHash] = cpy + s.logs[txHash] = cpy } for h, data := range child.preimages { - parent.preimages[h] = data + s.preimages[h] = data } - if parent.accessEvents != nil && child.accessEvents != nil { - parent.accessEvents.Merge(child.accessEvents) + if s.accessEvents != nil && child.accessEvents != nil { + s.accessEvents.Merge(child.accessEvents) } for _, addr := range child.parallelMergeAddrs { if op, ok := child.mutations[addr]; ok && op.isDelete() { - delete(parent.stateObjects, addr) + delete(s.stateObjects, addr) if dob, ok := child.stateObjectsDestruct[addr]; ok { - parent.stateObjectsDestruct[addr] = dob.deepCopy(parent) + s.stateObjectsDestruct[addr] = dob.deepCopy(s) } - parent.markDelete(addr) + s.markDelete(addr) continue } if obj, ok := child.stateObjects[addr]; ok { - parent.stateObjects[addr] = obj.deepCopy(parent) - parent.markUpdate(addr) + s.stateObjects[addr] = obj.deepCopy(s) + s.markUpdate(addr) } } } diff --git a/tests/parallel_vm_block_test.go b/tests/parallel_vm_block_test.go index 071ac18a27..63b1d8afd2 100644 --- a/tests/parallel_vm_block_test.go +++ b/tests/parallel_vm_block_test.go @@ -26,7 +26,7 @@ import ( const ( isolatedJobTxGasLimit = uint64(550_000_000) isolatedTestNumIndependentTxs = 3 - isolatedTestBlockGasLimit = uint64((isolatedTestNumIndependentTxs + 1) * isolatedJobTxGasLimit) + isolatedTestBlockGasLimit = (isolatedTestNumIndependentTxs + 1) * isolatedJobTxGasLimit ) func TestParallelVMBlockAccessListIsolated(t *testing.T) { @@ -334,5 +334,3 @@ func TestParallelVMBlockAccessListMixed(t *testing.T) { assertStorageUintBlock(t, statedb, cIsolated, common.BigToHash(big.NewInt(2)), 0) }) } - -