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

Invalid Felt Regex validation #861

Closed
arkoc opened this issue Feb 4, 2025 · 3 comments · Fixed by #862
Closed

Invalid Felt Regex validation #861

arkoc opened this issue Feb 4, 2025 · 3 comments · Fixed by #862

Comments

@arkoc
Copy link

arkoc commented Feb 4, 2025

Steps to reproduce

  1. Go to: https://dwiekawki.github.io/beerus-wasm-demo/
  2. Try to execute this:
{
  "execute": {
    "calldata": [],
    "contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "entry_point_selector": "0x01557182e4359a1f0c6301278e8f5b35a776ab58d39892581e357578fb287836"
  }
}

This is calling total_supply() function.

Response:

{
  "error": "failed to parse request: Error('Felt value does not match regex: 0x01557182e4359a1f0c6301278e8f5b35a776ab58d39892581e357578fb287836', line: 1, column: 194)"
}

Also a side note, when any of functions are returning null (0x) it is not parsed correctly as well.

@arkoc arkoc changed the title Invalid Regex for validating Felt Invalid Felt Regex validation Feb 4, 2025
@dwiekawki
Copy link
Contributor

Hi @arkoc , thank you for describing the issue.

The regex is actually from the official RPC spec, so it can't be invalid by definition. Leading zeros are explicitly forbidden: https://github.com/starkware-libs/starknet-specs/blob/76bdde23c7dae370a3340e40f7ca2ef2520e75b9/api/starknet_api_openrpc.json#L1338

The problem is that the regex is not respected, but this can be easily mitigated on the Beerus side quite easily.

I will post updates here in the issue comments, so don't worry this should be a quick one.

@arkoc
Copy link
Author

arkoc commented Feb 5, 2025

Thanks for clarification @dwiekawki. We assumed that the issue was the regex, because when we removed it, everything worked.

@dwiekawki
Copy link
Contributor

Fixed version is deployed to https://dwiekawki.github.io/beerus-wasm-demo/.
Release 0.7.1 job is already running.
Enjoy!

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 a pull request may close this issue.

2 participants