Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatxpool: transaction reported as invalid during block building shall be removed from the pool #6008

Open
Tracked by #5472
michalkucharczyk opened this issue Oct 10, 2024 · 0 comments · May be fixed by #6661
Open
Tracked by #5472
Assignees

Comments

@michalkucharczyk
Copy link
Contributor

Currently the transaction which reported as invalid by a block builder is silently skipped:

/// Intended to remove transactions identified by the given hashes, and any dependent
/// transactions, from the pool. In current implementation this function only outputs the error.
/// Seems that API change is needed here to make this call reasonable.
// todo [#5491]: api change? we need block hash here (assuming we need it at all - could be
// useful for verification for debugging purposes).
fn remove_invalid(&self, hashes: &[TxHash<Self>]) -> Vec<Arc<Self::InPoolTransaction>> {
if !hashes.is_empty() {
log::debug!(target: LOG_TARGET, "fatp::remove_invalid {}", hashes.len());
log_xt_trace!(target:LOG_TARGET, hashes, "[{:?}] fatp::remove_invalid");
self.metrics
.report(|metrics| metrics.removed_invalid_txs.inc_by(hashes.len() as _));
}
Default::default()
}

Current behavior requires improvements - transaction shall be removed from the view, and also from the fatp. Invalid event shall be dispatched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant