-
Notifications
You must be signed in to change notification settings - Fork 768
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
Contracts: Reuse module when validating #3789
Conversation
bot bench substrate-pallet --pallet=pallet_contracts |
@pgherveou https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5610229 was started for your command Comment |
@pgherveou Command |
bot bench substrate-pallet --pallet=pallet_contracts |
@pgherveou https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5610548 was started for your command Comment |
@pgherveou Command |
ef3ea49
to
b345605
Compare
b345605
to
94fe749
Compare
The CI pipeline was cancelled due to failure one of the required jobs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is that if there was a bug in the validation logic when the contract was uploaded and validated. Now this bug gets fixed and would reject the contract code. Are we fine with this?
I think so, Note that even though it's laying up the ground work for Module:new_unchecked, it's not even using it here (since it's not available in the current wasmi version). This mainly fix an issue where we were wasting time loading the module twice when validating. |
This argument could be applied to every caching logic. What we could do is to provide a mechanism for chain users to off-chain scan for invalid uploaded contracts and contest them, initiating a validation and if they no longer validate the user is getting a reward, otherwise is punished. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is that if there was a bug in the validation logic when the contract was uploaded and validated. Now this bug gets fixed and would reject the contract code. Are we fine with this?
This is already the case right now. If it gives us any performance benefit we will start skipping validation in a later PR as @pgherveou pointed out.
bot bench substrate-pallet --pallet=pallet_contracts |
@pgherveou |
bot cancel 2-69da3527-bbc9-406f-95d6-bb76aec58651 |
@pgherveou Command |
5f8ef47
to
242f018
Compare
bot bench substrate-pallet --pallet=pallet_contracts |
@pgherveou https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5865293 was started for your command Comment |
@pgherveou Command |
Reuse wasmi Module when validating.
Prepare the code for 0.32 and the addition of Module::new_unchecked