tellor-io / tellor-pallet

GNU General Public License v3.0
7 stars 3 forks source link

fix min balance #126

Closed evilrobot-01 closed 1 year ago

evilrobot-01 commented 1 year ago

Simply initialises sub-accounts with min balance on first usage, ensuring that any initial tips, dispute fees are fully claimable and that staking rewards exclude min balance.

Also allows feed reward increments to theoretically be below the minimum balance, although probably unlikely to be of much use in practice.

Note: based on the other two open PRs, so will need to rebase to clean up once those are completed/merged.

evilrobot-01 commented 1 year ago

I'm unclear why the sub-accounts need to be initialized with a min balance to ... ensuring that any initial tips, dispute fees are fully claimable and that staking rewards exclude min balance....

The first tip of 100 will mean that only 99 is available if the min_balance is 1, which obviously isnt fair on the first claimer. We also dont want to have the sub-account dropped when empty, as it consumes more weight to recreate the account again when required.

Its a very minor thing and it can be argued that it is probably as is (e.g. first claimer takes the hit) than the overhead of checking on each call. I just wanted to quickly add it to highlight.

evilrobot-01 commented 1 year ago

Rebased