Skip to content

Commit

Permalink
fix: unrevertible tx hashes in bidArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Aug 27, 2024
1 parent f48e4bf commit b3288b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion miner/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (b *Bidder) bid(work *environment) {
_, err := cli.SendBid(context.Background(), bidArgs)
if err != nil {
b.deleteBestWork(work)
log.Error("Bidder: bidding failed", "err", err)
log.Error("Bidder: bidding failed", "err", err, "number", work.header.Number, "txs", len(work.txs), "unrevertible", len(work.UnRevertible))

var bidErr rpc.Error
ok := errors.As(err, &bidErr)
Expand Down
14 changes: 7 additions & 7 deletions miner/worker_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,21 +366,22 @@ func (w *worker) mergeBundles(
continue
}

log.Info("included bundle",
"gasUsed", simulatedBundle.BundleGasUsed,
"gasPrice", simulatedBundle.BundleGasPrice,
"txcount", len(simulatedBundle.OriginalBundle.Txs))

includedTxs = append(includedTxs, bundle.OriginalBundle.Txs...)

mergedBundle.BundleGasFees.Add(mergedBundle.BundleGasFees, simulatedBundle.BundleGasFees)
mergedBundle.BundleGasUsed += simulatedBundle.BundleGasUsed

for _, tx := range includedTxs {
for _, tx := range bundle.OriginalBundle.Txs {
if !containsHash(bundle.OriginalBundle.RevertingTxHashes, tx.Hash()) {
env.UnRevertible = append(env.UnRevertible, tx.Hash())
}
}

log.Info("included bundle",
"gasUsed", simulatedBundle.BundleGasUsed,
"gasPrice", simulatedBundle.BundleGasPrice,
"txcount", len(simulatedBundle.OriginalBundle.Txs),
"unrevertible", len(env.UnRevertible))
}

if len(includedTxs) == 0 {
Expand Down Expand Up @@ -448,7 +449,6 @@ func (w *worker) simulateBundle(
}

if env.header.BaseFee != nil {
log.Info("simulate bundle: header base fee", "value", env.header.BaseFee.String())
effectiveTip.Add(effectiveTip, env.header.BaseFee)
}

Expand Down

0 comments on commit b3288b9

Please sign in to comment.