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

fix: handle out of sync errors when returning mempool transactions #5701

Conversation

brianp
Copy link
Contributor

@brianp brianp commented Aug 31, 2023

Description

Add a new error type and gracefully recover from possible runtime panic.

Motivation and Context

Currently, there is a minimal possibility that the collection of tx's is out sync. If this occurs the base node will likely crash.

How Has This Been Tested?

CI

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

Test Results (CI)

1 196 tests   1 196 ✔️  7m 31s ⏱️
     37 suites         0 💤
       1 files           0

Results for commit 37b8619.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Aug 31, 2023
@github-actions
Copy link

github-actions bot commented Aug 31, 2023

Test Results (Integration tests)

27 tests   27 ✔️  17m 33s ⏱️
11 suites    0 💤
  2 files      0

Results for commit 37b8619.

♻️ This comment has been updated with latest results.

&self,
excess_sigs: &[PrivateKey],
) -> Result<(Vec<Arc<Transaction>>, Vec<PrivateKey>), MempoolError> {
let (found_txns, remaining) = match self.unconfirmed_pool.retrieve_by_excess_sigs(excess_sigs) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let (found_txns, remaining) = match self.unconfirmed_pool.retrieve_by_excess_sigs(excess_sigs) {
let (found_txns, remaining) = self.unconfirmed_pool.retrieve_by_excess_sigs(excess_sigs)?;

why not do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I overlooked the possibility 🙃

updated.

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Aug 31, 2023
@SWvheerden SWvheerden merged commit b0337cf into tari-project:development Aug 31, 2023
@brianp brianp deleted the bp-fix-handle-possible-out-of-sync-errors branch October 2, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants