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

feat: add L1->L2 hashes #1186

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Conversation

PhilippeR26
Copy link
Collaborator

Motivation and Resolution

Solves issue #1178
Provides functions to calculate L1->L2 hashes.
L2->L1 hash has already been implemented in PR #702

Usage related changes

2 new functions :

  • L1->L2 message Hash :
const l1L2MessageHash = hash.getL2MessageHash(l1FromAddress, l2ToAddress, l2Selector, payload, l1Nonce);
  • L1->L2 transaction Hash :
const l1L2txH = hash.calculateL2MessageTxHash(l1FromAddress, l2ToAddress, l2Selector, payload, constants.StarknetChainId.SN_SEPOLIA, l1Nonce);

All inputs have to be recovered from a L1 explorer.

Development related changes

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

Copy link
Collaborator

@tabaktoni tabaktoni left a comment

Choose a reason for hiding this comment

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

LGTM !

@tabaktoni tabaktoni changed the base branch from develop to next-version July 26, 2024 11:09
@tabaktoni tabaktoni merged commit 96a3dfb into starknet-io:next-version Jul 26, 2024
3 checks passed
Copy link

🎉 This issue has been resolved in version 6.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants