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

Un-reject transactions which depend on newly created outputs #2694

Closed
Tracked by #2309
teor2345 opened this issue Aug 30, 2021 · 3 comments · Fixed by #2844
Closed
Tracked by #2309

Un-reject transactions which depend on newly created outputs #2694

teor2345 opened this issue Aug 30, 2021 · 3 comments · Fixed by #2844
Assignees

Comments

@teor2345
Copy link
Contributor

teor2345 commented Aug 30, 2021

Motivation

Zebra rejects transactions that spend outputs that haven't been mined yet.

But when those outputs are mined, we continue to reject those transactions until:

Design

  • Expire FailedVerification and SpendConflict rejections every time we get a new block.
  • Limit the size of the FailedVerification and SpendConflict list to 40,000 entries

This size limit is the same as ZIP-401, but the lists should be separate.

This might mean that we need to split the error types and the lists again.

Alternative Designs

This alternative design depends on the OutPoints and nullifiers from ticket #2631.

We could keep lists of:

  • missing inputs in each Invalid rejection, and remove the rejection when all the inputs are mined
  • conflicting inputs in each SpendConflict rejection, and remove the rejection if all its conflicting inputs are rejected

Follow Up

Split transaction::Verifier errors the same way, see #2834.

@mpguerra
Copy link
Contributor

mpguerra commented Sep 1, 2021

@mpguerra mpguerra added this to the 2021 Sprint 20 milestone Sep 15, 2021
@mpguerra mpguerra removed this from the 2021 Sprint 20 milestone Sep 27, 2021
@teor2345 teor2345 added this to the 2021 Sprint 20 milestone Sep 30, 2021
@teor2345 teor2345 changed the title Work out how to un-reject transactions which depend on newly created outputs Un-reject transactions which depend on newly created outputs Sep 30, 2021
@conradoplg
Copy link
Collaborator

My arguments for the quick fix:

When a transactions fails due to missing inputs, I think they just timeout. We'd need to detect that and include somehow the missing inputs in the error being returned, which seems tricky. Otherwise we can just query the state to get the missing inputs, but it also seems awkward... Also, in a sense, it seems this would basically recreate the timeout for missing inputs but elsewhere.

Handling SpendConflict seems easier, but I have questions about efficiency. I'll start implementing the quick fix while I think more about this...

@conradoplg conradoplg self-assigned this Oct 4, 2021
@mpguerra mpguerra removed this from the 2021 Sprint 20 milestone Oct 4, 2021
@teor2345 teor2345 added the P-Low label Oct 4, 2021
@teor2345 teor2345 added this to the 2021 Sprint 20 milestone Oct 5, 2021
@teor2345
Copy link
Contributor Author

teor2345 commented Oct 5, 2021

I'm probably going to run out of work tomorrow, and there are no unblocked tasks left in the sprint, so I'm moving this one back in.

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.

3 participants