2

Context

I'm currently working on a faucet/claiming pallet that allows new users to claim a certain amount of tokens. We have some logic in place to gatekeep who can receive the tokens, and each user can claim once. I believe this claiming feature could serve as a good example of the use of the SkipCheckIfFeeless SignedExtension to bypass the check on any transaction payment charging logic.

Problem

The SkipCheckIfFeeless seems to effectively skip the transaction payment. However, when attempting to execute a transaction as a new user, the CheckNonce signed extension throws errors on the following lines, as the new account's providers and sufficients are both 0. The error indicates that the Nonce storage should have been paid for.

Questions/Solutions

So, how can we solve this problem? Should we:

  • Add an extra SignedExtension that will increase the account's providers and sufficients for this specific extrinsic if they are both 0?
  • Develop a custom CheckNonce extension that skips the providers/sufficients check if the call is a claim_call?
  • Consider a different solution altogether?

Is the providers/sufficients check necessary in the CheckNonce Extension?

In which situations should the SkipCheckIfFeeless extension be used? As far as I understand it, it can be used to facilitate accounts without any balance to execute some extrinsic? If the account already has some balance, I could simply mark the extrinsic with Pays::No, correct?

I would appreciate any help!

1 Answer 1

4

This is a great question!

SkipCheckIfFeeless was indeed designed as a mechanism to trigger transactions without requiring the existence of the sender's account. So, this error should be fixed at the framework level. I'll create an issue in the polkadot-sdk repo to take that further (EDIT: created).

For now though, I think a custom CheckNonce extension as you proposed would be the way to go. You would need a similar mechanism to check the call and create an account in this case.

If the account already has some balance, I could simply mark the extrinsic with Pays::No, correct?

This is correct. This, however, deducts the fee first and refunds it later, thus requiring the existence of an account and the balance to pay for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.