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

abi length is too short for nested tuples #2458

Closed
Tracked by #2471
charles-cooper opened this issue Sep 16, 2021 · 1 comment
Closed
Tracked by #2471

abi length is too short for nested tuples #2458

charles-cooper opened this issue Sep 16, 2021 · 1 comment
Assignees
Labels
bug Bug that shouldn't change language semantics when fixed.

Comments

@charles-cooper
Copy link
Member

charles-cooper commented Sep 16, 2021

Version Information

  • vyper Version (output of vyper --version): v0.2.16

What's your issue about?

The size bound for nested tuples is too small. For example abi_encode of a ((Bytes[6],),) should have a size bound of 128, but the following compiles with no issue:

struct WrappedBytes: # equivalent to (Bytes[6],)
    bs: Bytes[6]

@internal
def foo():
    x: WrappedBytes = WrappedBytes({bs: b"hello"})
    y: Bytes[96] = _abi_encode(x, ensure_tuple=True)

How can it be fixed?

Fix the size bound estimate in vyper/old_codegen/abi.py

@charles-cooper charles-cooper self-assigned this Sep 16, 2021
@charles-cooper charles-cooper added the bug Bug that shouldn't change language semantics when fixed. label Sep 16, 2021
@charles-cooper
Copy link
Member Author

fixed in #2447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that shouldn't change language semantics when fixed.
Projects
None yet
Development

No branches or pull requests

1 participant