How to ensure every ActiveVault receives every gas asset in a churn?
Based on this discussion in !2381 (merged):
Currently the number of vault migration rounds is determined by the Mimir key ChurnMigrateRounds
, called only here in manager_network_current.go
's EndBlock
.
The number of ActiveVaults can vary as churns occur, influenced by Mimir keys (such as AsgardSize
) and otherwise.
Existing code here seeks to ensure that every ActiveVault receives some of each gas asset (vital for being able to do outbounds or future vault migrations)
by prioritising vaults which do not have each gas asset over vaults which already have that gas asset
(only choosing by security once all vaults already have some gas asset).
Expected behaviour is that for instance if there were 5 migration rounds and 6 Asgard vaults,
or 4 migration rounds and 5 Asgard vaults,
one vault per migration round would receive a portion of each gas asset from all RetiringVaults, but the last vault would receive no gas assets.
(ChurnMigrateRounds
being set to 1 and leaving four Asgards with no gas assets is a more extreme example.)
At present it appears to me that a small and intuitive change is to do at minimum as many migration rounds as there are Asgard vaults.
Specifically, commit 93575ce5 ,
now separated into separate code proposal !3043 (closed)
'No fewer migration rounds than ActiveVaults'.
// Always have at least as many migration rounds as Active vaults,
// to ensure that all Active vaults receive gas assets.
if int64(len(active)) > migrationRounds {
migrationRounds = int64(len(active))
}
As this approach is viewed to be fixing the problem at the wrong place in the code, I am curious as to what a preferred resolution is of ensuring that all ActiveVaults receive all gas assets.
Update:
An alternative code proposal to at least partially address this is !3046 (merged)
'Track same-block-scheduled migrations to send each Asset to all ActiveVaults'.