software-mansion/starknet.py

[BUG] <issue in using rpc,but using GatewayClient is normal>

ManutdGTA opened this issue · 9 comments

What happened

the code running is GatewayClient is okay, but there is errror in using RPC node,both alchemy and infura.

is correct,used 
client = FullNodeClient('https://starknet-mainnet.g.alchemy.com/v2/..')
is wrong
# 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 <starknet_py.net.account.account.Account object at 0x7fefe83a7f10> True
contract = await Contract.from_address(address=address, provider=provider,
                                                   proxy_config=proxy_config)
pip show starknet_py

Name: starknet-py
Version: 0.18.3
Summary: A python SDK for Starknet
Home-page: https://github.com/software-mansion/starknet.py
Author: Tomasz Rejowski
Author-email: tomasz.rejowski@swmansion.com
License: 
Location: /site-packages
Requires: aiohttp, asgiref, crypto-cpp-py, lark, marshmallow, marshmallow-dataclass, marshmallow-oneofschema, poseidon-py, pycryptodome, typing-extensions
Required-by: 

Stack trace

'"/starknet_py/contract.py", '
 'line 613, in from_address\n'
 '    abi, cairo_version = await ContractAbiResolver(\n'
 '  File '
 '"/starknet_py/proxy/contract_abi_resolver.py", '
 'line 89, in resolve\n'
 '    return await self.resolve_abi()\n'
 '  File '
 '"/starknet_py/proxy/contract_abi_resolver.py", '
 'line 118, in resolve_abi\n'
 '    async for implementation, implementation_type in '
 'implementation_generator:\n'
 '  File '
 '"/starknet_py/proxy/contract_abi_resolver.py", '
 'line 192, in _get_implementation_from_proxy\n'
 '    raise err\n'
 '  File '
 '"/starknet_py/proxy/contract_abi_resolver.py", '
 'line 166, in _get_implementation_from_proxy\n'
 '    implementation = await proxy_check.implementation_hash(\n'
 '  File '
 '"/starknet_py/proxy/proxy_check.py", '
 'line 42, in implementation_hash\n'
 '    return await self.get_implementation(address, client)\n'
 '  File '
 '"/starknet_py/proxy/proxy_check.py", '
 'line 51, in get_implementation\n'
 '    (implementation,) = await client.call_contract(call=call)\n'
 '  File '
 '"/starknet_py/net/full_node_client.py", '
 'line 463, in call_contract\n'
 '    res = await self._client.call(\n'
 '  File '
 '"/starknet_py/net/http_client.py", '
 'line 104, in call\n'
 '    self.handle_rpc_error(result)\n'
 '  File '
 '"/starknet_py/net/http_client.py", '
 'line 111, in handle_rpc_error\n'
 '    raise ClientError(\n'
 'starknet_py.net.client_errors.ClientError: Client failed with code -32603: '
 'Internal error.\n')

Steps to reproduce

client = GatewayClient(net="mainnet") 
is correct,used 
client = FullNodeClient('https://starknet-mainnet.g.alchemy.com/v2/..')
is wrong
# 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 <starknet_py.net.account.account.Account object at 0x7fefe83a7f10> True
contract = await Contract.from_address(address=address, provider=provider,
                                                   proxy_config=proxy_config)

SDK Version

0.18.3

Python version

4.10

What operating system are you using?

Linux, Mac

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.