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: allow msg.data in raw_call without slice #2902

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jun 8, 2022

What I did

as title

How I did it

How to verify it

Commit message

a common use case for raw_call is to forward all calldata to an
implementation or logic contract of some kind. however, currently vyper 
only allows msg.data inside of slice() or len(); this does not allow one
to forward calldata of any size. this enables that use case without
requiring the length of msg.data to be known. it does this by simply
copying calldata to the location pointed to by `msize`.

Description for the changelog

Cute Animal Picture

image

a common use case for raw_call is to forward all calldata to an
implementation or logic contract of some kind. this enables that without
requiring the length of msg.data to be known. it does this by simply
copying calldata to the location pointed to by `msize`.

this commit also fixes an annotation in abi_decode, and slightly cleans
up the logic in the raw_call implementation.
@charles-cooper charles-cooper marked this pull request as ready for review June 8, 2022 23:10
@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2022

Codecov Report

Merging #2902 (ea2f439) into master (4243cbd) will increase coverage by 0.00%.
The diff coverage is 92.85%.

❗ Current head ea2f439 differs from pull request most recent head 60faa4e. Consider uploading reports for the commit 60faa4e to get more accurate results

@@           Coverage Diff           @@
##           master    #2902   +/-   ##
=======================================
  Coverage   88.04%   88.05%           
=======================================
  Files          95       95           
  Lines       10435    10442    +7     
  Branches     2511     2512    +1     
=======================================
+ Hits         9188     9195    +7     
  Misses        790      790           
  Partials      457      457           
Impacted Files Coverage Δ
vyper/builtin_functions/functions.py 92.03% <91.66%> (+0.04%) ⬆️
vyper/semantics/validation/local.py 91.21% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4243cbd...60faa4e. Read the comment docs.

@charles-cooper charles-cooper merged commit b8dea0c into vyperlang:master Jun 9, 2022
@charles-cooper charles-cooper deleted the feat/msgdata_in_rawcall branch June 9, 2022 04:38
ThiwakonPB pushed a commit to ThiwakonPB/vyper that referenced this pull request Jun 13, 2022
a common use case for raw_call is to forward all calldata to an
implementation or logic contract of some kind. however, currently vyper
only allows msg.data inside of slice() or len(); this does not allow one
to forward calldata of any size. this enables that use case without
requiring the length of msg.data to be known. it does this by simply
copying calldata to the location pointed to by `msize`.

this commit also fixes an annotation in abi_decode, and slightly cleans
up the logic in the raw_call implementation.
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.

3 participants