osmosis
osmosis copied to clipboard
feat: Delete intermediary accounts
Closes #1797
What is the purpose of the change
We currently do not delete intermediary accounts without any delegations, instead keeping them all in store.
The problem is that we even iterate them during epoch, which is the main cause of the log ERR no delegation distribution info, as we're trying to get rewards from delegations that doesn't exist.
This PR introduces logic to deleting intermediary accounts, where we delete an intermediary account when there's no intermediary account connection and delegations from the intermediary account.
Upon my scope of investigation, I do not find any points that can be troublesome when deleting an intermediary account, although there were potential concerns for deleting intermediary account. (Note that we're not deleting the account itself using accountKeeper, we're only deleting this from the superfluid module state)
This PR achieves the goal of deleting unused intermediary accounts by adding the deleting logic and check inside EndBlocker of the superfluid module. (This has to be done in superfluid module not the lockup module because of go lang circular dependency issue. We can get an get around with this via interfaces but tbd upon reveiws)
Brief Changelog
- Add logic for checking and deleting unused intermediary accounts in
EndBlockerof the superfluid module.
Testing and Verifying
Added test cases
Documentation and Release Note
- Does this pull request introduce a new feature or user-facing behavior changes? yes
- Is a relevant changelog entry added to the
Unreleasedsection inCHANGELOG.md? yes - How is the feature or change documented? not applicable
Ohh this is what you meant - the errors are coming from an intermediary account having 0 delegations. I thought you meant a validator going inactive / getting jailed.
This does seem safe / good to me!
I definitely feel like we should have a changelog entry for this.
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!
Current status of PR is that we're merging this upon checking logs for the current logs we have every epoch to confirm this PR would fix the main cause for the error logs
Confirmed that the logs are actually happening because of the undeleted intermediary accounts. Planning to merge this after getting the changelog entry and fixing the merge conflicts.
I don't think we should pressure getting it on chain asap imo as long as we have merged it.
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!
TODO For this PR pre-merge: write down edge casese that we think needs to be ensured testing, ensure that those cases are well unit tested
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!