reth
reth copied to clipboard
Improve tx type count observability in pool
Describe the feature
currently we're only tracking txs by pool, which means that these metrics only track non pending blob txs:
https://github.com/paradigmxyz/reth/blob/098018db493c48e8bc9e4a4fc4d62e2b668de724/crates/transaction-pool/src/metrics.rs#L34-L37
https://github.com/paradigmxyz/reth/blob/098018db493c48e8bc9e4a4fc4d62e2b668de724/crates/transaction-pool/src/pool/blob.rs#L12-L12
hence these metrics aren't useful to monitor how many blob transactions are currently in the entire txpool.
we would like this for all transaction types
TODO
- introduce new metrics for legacy,eip2930,1559,4844 count
we can either try tracking this on a per tx operation basis or by checking the total list by doing a fold over all transactions in the pool, which is more expensive. https://github.com/paradigmxyz/reth/blob/098018db493c48e8bc9e4a4fc4d62e2b668de724/crates/transaction-pool/src/pool/txpool.rs#L930-L931
tracking all tx ops is more complex, so imo we're okay with updating these metrics when we update the pool for now this should be accurate enough:
https://github.com/paradigmxyz/reth/blob/098018db493c48e8bc9e4a4fc4d62e2b668de724/crates/transaction-pool/src/pool/txpool.rs#L432-L432
Additional context
No response