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

shielded-pool(ics20): process truncated addresses in packet data #4962

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Dec 16, 2024

Describe your changes

This PR makes sure that truncated addresses are encoded correctly when ICS20 withdrawals are marshaled into fungible packet data.

To test this PR, one can performa IBC roundtrip against a testnet chain with broken bech32m handling (e.g, grand-1).

Issue ticket number and link

#4950

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    CB release branch.

@erwanor erwanor marked this pull request as ready for review December 16, 2024 03:41
@cronokirby
Copy link
Contributor

Why can't the pcli command just use the`FullViewingKey::transparent_address()" method to create the address?

@erwanor
Copy link
Member Author

erwanor commented Dec 16, 2024

Good idea! This feels kind of an API cheat code, I am curious to understand why the IVK doesn't allow building a transparent Address directly

@erwanor erwanor merged commit f1d8459 into release/v0.81.x Dec 16, 2024
12 checks passed
@erwanor erwanor deleted the erwan/uip8_fungible_data branch December 16, 2024 15:37
erwanor added a commit that referenced this pull request Dec 16, 2024
## Describe your changes

This PR makes sure that truncated addresses are encoded correctly when
ICS20 withdrawals are marshaled into fungible packet data.

In addition to that, it modifies pcli to (hazardously?) handcraft a
return `Address` with an identity clue key and zero diversifier.

To test this PR, one can performa IBC roundtrip against a testnet chain
with broken bech32m handling (e.g, `grand-1`).

## Issue ticket number and link

#4950 

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CB release branch.
conorsch pushed a commit that referenced this pull request Dec 16, 2024
## Describe your changes

This PR makes sure that truncated addresses are encoded correctly when
ICS20 withdrawals are marshaled into fungible packet data.

In addition to that, it modifies pcli to (hazardously?) handcraft a
return `Address` with an identity clue key and zero diversifier.

To test this PR, one can performa IBC roundtrip against a testnet chain
with broken bech32m handling (e.g, `grand-1`).

## Issue ticket number and link

#4950 

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CB release branch.
conorsch pushed a commit that referenced this pull request Dec 17, 2024
## Describe your changes

This PR makes sure that truncated addresses are encoded correctly when
ICS20 withdrawals are marshaled into fungible packet data.

In addition to that, it modifies pcli to (hazardously?) handcraft a
return `Address` with an identity clue key and zero diversifier.

To test this PR, one can performa IBC roundtrip against a testnet chain
with broken bech32m handling (e.g, `grand-1`).

## Issue ticket number and link

#4950 

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CB release branch.
.encode_as_transparent_address()
.unwrap_or_else(|| ordinary_return_address)
} else {
ordinary_return_address
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, this removed compat support in the protocol.

conorsch pushed a commit that referenced this pull request Dec 20, 2024
## Describe your changes

This PR makes sure that truncated addresses are encoded correctly when
ICS20 withdrawals are marshaled into fungible packet data.

In addition to that, it modifies pcli to (hazardously?) handcraft a
return `Address` with an identity clue key and zero diversifier.

To test this PR, one can performa IBC roundtrip against a testnet chain
with broken bech32m handling (e.g, `grand-1`).

## Issue ticket number and link

#4950

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CB release branch.

(cherry picked from commit c4ab7d7)
erwanor added a commit that referenced this pull request Dec 20, 2024
## Describe your changes

This PR makes sure that truncated addresses are encoded correctly when
ICS20 withdrawals are marshaled into fungible packet data.

In addition to that, it modifies pcli to (hazardously?) handcraft a
return `Address` with an identity clue key and zero diversifier.

To test this PR, one can performa IBC roundtrip against a testnet chain
with broken bech32m handling (e.g, `grand-1`).

## Issue ticket number and link

#4950

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CB release branch.

(cherry picked from commit c4ab7d7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants