fix mempool count overflow#2398
Conversation
|
According to an LLM (I know uhhg), this is a fix to a symptom of a larger problem:
According to it, the part that does underflow is: let _ignore_error = mempool_transaction_sender.send(raw_transaction).await;
unprocessed_transactions_count.fetch_add(1, atomic::Ordering::Release);
|
…sing incorrect mempool count and potential count overflow
ok good point. so in practice this error can't be hit unless the whole sync fn has already been exited so it wouldnt matter, but i have added some extra precautions to avoid this wrapping in the case of the architecture changing in the future maybe allowing the mempool receiver to be dropped in some edge cases. i have kept the AtomicU32 for mempool count for similar reasons.. maybe in the future the mempool channel limit is raised beyond 256 risking overflow. |
Fixes: #2397
changed AtomicU8 to AtomicU32 to avoid overflow in the case of high volume of mempool txs