paritytech / json-rpc-interface-spec

29 stars 3 forks source link

Questions about `chainHead_unstable_storage` type `hash` & `descendants-hashes` #71

Closed josepot closed 1 year ago

josepot commented 1 year ago

I'm sure that I must be missing something, but I don't quite understand what the type hash is meant to return on a chainHead_unstable_storage item request.

Isn't the returned hash the same as the key that was being used for querying the hash? 🤔 If that's the case, then do we really need the type hash? I guess that it could be useful for determining whether an entry actually exists?

Also, if what I've said so far is correct, then: do we really need the hash property on the responded item? Wouldn't the value of the hash property always be identical to the value of the key property (for both hash and descendants-hashes responses)? 🤔

Again, I'm sure that I must be missing something 😬😅.

cc: @tomaka

tomaka commented 1 year ago

The hash is the hash of the value associated to the given key. For example, if you query the hash of :code, you get the hash of the runtime code.

josepot commented 1 year ago

The hash is the hash of the value associated to the given key

Ahhhhh! I see... Ok, now I get it! 😅 Thanks!