Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 3e90e81

Browse files
committed
mark txs signed by builder as known txs
1 parent 5740880 commit 3e90e81

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

miner/worker.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,22 @@ func (w *worker) generateWork(params *generateParams) (*types.Block, *big.Int, e
15471547
orderCloseTime := time.Now()
15481548

15491549
blockBundles, allBundles, usedSbundles, mempoolTxHashes, err := w.fillTransactionsSelectAlgo(nil, work)
1550-
15511550
if err != nil {
15521551
return nil, nil, err
15531552
}
15541553

1554+
// We mark transactions created by the builder as mempool transactions so code validating bundles will not fail
1555+
// for transactions created by the builder such as mev share refunds.
1556+
for _, tx := range work.txs {
1557+
from, err := types.Sender(work.signer, tx)
1558+
if err != nil {
1559+
return nil, nil, err
1560+
}
1561+
if from == work.coinbase {
1562+
mempoolTxHashes[tx.Hash()] = struct{}{}
1563+
}
1564+
}
1565+
15551566
err = VerifyBundlesAtomicity(work, blockBundles, allBundles, usedSbundles, mempoolTxHashes)
15561567
if err != nil {
15571568
log.Error("Bundle invariant is violated for built block", "block", work.header.Number, "err", err)

0 commit comments

Comments
 (0)