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(bridge-contracts): fix memo transaction hash encoding #1428

Merged
merged 14 commits into from
Sep 16, 2024

Conversation

itamarreif
Copy link
Contributor

@itamarreif itamarreif commented Aug 29, 2024

Summary

Use the correct encoding functions to populate memo field in the bridge's conversion logic from rollup withdrawal events to sequencer actions.

Background

We were using ethers::H256::to_string() to get the string for the rollup_transaction_hash value, which returns a shortened version of the hash. the string 0x1234...0x1234 is instead of the full hash (i.e. you would expect it to give you something like 0x1234567890123456789012345678901234567890123456789012345678901234).

Changes

  • Use the correct

Breaking Changelist

  • The previously invalid memo data will now be populated with the correct information. This doesn't actually break anything because we also aren't actually using these hashes anywhere.

Related Issues

Link any issues that are related, prefer full github links.

closes #1427, #1471

@itamarreif itamarreif added bug Something isn't working bridging labels Aug 29, 2024
@itamarreif itamarreif marked this pull request as ready for review August 29, 2024 18:04
@itamarreif itamarreif requested a review from a team as a code owner August 29, 2024 18:04
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.

Change looks fine, but please import the trait anonymously.

@itamarreif itamarreif force-pushed the itamarreif/bridge-contracts/hash-fix branch 2 times, most recently from 8c03c0a to cd975cd Compare August 29, 2024 21:38
itamarreif and others added 4 commits August 29, 2024 17:44
…idge_withdrawer.rs

Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io>
Co-authored-by: Richard Janis Goldschmidt <github@aberrat.io>
@itamarreif itamarreif force-pushed the itamarreif/bridge-contracts/hash-fix branch from cd975cd to 45fef0d Compare August 29, 2024 21:44
@itamarreif itamarreif added this pull request to the merge queue Aug 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 29, 2024
@itamarreif itamarreif added this pull request to the merge queue Aug 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 30, 2024
@itamarreif itamarreif added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@itamarreif itamarreif added this pull request to the merge queue Sep 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 5, 2024
@itamarreif itamarreif self-assigned this Sep 6, 2024
@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Sep 13, 2024
@itamarreif itamarreif added the docker-build used to trigger docker builds on PRs label Sep 13, 2024
@itamarreif itamarreif force-pushed the itamarreif/bridge-contracts/hash-fix branch from f31129f to 44caf94 Compare September 13, 2024 19:19
@@ -502,6 +516,11 @@ impl GetWithdrawalActionsError {
fn log_without_transaction_hash(_log: &Log) -> Self {
Self(GetWithdrawalActionsErrorKind::LogWithoutTransactionHash)
}

// XXX: Somehow identify the log?
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't think this error should ever happen, but maybe put the tx hash?

Comment on lines 38 to 39
self.rollup_withdrawal_event_id.len() <= 256,
"rollup withdrawal event id must not be more than 64 bytes",
Copy link
Collaborator

Choose a reason for hiding this comment

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

update error message to 256

@itamarreif itamarreif added this pull request to the merge queue Sep 16, 2024
Merged via the queue into main with commit 6b5dae9 Sep 16, 2024
42 checks passed
@itamarreif itamarreif deleted the itamarreif/bridge-contracts/hash-fix branch September 16, 2024 22:03
steezeburger added a commit that referenced this pull request Sep 23, 2024
* main:
  feat(conductor): implement restart logic (#1463)
  fix: ignore `RUSTSEC-2024-0370` (#1483)
  fix, refactor(sequencer): refactor ics20 logic (#1495)
  fix(ci): use commit SHA instead of PR number preview-env images (#1501)
  chore(bridge-withdrawer): pass GRPC and CometBFT clients to consumers directly (#1510)
  fix(sequencer): Fix incorrect error message from BridgeUnlock actions (#1505)
  fix(bridge-contracts): fix memo transaction hash encoding (#1428)
  fix: build docker when workflow explicitly includes component (#1498)
  chore(sequencer): migrate from `anyhow::Result` to `eyre::Result` (#1387)
  fix(ci): typo for required field in sequencer preview-env (#1500)
  feat(ci): provide demo/preview environments (#1406)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridging bug Something isn't working 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.

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