Skip to content
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)!: allow compat prefixed addresses when receiving ics20 transfers #1655

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

quasystaty1
Copy link
Contributor

@quasystaty1 quasystaty1 commented Oct 14, 2024

Summary

Support ics20 transfer from a counterparty to the astria sequencer.

Background

Currently, when performing an ics20 transfer to the Sequencer, the transfer only accepts bech32m address formats. This is inconsistent with refunding failed ics20 from Sequencer to the counterparty, where both compat (bech32) and normal (bech32m) addresses are accepted. Sequencer should accept both.

The main use case is when receiving assets from Noble (such as USDC). While Noble only enforces bech32 when handling failed ics20 transfers, this still requires ics20 transfers from Astria Sequencer to Noble to be bech32 (and not bech32m) encoded. The bech32 compatible address is hence the sender address that will be known by the counterparty/Noble, and we must allow transfers of funds back to it.

Changes

  • sequencer now accepts ics20-transfers with compat bech32 addresses
  • relevant tests includes prefixes in storage

Testing

All test passes

Breaking Changelist

  • sequencer will now accept ics-transfer with bech32 addresses, this is breaking as previously failed transfers will now be accepted

Related Issues

closes #1653

@quasystaty1 quasystaty1 requested a review from a team as a code owner October 14, 2024 15:38
@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Oct 14, 2024
@quasystaty1 quasystaty1 changed the title feat: support ics20-transfer with compat address on sequencer feat(sequencer)!: support ics20-transfer with compat address on sequencer Oct 14, 2024
@SuperFluffy SuperFluffy changed the title feat(sequencer)!: support ics20-transfer with compat address on sequencer fix(sequencer)!: allow compat prefixed addresses when receiving ics20 transfers Oct 15, 2024
Copy link
Member

@SuperFluffy SuperFluffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix. This was an oversight.

I have changed the patch title to from feat to fix and adjusted the text slightly.

Before approving: note that at the moment we completely lack tests for ics20 transfers. Since you originally encountered this problem when trying to do ics20 transfers, can you confirm that these now work?

Better yet, is there a way to provide a smoke test for this? (I am happy with you doing a manual confirmation if adding smoke tests is too much of a lift).

@quasystaty1 quasystaty1 self-assigned this Oct 15, 2024
@quasystaty1 quasystaty1 added the docker-build used to trigger docker builds on PRs label Oct 15, 2024
@quasystaty1 quasystaty1 requested a review from a team as a code owner October 15, 2024 19:24
@github-actions github-actions bot added the cd label Oct 15, 2024
@quasystaty1 quasystaty1 force-pushed the quasystaty1/ENG-915/ics20-transfer-support-compat branch from ceac1c5 to 4cbb771 Compare October 15, 2024 19:59
@quasystaty1 quasystaty1 force-pushed the quasystaty1/ENG-915/ics20-transfer-support-compat branch from 4cbb771 to c529b33 Compare October 15, 2024 20:07
Copy link
Collaborator

@noot noot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me - don't see any downside with allowing compat addresses for incoming transfers.

Copy link
Member

@joroshiba joroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infra approval

@quasystaty1
Copy link
Contributor Author

Added a smoke test

@quasystaty1 quasystaty1 added this pull request to the merge queue Oct 16, 2024
Merged via the queue into main with commit 3900b70 Oct 16, 2024
44 checks passed
@quasystaty1 quasystaty1 deleted the quasystaty1/ENG-915/ics20-transfer-support-compat branch October 16, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cd docker-build used to trigger docker builds on PRs sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICS-20 Transfers to sequencer should support compat addresses
4 participants