Skip to content

Commit

Permalink
Specify merkle value (#89)
Browse files Browse the repository at this point in the history
* Specify merkle value

* Fix

* Update src/api/chainHead_unstable_follow.md

Co-authored-by: Pierre Krieger <[email protected]>

* Update src/api.md

Co-authored-by: Pierre Krieger <[email protected]>

---------

Co-authored-by: Pierre Krieger <[email protected]>
Co-authored-by: Josep M Sobrepere <[email protected]>
  • Loading branch information
3 people authored Sep 7, 2023
1 parent d6526a5 commit aae7190
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Any missing parameter, or parameter with an invalid format, should result in a J

- "hexadecimal-encoded" designates a binary value encoded as hexadecimal. The value must either be empty, or start with `"0x"` and contain an even number of characters.
- "SCALE-encoded" designates a value encoded using [the SCALE codec](https://docs.substrate.io/v3/advanced/scale-codec/).
- "Merkle value" is described in the [Polkadot specification](https://spec.polkadot.network/chap-state#defn-merkle-value).
2 changes: 1 addition & 1 deletion src/api/chainHead_unstable_follow.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ The `value` field is set if this item corresponds to one of the requested items

The `hash` field is set if this item corresponds to one of the requested items whose `type` was `"hash"` or `"descendantsHashes"`. The `hash` field is a string containing the hexadecimal-encoded hash of the storage entry.

The `closestDescendantMerkleValue` field is set if this item corresponds to one of the requested items whose `type` was `"closestDescendantMerkleValue"`. The trie node whose Merkle value is indicated in `closestDescendantMerkleValue` is not indicated, as determining the key of this node might incur an overhead for the JSON-RPC server.
The `closestDescendantMerkleValue` field is set if this item corresponds to one of the requested items whose `type` was `"closestDescendantMerkleValue"`. The trie node whose Merkle value is indicated in `closestDescendantMerkleValue` is not indicated, as determining the key of this node might incur an overhead for the JSON-RPC server. The Merkle value is equal to either the node value or the hash of the node value, as defined in the [Polkadot specification](https://spec.polkadot.network/chap-state#defn-merkle-value).

### operationWaitingForContinue

Expand Down
2 changes: 1 addition & 1 deletion src/api/chainHead_unstable_storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This function should be seen as a complement to `chainHead_unstable_follow`, all

If the `type` of an item is `value`, and `key` is associated with a storage value in the trie, then the result will include an item that contains this storage value. If `key` is not associated with a storage value in the trie, then the result will not include such item.

If the `type` of an item is `hash`, the behaviour is similar to a `type` equal to `value`, except that the cryptographic hash of the value is included in the result rather than the value itself. The hashing algorithm used is the one of the chain, which is typically blake2b. This can lead to significantly less bandwidth usage and can be used in order to compare the value of an item with a known hash and querying the full value only if it differs.
If the `type` of an item is `hash`, the behavior is similar to a `type` equal to `value`, except that the cryptographic hash of the value is included in the result rather than the value itself. The hashing algorithm used is the one of the chain, which is typically blake2b. This can lead to significantly less bandwidth usage and can be used in order to compare the value of an item with a known hash and querying the full value only if it differs.

If the `type` of an item is `descendantsValues` or `descendantsHashes`, then the result will contain zero or more items whose key starts with the `key` of this item.

Expand Down

0 comments on commit aae7190

Please sign in to comment.