joystream icon indicating copy to clipboard operation
joystream copied to clipboard

No 20% tx fee cut for validators

Open bedeho opened this issue 2 years ago • 1 comments

Block author still gets tip, but no inclusion fee cut of 20%, also good for tokenomics, see background https://github.com/Joystream/joystream/issues/4174

┆Issue is synchronized with this Asana task by Unito

bedeho avatar Aug 15 '22 20:08 bedeho

Implemented in https://github.com/Joystream/joystream/pull/4199

mnaamani avatar Aug 23 '22 11:08 mnaamani

How to test in QA: verify that validator does not receive any tx inclusion fee revenue at all, they still should be able to receive tips.

bedeho avatar Aug 24 '22 09:08 bedeho

How to test in QA: verify that validator does not receive any tx inclusion fee revenue at all, they still should be able to receive tips.

I added a basic test for correct implementation of the DealWithFees implementation in the runtime as cargo unit tests, but this is by no means a complete test coverage.

We could have simple test scenario in integration tests as follows:

  • Setup Account X fund it from Alice (the block author)
  • Record total issuance, and balance of Alice and X
  • execute N balances:transfer() calls each with a tip T, transferring amount V to account Y
  • At end of the scenario (which should be completed before the end of an Era) the following should hold:
    • Alice Balance should have increased by (N * T) only
    • Account X balance decresed by (N * T + N * V + TotalTxFeesPaid)
    • Account Y balance equal to (N * V)
    • Total Issuance reduced by TotalTxFeesPaid

we can derive TotalTxFeesPaid by BalanceOf(X) - (N * T + N * V) we can also simplify by transfering to self ie. X == Y and transferring zero balance, ie V == 0

mnaamani avatar Aug 24 '22 13:08 mnaamani