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

[pallet-revive] write sandbox output according to the provided output buffer length #5743

Merged
merged 8 commits into from
Sep 18, 2024

Conversation

xermicus
Copy link
Member

Instead of error out if the provided output buffer is smaller than what we want to write, we can just write what fits into the output buffer instead. We already write back the actual bytes written to the in-out pointer, so contracts can check it anyways.

This in turn introduces the benefit of allowing contracts to implicitly request only a portion of the returned data from calls and incantations. Which is especially beneficial for YUL as the call family opcodes have a return data size argument and this change removes the need to work around it in contract code.

Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: xermicus <cyrill@parity.io>
@xermicus xermicus added R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts. labels Sep 17, 2024
@xermicus xermicus changed the title [pallet-revive] write [pallet-revive] write sandbox output according to the provided output buffer length Sep 17, 2024
Signed-off-by: xermicus <cyrill@parity.io>
@xermicus xermicus marked this pull request as ready for review September 17, 2024 19:40
@xermicus xermicus requested a review from athei September 18, 2024 09:15
@xermicus xermicus added this pull request to the merge queue Sep 18, 2024
Merged via the queue into master with commit c0d5c4d Sep 18, 2024
207 of 210 checks passed
@xermicus xermicus deleted the cl/skip-output-on-zero-len branch September 18, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T7-smart_contracts This PR/Issue is related to smart contracts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants