fix lint errors

This commit is contained in:
idotalk 2026-06-21 13:04:04 +03:00
parent 820c3b3b82
commit f13394dbb6
3 changed files with 14 additions and 28 deletions

View file

@ -124,18 +124,6 @@ func collectDeclaredAddressSets(txs []*types.Transaction, signer types.Signer) (
return sets, nil 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 { func declaredAddressSetsOverlap(a, b map[common.Address]struct{}) bool {
for addr := range a { for addr := range a {
if _, ok := b[addr]; ok { if _, ok := b[addr]; ok {

View file

@ -743,38 +743,38 @@ func (s *StateDB) SetDeferTrieFlush(v bool) {
// MergeParallelChildInto merges one transaction's effects from child onto parent. // MergeParallelChildInto merges one transaction's effects from child onto parent.
// Child should be a Copy() of the same pre-wave state, executed with // Child should be a Copy() of the same pre-wave state, executed with
// SetDeferTrieFlush(true). Log indices are reassigned to follow parent.logSize. // 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 { if child.dbErr != nil {
parent.setError(child.dbErr) s.setError(child.dbErr)
} }
if logs := child.logs[txHash]; len(logs) > 0 { if logs := child.logs[txHash]; len(logs) > 0 {
cpy := make([]*types.Log, len(logs)) cpy := make([]*types.Log, len(logs))
for i, l := range logs { for i, l := range logs {
cpy[i] = new(types.Log) cpy[i] = new(types.Log)
*cpy[i] = *l *cpy[i] = *l
cpy[i].Index = uint(parent.logSize) cpy[i].Index = s.logSize
parent.logSize++ s.logSize++
} }
parent.logs[txHash] = cpy s.logs[txHash] = cpy
} }
for h, data := range child.preimages { for h, data := range child.preimages {
parent.preimages[h] = data s.preimages[h] = data
} }
if parent.accessEvents != nil && child.accessEvents != nil { if s.accessEvents != nil && child.accessEvents != nil {
parent.accessEvents.Merge(child.accessEvents) s.accessEvents.Merge(child.accessEvents)
} }
for _, addr := range child.parallelMergeAddrs { for _, addr := range child.parallelMergeAddrs {
if op, ok := child.mutations[addr]; ok && op.isDelete() { if op, ok := child.mutations[addr]; ok && op.isDelete() {
delete(parent.stateObjects, addr) delete(s.stateObjects, addr)
if dob, ok := child.stateObjectsDestruct[addr]; ok { 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 continue
} }
if obj, ok := child.stateObjects[addr]; ok { if obj, ok := child.stateObjects[addr]; ok {
parent.stateObjects[addr] = obj.deepCopy(parent) s.stateObjects[addr] = obj.deepCopy(s)
parent.markUpdate(addr) s.markUpdate(addr)
} }
} }
} }

View file

@ -26,7 +26,7 @@ import (
const ( const (
isolatedJobTxGasLimit = uint64(550_000_000) isolatedJobTxGasLimit = uint64(550_000_000)
isolatedTestNumIndependentTxs = 3 isolatedTestNumIndependentTxs = 3
isolatedTestBlockGasLimit = uint64((isolatedTestNumIndependentTxs + 1) * isolatedJobTxGasLimit) isolatedTestBlockGasLimit = (isolatedTestNumIndependentTxs + 1) * isolatedJobTxGasLimit
) )
func TestParallelVMBlockAccessListIsolated(t *testing.T) { func TestParallelVMBlockAccessListIsolated(t *testing.T) {
@ -334,5 +334,3 @@ func TestParallelVMBlockAccessListMixed(t *testing.T) {
assertStorageUintBlock(t, statedb, cIsolated, common.BigToHash(big.NewInt(2)), 0) assertStorageUintBlock(t, statedb, cIsolated, common.BigToHash(big.NewInt(2)), 0)
}) })
} }