-
Notifications
You must be signed in to change notification settings - Fork 8
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
create_transaction(), send(), should consider Tx in mempool. #189
Comments
hmm, digging into the code, I don't immediately see how to achieve unconfirmed tx chaining. Tx validation requires that the PrimitiveWitness have one mutator-set memership proof per input. But input utxos in the mempool are represented as RemovalRecord, with no such membership proof. I am not certain if it is possible with Neptune's design or not. a question for @aszepieniec. Even if unconfirmed tx chaining is not presently achievable, create_transaction() can still avoid adding any input that is already in the mempool. That would prevent the input re-use. |
About chaining unconfirmed transactions: it is possible in principle, but requires a substantial amount of engineering. What would need to be done is 1) generalize inputs; and 2) write a new SingleProof path.
Right now I think other features are more urgently demanded. |
@aszepieniec somehow I missed your comment above until just now. anyway, please take a look at #197 when u have a chance and let me know your thoughts. low-ish priority -- It can wait until after the merge is completed. If it's fatally flawed somehow I can still fix this issue by ignoring wallet inputs in the mempool when creating a tx. |
closes Neptune-Crypto#189. input selection now ignores spent inputs from unconfirmed tx in the mempool. Also fixes an input selection bug where the balance check considers available funds (not timelocked) but the input utxo selection does not. Adds a test to verify that same input can no longer be spent twice.
Presently create_transaction() will re-use the same inputs when it is called multiple times in the same block.
eg, consider this loop:
What happens is that 5 tx get created that all spend the same input.
(but Mempool::insert() de-dups them into just one tx)
This is because create_transaction() calls
WalletState::allocate_sufficient_input_funds_from_lock()
which fetches unspent utxos that are valid as of tip block. It does not consider utxos in the mempool at all.This means that:
Fixing this will require that create_transaction() inspects the utxos in the mempool.
The text was updated successfully, but these errors were encountered: