Module distribution

Module distribution 

Source
Expand description

Storage fee distribution into epochs

Data is stored in Platform “forever” currently, which is 50 eras (50 years by default). To incentivise masternodes to continue store and serve this data, payments are distributed for entire period split into epochs. Every epoch, new aggregated storage fees are distributed among epochs and masternodes receive payouts for previous epoch.

Constants§

FEE_DISTRIBUTION_TABLE
The amount of the perpetual storage fee to be paid out to masternodes per era. Adds up to 1.

Functions§

calculate_storage_fee_refund_amount_and_leftovers
Calculates leftovers and amount of credits by distributing storage fees to epochs
distribute_storage_fee_to_epochs_collection
Distributes storage fees to epochs into SignedCreditsPerEpoch and returns leftovers
subtract_refunds_from_epoch_credits_collection
Distributes refunds to epochs into SignedCreditsPerEpoch and returns leftovers It skips epochs up to specified skip_until_epoch_index