sora-xor / sora2-network

SORA is a new economic system aimed at creating a supranational, world economic system with built-in tools for decentralized finance (DeFi). The SORA network implements a new way of parachain architecture on Polkadot and Kusama network, with the capability to bridge external blockchains (like Ethereum) to the Polkadot ecosystem.
Other
50 stars 22 forks source link

fix(kensetsu): fix CollateralInfos migration #1090

Closed Alexey-N-Chernyshov closed 2 weeks ago

Alexey-N-Chernyshov commented 3 weeks ago

This fixes double reading of CollateralInfos. Despite of defining old v1::CollateralInfos and new CollateralInfos they are essentially the same storage, so inserting after drain results in UB, which is double reading of values. In this particular case it doesn't break the logic, but for general purpose the storage must be drained completely before the inserting updated values.