RetiringVault -> InactiveVault height isn't recorded in StatusSince
This came up in this Discord thread, in which there was an inbound to an InactiveVault and seeking to learn when it had become an InactiveVault.
Block 12699468: RetiringVault.
Block 12699469: No status displayed (InactiveVault).
However, the status_since
continued indicating block 12694848, 4621 blocks earlier (the change from ActiveVault to RetiringVault),
which made it avoidably troublesome to track down when it actually became empty.
Code for status change from ActiveVault to RetiringVault:
https://gitlab.com/thorchain/thornode/-/blob/v1.121.0/x/thorchain/manager_network_current.go#L1021-1022
asgard.UpdateStatus(RetiringVault, ctx.BlockHeight())
if err := vm.k.SetVault(ctx, asgard); err != nil {
Code for status change from RetiringVault to InactiveVault:
https://gitlab.com/thorchain/thornode/-/blob/v1.121.0/x/thorchain/manager_network_current.go#L432-433
vault.Status = InactiveVault
if err := vm.k.SetVault(ctx, vault); err != nil {
UpdateStatus
code, which updates StatusSince as well:
https://gitlab.com/thorchain/thornode/-/blob/v1.121.0/x/thorchain/types/type_vault.go#L103-107
// UpdateStatus set the vault to given status
func (m *Vault) UpdateStatus(s VaultStatus, height int64) {
m.Status = s
m.StatusSince = height
}
I propose that the line
vault.Status = InactiveVault
be directly changed (for a later network version) to
vault.UpdateStatus(InactiveVault, ctx.BlockHeight())
.
Specifically: !3164 (merged)
'Set StatusSince upon change from RetiringVault to InactiveVault'.