This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add Existence Requirement to Transfer #3986
Labels
J0-enhancement
An additional feature request.
Z1-easy
Can be fixed primarily by duplicating and adapting code by an intermediate coder
Z6-mentor
An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
We should add a parameter to
transfer
in the Balances module so that the sender can prefer to have the transaction fail rather than have the account reaped.Currently, extrinsics pay an
inclusion_fee = base_fee + byte_fee + weight_fee
. This is charged prior to execution of the extrinsic and doesn't know anything about the internal logic of the extrinsic.The inclusion fee is updated for block
N+1
based on the weight of blockN
compared to the target weight according to TargetedFeeAdjustment so you can calculate the inclusion fee for the next block. However, it is possible that a transaction is in the pool for several blocks before inclusion. The sender may intend to leave enough balance to keep the account but have it reaped.Users
This is a problem for exchanges who manage thousands of accounts. Not having this feature makes them leave a large margin of safety on ED to prevent nonce reset. This is undesirable because it represents a lot of wasted capital.
Example
As a concrete example, imagine the following scenario:
The user attempts to transfer 7 tokens, but the extrinsic is in the pool for several blocks and the
inclusion_fee
increases to 2.1. Substrate then:balance = 0.9
and reaping the accountThe user should be able to add an optional parameter to
transfer
to avoid executing the transaction if it would lead to the account getting reaped.The text was updated successfully, but these errors were encountered: