Cannot un-whitelist bond provider with zero bond
When a bond provider is added to a pooled node, they are whitelisted with a zero-bond value.
If, for whatever reason, that bond provider does not send a bond, then their bond remains at zero and there is no way to remove the address as a whitelisted bond provider.
This happens due to the validation of the UNBOND
message in:
https://gitlab.com/thorchain/thornode/-/blob/develop/x/thorchain/types/msg_unbond.go#L32
Because the bond provider has a zero bond, the UNBOND
memo should be of the format:
UNBOND:<node addr>:0:<bond provider>
as per the documentation: https://docs.thorchain.org/thornodes/pooled-thornodes#node-operator
However, this unbond message fails.
This may also be related to the issue, or fixed in the same merge as #1336 (closed).
It seems this issue could be resolved by simply removing the IsZero
check in msg_unbond.go#L32
above, and then doing a check to see if the bond provider's bond is already zero in: https://gitlab.com/thorchain/thornode/-/blob/develop/x/thorchain/handler_unbond.go#L219
before executing refundBond
- that way the following code will be satisfied and simply remove the whitelisted bond provider.