-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Total issuance discrepancy #563
Comments
I think this stems from the way burned and recycled tokens are or are not counted in the various totals, but this is critical we get right as exchanges are relying on us for the truth and we are showing discrepancies in our data. |
Initial analysisGood news:
Inconsistency:
Next Steps
Long TermWe should migrate our staking system to use Holds instead of the current |
Confirmed the cause is with subnet registration fees and tx fees. Subnet registration makes up for the overwhelming majority of the 35k discrepancy, only ~7.5 TAO comes from tx fees. CausesSubnet registrationWhen a user registers a new network here: subtensor/pallets/subtensor/src/lib.rs Lines 2016 to 2023 in c097ff8
balance is "burnt" from the registrar without a corresponding update to the subtensor total issuance: subtensor/pallets/subtensor/src/root.rs Line 833 in c097ff8
Tx feesTx fees are burnt using the default Line 339 in c097ff8
This default behavior is to just drop (burn) the fee amount, and this updates the Balances pallet TI but not the subtensor pallet TI. Immediate remediesSubnet registrationIf we wish to consider TAO locked as part of TI, then we should create a Tx feeWe should write an "Syncing" the correct total issuanceOnce the above is in place, we can use sudo to initialise the Then, we can call a simple admin function that sets the subtensor pallet TI to Balances pallet TI + total stake + total subnet registration lock. This will result in the subtensor pallet TI becoming perfectly balanced. try-stateA try-state invariant should be written to notify us if TI ever deviates again. Long termAs mentioned, we should migrate to using Holds for Staking and Subnet Registration which will massively simplify our accounting. However this is a large size lift, and I am not sure how high priority it will be once we fix the current issue. |
but tao locked is part of total issuance, so it seems like only the trx fees need to be fixed. And Balances TI should include locked tao |
I think it's still prudent to add a
This will happen when we migrate to Holds. In the mean time, I think it's prudent to avoid changing the idiomatic definition, or otherwise messing with the Balances pallet TI. |
balance.totalIssuance
: 1,195,894,993,084,044 (which should be effectively the number of coins in circulation)subtensorModule.totalissuance
: 7,010,451,064,912,511subtensorModule.totalstake
: 5,780,329,269,388,411The text was updated successfully, but these errors were encountered: