Skip to content

fix(bridge-withdrawer)!: correctly identify rollup return address in ics20 withdrawal actions#1714

Merged
joroshiba merged 3 commits intomainfrom
itamarreif/bridge-contracts/memo-address-fix
Oct 23, 2024
Merged

fix(bridge-withdrawer)!: correctly identify rollup return address in ics20 withdrawal actions#1714
joroshiba merged 3 commits intomainfrom
itamarreif/bridge-contracts/memo-address-fix

Conversation

@itamarreif
Copy link
Copy Markdown
Contributor

@itamarreif itamarreif commented Oct 22, 2024

Summary

Use the full hex encoded sender of the smart contract event as the rollup return address in the ics20 withdrawal event memo.

Background

Before this patch, the astria.protocol.memos::v1::Ics20WithdrawalFromRollup memo used the abbreviated form of the ethers contract event sender, making it impossible to return funds if necessary. Specifically, the field was set as rollupReturnAddress":"0xc59a…2d94"

After this patch, the full address is used, making it possible to identify the sender.

Changes

  • change the event conversion logic to use AbiEncode::encode_hex() instead of H160::to_string()
  • update the black box test mock to also do this

Breaking Changelist

  • This is a breaking change because two differerent versions of bridge-withdrawer will produce different sequencer transactions.

Related Issues

Original issue where this was first encountered but not fixed: #1427

@itamarreif itamarreif requested a review from a team as a code owner October 22, 2024 18:02
@itamarreif itamarreif requested a review from Fraser999 October 22, 2024 18:02
@itamarreif itamarreif self-assigned this Oct 22, 2024
@itamarreif itamarreif changed the title fix(bridge-contracts): fix address encoding in ibc memo fix(bridge-withdrawer)!: fix address encoding in ibc memo Oct 22, 2024
@SuperFluffy SuperFluffy changed the title fix(bridge-withdrawer)!: fix address encoding in ibc memo fix(bridge-withdrawer)!: correctly identify rollup return address Oct 22, 2024
@SuperFluffy SuperFluffy changed the title fix(bridge-withdrawer)!: correctly identify rollup return address fix(bridge-withdrawer)!: correctly identify rollup return address in ics20 withdrawal actions Oct 22, 2024
@itamarreif itamarreif marked this pull request as draft October 22, 2024 18:15
@itamarreif itamarreif marked this pull request as ready for review October 22, 2024 18:22
@itamarreif itamarreif force-pushed the itamarreif/bridge-contracts/memo-address-fix branch from cbb7346 to d5ede81 Compare October 22, 2024 18:23
@itamarreif itamarreif force-pushed the itamarreif/bridge-contracts/memo-address-fix branch from d5ede81 to 2068caf Compare October 22, 2024 19:38
Copy link
Copy Markdown
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.

Do we have any tests over this? I would ideally have a snapshot test that validates that json memos don't change

@joroshiba joroshiba added the docker-build used to trigger docker builds on PRs label Oct 23, 2024
Copy link
Copy Markdown
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.

Approved based on my other passing test built on top of this.

@joroshiba joroshiba added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit 815b083 Oct 23, 2024
@joroshiba joroshiba deleted the itamarreif/bridge-contracts/memo-address-fix branch October 23, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker-build used to trigger docker builds on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the correct encoding for ethers hashes in the bridge's conversion logic

2 participants