You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
System info: [Include Ethermint commit, operating system name, and other relevant details]
commit : 6e1c166
Steps to reproduce:
[First Step]
Calling GetHashFn(100) when current block height is 100
[Second Step]
Calling GetHashFn(100) when current block height is 101
[result]
There has two different hash value returned
Root cause:
after PR #538 merged, the hash of (height -> hash mapping) has changed from types.HashFromContext to req.Header.LastBlockId.GetHash()
But the code of GetHashFn was still using types.HashFromContext when getting hash for current block height:
funcGetHashFn(ctx sdk.Context, csdb*CommitStateDB) vm.GetHashFunc {
returnfunc(heightuint64) common.Hash {
switch {
casectx.BlockHeight() ==int64(height):
// Case 1: The requested height matches the one from the context so we can retrieve the header// hash directly from the context.returnHashFromContext(ctx)
casectx.BlockHeight() >int64(height):
// Case 2: if the chain is not the current height we need to retrieve the hash from the store for the// current chain epoch. This only applies if the current height is greater than the requested height.returncsdb.WithContext(ctx).GetHeightHash(height)
default:
// Case 3: heights greater than the current one returns an empty hash.return common.Hash{}
}
}
}
Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Additional info: [Include gist of relevant config, logs, etc.]
The text was updated successfully, but these errors were encountered:
System info: [Include Ethermint commit, operating system name, and other relevant details]
commit : 6e1c166
Steps to reproduce:
Calling
GetHashFn(100)
when current block height is 100Calling
GetHashFn(100)
when current block height is 101There has two different hash value returned
Root cause:
after PR #538 merged, the hash of (height -> hash mapping) has changed from
types.HashFromContext
toreq.Header.LastBlockId.GetHash()
But the code of GetHashFn was still using
types.HashFromContext
when getting hash for current block height:Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Additional info: [Include gist of relevant config, logs, etc.]
The text was updated successfully, but these errors were encountered: