Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Allow off-chain indetermisim #12063

Closed
athei opened this issue Aug 18, 2022 · 0 comments · Fixed by #12469
Closed

Allow off-chain indetermisim #12063

athei opened this issue Aug 18, 2022 · 0 comments · Fixed by #12469
Assignees
Labels
J0-enhancement An additional feature request. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Comments

@athei
Copy link
Member

athei commented Aug 18, 2022

The Vision

Some users want to use contracts for number crunching (floats are banned cause of in-determinism) in off-chain situations. In these cases determinism is not required because the results are not subject to consensus.

In this case the requirement comes from the phala team who runs the contract in a secure enclave (off-chain) and wants allow users to to computation there.

The Plan

We allow for the upload of in-deterministic code blobs but prevent users from using them on-chain. Only when called off-chain (through bare_call with a specific flag) we allow the execution. Please note that those code blobs can never be instantiated into a contract cause that would require on-chain execution. The only way to use them is from another contract using seal_delegate_call. A code will be flagged in-deterministic on upload by adding a new dispatchable exactly for this reason. We don't change the existing upload_code for backwards compatibility reasons.

Original discussion: #11367

Open Questions

@athei athei added J0-enhancement An additional feature request. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels Aug 18, 2022
@athei athei moved this to Draft in Parity Roadmap Aug 18, 2022
@athei athei moved this from Draft to Open in Parity Roadmap Aug 18, 2022
@athei athei self-assigned this Aug 18, 2022
@athei athei moved this from Backlog 🗒 to In Progress 🛠 in Smart Contracts Sep 22, 2022
Repository owner moved this from In Progress 🛠 to Done ✅ in Smart Contracts Oct 24, 2022
Repository owner moved this from Open to Closed in Parity Roadmap Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant