entropyxyz / programs

Source, toolchain, and examples for using programs on Entropy
https://docs.entropy.xyz/concepts/programs/
GNU Affero General Public License v3.0
19 stars 3 forks source link

Remove bytecode from `Runtime` method signatures; consolidate bytecode sanitization in methods #44

Open jakehemmerle opened 9 months ago

jakehemmerle commented 9 months ago

Currently, the evaluate and custom_hash functions on Runtime take bytecode and santize and instantiate it each time the function is called. Among things, there are several lines of duplicated code.

We should change the new function to accept bytecode, or add an additional function, that does component validation and other checks once, and then lets us call either evaluate or custom_hash without having to include bytecode in the parameters.

jakehemmerle commented 9 months ago

This should be acompanied by a core PR that, among things, significantly simplifies the signature of the hash_from_signature_request function.