An implementation for fractional gas on system fees #692
Labels
discussion
Initial issue state - proposed but not yet accepted
enhancement
Type - Changes that may affect performance, usability or add new features to existing modules.
ledger
Module - The ledger is our 'database', this is used to tag changes about how we store information
Projects
As discussed on #319, and also explained here #326 (comment) it is feasible to implement fractional (divisible) gas fees (without making Neo divisible) in the following way.
The proposed idea won't change any block format and it is fully backwards compatible, to be implemented as soon as possible.
Currently, only integer system fees are allowed, due to a control on InvocationTransaction. On Blockchain file, the computation of system fees just aggregate the values on transactions, storing that on
SystemFeeAmount
inside Snapshot (which will also be integer). This is needed to be integer, otherwise it will break calculation of redistribution (becoming smaller than Fixed8). So, to allow divisible system fee and to redistribute only integer gas, the proposal is to:To publicly store this information, the proposal is to deploy a Validators Contract (as discussed #686 (comment)), and create a storage key on this contract regarding
FractionalSystemFee
.Example:
Suppose that contract storage
FractionalSystemFee
has zero GAS, the total system_fee value passed to snapshot will be: floor(0 + 4 + 3.7 + 5.5) = floor(13.2) = 13The exceeding value of 0.2 will be stored again on
FractionalSystemFee
.To put this into production, it will be easy, as long as the following steps are done:
The deployed contract can have this format (using #690):
This way, we can have this feature already on Neo 2.X, and prepare ground for improved fee system on 3.0.
The text was updated successfully, but these errors were encountered: