Bumps [github.com/cosmos/gogoproto](https://github.com/cosmos/gogoproto) from 1.4.1 to 1.4.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cosmos/gogoproto/releases">github.com/cosmos/gogoproto's releases</a>.</em></p> <blockquote> <h2>v1.4.2</h2> <h3>Features</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/13">#13</a> Add <code>AllFileDescriptors</code> function.</li> </ul> <h3>Improvements</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Fix typo in <code>doc.go</code>.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Support for merging messages implementing Merger which are embedded by value.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Use reflect.Value.String() for String kinds in proto equal.</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cosmos/gogoproto/blob/main/CHANGELOG.md">github.com/cosmos/gogoproto's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/cosmos/gogoproto/releases/tag/v1.4.2">v1.4.2</a> - 2022-09-14</h2> <h3>Features</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/13">#13</a> Add <code>AllFileDescriptors</code> function.</li> </ul> <h3>Improvements</h3> <ul> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Fix typo in <code>doc.go</code>.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Support for merging messages implementing Merger which are embedded by value.</li> <li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Use reflect.Value.String() for String kinds in proto equal.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cosmos/gogoproto/commit/739310d858571659171cdd7b2ca8bea7076c7ff2"><code>739310d</code></a> docs: add changelog (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/15">#15</a>)</li> <li><a href="https://github.com/cosmos/gogoproto/commit/4f8afe8bcdc6a15f9890f6bb14b76d5b5b295cb5"><code>4f8afe8</code></a> feat: add AllFileDescriptors function (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/13">#13</a>)</li> <li><a href="https://github.com/cosmos/gogoproto/commit/27e576980886b16935ef005e856772fd51b3e7e3"><code>27e5769</code></a> ci: fix proto registry workflow (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/12">#12</a>)</li> <li><a href="https://github.com/cosmos/gogoproto/commit/c3a0399b5ef29be2bed06aa30827a024566fd652"><code>c3a0399</code></a> feat: cherry-pick improvements from <code>gogo/protobuf</code> (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/8">#8</a>)</li> <li><a href="https://github.com/cosmos/gogoproto/commit/ed9594ccc9df20896422046173e63cd25fb3ccd3"><code>ed9594c</code></a> chore: bump protobuf (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/9">#9</a>)</li> <li>See full diff in <a href="https://github.com/cosmos/gogoproto/compare/v1.4.1...v1.4.2">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
Store
CacheKV
cachekv.Store is a wrapper KVStore which provides buffered writing / cached reading functionalities over the underlying KVStore.
type Store struct {
cache map[string]cValue
parent types.KVStore
}
Get
Store.Get() checks Store.cache first in order to find if there is any cached value associated with the key. If the value exists, the function returns it. If not, the function calls Store.parent.Get(), sets the key-value pair in the Store.cache, and returns it.
Set
Store.Set() sets the key-value pair to the Store.cache. cValue has the field dirty bool which indicates whether the cached value is different from the underlying value. When Store.Set() cache new pair, the cValue.dirty is set true so when Store.Write() is called it can be written to the underlying store.
Iterator
Store.Iterator() have to traverse on both caches items and the original items. In Store.iterator(), two iterators are generated for each of them, and merged. memIterator is essentially a slice of the KVPairs, used for cached items. mergeIterator is a combination of two iterators, where traverse happens ordered on both iterators.
CacheMulti
cachemulti.Store is a wrapper MultiStore which provides buffered writing / cached reading functionalities over the underlying MutliStore
type Store struct {
db types.CacheKVStore
stores map[types.StoreKey] types.CacheWrap
}
cachemulti.Store branches all substores in its constructor and hold them in Store.stores. Store.GetKVStore() returns the store from Store.stores, and Store.Write() recursively calls CacheWrap.Write() on the substores.
DBAdapter
dbadapter.Store is a adapter for dbm.DB making it fulfilling the KVStore interface.
type Store struct {
dbm.DB
}
dbadapter.Store embeds dbm.DB, so most of the KVStore interface functions are implemented. The other functions(mostly miscellaneous) are manually implemented.
IAVL
iavl.Store is a base-layer self-balancing merkle tree. It is guaranteed that
- Get & set operations are
O(log n), wherenis the number of elements in the tree - Iteration efficiently returns the sorted elements within the range
- Each tree version is immutable and can be retrieved even after a commit(depending on the pruning settings)
Specification and implementation of IAVL tree can be found in https://github.com/cosmos/iavl.
GasKV
gaskv.Store is a wrapper KVStore which provides gas consuming functionalities over the underlying KVStore.
type Store struct {
gasMeter types.GasMeter
gasConfig types.GasConfig
parent types.KVStore
}
When each KVStore methods are called, gaskv.Store automatically consumes appropriate amount of gas depending on the Store.gasConfig.
Prefix
prefix.Store is a wrapper KVStore which provides automatic key-prefixing functionalities over the underlying KVStore.
type Store struct {
parent types.KVStore
prefix []byte
}
When Store.{Get, Set}() is called, the store forwards the call to its parent, with the key prefixed with the Store.prefix.
When Store.Iterator() is called, it does not simply prefix the Store.prefix, since it does not work as intended. In that case, some of the elements are traversed even they are not starting with the prefix.
RootMulti
rootmulti.Store is a base-layer MultiStore where multiple KVStore can be mounted on it and retrieved via object-capability keys. The keys are memory addresses, so it is impossible to forge the key unless an object is a valid owner(or a receiver) of the key, according to the object capability principles.
TraceKV
tracekv.Store is a wrapper KVStore which provides operation tracing functionalities over the underlying KVStore.
type Store struct {
parent types.KVStore
writer io.Writer
context types.TraceContext
}
When each KVStore methods are called, tracekv.Store automatically logs traceOperation to the Store.writer.
type traceOperation struct {
Operation operation
Key string
Value string
Metadata map[string]interface{}
}
traceOperation.Metadata is filled with Store.context when it is not nil. TraceContext is a map[string]interface{}.
Transient
transient.Store is a base-layer KVStore which is automatically discarded at the end of the block.
type Store struct {
dbadapter.Store
}
Store.Store is a dbadapter.Store with a dbm.NewMemDB(). All KVStore methods are reused. When Store.Commit() is called, new dbadapter.Store is assigned, discarding previous reference and making it garbage collected.