Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unrevertible tx hashes in bidArgs #49

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, "txcount", 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
Loading