User who opt for request_unlock
at the end of epoch could not get sufficient time to apply for cancel_unlock_request
#42
Labels
Github username: @aktech297
Twitter username: kaka
Submission hash (on-chain): 0x2303181153b635d84e7404e7f8043d81bc0eec4455a3e7e6b99c49679a2b520d
Severity: medium
Description:
Description
When a user opt for
request_unlock
at the end of the epcoh will not get sufficient time to raise thecancel_unlock_request
as per the implementation.Attack Scenario\
Attachments
When we see the functions request_unlock and cancel_unlock_request, they are stroing and retrivign the requests using the id which is calcualted using the function get_batch_unlock_id
if a user raise the
request_unlock
, then they would be allowed to cancel it with in this epoch window.L297-L304
But the problem is in the function
get_batch_unlock_id
which trucate the value. so if a user raise the request at the end of epoch, they will not get the full epoch time to cancel it.Lets see the following case - simplified one
batch_interval_delay = 2
time starts at 1
creation_time is 1
if we apply this in the function
get_batch_unlock_id
for different input we will get following output.For examle, if they raise the ticket at 2.9 , they would be given id with 2. in this case, their cancel request time passes quick.
They will not get enoug window to apply for cancel request.
I think, the restriction in the function
cancel_unlock_request
can be removed. So that the implementation will be user friendly.Kintsu-0x7d70f9442af3a9a0a734fa6a1b4857f25518e9d2/src/vault/lib.rs
Lines 300 to 307 in c9bdc85
And get the input time from user and proceed for cancel.
The text was updated successfully, but these errors were encountered: