Skip to content

Persist hash function in Environment #1820

@SkymanOne

Description

@SkymanOne

Originally raised by @cmichi

By default, ink! and corresponding tooling assumes that blake2 hasher is used. This is because it is default hasher set in pallet-system in substrate. It is quite possible that a chain can use a different hasher (like sha256or poseidon for ZKP).

This will cause an incorrect calculation of the metadata.

We need to introduce additional field in Environment trait that will persist a specific hasher used across the toolstack

### Tasks
- [ ] Introduce a hasher type/field in `Environment` trait
- [ ] Open issue in `cargo-contract` to use custom hasher or use the one specified in `Environment`
- [ ] Open issue in `contracts-ui` to validate that the correct hasher has been used

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions