Author Topic: Cancel a transaction  (Read 294 times)

0 Members and 1 Guest are viewing this topic.

Offline johnyy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Cancel a transaction
« on: July 10, 2018, 01:46:49 am »
Does a feature like cancel order by transaction id make sense to you guys?

Currently if i send a order and wanted to cancel it, i will have to wait for the order to be applied on the chain, which is a very looonnng time to wait.

If we have such a feature, I can initiate a cancel immediately after i sent one.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Cancel a transaction
« Reply #1 on: July 10, 2018, 11:40:41 pm »
Currently if i send a order and wanted to cancel it, i will have to wait for the order to be applied on the chain, which is a very looonnng time to wait.
Usually it's 3 seconds, not very long, so usually you don't have time to cancel it before it applied on the chain.

Quote
Does a feature like cancel order by transaction id make sense to you guys?
If we have such a feature, I can initiate a cancel immediately after i sent one.
« Last Edit: July 10, 2018, 11:42:34 pm by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline armin

  • Full Member
  • ***
  • Posts: 90
    • View Profile
Re: Cancel a transaction
« Reply #2 on: July 11, 2018, 04:38:56 am »
No sorry this is the price you have to pay to use a decentralized exchange, you always have to wait for the block to be confirmed first. Although I'm not sure if you can broadcast another message to cancel the transaction from being put in a block before the 3 seconds (1.5 sec average) have passed
« Last Edit: July 11, 2018, 04:40:52 am by armin »

Offline johnyy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Cancel a transaction
« Reply #3 on: July 12, 2018, 02:41:35 am »
No sorry this is the price you have to pay to use a decentralized exchange, you always have to wait for the block to be confirmed first. Although I'm not sure if you can broadcast another message to cancel the transaction from being put in a block before the 3 seconds (1.5 sec average) have passed

One could argue that this feature is not useful or it is unnecessary. But i think there is a way to not pay this price.

If there is a cancel_order_by_transaction_id, then it no longer depends on the order id to cancel (which has at least 3 sec delay), since the transaction id is known to the user before he/she sends the transactions.

The chain could have forks, then the order might have different order id in different fork, canceling an order id might not be applied in the end. Cancel_by_transaction_id could in deed complete the cancel in this situation.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3429
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Cancel a transaction
« Reply #4 on: July 12, 2018, 08:27:03 pm »
No sorry this is the price you have to pay to use a decentralized exchange, you always have to wait for the block to be confirmed first. Although I'm not sure if you can broadcast another message to cancel the transaction from being put in a block before the 3 seconds (1.5 sec average) have passed

One could argue that this feature is not useful or it is unnecessary. But i think there is a way to not pay this price.

If there is a cancel_order_by_transaction_id, then it no longer depends on the order id to cancel (which has at least 3 sec delay), since the transaction id is known to the user before he/she sends the transactions.

The chain could have forks, then the order might have different order id in different fork, canceling an order id might not be applied in the end. Cancel_by_transaction_id could in deed complete the cancel in this situation.

It's technically possible to implement, however, not easy based on current infrastructure.
* It's expensive (read: slow) for nodes to undo just one or a few transactions, if there were a lot of transactions in the queue;
* nodes need to make sure the cancellation is requested by the original signer, that said, the cancellation should also be signed, thus need a new verification process.

About usability, due to the 3s block time, it's likely that success rate of cancellation will be low. The cancellation request need to be transmitted through the p2p network, it need time to reach the next block producer. For slow blockchain like bitcoin, such feature would make much more sense.

About security, if this mechanism is in place, it can be used to spam/attack the network with zero cost.

For me, the gain doesn't worth the efforts/risks. Just my own opinion though.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline armin

  • Full Member
  • ***
  • Posts: 90
    • View Profile
Re: Cancel a transaction
« Reply #5 on: July 16, 2018, 08:40:29 am »
I agree with Abit, 3sec (1.5s average) is just too small a time span to cancel a transaction. So you would have to initiate AND cancel the transaction usually within 1.5s. Seems like an edge case to optimize for, not worth it