-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix(sequencer): fix ibc prefix conversion #1065
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
I have to note that it's difficult for me to understand how this fits into ibc because I lack background knowledge.
@@ -244,7 +244,13 @@ impl AppHandlerExecute for Ics20Transfer { | |||
.await | |||
{ | |||
Ok(()) => TokenTransferAcknowledgement::success(), | |||
Err(e) => TokenTransferAcknowledgement::Error(e.to_string()), | |||
Err(e) => { | |||
tracing::debug!( |
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 wonder if this should be elevated to info!
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.
probably not, as we could potentially see this often, users can trigger this by sending invalid transfers to astria
dest_port: &PortId, | ||
dest_channel: &ChannelId, | ||
is_refund: bool, | ||
) -> Denom { |
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.
looking at how you use this this might be a use case for Cow<'a, Denom>
with Cow::Borrowed(&'a Denom)
if is_refund
and Cow::Owned(Denom)
otherwise.
Summary
prefixes were not being converted correctly for bridge locks, i refactored the ibc prefix conversion to be in its own function and added unit tests for all cases.
Background
found while testing incoming ibc transfers to a bridge account, the denom was not being prefixed before being compared to the allowed asset ID for the bridge account.
Changes
convert_denomination
functionexecute_ics20_transfer
, so the correct converted denom should be usedTesting
unit tests + tested it with a bridge lock via ibc