-
Notifications
You must be signed in to change notification settings - Fork 724
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
Allow dependent tx issuance over the wallet API #1413
Conversation
w.pendingTxs.Delete(txID) | ||
|
||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document or just help me understand, why pop off oldest transaction only once, and exit the for-loop on success? Trying to understand how decided
function relates to this operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To rephrase my question,
Allow dependent tx issuance
In what cases, dependent tx failed to be issued, so we need another tx issuance to trigger the tx issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user is issuing virtuous txs - verification will never fail. However, I didn't want to just have the node crash (or fall into an infinite loop) in this situation... So instead I dropped the tx and logged a warning.
In all likelihood - if one tx is dropped they all will be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... didn't want .. or fall into an infinite loop
Oh makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the wallet API is explicitly designed to enable issuance of dependent txs
Now makes sense. Thanks for the context.
Co-authored-by: abenegia <alberto.benegiamo@gmail.com> Co-authored-by: Aaron Buchwald <aaron.buchwald56@gmail.com> Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org> Co-authored-by: Manthan Dave <manthanhd@live.com>
Why this should be merged
The X-chain mempool post Cortina does not allow dependent transactions to be included. For example:
The mempool disallows this to avoid mempool DoSes. However, the wallet API is explicitly designed to enable issuance of dependent txs.
How this works
Honors the mempool requirement of only having no dependent txs while making the API seem like there are dependent txs in the mempool. In the example above, Tx A will be issued into the mempool. If Tx B is then issued while Tx A is still processing, Tx B will be enqueued until Tx A is accepted. After Tx A is accepted, Tx B will be issued into the mempool.
This is a fairly minimal implementation that does not attempt to parallelize independent txs.
How this was tested
Issued many concurrent txs onto Fuji