core/txpool: move cell validation outside of lock

This commit is contained in:
healthykim 2026-07-13 15:33:39 +02:00
parent f7cd5a0579
commit 41e966c2b5

View file

@ -1965,6 +1965,10 @@ func (p *BlobPool) Add(txs []*types.Transaction, sync bool) []error {
errs[i] = err errs[i] = err
continue continue
} }
if err := txpool.ValidateCells(ptx.CellSidecar); err != nil {
errs[i] = err
continue
}
errs[i] = p.AddPooledTx(ptx) errs[i] = p.AddPooledTx(ptx)
} }
return errs return errs
@ -2034,10 +2038,6 @@ func (p *BlobPool) addLocked(ptx *BlobTxForPool, checkGapped bool) (err error) {
} }
return err return err
} }
//todo: validation happens twice for eth72
if err := txpool.ValidateCells(ptx.CellSidecar); err != nil {
return err
}
// If the address is not yet known, request exclusivity to track the account // If the address is not yet known, request exclusivity to track the account
// only by this subpool until all transactions are evicted // only by this subpool until all transactions are evicted
from, _ := types.Sender(p.signer, tx) // already validated above from, _ := types.Sender(p.signer, tx) // already validated above