Skip to content
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

reset delegation change in progress to 0 when a channel is restored #1074

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

sampocs
Copy link
Collaborator

@sampocs sampocs commented Jan 12, 2024

Closes: #XXX

Context

The DelegationChangesInProgress field on the validator struct is a mechanism to prevent ICA/ICQ overlap. When ICAs are submitted, the DelegationChangesInProgress field is incremented, and when the ack comes back, it is decremented.

In order to prevent ICA/ICQ overlap, when a slash ICQ is relayed, it [checks] if there are any active delegation changes in progress, and if so, the query is retried (since the results can’t be trusted)

However, when an ICA packet times out, the channel is closed and the pending packets are never relayed. Since we never receive the ack for these packets, the DelegationChangesInProgress field never gets decremented.

This PR sets the DelegationChangesInProgress field to 0 when the ICA channel is restored.

Brief Changelog

  • Set the DelegationChangesInProgress to 0 when a channel is restored and added unit test

Copy link
Contributor

@riley-stride riley-stride left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question

@sampocs sampocs added the A:automerge Automatically merge PR once checks pass label Jan 25, 2024
@mergify mergify bot merged commit 8d00ae6 into main Jan 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once checks pass C:stakeibc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants