-
Notifications
You must be signed in to change notification settings - Fork 222
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
Host function generic_hash()
with blake2b/blake3 support.
#4412
Host function generic_hash()
with blake2b/blake3 support.
#4412
Commits on Nov 13, 2023
-
Install
blake3
package in execution_engine.Will be used to introduce hashing method for runtime.
Configuration menu - View commit details
-
Copy full SHA for 2dc1b1a - Browse repository at this point
Copy the full SHA 2dc1b1aView commit details -
Add blake3 hasher to execution engine.
Placed in new `crypto` module under `runtime`.
Configuration menu - View commit details
-
Copy full SHA for 930d0b8 - Browse repository at this point
Copy the full SHA 930d0b8View commit details -
Add
HashAlgoType
to base types.Will be used to switch between different hashing algorithms.
Configuration menu - View commit details
-
Copy full SHA for 356b5ca - Browse repository at this point
Copy the full SHA 356b5caView commit details -
Implement host function
GenericHash
.Note: no gas charging was introduced yet.
Configuration menu - View commit details
-
Copy full SHA for eb3eb45 - Browse repository at this point
Copy the full SHA eb3eb45View commit details -
Charge default cost for using
generic_hash
.Inspired by `FunctionIndex::Blake2b`, which is also not researched in terms of execution cost.
Configuration menu - View commit details
-
Copy full SHA for 267873a - Browse repository at this point
Copy the full SHA 267873aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f27876d - Browse repository at this point
Copy the full SHA f27876dView commit details -
Add
crypto::generic_hash()
to contract API.Note: new module `crypto` was introduced.
Configuration menu - View commit details
-
Copy full SHA for ef78d59 - Browse repository at this point
Copy the full SHA ef78d59View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d400ec - Browse repository at this point
Copy the full SHA 5d400ecView commit details
Commits on Nov 15, 2023
-
Use default features for
blake3
to utilize SIMD.Results in better performance. See https://github.com/BLAKE3-team/BLAKE3/blob/92e4cd71be48fdf9a79e88ef37b8f415ec5ac210/Cargo.toml#L21-L26 Co-authored-by: Michał Papierski <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8bd8fbb - Browse repository at this point
Copy the full SHA 8bd8fbbView commit details -
Update
HashAlgoType
description.Improved type documentation. Co-authored-by: Michał Papierski <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d38140f - Browse repository at this point
Copy the full SHA d38140fView commit details -
Pass
hash_algo_type
directly by value.We can avoid working with bytes and serialization, as `HashAlgoType` enum is represented by simple `u8`.
Configuration menu - View commit details
-
Copy full SHA for 2c70942 - Browse repository at this point
Copy the full SHA 2c70942View commit details
Commits on Nov 16, 2023
-
Fix signature (arguments length) in WASM resolver.
After passing `hash_algo_type` directly, we have one less parameter.
Configuration menu - View commit details
-
Copy full SHA for 4ec1f31 - Browse repository at this point
Copy the full SHA 4ec1f31View commit details
Commits on Nov 20, 2023
-
Change error type for
HashAlgoType::try_from
.It can be simple `()` instead of `bytesrepr::Error::Formatting` (the one commonly used for serialization related issues).
Configuration menu - View commit details
-
Copy full SHA for 85885d0 - Browse repository at this point
Copy the full SHA 85885d0View commit details -
Return
ApiError::InvalidArgument
for invalidhash_algo_type
.Previous deserializiation error was confusing. NOTE: The code seems too complex for such a basic thing like returning API error.
Configuration menu - View commit details
-
Copy full SHA for d064e2c - Browse repository at this point
Copy the full SHA d064e2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b85568 - Browse repository at this point
Copy the full SHA 4b85568View commit details