From 2b9c88611641e53a729a03b11749540e7c7ec943 Mon Sep 17 00:00:00 2001 From: Roshan Date: Mon, 22 Apr 2024 17:58:21 +0800 Subject: [PATCH] debug: add more logs1 --- miner/ordering.go | 12 +++++++----- miner/worker_builder.go | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/miner/ordering.go b/miner/ordering.go index 7cbe2d5630..3be515aed3 100644 --- a/miner/ordering.go +++ b/miner/ordering.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/holiman/uint256" + "github.com/ethereum/go-ethereum/log" ) // txWithMinerFee wraps a transaction with its gas price or effective miner gasTipCap @@ -109,6 +110,7 @@ func newTransactionsByPriceAndNonce(signer types.Signer, txs map[common.Address] for from, accTxs := range txs { wrapped, err := newTxWithMinerFee(accTxs[0], from, baseFeeUint) if err != nil { + log.Info("Failed to wrap transaction", "err", err) delete(txs, from) continue } @@ -205,11 +207,11 @@ func (t *transactionsByPriceAndNonce) Forward(tx *types.Transaction) { } return } - //check whether target tx exists in t.heads + // check whether target tx exists in t.heads for _, head := range t.heads { if head.tx != nil && head.tx.Resolve() != nil { if tx == head.tx.Tx { - //shift t to the position one after tx + // shift t to the position one after tx txTmp := t.PeekWithUnwrap() for txTmp != tx { t.Shift() @@ -220,13 +222,13 @@ func (t *transactionsByPriceAndNonce) Forward(tx *types.Transaction) { } } } - //get the sender address of tx + // get the sender address of tx acc, _ := types.Sender(t.signer, tx) - //check whether target tx exists in t.txs + // check whether target tx exists in t.txs if txs, ok := t.txs[acc]; ok { for _, txLazyTmp := range txs { if txLazyTmp != nil && txLazyTmp.Resolve() != nil { - //found the same pointer in t.txs as tx and then shift t to the position one after tx + // found the same pointer in t.txs as tx and then shift t to the position one after tx if tx == txLazyTmp.Tx { txTmp := t.PeekWithUnwrap() for txTmp != tx { diff --git a/miner/worker_builder.go b/miner/worker_builder.go index 95d06c140b..97e77505de 100644 --- a/miner/worker_builder.go +++ b/miner/worker_builder.go @@ -108,19 +108,19 @@ func (w *worker) fillTransactionsAndBundles(interruptCh chan int32, env *environ // 4.interrupted resubmit timer, which is by default 10s. // resubmit is for PoW only, can be deleted for PoS consensus later if len(localPlainTxs) > 0 || len(localBlobTxs) > 0 { - log.Info("fill local transactions", "plain", len(localPlainTxs), "blob", len(localBlobTxs)) plainTxs := newTransactionsByPriceAndNonce(env.signer, localPlainTxs, env.header.BaseFee) blobTxs := newTransactionsByPriceAndNonce(env.signer, localBlobTxs, env.header.BaseFee) + log.Info("fill local transactions", "plain", len(plainTxs.txs), "blob", len(blobTxs.txs)) if err := w.commitTransactions(env, plainTxs, blobTxs, interruptCh, stopTimer); err != nil { return err } } if len(remotePlainTxs) > 0 || len(remoteBlobTxs) > 0 { - log.Info("fill remote transactions", "plain", len(remotePlainTxs), "blob", len(remoteBlobTxs)) plainTxs := newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, env.header.BaseFee) blobTxs := newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, env.header.BaseFee) + log.Info("fill remote transactions", "plain", len(plainTxs.txs), "blob", len(blobTxs.txs)) if err := w.commitTransactions(env, plainTxs, blobTxs, interruptCh, stopTimer); err != nil { return err }