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: Adjust error handling of sub calls #6741

Merged
merged 7 commits into from
Dec 5, 2024

Conversation

athei
Copy link
Member

@athei athei commented Dec 3, 2024

We were trapping the host context in case a sub call was exhausting the storage deposit limit set for this sub call. This prevents the caller from handling this error. In this PR we added a new error code that is returned when either gas or storage deposit limit is exhausted by the sub call.

We also remove the longer used NotCallable error. No longer used because this is no longer an error: It will just be a balance transfer.

We also make set_code_hash infallible to be consistent with other host functions which just trap on any error condition.

@athei athei added the R0-silent Changes should not be mentioned in any release notes label Dec 3, 2024
@athei athei requested review from xermicus and pgherveou and removed request for xermicus December 3, 2024 16:04
@athei
Copy link
Member Author

athei commented Dec 4, 2024

/cmd prdoc --audience runtime_dev

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also cap all limits to 63/64 like the EVM?

@athei athei added this pull request to the merge queue Dec 5, 2024
@athei
Copy link
Member Author

athei commented Dec 5, 2024

Should we also cap all limits to 63/64 like the EVM?

Isn't that a fallback value when you supply 0? Or is the gas capped by this even when supplying a fixed value?

Merged via the queue into master with commit 0d3d450 Dec 5, 2024
196 of 200 checks passed
@athei athei deleted the at/revive-error-handling branch December 5, 2024 16:42
sylvaincormier pushed a commit to sylvaincormier/polkadot-sdk that referenced this pull request Dec 5, 2024
We were trapping the host context in case a sub call was exhausting the
storage deposit limit set for this sub call. This prevents the caller
from handling this error. In this PR we added a new error code that is
returned when either gas or storage deposit limit is exhausted by the
sub call.

We also remove the longer used `NotCallable` error. No longer used
because this is no longer an error: It will just be a balance transfer.

We also make `set_code_hash` infallible to be consistent with other host
functions which just trap on any error condition.

---------

Co-authored-by: GitHub Action <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants