fix(sequencer): fix escrow channel check when receiving non-refund ics20 packet#851
Merged
fix(sequencer): fix escrow channel check when receiving non-refund ics20 packet#851
Conversation
joroshiba
approved these changes
Mar 26, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 10, 2024
…1162) ## Summary Rewrites the IBC denomation construction by parsing its prefix into segments. This fixes the incorrect removal of prefxies for source non-refund ics20 packets. ## Background follow up to #851 which was an audit fix - this fixes the fix by removing the source prefix correctly, in the case assets we're the source of are transferred in. previously, the entire prefix was removed, would would have been invalid if the asset was prefixed by multiple hops, eg. transfer/channel-1/transfer/channel-2/denom would have become just denom when it should have become transfer/channel-2/denom. ## Changes - refactor `astria_core::primitive::1::asset::Denom` to express its prefix as a list of segments - ensure that only full prefix segments are removed - make `Denom` construction a fallible operation by parsing it - removed a bunch of constructors as they were only used in tests and not otherwise ## Testing Provide exhaustive units. ## Related Issues Replaces #1131
sgranfield4403-3
added a commit
to sgranfield4403-3/astria
that referenced
this pull request
Oct 2, 2025
…#1162) ## Summary Rewrites the IBC denomation construction by parsing its prefix into segments. This fixes the incorrect removal of prefxies for source non-refund ics20 packets. ## Background follow up to astriaorg/astria#851 which was an audit fix - this fixes the fix by removing the source prefix correctly, in the case assets we're the source of are transferred in. previously, the entire prefix was removed, would would have been invalid if the asset was prefixed by multiple hops, eg. transfer/channel-1/transfer/channel-2/denom would have become just denom when it should have become transfer/channel-2/denom. ## Changes - refactor `astria_core::primitive::1::asset::Denom` to express its prefix as a list of segments - ensure that only full prefix segments are removed - make `Denom` construction a fallible operation by parsing it - removed a bunch of constructors as they were only used in tests and not otherwise ## Testing Provide exhaustive units. ## Related Issues Replaces astriaorg/astria#1131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix escrow channel balance check by:
dest_channelescrow balanceI had to put both the fixes in one PR to be able to add the unit tests (they would fail if only one issue was fixed)
Background
zellic audits + needs to match ics20 spec (https://github.com/cosmos/ibc/blob/0238989da88e790ec4daea7214ff3521cc264137/spec/app/ics-020-fungible-token-transfer/README.md)
Changes
dest_channelescrow balanceTesting
unit tests
Related Issues
closes #848 and #849