crossbario / crossbario/autobahn-python

eip712: failure on pypy

Open
#1,253 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-investigation XBR
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

cpython (success):

(cpy374_1) oberstet@intel-nuci7:~/scm/crossbario/autobahn-python/examples/xbr$ make typed 
python test_typed.py --gateway http://localhost:1545

using web3.py v5.2.0
connected via provider "http://localhost:1545"
Provider set - xbrtoken=0xCfEB869F69431e42cdB54A4F4f105C19C080A601
Provider set - xbrnetwork=0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
Using private key: a4985a2ed93107886e9a1f12c7b8e2e351cc1d26c42f3aab7f220f3a7d08fda6
Account address: 3f979903acbd194ca450dc956df17a6df392ec08
Account canonical address: 0x3F979903ACBd194cA450DC956df17A6dF392ec08
Ok, MSG_HASH = 0xb5dc3216d43579455cb01520c4cb0e624d60859457d80f48df7c74d7344e4932
Ok, signed typed data (using key 0x3F979903ACBd194cA450DC956df17A6dF392ec08):
SIGNATURE = 0xcde46611fae9f28e3475c8fdbd58035dfd3cf22040e2cf90f4655d9cc768111b25d08b87bbd926e161407d894ffae343a07223a976ca38dbc9c54ea4aeaa51661b
Ok, verified signature was signed by 0x3F979903ACBd194cA450DC956df17A6dF392ec08
(cpy374_1) oberstet@intel-nuci7:~/scm/crossbario/autobahn-python/examples/xbr$ 

pypy (failure):

(pypy3_1) oberstet@intel-nuci7:~/scm/crossbario/autobahn-python/examples/xbr$ make typed 
python test_typed.py --gateway http://localhost:1545

using web3.py v5.2.0
connected via provider "http://localhost:1545"
Provider set - xbrtoken=0xCfEB869F69431e42cdB54A4F4f105C19C080A601
Traceback (most recent call last):
  File "test_typed.py", line 94, in <module>
    xbr.setProvider(w3)
  File "/home/oberstet/scm/crossbario/autobahn-python/autobahn/xbr/__init__.py", line 109, in setProvider
    xbrtoken = _w3.eth.contract(address=XBR_DEBUG_TOKEN_ADDR, abi=XBR_TOKEN_ABI)
  File "/home/oberstet/pypy3_1/site-packages/web3/eth.py", line 435, in contract
    ContractFactory = ContractFactoryClass.factory(self.web3, **kwargs)
  File "/home/oberstet/pypy3_1/site-packages/web3/contract.py", line 301, in factory
    'address': partial(normalize_address, kwargs['web3'].ens),
  File "/home/oberstet/pypy3_1/site-packages/web3/main.py", line 235, in ens
    return ENS.fromWeb3(self)
  File "/home/oberstet/pypy3_1/site-packages/ens/main.py", line 73, in fromWeb3
    return cls(web3.manager.provider, addr=addr)
  File "/home/oberstet/pypy3_1/site-packages/ens/main.py", line 61, in __init__
    self.ens = self.web3.eth.contract(abi=abis.ENS, address=ens_addr)
  File "/home/oberstet/pypy3_1/site-packages/web3/eth.py", line 438, in contract
    return ContractFactory(address)
  File "/home/oberstet/pypy3_1/site-packages/web3/contract.py", line 284, in __init__
    self.address = normalize_address(self.web3.ens, address)
  File "/home/oberstet/pypy3_1/site-packages/web3/_utils/normalizers.py", line 211, in normalize_address
    validate_name_has_address(ens, address)
  File "/home/oberstet/pypy3_1/site-packages/web3/_utils/ens.py", line 34, in validate_name_has_address
    raise NameNotFound("Could not find address for name %r" % name)
web3.exceptions.NameNotFound: Could not find address for name '0x314159265dD8dbb310642f98f50C066173C1259b'
Makefile:5: recipe for target 'typed' failed
make: *** [typed] Error 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with make typed from examples/xbr under PyPy and compare it with the successful CPython run. Inspect autobahn/xbr/init.py, especially setProvider, and follow the web3.py ENS-related traceback. Done means the typed example completes successfully under PyPy with signature verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.