-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prune stale acknowledgements after successful channel upgrade #3937
Comments
unsure what the timeline is on this but I'd like to take it on when the time is right ™️ |
Now that we removed When chain A moves to |
Gonna split this one up in a couple of PRs to make it faster to review.
|
woot woot this is done, see all linked issues |
Summary
Prune stale acknowledgements after successful channel upgrade.
Problem Definition
Acknowledgements currently live forever in IBC state despite no longer being necessary once a packet has completed its lifecycle. Overtime this can add up to quite a bit as outlined in #2869
Once a channel successfully upgrades, all old packets using previous channel parameters have been flushed and completed their lifecycle. The acknowledgement on the counterparty can then be safely removed.
Proposal
To avoid potential gas issues in block processing due to an unpredictable amount of acknowledgements to prune, I suggest the channel keeper store a mapping from the port/channel ID to the highest stale sequence. By stale sequence, I mean a sequence which refers to packets which have fully completed their lifecycle and thus all their information may be safely deleted.
The channel upgrade will already receive the counterparty latest sequence send, so on an upgrade it simply needs to store it:
A new msg type will need to be added which may prune any acknowledgement with a sequence <= to the highest stale packet sequence
We can also add some result value to the
MsgPruneAcknowledgementResponse
to indicate if all possible acknowledgements were pruned, or if there are some leftOnce the lowest acknowledgement sequence is greater than the pruning sequence, we can remove the pruning sequence mapping as well
Some quick pseudo code:
For Admin Use
The text was updated successfully, but these errors were encountered: