Skip to content

Commit

Permalink
bugfix: Only send to order transactions channel in zone
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Oct 4, 2024
1 parent 400e568 commit 61be750
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, db ethdb.Databas
resultCh: make(chan *types.WorkObject, resultQueueSize),
exitCh: make(chan struct{}),
resubmitIntervalCh: make(chan time.Duration),
orderTransactionCh: make(chan transactionOrderingInfo),
fillTransactionsRollingAverage: &RollingAverage{windowSize: 100},
logger: logger,
}
Expand Down Expand Up @@ -260,6 +259,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, db ethdb.Databas
worker.wg.Add(1)
go worker.asyncStateLoop()

worker.orderTransactionCh = make(chan transactionOrderingInfo)
worker.wg.Add(1)
go worker.transactionOrderingLoop()
}
Expand Down Expand Up @@ -608,11 +608,13 @@ func (w *worker) GeneratePendingHeader(block *types.WorkObject, fill bool, txs t
work.wo.Header().SetBaseFee(big.NewInt(0))
}

if !fromOrderedTransactionSet {
select {
case w.orderTransactionCh <- transactionOrderingInfo{work.txs, work.gasUsedAfterTransaction, block}:
default:
w.logger.Info("w.orderTranscationCh is full")
if nodeCtx == common.ZONE_CTX && w.hc.ProcessingState() {
if !fromOrderedTransactionSet {
select {
case w.orderTransactionCh <- transactionOrderingInfo{work.txs, work.gasUsedAfterTransaction, block}:
default:
w.logger.Debug("w.orderTranscationCh is full")
}
}
}

Expand Down

0 comments on commit 61be750

Please sign in to comment.