Report Author: Toufeeq from the Avail Technical Committee [5CoVaWrZnaV3BSeUJCA8Ca3SPMJDtjT1zPvZkzovkxJU7dkr]
Change Executed: Changes will be applied at block #470,242
Technical Committee Consensus: 5/7 signers https://avail.subscan.io/tech/15?tab=votes
Introduction:
This report aims to provide transparency to the Avail community regarding upcoming and executed network changes. The Avail Technical Committee (TC) has approved a runtime upgrade on Avail Mainnet, addressing an inconsistency identified in the upstream Polkadot SDK related to transferable balance calculations. This issue has been resolved by migrating to the FungibleAdapter in the transaction payment pallet. After a detailed review of the effectiveness, impact, and security of the upgrade, the TC reached a majority consensus (5/7) to proceed with the changes.
Proposed / Executed Changes:
The inconsistency was identified in the Polkadot SDK’s logic for computing transferable balances. This led to misleading calculations for users, potentially resulting in failed transactions due to insufficient balance to cover fees.
Previously, the formula for transferable balances was:
• Old Formula: transferable = free - max(frozen, reserved)
The new formula is:
• New Formula: transferable = free - (frozen - reserved)
The old formula, used by the CurrencyAdapter, did not accurately account for certain scenarios where frozen and reserved balances overlapped, leading to discrepancies. The migration to the FungibleAdapter, which uses the reducible_balances function (as outlined here), corrects this issue.
Additionally, this upgrade includes improvements to optimize election phragmen bounds.
Code Modifications:
For those interested, you can review the necessary code modifications in the following PRs:
Potential Merits to the Network:
This change brings clarity and precision to balance calculations, ensuring users are accurately informed of their available spendable balance, thus preventing transaction failures. This correction improves the user experience by reducing confusion and avoiding unnecessary errors when covering transaction fees. Furthermore, the optimizations in the election process provide a more efficient and stable staking and governance experience
If you require any additional resources or information, please feel free to drop comments.
Thank you.