substrate icon indicating copy to clipboard operation
substrate copied to clipboard

contracts: Allow indeterministic instructions off-chain

Open athei opened this issue 2 years ago • 1 comments

Fixes https://github.com/paritytech/substrate/issues/12063 Fixes https://github.com/paritytech/substrate/issues/11367

Some points apart from what was mentioned in the issues. Also mentioned in updates to the README:

  • A indeterministic code can never be instantiated. Even during an off-chain execution where the change wouldn't be persisted in storage.
  • The set_code API call does not allow setting to an indeterministic contract. With the exception of the root call. We trust governance here.
  • The only allowed workflow is: upload_call-> bare_call. The runtime API also does not allow executing indeterministic code. A runtime need to build their own abstraction around pallet_contracts::Pallet::bare_call.
  • The default schedule does disable this feature (will fail at upload).

cc @kvinwang @h4x3rotab

athei avatar Oct 11 '22 11:10 athei

Fantastic! Thank you for the support. We cannot wait to test running serde_json in ink! 😎

h4x3rotab avatar Oct 12 '22 10:10 h4x3rotab

bot merge

athei avatar Oct 24 '22 17:10 athei

Error: "Check reviews" status is not passing for https://github.com/paritytech/cumulus/pull/1794

bot merge

athei avatar Oct 24 '22 17:10 athei