Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FIX: Cannot unstake 0 #260

Merged
merged 3 commits into from
Oct 25, 2023
Merged

FIX: Cannot unstake 0 #260

merged 3 commits into from
Oct 25, 2023

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Oct 24, 2023

Fixes an error discovered by consensus-shipyard/fendermint#319
Follow up to #257

The reason we can't allow 0 in unstake is because if we do, the next checkpoint fails:

checkpoint submission should succeed: CallError { exit_code: ExitCode { value: 33 }, failure_info: Some(MessageBacktrace(Backtrace { frames: [Frame { source: 64, method: 6, code: ExitCode { value: 33 }, message: "contract reverted" }, Frame { source: 64, method: 3844450837, code: ExitCode { value: 33 }, message: "contract reverted" }, Frame { source: 120, method: 6, code: ExitCode { value: 33 }, message: "contract reverted" }, Frame { source: 120, method: 3844450837, code: ExitCode { value: 33 }, message: "contract reverted" }], cause: None })), error: fendermint_vm_actor_interface::ipc::subnet::SubnetActorErrors:GatewayManagerFacetErrors(CannotReleaseZero(CannotReleaseZero)) }

Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

Really good catch, the gateway prevents zero releases to prevent useless calls. Unfortunately, with the new staking module, this call has been hidden deep into the code :) Thanks!

src/subnet/SubnetActorManagerFacet.sol Outdated Show resolved Hide resolved
@aakoshh aakoshh merged commit 7ecad9a into dev Oct 25, 2023
@aakoshh aakoshh deleted the integration-testing branch October 25, 2023 07:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants