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

feature: support transactions with unmined inputs in the mempool #8777

Open
conradoplg opened this issue Aug 20, 2024 · 1 comment · May be fixed by #8857
Open

feature: support transactions with unmined inputs in the mempool #8777

conradoplg opened this issue Aug 20, 2024 · 1 comment · May be fixed by #8857
Assignees
Labels
A-mempool Area: Memory pool transactions A-rpc Area: Remote Procedure Call interfaces C-enhancement Category: This is an improvement P-Medium ⚡

Comments

@conradoplg
Copy link
Collaborator

conradoplg commented Aug 20, 2024

Motivation

We don't allow txs with unmined inputs in the mempool. However, supporting them can be useful, in particular for the tex address support which creates two transactions, one z->t and another t->t and submits them sequentially. Currently the second one is rejected in zebrad because of the unknown input since the first one wasn't mined yet.

Specifications

No spec for the mempool 🥲

Complex Code or Requirements

We need to consider that this changes the mempool criteria from "any txs that could be mined on their own" to "a collection of txs that possibly need to be mined together" and check if this has unintended consequences. (In particular I think this will stop #5674 from being implementable)

Testing

Probably trying to submit two txs where the second spends something from the first

Related Work

See discussion in https://discord.com/channels/809218587167293450/809251029673312267/1275193366740602993

@conradoplg conradoplg added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Aug 20, 2024
@github-project-automation github-project-automation bot moved this to New in Zebra Aug 20, 2024
@arya2 arya2 self-assigned this Aug 28, 2024
@arya2 arya2 added P-Medium ⚡ A-rpc Area: Remote Procedure Call interfaces A-mempool Area: Memory pool transactions and removed S-needs-triage Status: A bug report needs triage labels Aug 28, 2024
@arya2
Copy link
Contributor

arya2 commented Aug 30, 2024

It looks like shielded inputs must already be mined, so allowing spends from utxos in the mempool when verifying mempool transactions will be enough, though that may still be tricky, the PendingUtxos struct in the state service could be useful here.

(In particular I think this will stop #5674 from being implementable)

It'll complicate it a bit for mempool transactions that depend on other mempool transactions, but it should still be implementable.

Update: We need to track transaction dependencies to ensure that Zebra produces valid block templates anyway, so, the block verifier could send all of a block's ordered transactions' ids to the mempool in a single request to see which ones have been verified and are still valid if some of them were verified with a dependency.

@mpguerra mpguerra moved this from New to Sprint Backlog in Zebra Sep 2, 2024
@mpguerra mpguerra moved this from Sprint Backlog to In progress in Zebra Sep 10, 2024
@mpguerra mpguerra changed the title feature: support orphan transactions in the mempool feature: support transactions with unmined inputs in the mempool Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mempool Area: Memory pool transactions A-rpc Area: Remote Procedure Call interfaces C-enhancement Category: This is an improvement P-Medium ⚡
Projects
Status: Review/QA
Development

Successfully merging a pull request may close this issue.

2 participants