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: starknet message_id and address format #726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ctoyan
Copy link

@ctoyan ctoyan commented Dec 14, 2024

Description

The PR consists of:

  • voting-verifier CosmWASM contract changes, mostly related to MessageIdFormat and AddressFormat
  • MessageIdFormat::FieldElementAndEventIndex and AddressFormat:Starknet

Todos

  • Unit tests
  • Manual tests
  • Documentation
  • Connect epics/issues

Steps to Test

You would need the Starknet relayer, in order to manually test, which is not open sourced yet.
Also we don't have integration or end-to-end tests yet.

Expected Behaviour

Other Notes

Once this PR is merged and the changes related to the format are deployed on your devnet contracts, we'll re-test manually.

@ctoyan ctoyan requested a review from a team as a code owner December 14, 2024 15:15
Copy link
Author

Choose a reason for hiding this comment

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

This MessageIdFormat is very similar to the HexTxHashAndEventIndex.
The main difference is that it's checking if the FieldElement (Felt) overflows.
Felt::MAX is 2^251+17*2^192+1, which fits in 252 bits. This means that a 64 hex string, representing 256 bits, might overflow it. We enforce 64 hex string everywhere with padded zeros.

If you find this check useless, I believe we can get rid of the custom message id format and re-use the HexTxHashAndEventIndex.

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.

1 participant