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

Add expired transactions to the mempool rejected list #2852

Merged
merged 8 commits into from
Oct 11, 2021

Conversation

conradoplg
Copy link
Collaborator

Motivation

When a mempool transaction expires, we remove it from the mempool. But we should also add it to the rejected list, to avoid redownloading and reverifying it if it's sent again.

Specifications

Designs

Solution

  • Split chain_rejected_same_effects into two lists, to keep evicted and reject txs apart. (This was done by adding the lists to a HashMap, keyed by their respective error cases. This improved type safety a bit compared to just creating two separate lists)
  • Add rejected txs to the respective list.

Closes #2848

Review

Anyone can review this.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

@conradoplg conradoplg requested a review from a team October 8, 2021 17:21
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

This looks good, we could merge it as-is.

I've made some suggestions about comments that could change.
I also suggested a refactor to remove near-duplicate code.

@teor2345
Copy link
Contributor

Please feel free to merge with or without these changes - no need to wait for my re-approval.

I think this PR might conflict with ticket #2780, so we should try to get it merged on Monday.
(@dconnolly should feel free to approve and merge.)

@teor2345
Copy link
Contributor

@conradoplg commit 51e59ae in PR #2855 resolves a tricky conflict between this PR and PR #2826.

You might want to cherry-pick it here, after you review it.

Copy link
Collaborator Author

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Addressed comments! @dconnolly can you take a look per @teor2345's comment?

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good, let's merge

@teor2345 teor2345 enabled auto-merge (squash) October 11, 2021 20:48
@teor2345 teor2345 merged commit 31e7a21 into main Oct 11, 2021
@teor2345 teor2345 deleted the add-expired-txs-to-rejected branch October 11, 2021 21:23
Copy link
Contributor

@dconnolly dconnolly left a comment

Choose a reason for hiding this comment

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

👍

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 this pull request may close these issues.

Add expired transactions to the mempool rejected list
3 participants