Skip to content

Erroneous code in web3._utils.encoding #1252

Open
@davesque

Description

@davesque

What was wrong?

Found some erroneous code in web3._utils.encoding:

if abi_type.arrlist[-1] != 1:

The problem with the above code is that the arrlist property on ABIType instances is always a tuple of tuples or None if no array dimension list was encountered when parsing a type string. So arrlist[-1] will never equal 1.

I tried swapping out the enclosing function (which appears to implement an experimental packed encoder before one was available in eth-abi) for the packed encoder that is now available in eth-abi. This caused tests to fail in tests/core/filtering/test_contract_topic_filters.py.

I didn't have time to dig into things and really diagnose the problem. It seems like it could take a bit of time to do that. My sense is that some of the filtering features were built upon incorrect assumptions about packed encodings.

How can it be fixed?

Not sure yet. Will need to dig into this more deeply.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions