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

Ensure no error is possible in apply_validated_transaction and fix correct_and_deposit_fee #497

Merged
merged 5 commits into from
Oct 13, 2021

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented Oct 13, 2021

In normal Ethereum::transact execution, we do not have any Substrate fee wrappers. As a result, apply_validated_transaction should never error out, because in that situation no fee will be paid. On the other hand, we can return Substrate dispatchable error in the first ensure_ethereum_transaction line, because if it's not, then it is actually wrapped with Substrate fee handling logic.

This PR also fixes an issue in correct_and_deposit_fee, in that because we modified state before, it should not be able to return any errors.

cc @librelois

@librelois
Copy link
Contributor

Ok it's much clearer, thanks :)

My misunderstanding came from the fact that I thought that in case of reverting an ethereum transaction, a DispatchError was returned and that the extrinsic failed from the substrate point of view.

In fact, even when the ethereum transaction reverts, substrate will consider that the extrinsic execution was successful.

@sorpaas sorpaas merged commit 334409c into master Oct 13, 2021
@sorpaas sorpaas deleted the sp-panic-ethereum branch October 13, 2021 13:56
librelois pushed a commit to moonbeam-foundation/frontier that referenced this pull request Oct 13, 2021
…`correct_and_deposit_fee` (polkadot-evm#497)

* Ensure no error is possible in `apply_validated_transaction`

* Fix lints

* Fix correct_and_deposit_fee should not be able to error

* Change ensure to assert

* Fix tests
abhijeetbhagat pushed a commit to web3labs/frontier that referenced this pull request Jan 11, 2023
…`correct_and_deposit_fee` (polkadot-evm#497)

* Ensure no error is possible in `apply_validated_transaction`

* Fix lints

* Fix correct_and_deposit_fee should not be able to error

* Change ensure to assert

* Fix tests
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