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
renamed Store Interface Load methods to Get (#1349)
closes: #1284
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- **Refactor**
- Updated method names for data retrieval across the application for
improved clarity and consistency.
- **Tests**
- Adjusted test cases to align with the updated method names in the data
retrieval process.
- **Documentation**
- Revised documentation to reflect the changes in method naming
conventions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: store/store.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,16 @@ The Store interface defines the following methods:
11
11
-`Height`: Returns the height of the highest block in the store.
12
12
-`SetHeight`: Sets given height in the store if it's higher than the existing height in the store.
13
13
-`SaveBlock`: Saves a block along with its seen commit.
14
-
-`LoadBlock`: Returns a block at a given height.
15
-
-`LoadBlockByHash`: Returns a block with a given block header hash.
14
+
-`GetBlock`: Returns a block at a given height.
15
+
-`GetBlockByHash`: Returns a block with a given block header hash.
16
16
-`SaveBlockResponses`: Saves block responses in the Store.
17
-
-`LoadBlockResponses`: Returns block results at a given height.
18
-
-`LoadCommit`: Returns a commit for a block at a given height.
19
-
-`LoadCommitByHash`: Returns a commit for a block with a given block header hash.
17
+
-`GetBlockResponses`: Returns block results at a given height.
18
+
-`GetCommit`: Returns a commit for a block at a given height.
19
+
-`GetCommitByHash`: Returns a commit for a block with a given block header hash.
20
20
-`UpdateState`: Updates the state saved in the Store. Only one State is stored.
21
-
-`LoadState`: Returns the last state saved with UpdateState.
21
+
-`GetState`: Returns the last state saved with UpdateState.
22
22
-`SaveValidators`: Saves the validator set at a given height.
23
-
-`LoadValidators`: Returns the validator set at a given height.
23
+
-`GetValidators`: Returns the validator set at a given height.
24
24
25
25
The `TxnDatastore` interface inside [go-datastore] is used for constructing different key-value stores for the underlying storage of a full node. The are two different implementations of `TxnDatastore` in [kv.go]:
26
26
@@ -39,7 +39,7 @@ For the main node data, `DefaultStore` struct, an implementation of the Store in
39
39
-`responsesPrefix` with value "r": Used to store responses related to the blocks.
40
40
-`validatorsPrefix` with value "v": Used to store validator sets at a given height.
41
41
42
-
For example, in a call to `LoadBlockByHash` for some block hash `<block_hash>`, the key used in the full node's base key-value store will be `/0/b/<block_hash>` where `0` is the main store prefix and `b` is the block prefix. Similarly, in a call to `LoadValidators` for some height `<height>`, the key used in the full node's base key-value store will be `/0/v/<height>` where `0` is the main store prefix and `v` is the validator set prefix.
42
+
For example, in a call to `GetBlockByHash` for some block hash `<block_hash>`, the key used in the full node's base key-value store will be `/0/b/<block_hash>` where `0` is the main store prefix and `b` is the block prefix. Similarly, in a call to `GetValidators` for some height `<height>`, the key used in the full node's base key-value store will be `/0/v/<height>` where `0` is the main store prefix and `v` is the validator set prefix.
43
43
44
44
Inside the key-value store, the value of these various types of data like `Block`, `Commit`, etc is stored as a byte array which is encoded and decoded using the corresponding Protobuf [marshal and unmarshal methods][serialization].
0 commit comments