You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #7092, we removed the global supply blog but setSupply, BurnCoins and MintCoins are still iterating over the whole supply and re-writing the whole supply store for every operation.
Set the supply one denom at a time rather than reading and writing the whole supply for each operation. A related issue may be #4076 as the sdk.Coins array is inherently inefficient when there are multiple denoms.
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Remember that when we set some supply which is zero, in the past as we rewrote the full struct we did not have this problem, but as soon as the value is zero it needs to rewrite the zero value.
Summary of Bug
In #7092, we removed the global supply blog but
setSupply
,BurnCoins
andMintCoins
are still iterating over the whole supply and re-writing the whole supply store for every operation.cosmos-sdk/x/bank/keeper/keeper.go
Lines 195 to 211 in 641b13e
cosmos-sdk/x/bank/keeper/keeper.go
Lines 407 to 410 in 641b13e
Proposed Fix
Set the supply one denom at a time rather than reading and writing the whole supply for each operation. A related issue may be #4076 as the
sdk.Coins
array is inherently inefficient when there are multiple denoms.For Admin Use
The text was updated successfully, but these errors were encountered: