// Among all 3 types: Output, OutputI, and OutputII, we define same Hash
// for all of them:
// 1. Only the OutputIdentifier is used for Hash.
// 2. All 3 types (Output, OutputI, OutputII) have same Hash result.
The benefit of this design is for the convenience of hash compare between all these types of OutputX and Input, but the consequence is the Output MMR will be same even if the detail of the OutputX are different! That definitely is NOT what we want.
Since the MMR hash always use the hash_with_index, we just need to remove the universal hash_with_index implementation which was:
impl<T: DefaultHashable> PMMRIndexHashable for T {
fn hash_with_index(&self, index: u64) -> Hash {
(index, self).hash()
}
}
And use the full data of Output / OutputI / OutputII for the specific hash_with_index function implementation.
This is a consensus breaking change and we have to re-generate a new Genesis again, I will do it in next PR soon.
Regarding to the following designed behaviour:
The benefit of this design is for the convenience of hash compare between all these types of OutputX and Input, but the consequence is the Output MMR will be same even if the detail of the OutputX are different! That definitely is NOT what we want.
Since the MMR hash always use the
hash_with_index
, we just need to remove the universalhash_with_index
implementation which was:And use the full data of Output / OutputI / OutputII for the specific
hash_with_index
function implementation.This is a consensus breaking change and we have to re-generate a new Genesis again, I will do it in next PR soon.