I can send token from and to the same address.
v0.38.3
desmoscli tx send desmos1fc3mdf0ue2f4suyg5vjj75jtaer0cl0dgqvy6u desmos1fc3mdf0ue2f4suyg5vjj75jtaer0cl0dgqvy6u 1udaric --from kwun --fee 20udaric
The result can be found here.
I expect this should be rejected before broadcasting the tx. The ValidateBasic is not checking if the from and to addresses are the same.
https://github.com/cosmos/cosmos-sdk/blob/218ec99508417636ccd47477bc7aad96ac0ac804/x/bank/types/msgs.go#L22
This will lead to unnecessary processing.
I wonder if this is a design choice to have no limitations from SDK, but it would be good to have atleast a flag enable/disable self transfers.
ahh, this is an old issue. I recall we didn't do the validation because it is up to them if they want to spend fees testing a transaction. The issue now is, what if the proposer accepts 0 fees? That could lead to DoS.
I'd propose adding an ante handler decorator to see if the transaction has positive fees.
Self vs No-Self sends don't matter WRT to DoS -- I can simply create two addresses that I own and send the same funds back-n-forth for free (or even some multiple set of addresses).
I would recommend that we do not impose this limitation in the protocol, but rather have a warning at some level in the client UX.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Self vs No-Self sends don't matter WRT to DoS -- I can simply create two addresses that I own and send the same funds back-n-forth for free (or even some multiple set of addresses).
I would recommend that we do not impose this limitation in the protocol, but rather have a warning at some level in the client UX.