Skip to content

Remove double decrement of staker count in withdraw_stake

Closes #2934 (closed)

Context

If a staker tries to cement a commitment after another staker has withdrawn their stake, it fails with error: No stakers. This was caused by double decrement of number of stakers in the withdraw_stake function.

Manually testing the MR

MR includes unit test given in the related issue.

dune exec src/proto_alpha/lib_protocol/test/unit/main.exe -- test "^\[Unit\] Sc_rollup_storage.ml$"

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Thomas Pecseli

Merge request reports