-
Notifications
You must be signed in to change notification settings - Fork 206
Open
Description
Describe the bug
Affected Component
Transaction Pool (crates/transaction-pool/src/tempo_pool.rs)
Description
The Tempo transaction pool contains unwrap() calls in production code at lines 352 and 361. While these unwraps are protected by Reth's API contract (which guarantees one result per input transaction), they could theoretically panic if Reth's implementation changes behavior.
Root Cause
The code calls add_transactions() with single-item inputs and assumes it will always return at least one result:
// Line 449
.add_transactions(origin, std::iter::once(TransactionValidationOutcome::Valid { ... }))
.pop()
.unwrap()
// Line 468
.add_transactions(origin, Some(invalid))
.pop()
.unwrap()The .pop() returns Option<T> and .unwrap() will panic if the Vec is empty.
Steps to reproduce
Empty Result from Valid Transaction (Theoretical Only)
- The current code path only executes for transactions with
nonce_key = 0(standard protocol nonces) - Would require Reth's
add_transactions()to return empty Vec - If Reth returns empty Vec for any reason, the
.pop().unwrap()will panic - This would crash the transaction pool service
Logs
Platform(s)
Linux (x86)
Container Type
Not running in a container
What version/commit are you on?
v1.0.2 - the Presto release
If you've built from source, provide the full command you used
No response
Code of Conduct
- I agree to follow the Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels