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

Commit

Permalink
mark txs signed by builder as known txs (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush authored Aug 11, 2023
1 parent 5740880 commit 1d09dbd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1547,11 +1547,22 @@ func (w *worker) generateWork(params *generateParams) (*types.Block, *big.Int, e
orderCloseTime := time.Now()

blockBundles, allBundles, usedSbundles, mempoolTxHashes, err := w.fillTransactionsSelectAlgo(nil, work)

if err != nil {
return nil, nil, err
}

// We mark transactions created by the builder as mempool transactions so code validating bundles will not fail
// for transactions created by the builder such as mev share refunds.
for _, tx := range work.txs {
from, err := types.Sender(work.signer, tx)
if err != nil {
return nil, nil, err
}
if from == work.coinbase {
mempoolTxHashes[tx.Hash()] = struct{}{}
}
}

err = VerifyBundlesAtomicity(work, blockBundles, allBundles, usedSbundles, mempoolTxHashes)
if err != nil {
log.Error("Bundle invariant is violated for built block", "block", work.header.Number, "err", err)
Expand Down

0 comments on commit 1d09dbd

Please sign in to comment.