1

I have been working on payout in my L0 relay chain blockchain .While making payout I have observed the transaction fee that is deducted from my account and the actual fee that is been deducted are different, what I see from events the extra deducted fee is deposited back to my account. I want to know why extra fee get deducted from my account and then deposited back again.

eg. lets suppose i have made payout transaction from A account.

  1. 0.2 units fee gets deducted

  2. 0.18units gets credited to my account.

  3. 0.02units fee gets deducted this way.

I am sharing the screenshot for the same.

image1

enter image description here

1 Answer 1

1

I assume what you did was calling Staking::payout_stakers. This call first deduces the worst-case fee and then refunds all amount that was not used.
This is a standard pattern in Substrate when only the worst-case effort is known in advance.
The refund happens here where a DispatchResultWithPostInfo is returned that corrects the consumed weight downwards. Note that it is only possible to reduce it downwards - not upwards, since the provided pre-dispatch weight must always be the worst-case.

Your Answer

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

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