You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming the validator is a committee member, any delegator can call unbond_public. The validator's bond is 100 credits and the delegator's bond is 10,000 credits.
// If the delegated total is below 10M credits, continue to unbonding the validator.
position end_unbond_delegator;
// {
// Check if the new delegated total is at least 10M credits.
gte r22 10_000_000_000_000u64 into r26;
// Jump to end if the delegated total is at least 10M credits.
branch.eq r26 true to end;
// }
// If the delegated total is below 10M credits, continue to unbonding the validator.
If delegated[validator.address] is less than the threshold after the delegator unbinds the funds, the logic continues to execute.
// Calculate the updated amount of microcredits after unbonding.
sub r30.microcredits r2 into r34;
In the /* Unbond the Validator */ logic, because the validator's funds of 100 are less than the delegator's funds of 10000, the calculation will overflow and the function call will fail.
🐛 Bug Report
The delegator may fail to execute unbond_public.
Steps to Reproduce
Assuming the validator is a committee member, any delegator can call unbond_public. The validator's bond is 100 credits and the delegator's bond is 10,000 credits.
1.Unbond the delegator
snarkVM/synthesizer/program/src/resources/credits.aleo
Line 554 in 5050cb1
If delegated[validator.address] is less than the threshold after the delegator unbinds the funds, the logic continues to execute.
2.Unbond the validator
snarkVM/synthesizer/program/src/resources/credits.aleo
Line 587 in 5050cb1
In the /* Unbond the Validator */ logic, because the validator's funds of 100 are less than the delegator's funds of 10000, the calculation will overflow and the function call will fail.
Expected Behavior
The delegator can unbind the funds normally.
Your Environment
snarkVM Version: 5050cb1
The text was updated successfully, but these errors were encountered: