Skip to content

Commit

Permalink
E35: Fixed transaction pool (Again) (#10382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored May 17, 2024
1 parent 3e93af6 commit cf9fc56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
9 changes: 5 additions & 4 deletions core/state/rw_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ type StateWriterV3 struct {

func NewStateWriterV3(rs *StateV3, accumulator *shards.Accumulator) *StateWriterV3 {
return &StateWriterV3{
rs: rs,
rs: rs,
accumulator: accumulator,
//trace: true,
}
}
Expand Down Expand Up @@ -535,9 +536,9 @@ func (w *StateWriterV3) DeleteAccount(address common.Address, original *accounts
if err := w.rs.domains.DomainDel(kv.AccountsDomain, address[:], nil, nil, 0); err != nil {
return err
}
if w.accumulator != nil {
w.accumulator.DeleteAccount(address)
}
// if w.accumulator != nil { TODO: investigate later. basically this will always panic. keeping this out should be fine anyway.
// w.accumulator.DeleteAccount(address)
// }
return nil
}

Expand Down
5 changes: 3 additions & 2 deletions erigon-lib/kv/membatchwithdb/memory_mutation_cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ func (m *memoryMutationCursor) DeleteCurrent() error {
return nil
}

func (m *memoryMutationCursor) DeleteExact(_, _ []byte) error {
panic("DeleteExact Not implemented")
func (m *memoryMutationCursor) DeleteExact(k, v []byte) error {
m.mutation.deleteDup(m.table, k, v)
return nil
}

func (m *memoryMutationCursor) DeleteCurrentDuplicates() error {
Expand Down
14 changes: 5 additions & 9 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,6 @@ func ExecV3(ctx context.Context,
slowDownLimit := time.NewTicker(time.Second)
defer slowDownLimit.Stop()

stateStream := !initialCycle && cfg.stateStream && maxBlockNum-blockNum < stateStreamLimit

var readAhead chan uint64
if !parallel {
// snapshots are often stored on chaper drives. don't expect low-read-latency and manually read-ahead.
Expand Down Expand Up @@ -673,14 +671,12 @@ Loop:
}
}
}()
} else {
if !initialCycle && stateStream {
txs, err := blockReader.RawTransactions(context.Background(), applyTx, b.NumberU64(), b.NumberU64())
if err != nil {
return err
}
cfg.accumulator.StartChange(b.NumberU64(), b.Hash(), txs, false)
} else if shouldReportToTxPool {
txs, err := blockReader.RawTransactions(context.Background(), applyTx, b.NumberU64(), b.NumberU64())
if err != nil {
return err
}
cfg.accumulator.StartChange(b.NumberU64(), b.Hash(), txs, false)
}

rules := chainConfig.Rules(blockNum, b.Time())
Expand Down

0 comments on commit cf9fc56

Please sign in to comment.