core/txpool: make transaction validation reusable across packages (pools) (#27429)

* core/txpool: abstraction prep work for secondary pools (blob pool)

* core/txpool: leave subpool concepts to a followup pr

* les: fix tests using hard coded errors

* core/txpool: use bitmaps instead of maps for tx type filtering
This commit is contained in:
Péter Szilágyi
2023-06-06 12:53:29 +03:00
committed by GitHub
parent 4cf708d30b
commit 950d5643b1
13 changed files with 335 additions and 179 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ func (api *MinerAPI) SetGasPrice(gasPrice hexutil.Big) bool {
api.e.gasPrice = (*big.Int)(&gasPrice)
api.e.lock.Unlock()
api.e.txPool.SetGasPrice((*big.Int)(&gasPrice))
api.e.txPool.SetGasTip((*big.Int)(&gasPrice))
return true
}
+2 -2
View File
@@ -206,7 +206,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.TxPool.Journal != "" {
config.TxPool.Journal = stack.ResolvePath(config.TxPool.Journal)
}
eth.txPool = txpool.NewTxPool(config.TxPool, eth.blockchain.Config(), eth.blockchain)
eth.txPool = txpool.New(config.TxPool, eth.blockchain.Config(), eth.blockchain)
// Permit the downloader to use the trie cache allowance during fast sync
cacheLimit := cacheConfig.TrieCleanLimit + cacheConfig.TrieDirtyLimit + cacheConfig.SnapshotLimit
@@ -399,7 +399,7 @@ func (s *Ethereum) StartMining() error {
s.lock.RLock()
price := s.gasPrice
s.lock.RUnlock()
s.txPool.SetGasPrice(price)
s.txPool.SetGasTip(price)
// Configure the local mining address
eb, err := s.Etherbase()
+1 -1
View File
@@ -119,7 +119,7 @@ func newTestBackendWithGenerator(blocks int, shanghai bool, generator func(int,
return &testBackend{
db: db,
chain: chain,
txpool: txpool.NewTxPool(txconfig, params.TestChainConfig, chain),
txpool: txpool.New(txconfig, params.TestChainConfig, chain),
}
}