Skip to content

Fix: ensure stake removal processing#758

Merged
kpeluso merged 8 commits intodevfrom
arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a
Mar 14, 2025
Merged

Fix: ensure stake removal processing#758
kpeluso merged 8 commits intodevfrom
arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a

Conversation

@amimart
Copy link
Contributor

@amimart amimart commented Mar 4, 2025

Purpose of Changes and their Description

When processing stake removals in the x/emissions end blocker there's a limit to the number of stakes to process which when reached was causing an error, resulting with the stake removals until not to be processed.

The resolution consists of not returning such error anymore but emitting a log instead, allowing to process these removals.

Another fix is covered here: in the case stake removals were not process in the block they were expected to be completed because of this limit, they were not managed afterwards because the provided block when removing them was systematically the current block.

Some refactoring has been necessary to allow this module part to be testable by mocking the emissions keeper.

Link(s) to Ticket(s) or Issue(s) resolved by this PR

https://linear.app/alloralabs/issue/ENGN-3494/135-logic-error-in-the-removestakes-function-could-lead-to-a-denial-of

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed.
  • If documented, please describe where. If not, describe why docs are not needed.
  • Added to Unreleased section of CHANGELOG.md?

@amimart amimart force-pushed the arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a branch from eb80312 to a1978ca Compare March 4, 2025 14:43
@amimart amimart marked this pull request as ready for review March 4, 2025 14:43
xmariachi
xmariachi previously approved these changes Mar 4, 2025
Copy link
Contributor

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

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

lgtm

@amimart amimart force-pushed the arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a branch from a1978ca to 1c3e0e0 Compare March 11, 2025 22:06
@amimart amimart force-pushed the arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a branch from 1c3e0e0 to 6d002c6 Compare March 11, 2025 22:08
kpeluso
kpeluso previously approved these changes Mar 14, 2025
Copy link
Contributor

@kpeluso kpeluso left a comment

Choose a reason for hiding this comment

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

perfect

@kpeluso kpeluso merged commit c647bb8 into dev Mar 14, 2025
7 of 8 checks passed
@kpeluso kpeluso deleted the arnaud/engn-3494-135-logic-error-in-the-removestakes-function-could-lead-to-a branch March 14, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants