-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: resubmit a failed tx from the wallet #8251
Comments
Could #6929 be related? |
Looks like the same thing I was running into to me! And duh.. seems I'll see if I can capture more useful logs to help get to the bottom of why it's not broadcasting in the first place. I'll include any useful logs over in that issue. |
I think I may have had a similar issue when using i2p tx routing, but even relay didn't work. I had to flush the tx pool before re-submitting. Maybe *also have an option to 'cancel' a stuck tx and API hook into flushing the tx pool before creating another one? |
It seems both In any case, I figure ideally some re-submission flow should work for someone connected to a public |
Overview
My wallet is connected to my node via tor, my node uses the tx proxy over tor. This happened the other day:
So I ended up paying someone twice and never saw them again unfortunately (the one that got away). I figure there could probably be some fail-safe to protect against this scenario better. I think the best fail-safe is enabling the user to resubmit a failed tx to a node from their wallet in a cleaner way. I don't see an RPC endpoint for this particular scenario.
My investigation so far
First off, this issue happens to me sporadically and I've yet to capture it in useful logs, but I'm hoping I will soon.
This is what I believe is happening: upon initial successful tx submission, my tx first enters my node's pool with the
relay_method::local
state, and then sporadically it takes quite a bit of time before the tx reaches therelay_method::fluff
state (which AFAIU occurs after another node tells mine it knows about the tx and Dandellion++ has completed). So on occasion, before the tx reaches the fluff state on my node, in my wallet it enters the "failed" state from this 500 second propagation timeout here, and my wallet indicates this to me in the UI.Note this TODO inside
core_rpc_server::on_send_raw_tx
:Because my node responds successfully to the RPC server call to
send_raw_tx
even before knowing other nodes have seen the tx, the client thinks the tx submit successfully (naturally), even though it has not broadcast to the rest of the network.I'm able to repro the failed state consistently by submitting a tx to my node, then immediately setting
out_peers 0
to cut my node off from the rest of the network before the tx enters therelay_method::fluff
state, which eventually triggers the propagation timeout that causes the failure to appear in my wallet.My takes
First and foremost, ideally it wouldn't take so long for my node to broadcast the tx to other nodes in those apparent edge cases. Solving that will take more investigation that the logs may help with, and I suspect connection: fix implementation #7760 and related work may help with this too. However, at the end of the day, I still think it is optimal to have a stronger fail-safe UX under not-so-great network conditions.
It would have been nice to be able to re-submit the failed tx from my wallet, exactly as is. If a node receives a re-submission attempt for a tx that is already in the pool but not in
relay_method::fluff
state, the node can attempt to rebroadcast, and indicate to the wallet it's retrying (or still trying) the broadcast flow, then the tx can re-enter a pending state in the wallet.More debatable, but I don't think the user should get a "successfully sent" indicator in the wallet until the tx has been confirmed broadcast to the rest of the network. Either this TODO should be solved in that exact spot/line above, or alternatively, after the node responds successfully from
on_send_raw_tx
, the client should wait until it sees the tx in the pool before indicating to the user the tx sent successfully. I lean toward the latter as safer because otherwise traffic analysis might be easier to determine that a tx was broadcast from a particular node, by observing timing of payloads going into and out of a node.I think the wallet was failing to recognize the node eventually did broadcast the tx. At some point the tx should have re-entered the "pending" state since the tx eventually did broadcast, but I don't think there was any logic handling it re-entering the "pending" state after it had already failed. Could be wrong on this. Still looking.
The text was updated successfully, but these errors were encountered: