-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Argo revert_outbound_transfer extrinsic #5158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@kdembler do you want me to handle the benchmark tests for this or are you gonna do that as well?
@freakstatic if you could do that, that'd be great |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks ok, I have just left a few points
#[weight = WeightInfoArgo::<T>::finalize_inbound_transfer()] | ||
pub fn revert_outbound_transfer( | ||
origin, | ||
transfer_id: TransferId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this is an identifier whose validity is already confirmed by the squid.
Given that there are no checks on this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Namely the extr. assumes that transfer_id
will refer to a pending transfer outbound request queued in the argo-squid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, likewise we don't check it any way when calling finaliza_inbound_transfer
. It all assumes that the operator is acting correctly
let caller = ensure_signed(origin)?; | ||
ensure!(caller == Self::operator_account().unwrap(), Error::<T>::NotOperatorAccount); | ||
|
||
ensure!(Self::status() == BridgeStatus::Active, Error::<T>::BridgeNotActive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be present?
I am thinking about the following scenario:
- Transaction outbound exists
- Bridge is paused
- User tries to revert transaction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when the bridge is paused, nothing should be callable. Also it's not user that reverts the transaction, it's the operator
)); | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite my previous comment I will point this out :
transfer revert failing test case for bridge status not active is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should add this as well. Let me do this in next PR though, at this branch there are small issues with bridge status that I fixed on my next branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Based on #5155
Adds a new
revert_outbound_transfer
extrinsic. Functionally, the new extrinsic is almost the same asfinalize_inbound_transfer
:The only difference is in input arguments and the emitted event.
Todo: