Skip to content
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

Persist hash function in Environment #1820

Open
SkymanOne opened this issue Jun 20, 2023 · 0 comments
Open

Persist hash function in Environment #1820

SkymanOne opened this issue Jun 20, 2023 · 0 comments
Labels
A-ink_metadata [ink_metadata] Work item B-enhancement New feature or request

Comments

@SkymanOne
Copy link
Contributor

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
@SkymanOne SkymanOne added B-enhancement New feature or request A-ink_metadata [ink_metadata] Work item labels Jun 20, 2023
@SkymanOne SkymanOne mentioned this issue Jan 10, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ink_metadata [ink_metadata] Work item B-enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant