Skip to content

Conversation

@Fibonacci747
Copy link
Contributor

This change updates TransactionEvent::is_final() to include Invalid as a terminal event. The transaction pool subscribes to per-hash events before validation in add_transaction_and_subscribe(), and when validation fails with Invalid, the per-hash broadcaster would stay in broadcasters_by_hash because Invalid was not considered final and no more events would follow. As a result, the sender entry could be retained indefinitely. Treating Invalid as final aligns with documentation that Invalid is “invalid indefinitely,” matches lifecycle expectations for transactions that never enter the pool, and ensures the per-hash broadcaster is cleaned up immediately after emitting Invalid, preventing resource leaks.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 15, 2025

CodSpeed Performance Report

Merging #19782 will degrade performances by 28.96%

Comparing Fibonacci747:fix/txpool (446e8e6) with main (fce0825)

Summary

❌ 1 regression
✅ 80 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
remove_leaf[1000] 193.4 µs 272.2 µs -28.96%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant