Skip to content

[BUG] Parser bug #1595

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

Open
1 task done
kkawula opened this issue Apr 17, 2025 · 0 comments
Open
1 task done

[BUG] Parser bug #1595

kkawula opened this issue Apr 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kkawula
Copy link
Member

kkawula commented Apr 17, 2025

What happened

Probably a new type has been added.
Contract deployed with sncast.
Contract: https://github.com/NethermindEth/pitchlake-coprocessor/blob/6d6c2af889c26762a11c87e38af7c9021a3fc342/pitchlake_verifier/src/pitchlake_verifier.cairo

Stack trace

/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/net/account/account.py:233: IncompatibleRPCVersionWarning: RPC node with the url http://127.0.0.1:5050 uses incompatible version 0.8.0. Expected version: 0.8.1
return await self._client.get_contract_nonce(
Traceback (most recent call last):
File "/Users/kamil/starkware/pitchlake-coprocessor/client.py", line 53, in
asyncio.run(main())
File "/Users/kamil/.pyenv/versions/3.11.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/kamil/.pyenv/versions/3.11.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/.pyenv/versions/3.11.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/client.py", line 43, in main
cont = await Contract.from_address(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/contract.py", line 665, in from_address
return Contract(
^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/contract.py", line 607, in init
self._functions = self._make_functions(
^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/contract.py", line 817, in _make_functions
repository[name] = ContractFunction(
^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/contract.py", line 457, in init
assert isinstance(contract_data.parsed_abi, AbiV2)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/.pyenv/versions/3.11.11/lib/python3.11/functools.py", line 1001, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/contract.py", line 79, in parsed_abi
return AbiParserV2(self.abi).parse()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/abi/v2/parser.py", line 83, in parse
events[name] = self._parse_event(event)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/abi/v2/parser.py", line 234, in _parse_event
types=self._parse_members(
^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/abi/v2/parser.py", line 249, in _parse_members
return OrderedDict(
^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/abi/v2/parser.py", line 250, in
(name, self.type_parser.parse_inline_type(param["type"]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/cairo/v2/type_parser.py", line 70, in parse_inline_type
parsed = parse(type_string, self.defined_types)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/starknet_py/abi/v2/parser_transformer.py", line 210, in parse
parsed_lark_tree = grammar_parser.parse(code)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/lark/lark.py", line 655, in parse
return self.parser.parse(text, start=start, on_error=on_error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/lark/parser_frontends.py", line 104, in parse
return self.parser.parse(stream, chosen_start, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/lark/parsers/earley.py", line 280, in parse
to_scan = self._parse(lexer, columns, to_scan, start_symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/lark/parsers/xearley.py", line 152, in _parse
to_scan = scan(i, to_scan)
^^^^^^^^^^^^^^^^
File "/Users/kamil/starkware/pitchlake-coprocessor/.venv/lib/python3.11/site-packages/lark/parsers/xearley.py", line 125, in scan
raise UnexpectedCharacters(stream, i, text_line, text_column, {item.expect.name for item in to_scan},
lark.exceptions.UnexpectedCharacters: No terminal matches '[' in the current parser context, at line 1 col 1

[core::integer::u32; 8]
^
Expected one of:
* __ANON_12
* __ANON_4
* __ANON_13
* __ANON_0
* LPAR
* IDENTIFIER
* __ANON_14
* __ANON_1
* __ANON_9
* __ANON_11
* AT
* __ANON_2
* __ANON_5
* __ANON_6
* __ANON_8
* __ANON_10
* __ANON_7
* __ANON_3

Steps to reproduce

  1. Declare with sncast (I didn't try declaring with starknet.py)
  2. Deploy with sncast

SDK Version

0.26.2

Python version

3.11.11

What operating system are you using?

Mac

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.
@kkawula kkawula added the bug Something isn't working label Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant