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

feat[codegen]!: check returndatasize even when skip_contract_check is set #4148

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jun 14, 2024

What I did

How I did it

How to verify it

Commit message

previously, when `skip_contract_check=True` was set, the ABI decoding
routine could result in garbage memory in the case that no contract is
at the target address, based on the logic that, if we don't care about
whether a contract exists at the target, we can skip the returndatasize
check. however, it makes sense for the ABI decoder to in any case
include the returndatasize check, to prevent the garbage data case as
previously mentioned in the docs.

this is a breaking change, since previously calls with
`skip_contract_set=True` could result in garbage memory - and now they
would revert instead.

this represents a slight performance regression in that case, but it is
easier to reason about and also ensures the user always decodes valid
data.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

include the check even when `skip_contract_check` is `True`. this is a
slight performance regression in that case, but it is easier to reason
about and also ensures the user always decodes valid data.
@charles-cooper charles-cooper changed the title Refactor/skip contract check returndatasize feat[codegen]: check returndatasize even when skip_contract_check is set Jun 14, 2024
@charles-cooper charles-cooper added this to the v0.4.1 milestone Jun 15, 2024
@charles-cooper charles-cooper marked this pull request as ready for review August 5, 2024 08:41
@charles-cooper charles-cooper changed the title feat[codegen]: check returndatasize even when skip_contract_check is set feat[codegen]!: check returndatasize even when skip_contract_check is set Aug 8, 2024
@charles-cooper charles-cooper changed the title feat[codegen]!: check returndatasize even when skip_contract_check is set feat[codegen]!: check returndatasize even when skip_contract_check is set Aug 8, 2024
@charles-cooper charles-cooper enabled auto-merge (squash) August 8, 2024 11:28
@charles-cooper charles-cooper merged commit cefb0c5 into vyperlang:master Aug 8, 2024
155 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants