From e769debbdce2c1885a2f92f74d8ff6cd0ca01b01 Mon Sep 17 00:00:00 2001 From: DrPeterVanNostrand Date: Fri, 4 Mar 2022 18:52:22 +0000 Subject: [PATCH] fix: hasher name should not include field --- filecoin-hashers/src/blake2s.rs | 7 +++++-- filecoin-hashers/src/poseidon.rs | 7 +++++-- filecoin-hashers/src/sha256.rs | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/filecoin-hashers/src/blake2s.rs b/filecoin-hashers/src/blake2s.rs index cf14b263e..7704f3402 100644 --- a/filecoin-hashers/src/blake2s.rs +++ b/filecoin-hashers/src/blake2s.rs @@ -498,6 +498,9 @@ impl Hasher for Blake2sHasher { type Domain = Blake2sDomain; type Function = Blake2sFunction; + // The hasher name should be the same for all fields. The hasher name is used to name the SDR + // parent-cache; graph parent generation is not affected by a hasher's field, thus the field + // name should not be included in the hasher name. fn name() -> String { "Blake2sHasher".into() } @@ -507,7 +510,7 @@ impl Hasher for Blake2sHasher { type Function = Blake2sFunction; fn name() -> String { - "Blake2sHasher_pallas".into() + "Blake2sHasher".into() } } impl Hasher for Blake2sHasher { @@ -515,6 +518,6 @@ impl Hasher for Blake2sHasher { type Function = Blake2sFunction; fn name() -> String { - "Blake2sHasher_vesta".into() + "Blake2sHasher".into() } } diff --git a/filecoin-hashers/src/poseidon.rs b/filecoin-hashers/src/poseidon.rs index e172ab1e4..58280c2b4 100644 --- a/filecoin-hashers/src/poseidon.rs +++ b/filecoin-hashers/src/poseidon.rs @@ -610,6 +610,9 @@ impl Hasher for PoseidonHasher { type Domain = PoseidonDomain; type Function = PoseidonFunction; + // The hasher name should be the same for all fields. The hasher name is used to name the SDR + // parent-cache; graph parent generation is not affected by a hasher's field, thus the field + // name should not be included in the hasher name. fn name() -> String { "poseidon_hasher".into() } @@ -619,7 +622,7 @@ impl Hasher for PoseidonHasher { type Function = PoseidonFunction; fn name() -> String { - "poseidon_hasher_pallas".into() + "poseidon_hasher".into() } } impl Hasher for PoseidonHasher { @@ -627,6 +630,6 @@ impl Hasher for PoseidonHasher { type Function = PoseidonFunction; fn name() -> String { - "poseidon_hasher_vesta".into() + "poseidon_hasher".into() } } diff --git a/filecoin-hashers/src/sha256.rs b/filecoin-hashers/src/sha256.rs index 289d46373..01ebfd823 100644 --- a/filecoin-hashers/src/sha256.rs +++ b/filecoin-hashers/src/sha256.rs @@ -526,6 +526,9 @@ impl Hasher for Sha256Hasher { type Domain = Sha256Domain; type Function = Sha256Function; + // The hasher name should be the same for all fields. The hasher name is used to name the SDR + // parent-cache; graph parent generation is not affected by a hasher's field, thus the field + // name should not be included in the hasher name. fn name() -> String { "sha256_hasher".into() } @@ -535,7 +538,7 @@ impl Hasher for Sha256Hasher { type Function = Sha256Function; fn name() -> String { - "sha256_hasher_pallas".into() + "sha256_hasher".into() } } impl Hasher for Sha256Hasher { @@ -543,6 +546,6 @@ impl Hasher for Sha256Hasher { type Function = Sha256Function; fn name() -> String { - "sha256_hasher_vesta".into() + "sha256_hasher".into() } }