-
Notifications
You must be signed in to change notification settings - Fork 704
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
CheckNonce
should not enforce the account creation requirement for feeless calls
#3991
Comments
The fix can not just be to allow this for feeless calls, because this would mean that people can store the nonce for free on chain. When the account doesn't has any ED, we could only accept nonce zero. However, this would mean that if they don't get some ED at some point later, you could always replay the transactions. |
We can add this check in the |
Not really, since you can't know for sure ahead of time that ED will be provided. See the explanation for |
I understand your point. However, it should be expected that the runtime dev ensures that the ED is allocated for such feeless transactions (with nonce as zero)? So, this should never happen and this error should just be a fail-safe? I am not sure if its better to not add this check, causing the transactions to be replayable? |
Reading the stack exchange question and the PR mentioned #4165, I think we're conflating 2 problems:
Problem 1 is already nicely solved by the combination of Problem 2 is an entirely separate problem that should not be addressed by I believe there is no issue with |
Thanks!.The proposed approaches are indeed quite interesting and might solve this generally. However, the PR linked here tries to solve this specifically for feeless calls when used in combination with
Please note that the linked PR is not causing any change in the exisiting |
Reiterating, I think problem 2 is very difficult to solve because of the attack vector and I view a
The fact that you can't know in advance if the ED will be provided and the validation logic happens before dispatch is exactly why this problem is so difficult to solve in the context of an extension and is best handled somewhere else (detailed on the linked PR). The extension contract is just not built to handle this usecase.
In addition to what is mentioned on this issue, and to the reasons here (and subsequent explanations):
|
As raised in https://substrate.stackexchange.com/questions/11259/how-to-enable-free-execution-for-specific-extrinsics-using-the-skipcheckiffeeles/11262#11262,
SkipCheckIfFeeless
, though skips the payment extensions, doesn't work as intended due to these requirements inCheckNonce
:polkadot-sdk/substrate/frame/system/src/extensions/check_nonce.rs
Lines 83 to 86 in 0bbda78
So, we need a mechanism for
CheckNonce
to skip these checks for feeless calls.The text was updated successfully, but these errors were encountered: