Skip to content

Commit

Permalink
Merge branch 'main' into akhil/mint-system-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilkumarpilli committed Oct 17, 2024
2 parents b06f429 + f01baf3 commit 64e1f17
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion scripts/init-simapp-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -d "$SIMD_HOME" ]; then rm -rv $SIMD_HOME; fi
$SIMD_BIN config set client chain-id simapp-v2-chain
$SIMD_BIN config set client keyring-backend test
$SIMD_BIN config set client keyring-default-keyname alice
$SIMD_BIN config set app api.enable true
$SIMD_BIN config set app rest.enable true
$SIMD_BIN keys add alice --indiscreet
$SIMD_BIN keys add bob --indiscreet
$SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain
Expand Down
2 changes: 1 addition & 1 deletion server/v2/api/rest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
ServerName = "rest-v2"
ServerName = "rest"
)

type Server[T transaction.Tx] struct {
Expand Down
8 changes: 4 additions & 4 deletions server/v2/cometbft/internal/mock/mock_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
)

type MockStore struct {
Storage storev2.VersionedDatabase
Storage storev2.VersionedWriter
Committer storev2.Committer
}

func NewMockStorage(logger log.Logger, dir string) storev2.VersionedDatabase {
func NewMockStorage(logger log.Logger, dir string) storev2.VersionedWriter {
storageDB, _ := sqlite.New(dir)
ss := storage.NewStorageStore(storageDB, logger)
return ss
Expand All @@ -36,7 +36,7 @@ func NewMockCommiter(logger log.Logger, actors ...string) storev2.Committer {
return sc
}

func NewMockStore(ss storev2.VersionedDatabase, sc storev2.Committer) *MockStore {
func NewMockStore(ss storev2.VersionedWriter, sc storev2.Committer) *MockStore {
return &MockStore{Storage: ss, Committer: sc}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ func (s *MockStore) StateAt(version uint64) (corestore.ReaderMap, error) {
return NewMockReaderMap(version, s), nil
}

func (s *MockStore) GetStateStorage() storev2.VersionedDatabase {
func (s *MockStore) GetStateStorage() storev2.VersionedWriter {
return s.Storage
}

Expand Down
2 changes: 1 addition & 1 deletion store/v2/mock/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type StateCommitter interface {
store.UpgradeableStore
}

// StateStorage is a mock of store.VersionedDatabase
// StateStorage is a mock of store.VersionedWriter
type StateStorage interface {
store.VersionedWriter
store.UpgradableDatabase
Expand Down
8 changes: 4 additions & 4 deletions store/v2/storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The `storage` package contains the state storage (SS) implementation. Specifically,
it contains RocksDB, PebbleDB, and SQLite (Btree) backend implementations of the
`VersionedDatabase` interface.
`VersionedWriter` interface.

The goal of SS is to provide a modular storage backend, i.e. multiple implementations,
to facilitate storing versioned raw key/value pairs in a fast embedded database,
Expand All @@ -26,7 +26,7 @@ latest and historical versions efficiently.
### RocksDB

The RocksDB implementation is a CGO-based SS implementation. It fully supports
the `VersionedDatabase` API and is arguably the most efficient implementation. It
the `VersionedWriter` API and is arguably the most efficient implementation. It
also supports versioning out-of-the-box using User-defined Timestamps in
ColumnFamilies (CF). However, it requires the CGO dependency which can complicate
an app’s build process.
Expand All @@ -42,7 +42,7 @@ and does not require CGO.
### SQLite (Btree)

The SQLite implementation is another CGO-based SS implementation. It fully supports
the `VersionedDatabase` API. The implementation is relatively straightforward and
the `VersionedWriter` API. The implementation is relatively straightforward and
easy to understand as it’s entirely SQL-based. However, benchmarks show that this
options is least performant, even for reads. This SS backend has a lot of promise,
but needs more benchmarking and potential SQL optimizations, like dedicated tables
Expand Down Expand Up @@ -92,7 +92,7 @@ batch object which is committed to the underlying SS engine.

An SS backend is meant to be used within a broader store implementation, as it
only stores data for direct and historical query purposes. We define a `Database`
interface in the `storage` package which is mean to be represent a `VersionedDatabase`
interface in the `storage` package which is mean to be represent a `VersionedWriter`
with only the necessary methods. The `StorageStore` interface is meant to wrap or
accept this `Database` type, e.g. RocksDB.

Expand Down
2 changes: 1 addition & 1 deletion store/v2/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
_ store.UpgradableDatabase = (*StorageStore)(nil)
)

// StorageStore is a wrapper around the store.VersionedDatabase interface.
// StorageStore is a wrapper around the store.VersionedWriter interface.
type StorageStore struct {
logger log.Logger
db Database
Expand Down
6 changes: 6 additions & 0 deletions tools/confix/data/v2-app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ max-recv-msg-size = 10485760
# The default value is math.MaxInt32.
max-send-msg-size = 2147483647

[rest]
# Enable defines if the REST server should be enabled.
enable = true
# Address defines the REST server address to bind to.
address = 'localhost:8080'

[server]
# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2).
minimum-gas-prices = '0stake'
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ In order to create accounts at genesis, the `x/accounts` module allows developer
a list of genesis `MsgInit` messages that will be executed in the `x/accounts` genesis flow.

The init messages are generated offline. You can also use the following CLI command to generate the
json messages: `simd accounts tx init [account type] [msg] --from me --genesis`. This will generate
json messages: `simd tx accounts init [account type] [msg] --from me --genesis`. This will generate
a jsonified init message wrapped in an x/accounts `MsgInit`.

This follows the same initialization flow and rules that would happen if the chain is running.
Expand Down

0 comments on commit 64e1f17

Please sign in to comment.