diff --git a/api/keystore/keystore.go b/api/keystore/keystore.go index fe3bee0e9dc0..cd7f0b8a8f21 100644 --- a/api/keystore/keystore.go +++ b/api/keystore/keystore.go @@ -14,7 +14,6 @@ import ( "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/database/encdb" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/json" @@ -105,13 +104,12 @@ type keystore struct { bcDB database.Database } -func New(log logging.Logger, dbManager manager.Manager) Keystore { - currentDB := dbManager.Current() +func New(log logging.Logger, db database.Database) Keystore { return &keystore{ log: log, usernameToPassword: make(map[string]*password.Hash), - userDB: prefixdb.New(usersPrefix, currentDB.Database), - bcDB: prefixdb.New(bcsPrefix, currentDB.Database), + userDB: prefixdb.New(usersPrefix, db), + bcDB: prefixdb.New(bcsPrefix, db), } } diff --git a/api/keystore/service.go b/api/keystore/service.go index c0e823c22e7f..d4c845743bbb 100644 --- a/api/keystore/service.go +++ b/api/keystore/service.go @@ -10,11 +10,8 @@ import ( "go.uber.org/zap" "github.com/ava-labs/avalanchego/api" - "github.com/ava-labs/avalanchego/database/manager" - "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/utils/formatting" "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/version" ) type service struct { @@ -115,17 +112,3 @@ func (s *service) ExportUser(_ *http.Request, args *ExportUserArgs, reply *Expor reply.Encoding = args.Encoding return nil } - -// CreateTestKeystore returns a new keystore that can be utilized for testing -func CreateTestKeystore() (Keystore, error) { - dbManager, err := manager.NewManagerFromDBs([]*manager.VersionedDatabase{ - { - Database: memdb.New(), - Version: version.Semantic1_0_0, - }, - }) - if err != nil { - return nil, err - } - return New(logging.NoLog{}, dbManager), nil -} diff --git a/api/keystore/service_test.go b/api/keystore/service_test.go index 0a3eef5687a4..842ab7d76cc7 100644 --- a/api/keystore/service_test.go +++ b/api/keystore/service_test.go @@ -11,8 +11,10 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/api" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/utils/formatting" + "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/password" ) @@ -23,8 +25,7 @@ var strongPassword = "N_+=_jJ;^(<;{4,:*m6CET}'&N;83FYK.wtNpwp-Jt" // #nosec G101 func TestServiceListNoUsers(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} reply := ListUsersReply{} @@ -35,8 +36,7 @@ func TestServiceListNoUsers(t *testing.T) { func TestServiceCreateUser(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -66,8 +66,7 @@ func genStr(n int) string { func TestServiceCreateUserArgsCheck(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -100,8 +99,7 @@ func TestServiceCreateUserArgsCheck(t *testing.T) { func TestServiceCreateUserWeakPassword(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -117,8 +115,7 @@ func TestServiceCreateUserWeakPassword(t *testing.T) { func TestServiceCreateDuplicate(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -140,12 +137,11 @@ func TestServiceCreateDuplicate(t *testing.T) { func TestServiceCreateUserNoName(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} reply := api.EmptyReply{} - err = s.CreateUser(nil, &api.UserPass{ + err := s.CreateUser(nil, &api.UserPass{ Password: strongPassword, }, &reply) require.ErrorIs(err, errEmptyUsername) @@ -154,8 +150,7 @@ func TestServiceCreateUserNoName(t *testing.T) { func TestServiceUseBlockchainDB(t *testing.T) { require := require.New(t) - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -185,8 +180,7 @@ func TestServiceExportImport(t *testing.T) { encodings := []formatting.Encoding{formatting.Hex} for _, encoding := range encodings { - ks, err := CreateTestKeystore() - require.NoError(err) + ks := New(logging.NoLog{}, memdb.New()) s := service{ks: ks.(*keystore)} { @@ -212,8 +206,7 @@ func TestServiceExportImport(t *testing.T) { exportReply := ExportUserReply{} require.NoError(s.ExportUser(nil, &exportArgs, &exportReply)) - newKS, err := CreateTestKeystore() - require.NoError(err) + newKS := New(logging.NoLog{}, memdb.New()) newS := service{ks: newKS.(*keystore)} { @@ -324,8 +317,7 @@ func TestServiceDeleteUser(t *testing.T) { t.Run(tt.desc, func(t *testing.T) { require := require.New(t) - ksIntf, err := CreateTestKeystore() - require.NoError(err) + ksIntf := New(logging.NoLog{}, memdb.New()) ks := ksIntf.(*keystore) s := service{ks: ks} @@ -333,7 +325,7 @@ func TestServiceDeleteUser(t *testing.T) { require.NoError(tt.setup(ks)) } got := &api.EmptyReply{} - err = s.DeleteUser(nil, tt.request, got) + err := s.DeleteUser(nil, tt.request, got) require.ErrorIs(err, tt.expectedErr) if tt.expectedErr != nil { return diff --git a/chains/linearizable_vm.go b/chains/linearizable_vm.go index ebe2652cfb1d..f4fc93f7a696 100644 --- a/chains/linearizable_vm.go +++ b/chains/linearizable_vm.go @@ -7,13 +7,12 @@ import ( "context" "github.com/ava-labs/avalanchego/api/metrics" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - - dbManager "github.com/ava-labs/avalanchego/database/manager" ) var ( @@ -32,7 +31,7 @@ type initializeOnLinearizeVM struct { registerer metrics.OptionalGatherer ctx *snow.Context - dbManager dbManager.Manager + db database.Database genesisBytes []byte upgradeBytes []byte configBytes []byte @@ -47,7 +46,7 @@ func (vm *initializeOnLinearizeVM) Linearize(ctx context.Context, stopVertexID i return vm.vmToInitialize.Initialize( ctx, vm.ctx, - vm.dbManager, + vm.db, vm.genesisBytes, vm.upgradeBytes, vm.configBytes, @@ -74,7 +73,7 @@ func NewLinearizeOnInitializeVM(vm vertex.LinearizableVMWithEngine) *linearizeOn func (vm *linearizeOnInitializeVM) Initialize( ctx context.Context, _ *snow.Context, - _ dbManager.Manager, + _ database.Database, _ []byte, _ []byte, _ []byte, diff --git a/chains/manager.go b/chains/manager.go index 2234e82aadcc..85472e424222 100644 --- a/chains/manager.go +++ b/chains/manager.go @@ -23,6 +23,8 @@ import ( "github.com/ava-labs/avalanchego/api/metrics" "github.com/ava-labs/avalanchego/api/server" "github.com/ava-labs/avalanchego/chains/atomic" + "github.com/ava-labs/avalanchego/database" + "github.com/ava-labs/avalanchego/database/meterdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/message" @@ -57,7 +59,6 @@ import ( "github.com/ava-labs/avalanchego/vms/proposervm" "github.com/ava-labs/avalanchego/vms/tracedvm" - dbManager "github.com/ava-labs/avalanchego/database/manager" timetracker "github.com/ava-labs/avalanchego/snow/networking/tracker" aveng "github.com/ava-labs/avalanchego/snow/engine/avalanche" @@ -180,7 +181,7 @@ type ManagerConfig struct { BlockAcceptorGroup snow.AcceptorGroup TxAcceptorGroup snow.AcceptorGroup VertexAcceptorGroup snow.AcceptorGroup - DBManager dbManager.Manager + DB database.Database MsgCreator message.OutboundMsgBuilder // message creator, shared with network Router router.Router // Routes incoming messages to the appropriate chain Net network.Network // Sends consensus messages to other validators @@ -596,18 +597,16 @@ func (m *manager) createAvalancheChain( State: snow.Initializing, }) - meterDBManager, err := m.DBManager.NewMeterDBManager("db", ctx.Registerer) + meterDB, err := meterdb.New("db", ctx.Registerer, m.DB) if err != nil { return nil, err } - prefixDBManager := meterDBManager.NewPrefixDBManager(ctx.ChainID[:]) - vmDBManager := prefixDBManager.NewPrefixDBManager(vmDBPrefix) - - db := prefixDBManager.Current() - vertexDB := prefixdb.New(vertexDBPrefix, db.Database) - vertexBootstrappingDB := prefixdb.New(vertexBootstrappingDBPrefix, db.Database) - txBootstrappingDB := prefixdb.New(txBootstrappingDBPrefix, db.Database) - blockBootstrappingDB := prefixdb.New(blockBootstrappingDBPrefix, db.Database) + prefixDB := prefixdb.New(ctx.ChainID[:], meterDB) + vmDB := prefixdb.New(vmDBPrefix, prefixDB) + vertexDB := prefixdb.New(vertexDBPrefix, prefixDB) + vertexBootstrappingDB := prefixdb.New(vertexBootstrappingDBPrefix, prefixDB) + txBootstrappingDB := prefixdb.New(txBootstrappingDBPrefix, prefixDB) + blockBootstrappingDB := prefixdb.New(blockBootstrappingDBPrefix, prefixDB) vtxBlocker, err := queue.NewWithMissing(vertexBootstrappingDB, "vtx", ctx.AvalancheRegisterer) if err != nil { @@ -730,7 +729,7 @@ func (m *manager) createAvalancheChain( err = dagVM.Initialize( context.TODO(), ctx.Context, - vmDBManager, + vmDB, genesisData, chainConfig.Upgrade, chainConfig.Config, @@ -796,7 +795,7 @@ func (m *manager) createAvalancheChain( registerer: snowmanRegisterer, ctx: ctx.Context, - dbManager: vmDBManager, + db: vmDB, genesisBytes: genesisData, upgradeBytes: chainConfig.Upgrade, configBytes: chainConfig.Config, @@ -1004,15 +1003,13 @@ func (m *manager) createSnowmanChain( State: snow.Initializing, }) - meterDBManager, err := m.DBManager.NewMeterDBManager("db", ctx.Registerer) + meterDB, err := meterdb.New("db", ctx.Registerer, m.DB) if err != nil { return nil, err } - prefixDBManager := meterDBManager.NewPrefixDBManager(ctx.ChainID[:]) - vmDBManager := prefixDBManager.NewPrefixDBManager(vmDBPrefix) - - db := prefixDBManager.Current() - bootstrappingDB := prefixdb.New(bootstrappingDB, db.Database) + prefixDB := prefixdb.New(ctx.ChainID[:], meterDB) + vmDB := prefixdb.New(vmDBPrefix, prefixDB) + bootstrappingDB := prefixdb.New(bootstrappingDB, prefixDB) blocked, err := queue.NewWithMissing(bootstrappingDB, "block", ctx.Registerer) if err != nil { @@ -1145,7 +1142,7 @@ func (m *manager) createSnowmanChain( if err := vm.Initialize( context.TODO(), ctx.Context, - vmDBManager, + vmDB, genesisData, chainConfig.Upgrade, chainConfig.Config, diff --git a/database/manager/manager.go b/database/manager/manager.go deleted file mode 100644 index fd9c36969b79..000000000000 --- a/database/manager/manager.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package manager - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/corruptabledb" - "github.com/ava-labs/avalanchego/database/leveldb" - "github.com/ava-labs/avalanchego/database/memdb" - "github.com/ava-labs/avalanchego/database/meterdb" - "github.com/ava-labs/avalanchego/database/prefixdb" - "github.com/ava-labs/avalanchego/utils" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/utils/wrappers" - "github.com/ava-labs/avalanchego/version" -) - -var ( - errNonSortedAndUniqueDBs = errors.New("managed databases were not sorted and unique") - errNoDBs = errors.New("no dbs given") -) - -var _ Manager = (*manager)(nil) - -type Manager interface { - // Current returns the database with the current database version. - Current() *VersionedDatabase - - // Previous returns the database prior to the current database and true if a - // previous database exists. - Previous() (*VersionedDatabase, bool) - - // GetDatabases returns all the managed databases in order from current to - // the oldest version. - GetDatabases() []*VersionedDatabase - - // Close all of the databases controlled by the manager. - Close() error - - // NewPrefixDBManager returns a new database manager with each of its - // databases prefixed with [prefix]. - NewPrefixDBManager(prefix []byte) Manager - - // NewNestedPrefixDBManager returns a new database manager where each of its - // databases has the nested prefix [prefix] applied to it. - NewNestedPrefixDBManager(prefix []byte) Manager - - // NewMeterDBManager returns a new database manager with each of its - // databases wrapped with a meterdb instance to support metrics on database - // performance. - NewMeterDBManager(namespace string, registerer prometheus.Registerer) (Manager, error) - - // NewCompleteMeterDBManager wraps each database instance with a meterdb - // instance. The namespace is concatenated with the version of the database. - // Note: calling this more than once with the same [namespace] will cause a - // conflict error for the [registerer]. - NewCompleteMeterDBManager(namespace string, registerer prometheus.Registerer) (Manager, error) -} - -type manager struct { - // databases with the current version at index 0 and prior versions in - // descending order - // invariant: len(databases) > 0 - databases []*VersionedDatabase -} - -// NewLevelDB creates a database manager of levelDBs at [filePath] by creating a -// database instance from each directory with a version <= [currentVersion]. If -// [includePreviousVersions], opens previous database versions and includes them -// in the returned Manager. -func NewLevelDB( - dbDirPath string, - dbConfig []byte, - log logging.Logger, - currentVersion *version.Semantic, - namespace string, - reg prometheus.Registerer, -) (Manager, error) { - return new( - leveldb.New, - dbDirPath, - dbConfig, - log, - currentVersion, - namespace, - reg, - ) -} - -// new creates a database manager at [filePath] by creating a database instance -// from each directory with a version <= [currentVersion]. If -// [includePreviousVersions], opens previous database versions and includes them -// in the returned Manager. -func new( - newDB func(string, []byte, logging.Logger, string, prometheus.Registerer) (database.Database, error), - dbDirPath string, - dbConfig []byte, - log logging.Logger, - currentVersion *version.Semantic, - namespace string, - reg prometheus.Registerer, -) (Manager, error) { - currentDBPath := filepath.Join(dbDirPath, currentVersion.String()) - - currentDB, err := newDB(currentDBPath, dbConfig, log, namespace, reg) - if err != nil { - return nil, fmt.Errorf("couldn't create db at %s: %w", currentDBPath, err) - } - - wrappedDB := corruptabledb.New(currentDB) - - manager := &manager{ - databases: []*VersionedDatabase{ - { - Database: wrappedDB, - Version: currentVersion, - }, - }, - } - - // Open old database versions and add them to [manager] - err = filepath.Walk(dbDirPath, func(path string, info os.FileInfo, err error) error { - // the walkFn is called with a non-nil error argument if an os.Lstat - // or Readdirnames call returns an error. Both cases are considered - // fatal in the traversal. - // Reference: https://golang.org/pkg/path/filepath/#WalkFunc - if err != nil { - return err - } - // Skip the root directory - if path == dbDirPath { - return nil - } - - // If the database directory contains any files, ignore them. - if !info.IsDir() { - return nil - } - _, dbName := filepath.Split(path) - dbVersion, err := version.Parse(dbName) - if err != nil { - // If the database directory contains any directories that don't - // match the expected version format, ignore them. - return filepath.SkipDir - } - - // If [dbVersion] is greater than or equal to the specified version - // skip over creating the new database to avoid creating the same db - // twice or creating a database with a version ahead of the desired one. - if cmp := dbVersion.Compare(currentVersion); cmp >= 0 { - return filepath.SkipDir - } - - versionStr := strings.ReplaceAll(dbName, ".", "_") - var dbNamespace string - if len(namespace) > 0 { - dbNamespace = fmt.Sprintf("%s_%s", namespace, versionStr) - } else { - dbNamespace = versionStr - } - - db, err := newDB(path, dbConfig, log, dbNamespace, reg) - if err != nil { - return fmt.Errorf("couldn't create db at %s: %w", path, err) - } - - manager.databases = append(manager.databases, &VersionedDatabase{ - Database: corruptabledb.New(db), - Version: dbVersion, - }) - - return filepath.SkipDir - }) - utils.Sort(manager.databases) - - // If an error occurred walking [dbDirPath] close the - // database manager and return the original error here. - if err != nil { - _ = manager.Close() - return nil, err - } - - return manager, nil -} - -// NewMemDB returns a database manager with a single memdb instance with -// [currentVersion]. -func NewMemDB(currentVersion *version.Semantic) Manager { - return &manager{ - databases: []*VersionedDatabase{ - { - Database: memdb.New(), - Version: currentVersion, - }, - }, - } -} - -// NewManagerFromDBs -func NewManagerFromDBs(dbs []*VersionedDatabase) (Manager, error) { - if len(dbs) == 0 { - return nil, errNoDBs - } - utils.Sort(dbs) - sortedAndUnique := utils.IsSortedAndUnique(dbs) - if !sortedAndUnique { - return nil, errNonSortedAndUniqueDBs - } - return &manager{ - databases: dbs, - }, nil -} - -func (m *manager) Current() *VersionedDatabase { - return m.databases[0] -} - -func (m *manager) Previous() (*VersionedDatabase, bool) { - if len(m.databases) < 2 { - return nil, false - } - return m.databases[1], true -} - -func (m *manager) GetDatabases() []*VersionedDatabase { - return m.databases -} - -func (m *manager) Close() error { - errs := wrappers.Errs{} - for _, db := range m.databases { - errs.Add(db.Close()) - } - return errs.Err -} - -// NewPrefixDBManager creates a new manager with each database instance prefixed -// by [prefix] -func (m *manager) NewPrefixDBManager(prefix []byte) Manager { - m, _ = m.wrapManager(func(vdb *VersionedDatabase) (*VersionedDatabase, error) { - return &VersionedDatabase{ - Database: prefixdb.New(prefix, vdb.Database), - Version: vdb.Version, - }, nil - }) - return m -} - -// NewNestedPrefixDBManager creates a new manager with each database instance -// wrapped with a nested prfix of [prefix] -func (m *manager) NewNestedPrefixDBManager(prefix []byte) Manager { - m, _ = m.wrapManager(func(vdb *VersionedDatabase) (*VersionedDatabase, error) { - return &VersionedDatabase{ - Database: prefixdb.NewNested(prefix, vdb.Database), - Version: vdb.Version, - }, nil - }) - return m -} - -// NewMeterDBManager wraps the current database instance with a meterdb instance. -// Note: calling this more than once with the same [namespace] will cause a conflict error for the [registerer] -func (m *manager) NewMeterDBManager(namespace string, registerer prometheus.Registerer) (Manager, error) { - currentDB := m.Current() - currentMeterDB, err := meterdb.New(namespace, registerer, currentDB.Database) - if err != nil { - return nil, err - } - newManager := &manager{ - databases: make([]*VersionedDatabase, len(m.databases)), - } - copy(newManager.databases[1:], m.databases[1:]) - // Overwrite the current database with the meter DB - newManager.databases[0] = &VersionedDatabase{ - Database: currentMeterDB, - Version: currentDB.Version, - } - return newManager, nil -} - -// NewCompleteMeterDBManager wraps each database instance with a meterdb instance. The namespace -// is concatenated with the version of the database. Note: calling this more than once -// with the same [namespace] will cause a conflict error for the [registerer] -func (m *manager) NewCompleteMeterDBManager(namespace string, registerer prometheus.Registerer) (Manager, error) { - return m.wrapManager(func(vdb *VersionedDatabase) (*VersionedDatabase, error) { - mdb, err := meterdb.New(fmt.Sprintf("%s_%s", namespace, strings.ReplaceAll(vdb.Version.String(), ".", "_")), registerer, vdb.Database) - if err != nil { - return nil, err - } - return &VersionedDatabase{ - Database: mdb, - Version: vdb.Version, - }, nil - }) -} - -// wrapManager returns a new database manager with each managed database wrapped -// by the [wrap] function. If an error is returned by wrap, the error is -// returned immediately. If [wrap] never returns an error, then wrapManager is -// guaranteed to never return an error. The function wrap must return a database -// that can be closed without closing the underlying database. -func (m *manager) wrapManager(wrap func(db *VersionedDatabase) (*VersionedDatabase, error)) (*manager, error) { - newManager := &manager{ - databases: make([]*VersionedDatabase, 0, len(m.databases)), - } - for _, db := range m.databases { - wrappedDB, err := wrap(db) - if err != nil { - // ignore additional errors in favor of returning the original error - _ = newManager.Close() - return nil, err - } - newManager.databases = append(newManager.databases, wrappedDB) - } - return newManager, nil -} diff --git a/database/manager/manager_test.go b/database/manager/manager_test.go deleted file mode 100644 index 5e7986b27416..000000000000 --- a/database/manager/manager_test.go +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package manager - -import ( - "os" - "path/filepath" - "testing" - - "github.com/prometheus/client_golang/prometheus" - - "github.com/stretchr/testify/require" - - "github.com/ava-labs/avalanchego/database/leveldb" - "github.com/ava-labs/avalanchego/database/memdb" - "github.com/ava-labs/avalanchego/database/meterdb" - "github.com/ava-labs/avalanchego/database/prefixdb" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/utils/metric" - "github.com/ava-labs/avalanchego/version" -) - -func TestNewSingleLevelDB(t *testing.T) { - require := require.New(t) - dir := t.TempDir() - - v1 := version.Semantic1_0_0 - - dbPath := filepath.Join(dir, v1.String()) - db, err := leveldb.New(dbPath, nil, logging.NoLog{}, "", prometheus.NewRegistry()) - require.NoError(err) - - require.NoError(db.Close()) - - manager, err := NewLevelDB(dir, nil, logging.NoLog{}, v1, "", prometheus.NewRegistry()) - require.NoError(err) - - semDB := manager.Current() - require.Zero(semDB.Version.Compare(v1)) - - _, exists := manager.Previous() - require.False(exists) - require.Len(manager.GetDatabases(), 1) - - require.NoError(manager.Close()) -} - -func TestNewCreatesSingleDB(t *testing.T) { - require := require.New(t) - - dir := t.TempDir() - - v1 := version.Semantic1_0_0 - - manager, err := NewLevelDB(dir, nil, logging.NoLog{}, v1, "", prometheus.NewRegistry()) - require.NoError(err) - - semDB := manager.Current() - require.Zero(semDB.Version.Compare(v1)) - - _, exists := manager.Previous() - require.False(exists) - - require.Len(manager.GetDatabases(), 1) - - require.NoError(manager.Close()) -} - -func TestNewInvalidMemberPresent(t *testing.T) { - require := require.New(t) - - dir := t.TempDir() - - v1 := &version.Semantic{ - Major: 1, - Minor: 1, - Patch: 0, - } - v2 := &version.Semantic{ - Major: 1, - Minor: 2, - Patch: 0, - } - - dbPath1 := filepath.Join(dir, v1.String()) - db1, err := leveldb.New(dbPath1, nil, logging.NoLog{}, "", prometheus.NewRegistry()) - require.NoError(err) - - dbPath2 := filepath.Join(dir, v2.String()) - db2, err := leveldb.New(dbPath2, nil, logging.NoLog{}, "", prometheus.NewRegistry()) - require.NoError(err) - - require.NoError(db2.Close()) - - _, err = NewLevelDB(dir, nil, logging.NoLog{}, v2, "", prometheus.NewRegistry()) - require.ErrorIs(err, leveldb.ErrCouldNotOpen) - - require.NoError(db1.Close()) - - f, err := os.Create(filepath.Join(dir, "dummy")) - require.NoError(err) - - require.NoError(f.Close()) - - db, err := NewLevelDB(dir, nil, logging.NoLog{}, v1, "", prometheus.NewRegistry()) - require.NoError(err, "expected not to error with a non-directory file being present") - - require.NoError(db.Close()) -} - -func TestNewSortsDatabases(t *testing.T) { - require := require.New(t) - - dir := t.TempDir() - - vers := []*version.Semantic{ - { - Major: 2, - Minor: 1, - Patch: 2, - }, - { - Major: 2, - Minor: 0, - Patch: 2, - }, - { - Major: 1, - Minor: 3, - Patch: 2, - }, - { - Major: 1, - Minor: 0, - Patch: 2, - }, - { - Major: 1, - Minor: 0, - Patch: 1, - }, - } - - for _, version := range vers { - dbPath := filepath.Join(dir, version.String()) - db, err := leveldb.New(dbPath, nil, logging.NoLog{}, "", prometheus.NewRegistry()) - require.NoError(err) - - require.NoError(db.Close()) - } - - manager, err := NewLevelDB(dir, nil, logging.NoLog{}, vers[0], "", prometheus.NewRegistry()) - require.NoError(err) - - defer func() { - require.NoError(manager.Close()) - }() - - semDB := manager.Current() - require.Zero(semDB.Version.Compare(vers[0])) - - prev, exists := manager.Previous() - require.True(exists) - require.Zero(prev.Version.Compare(vers[1])) - - dbs := manager.GetDatabases() - require.Len(dbs, len(vers)) - - for i, db := range dbs { - require.Zero(db.Version.Compare(vers[i])) - } -} - -func TestPrefixDBManager(t *testing.T) { - require := require.New(t) - - db := memdb.New() - - prefix0 := []byte{0} - db0 := prefixdb.New(prefix0, db) - - prefix1 := []byte{1} - db1 := prefixdb.New(prefix1, db0) - - k0 := []byte{'s', 'c', 'h', 'n', 'i'} - v0 := []byte{'t', 'z', 'e', 'l'} - k1 := []byte{'c', 'u', 'r', 'r', 'y'} - v1 := []byte{'w', 'u', 'r', 's', 't'} - - require.NoError(db0.Put(k0, v0)) - require.NoError(db1.Put(k1, v1)) - require.NoError(db0.Close()) - require.NoError(db1.Close()) - - m := &manager{databases: []*VersionedDatabase{ - { - Database: db, - Version: version.Semantic1_0_0, - }, - }} - - m0 := m.NewPrefixDBManager(prefix0) - m1 := m0.NewPrefixDBManager(prefix1) - - val, err := m0.Current().Database.Get(k0) - require.NoError(err) - require.Equal(v0, val) - - val, err = m1.Current().Database.Get(k1) - require.NoError(err) - require.Equal(v1, val) -} - -func TestNestedPrefixDBManager(t *testing.T) { - require := require.New(t) - - db := memdb.New() - - prefix0 := []byte{0} - db0 := prefixdb.NewNested(prefix0, db) - - prefix1 := []byte{1} - db1 := prefixdb.NewNested(prefix1, db0) - - k0 := []byte{'s', 'c', 'h', 'n', 'i'} - v0 := []byte{'t', 'z', 'e', 'l'} - k1 := []byte{'c', 'u', 'r', 'r', 'y'} - v1 := []byte{'w', 'u', 'r', 's', 't'} - - require.NoError(db0.Put(k0, v0)) - require.NoError(db1.Put(k1, v1)) - require.NoError(db0.Close()) - require.NoError(db1.Close()) - - m := &manager{databases: []*VersionedDatabase{ - { - Database: db, - Version: version.Semantic1_0_0, - }, - }} - - m0 := m.NewNestedPrefixDBManager(prefix0) - m1 := m0.NewNestedPrefixDBManager(prefix1) - - val, err := m0.Current().Database.Get(k0) - require.NoError(err) - require.Equal(v0, val) - - val, err = m1.Current().Database.Get(k1) - require.NoError(err) - require.Equal(v1, val) -} - -func TestMeterDBManager(t *testing.T) { - require := require.New(t) - - registry := prometheus.NewRegistry() - - m := &manager{databases: []*VersionedDatabase{ - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 2, - Minor: 0, - Patch: 0, - }, - }, - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 1, - Minor: 5, - Patch: 0, - }, - }, - { - Database: memdb.New(), - Version: version.Semantic1_0_0, - }, - }} - - // Create meterdb manager with fresh registry and confirm - // that there are no errors registering metrics for multiple - // versioned databases. - manager, err := m.NewMeterDBManager("", registry) - require.NoError(err) - - dbs := manager.GetDatabases() - require.Len(dbs, 3) - - require.IsType(&meterdb.Database{}, dbs[0].Database) - require.IsType(&memdb.Database{}, dbs[1].Database) - require.IsType(&memdb.Database{}, dbs[2].Database) - - // Confirm that the error from a name conflict is handled correctly - _, err = m.NewMeterDBManager("", registry) - require.ErrorIs(err, metric.ErrFailedRegistering) -} - -func TestCompleteMeterDBManager(t *testing.T) { - require := require.New(t) - - registry := prometheus.NewRegistry() - - m := &manager{databases: []*VersionedDatabase{ - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 2, - Minor: 0, - Patch: 0, - }, - }, - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 1, - Minor: 5, - Patch: 0, - }, - }, - { - Database: memdb.New(), - Version: version.Semantic1_0_0, - }, - }} - - // Create complete meterdb manager with fresh registry and confirm - // that there are no errors registering metrics for multiple - // versioned databases. - manager, err := m.NewCompleteMeterDBManager("", registry) - require.NoError(err) - - dbs := manager.GetDatabases() - require.Len(dbs, 3) - - require.IsType(&meterdb.Database{}, dbs[0].Database) - require.IsType(&meterdb.Database{}, dbs[1].Database) - require.IsType(&meterdb.Database{}, dbs[2].Database) - - // Confirm that the error from a name conflict is handled correctly - _, err = m.NewCompleteMeterDBManager("", registry) - require.ErrorIs(err, metric.ErrFailedRegistering) -} - -func TestNewManagerFromDBs(t *testing.T) { - require := require.New(t) - - versions := []*version.Semantic{ - { - Major: 3, - Minor: 2, - Patch: 0, - }, - { - Major: 1, - Minor: 2, - Patch: 0, - }, - { - Major: 1, - Minor: 1, - Patch: 1, - }, - } - m, err := NewManagerFromDBs( - []*VersionedDatabase{ - { - Database: memdb.New(), - Version: versions[2], - }, - { - Database: memdb.New(), - Version: versions[1], - }, - { - Database: memdb.New(), - Version: versions[0], - }, - }) - require.NoError(err) - - dbs := m.GetDatabases() - require.Len(dbs, len(versions)) - for i, db := range dbs { - require.Zero(db.Version.Compare(versions[i])) - } -} - -func TestNewManagerFromNoDBs(t *testing.T) { - require := require.New(t) - // Should error if no dbs are given - _, err := NewManagerFromDBs(nil) - require.ErrorIs(err, errNoDBs) -} - -func TestNewManagerFromNonUniqueDBs(t *testing.T) { - require := require.New(t) - - _, err := NewManagerFromDBs( - []*VersionedDatabase{ - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 1, - Minor: 1, - Patch: 0, - }, - }, - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 1, - Minor: 1, - Patch: 0, - }, // Duplicate - }, - { - Database: memdb.New(), - Version: &version.Semantic{ - Major: 1, - Minor: 2, - Patch: 0, - }, - }, - }) - require.ErrorIs(err, errNonSortedAndUniqueDBs) -} diff --git a/database/manager/versioned_database.go b/database/manager/versioned_database.go deleted file mode 100644 index 6ff983a95a92..000000000000 --- a/database/manager/versioned_database.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package manager - -import ( - "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/utils" - "github.com/ava-labs/avalanchego/version" -) - -var _ utils.Sortable[*VersionedDatabase] = (*VersionedDatabase)(nil) - -type VersionedDatabase struct { - Database database.Database - Version *version.Semantic -} - -// Close the underlying database -func (db *VersionedDatabase) Close() error { - return db.Database.Close() -} - -// Note this sorts in descending order (newest version --> oldest version) -func (db *VersionedDatabase) Less(other *VersionedDatabase) bool { - return db.Version.Compare(other.Version) > 0 -} diff --git a/go.mod b/go.mod index 8bcba0590042..0494bab53992 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/Microsoft/go-winio v0.5.2 github.com/NYTimes/gziphandler v1.1.1 - github.com/ava-labs/coreth v0.12.8-0.20231027221814-507f2239095b + github.com/ava-labs/coreth v0.12.8-rc.0 github.com/ava-labs/ledger-avalanche/go v0.0.0-20230105152938-00a24d05a8c7 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 diff --git a/go.sum b/go.sum index f4d542b4a159..10b15cd40ae7 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.12.8-0.20231027221814-507f2239095b h1:pKSpTTWvsmDJ7MUkaOPAYfN4mKgWgg4K2cm4k+tvqNI= -github.com/ava-labs/coreth v0.12.8-0.20231027221814-507f2239095b/go.mod h1:8aFn5vDkc9g7RT8bSvx9KAo2Xu4AqzwWAnfoderYPDs= +github.com/ava-labs/coreth v0.12.8-rc.0 h1:9W3i5/6ckOifhD/jrxWwd2SOMYmCAmDG5PUJ6EHxE74= +github.com/ava-labs/coreth v0.12.8-rc.0/go.mod h1:GBH5SxHZdScSp95IijDs9+Gxw/QDIWvfoLKiJMNYLsE= github.com/ava-labs/ledger-avalanche/go v0.0.0-20230105152938-00a24d05a8c7 h1:EdxD90j5sClfL5Ngpz2TlnbnkNYdFPDXa0jDOjam65c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20230105152938-00a24d05a8c7/go.mod h1:XhiXSrh90sHUbkERzaxEftCmUz53eCijshDLZ4fByVM= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= diff --git a/node/node.go b/node/node.go index 34293e85b0b6..d2ca97ae0497 100644 --- a/node/node.go +++ b/node/node.go @@ -38,8 +38,8 @@ import ( "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/database/leveldb" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/meterdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" @@ -92,7 +92,8 @@ var ( genesisHashKey = []byte("genesisID") ungracefulShutdown = []byte("ungracefulShutdown") - indexerDBPrefix = []byte{0x00} + indexerDBPrefix = []byte{0x00} + keystoreDBPrefix = []byte("keystore") errInvalidTLSKey = errors.New("invalid TLS key") errShuttingDown = errors.New("server shutting down") @@ -109,8 +110,7 @@ type Node struct { ID ids.NodeID // Storage for this node - DBManager manager.Manager - DB database.Database + DB database.Database // Profiles the process. Nil if continuous profiling is disabled. profiler profiler.ContinuousProfiler @@ -500,41 +500,32 @@ func (n *Node) Dispatch() error { */ func (n *Node) initDatabase() error { - // start the db manager - var ( - dbManager manager.Manager - err error - ) + // start the db switch n.Config.DatabaseConfig.Name { case leveldb.Name: - dbManager, err = manager.NewLevelDB(n.Config.DatabaseConfig.Path, n.Config.DatabaseConfig.Config, n.Log, version.CurrentDatabase, "db_internal", n.MetricsRegisterer) + dbPath := filepath.Join(n.Config.DatabaseConfig.Path, version.CurrentDatabase.String()) + var err error + n.DB, err = leveldb.New(dbPath, n.Config.DatabaseConfig.Config, n.Log, "db_internal", n.MetricsRegisterer) + if err != nil { + return fmt.Errorf("couldn't create db at %s: %w", dbPath, err) + } case memdb.Name: - dbManager = manager.NewMemDB(version.CurrentDatabase) + n.DB = memdb.New() default: - err = fmt.Errorf( + return fmt.Errorf( "db-type was %q but should have been one of {%s, %s}", n.Config.DatabaseConfig.Name, leveldb.Name, memdb.Name, ) } - if err != nil { - return err - } - meterDBManager, err := dbManager.NewMeterDBManager("db", n.MetricsRegisterer) + var err error + n.DB, err = meterdb.New("db", n.MetricsRegisterer, n.DB) if err != nil { return err } - n.DBManager = meterDBManager - - currentDB := dbManager.Current() - n.Log.Info("initializing database", - zap.Stringer("dbVersion", currentDB.Version), - ) - n.DB = currentDB.Database - rawExpectedGenesisHash := hashing.ComputeHash256(n.Config.GenesisBytes) rawGenesisHash, err := n.DB.Get(genesisHashKey) @@ -559,6 +550,10 @@ func (n *Node) initDatabase() error { return fmt.Errorf("db contains invalid genesis hash. DB Genesis: %s Generated Genesis: %s", genesisHash, expectedGenesisHash) } + n.Log.Info("initializing database", + zap.Stringer("genesisHash", genesisHash), + ) + ok, err := n.DB.Has(ungracefulShutdown) if err != nil { return fmt.Errorf("failed to read ungraceful shutdown key: %w", err) @@ -830,7 +825,7 @@ func (n *Node) initChainManager(avaxAssetID ids.ID) error { BlockAcceptorGroup: n.BlockAcceptorGroup, TxAcceptorGroup: n.TxAcceptorGroup, VertexAcceptorGroup: n.VertexAcceptorGroup, - DBManager: n.DBManager, + DB: n.DB, MsgCreator: n.msgCreator, Router: n.Config.ConsensusRouter, Net: n.Net, @@ -980,8 +975,7 @@ func (n *Node) initSharedMemory() { // Assumes n.APIServer is already set func (n *Node) initKeystoreAPI() error { n.Log.Info("initializing keystore") - keystoreDB := n.DBManager.NewPrefixDBManager([]byte("keystore")) - n.keystore = keystore.New(n.Log, keystoreDB) + n.keystore = keystore.New(n.Log, prefixdb.New(keystoreDBPrefix, n.DB)) handler, err := n.keystore.CreateHandler() if err != nil { return err @@ -1547,7 +1541,7 @@ func (n *Node) shutdown() { n.Log.Info("cleaning up plugin runtimes") n.runtimeManager.Stop(context.TODO()) - if n.DBManager != nil { + if n.DB != nil { if err := n.DB.Delete(ungracefulShutdown); err != nil { n.Log.Error( "failed to delete ungraceful shutdown key", @@ -1555,7 +1549,7 @@ func (n *Node) shutdown() { ) } - if err := n.DBManager.Close(); err != nil { + if err := n.DB.Close(); err != nil { n.Log.Warn("error during DB shutdown", zap.Error(err), ) diff --git a/proto/pb/vm/vm.pb.go b/proto/pb/vm/vm.pb.go index 9bb4f759ff9d..ebc64f5c3a48 100644 --- a/proto/pb/vm/vm.pb.go +++ b/proto/pb/vm/vm.pb.go @@ -232,7 +232,7 @@ func (x StateSummaryAcceptResponse_Mode) Number() protoreflect.EnumNumber { // Deprecated: Use StateSummaryAcceptResponse_Mode.Descriptor instead. func (StateSummaryAcceptResponse_Mode) EnumDescriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{46, 0} + return file_vm_vm_proto_rawDescGZIP(), []int{45, 0} } type InitializeRequest struct { @@ -246,15 +246,15 @@ type InitializeRequest struct { NodeId []byte `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // public_key is the BLS public key that would correspond with any signatures // produced by the warp messaging signer - PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - XChainId []byte `protobuf:"bytes,6,opt,name=x_chain_id,json=xChainId,proto3" json:"x_chain_id,omitempty"` - CChainId []byte `protobuf:"bytes,7,opt,name=c_chain_id,json=cChainId,proto3" json:"c_chain_id,omitempty"` - AvaxAssetId []byte `protobuf:"bytes,8,opt,name=avax_asset_id,json=avaxAssetId,proto3" json:"avax_asset_id,omitempty"` - ChainDataDir string `protobuf:"bytes,9,opt,name=chain_data_dir,json=chainDataDir,proto3" json:"chain_data_dir,omitempty"` - GenesisBytes []byte `protobuf:"bytes,10,opt,name=genesis_bytes,json=genesisBytes,proto3" json:"genesis_bytes,omitempty"` - UpgradeBytes []byte `protobuf:"bytes,11,opt,name=upgrade_bytes,json=upgradeBytes,proto3" json:"upgrade_bytes,omitempty"` - ConfigBytes []byte `protobuf:"bytes,12,opt,name=config_bytes,json=configBytes,proto3" json:"config_bytes,omitempty"` - DbServers []*VersionedDBServer `protobuf:"bytes,13,rep,name=db_servers,json=dbServers,proto3" json:"db_servers,omitempty"` + PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + XChainId []byte `protobuf:"bytes,6,opt,name=x_chain_id,json=xChainId,proto3" json:"x_chain_id,omitempty"` + CChainId []byte `protobuf:"bytes,7,opt,name=c_chain_id,json=cChainId,proto3" json:"c_chain_id,omitempty"` + AvaxAssetId []byte `protobuf:"bytes,8,opt,name=avax_asset_id,json=avaxAssetId,proto3" json:"avax_asset_id,omitempty"` + ChainDataDir string `protobuf:"bytes,9,opt,name=chain_data_dir,json=chainDataDir,proto3" json:"chain_data_dir,omitempty"` + GenesisBytes []byte `protobuf:"bytes,10,opt,name=genesis_bytes,json=genesisBytes,proto3" json:"genesis_bytes,omitempty"` + UpgradeBytes []byte `protobuf:"bytes,11,opt,name=upgrade_bytes,json=upgradeBytes,proto3" json:"upgrade_bytes,omitempty"` + ConfigBytes []byte `protobuf:"bytes,12,opt,name=config_bytes,json=configBytes,proto3" json:"config_bytes,omitempty"` + DbServerAddr string `protobuf:"bytes,13,opt,name=db_server_addr,json=dbServerAddr,proto3" json:"db_server_addr,omitempty"` // server_addr is the address of the gRPC server which serves // the messenger, keystore, shared memory, blockchain alias, // subnet alias, and appSender services @@ -377,11 +377,11 @@ func (x *InitializeRequest) GetConfigBytes() []byte { return nil } -func (x *InitializeRequest) GetDbServers() []*VersionedDBServer { +func (x *InitializeRequest) GetDbServerAddr() string { if x != nil { - return x.DbServers + return x.DbServerAddr } - return nil + return "" } func (x *InitializeRequest) GetServerAddr() string { @@ -470,63 +470,6 @@ func (x *InitializeResponse) GetTimestamp() *timestamppb.Timestamp { return nil } -type VersionedDBServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // server_addr is the address of the gRPC server which serves the - // Database service - ServerAddr string `protobuf:"bytes,2,opt,name=server_addr,json=serverAddr,proto3" json:"server_addr,omitempty"` -} - -func (x *VersionedDBServer) Reset() { - *x = VersionedDBServer{} - if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VersionedDBServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionedDBServer) ProtoMessage() {} - -func (x *VersionedDBServer) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VersionedDBServer.ProtoReflect.Descriptor instead. -func (*VersionedDBServer) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{2} -} - -func (x *VersionedDBServer) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *VersionedDBServer) GetServerAddr() string { - if x != nil { - return x.ServerAddr - } - return "" -} - type SetStateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -538,7 +481,7 @@ type SetStateRequest struct { func (x *SetStateRequest) Reset() { *x = SetStateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[3] + mi := &file_vm_vm_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +494,7 @@ func (x *SetStateRequest) String() string { func (*SetStateRequest) ProtoMessage() {} func (x *SetStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[3] + mi := &file_vm_vm_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,7 +507,7 @@ func (x *SetStateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetStateRequest.ProtoReflect.Descriptor instead. func (*SetStateRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{3} + return file_vm_vm_proto_rawDescGZIP(), []int{2} } func (x *SetStateRequest) GetState() State { @@ -589,7 +532,7 @@ type SetStateResponse struct { func (x *SetStateResponse) Reset() { *x = SetStateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[4] + mi := &file_vm_vm_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -602,7 +545,7 @@ func (x *SetStateResponse) String() string { func (*SetStateResponse) ProtoMessage() {} func (x *SetStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[4] + mi := &file_vm_vm_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -615,7 +558,7 @@ func (x *SetStateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetStateResponse.ProtoReflect.Descriptor instead. func (*SetStateResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{4} + return file_vm_vm_proto_rawDescGZIP(), []int{3} } func (x *SetStateResponse) GetLastAcceptedId() []byte { @@ -664,7 +607,7 @@ type CreateHandlersResponse struct { func (x *CreateHandlersResponse) Reset() { *x = CreateHandlersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[5] + mi := &file_vm_vm_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -677,7 +620,7 @@ func (x *CreateHandlersResponse) String() string { func (*CreateHandlersResponse) ProtoMessage() {} func (x *CreateHandlersResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[5] + mi := &file_vm_vm_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -690,7 +633,7 @@ func (x *CreateHandlersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateHandlersResponse.ProtoReflect.Descriptor instead. func (*CreateHandlersResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{5} + return file_vm_vm_proto_rawDescGZIP(), []int{4} } func (x *CreateHandlersResponse) GetHandlers() []*Handler { @@ -711,7 +654,7 @@ type CreateStaticHandlersResponse struct { func (x *CreateStaticHandlersResponse) Reset() { *x = CreateStaticHandlersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[6] + mi := &file_vm_vm_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -724,7 +667,7 @@ func (x *CreateStaticHandlersResponse) String() string { func (*CreateStaticHandlersResponse) ProtoMessage() {} func (x *CreateStaticHandlersResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[6] + mi := &file_vm_vm_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -737,7 +680,7 @@ func (x *CreateStaticHandlersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateStaticHandlersResponse.ProtoReflect.Descriptor instead. func (*CreateStaticHandlersResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{6} + return file_vm_vm_proto_rawDescGZIP(), []int{5} } func (x *CreateStaticHandlersResponse) GetHandlers() []*Handler { @@ -761,7 +704,7 @@ type Handler struct { func (x *Handler) Reset() { *x = Handler{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[7] + mi := &file_vm_vm_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -774,7 +717,7 @@ func (x *Handler) String() string { func (*Handler) ProtoMessage() {} func (x *Handler) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[7] + mi := &file_vm_vm_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -787,7 +730,7 @@ func (x *Handler) ProtoReflect() protoreflect.Message { // Deprecated: Use Handler.ProtoReflect.Descriptor instead. func (*Handler) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{7} + return file_vm_vm_proto_rawDescGZIP(), []int{6} } func (x *Handler) GetPrefix() string { @@ -815,7 +758,7 @@ type BuildBlockRequest struct { func (x *BuildBlockRequest) Reset() { *x = BuildBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[8] + mi := &file_vm_vm_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -828,7 +771,7 @@ func (x *BuildBlockRequest) String() string { func (*BuildBlockRequest) ProtoMessage() {} func (x *BuildBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[8] + mi := &file_vm_vm_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -841,7 +784,7 @@ func (x *BuildBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildBlockRequest.ProtoReflect.Descriptor instead. func (*BuildBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{8} + return file_vm_vm_proto_rawDescGZIP(), []int{7} } func (x *BuildBlockRequest) GetPChainHeight() uint64 { @@ -868,7 +811,7 @@ type BuildBlockResponse struct { func (x *BuildBlockResponse) Reset() { *x = BuildBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[9] + mi := &file_vm_vm_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -881,7 +824,7 @@ func (x *BuildBlockResponse) String() string { func (*BuildBlockResponse) ProtoMessage() {} func (x *BuildBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[9] + mi := &file_vm_vm_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -894,7 +837,7 @@ func (x *BuildBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildBlockResponse.ProtoReflect.Descriptor instead. func (*BuildBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{9} + return file_vm_vm_proto_rawDescGZIP(), []int{8} } func (x *BuildBlockResponse) GetId() []byte { @@ -950,7 +893,7 @@ type ParseBlockRequest struct { func (x *ParseBlockRequest) Reset() { *x = ParseBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[10] + mi := &file_vm_vm_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -963,7 +906,7 @@ func (x *ParseBlockRequest) String() string { func (*ParseBlockRequest) ProtoMessage() {} func (x *ParseBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[10] + mi := &file_vm_vm_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -976,7 +919,7 @@ func (x *ParseBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseBlockRequest.ProtoReflect.Descriptor instead. func (*ParseBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{10} + return file_vm_vm_proto_rawDescGZIP(), []int{9} } func (x *ParseBlockRequest) GetBytes() []byte { @@ -1002,7 +945,7 @@ type ParseBlockResponse struct { func (x *ParseBlockResponse) Reset() { *x = ParseBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[11] + mi := &file_vm_vm_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1015,7 +958,7 @@ func (x *ParseBlockResponse) String() string { func (*ParseBlockResponse) ProtoMessage() {} func (x *ParseBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[11] + mi := &file_vm_vm_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1028,7 +971,7 @@ func (x *ParseBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseBlockResponse.ProtoReflect.Descriptor instead. func (*ParseBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{11} + return file_vm_vm_proto_rawDescGZIP(), []int{10} } func (x *ParseBlockResponse) GetId() []byte { @@ -1084,7 +1027,7 @@ type GetBlockRequest struct { func (x *GetBlockRequest) Reset() { *x = GetBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[12] + mi := &file_vm_vm_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1097,7 +1040,7 @@ func (x *GetBlockRequest) String() string { func (*GetBlockRequest) ProtoMessage() {} func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[12] + mi := &file_vm_vm_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1110,7 +1053,7 @@ func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead. func (*GetBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{12} + return file_vm_vm_proto_rawDescGZIP(), []int{11} } func (x *GetBlockRequest) GetId() []byte { @@ -1138,7 +1081,7 @@ type GetBlockResponse struct { func (x *GetBlockResponse) Reset() { *x = GetBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[13] + mi := &file_vm_vm_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1151,7 +1094,7 @@ func (x *GetBlockResponse) String() string { func (*GetBlockResponse) ProtoMessage() {} func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[13] + mi := &file_vm_vm_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1164,7 +1107,7 @@ func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead. func (*GetBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{13} + return file_vm_vm_proto_rawDescGZIP(), []int{12} } func (x *GetBlockResponse) GetParentId() []byte { @@ -1227,7 +1170,7 @@ type SetPreferenceRequest struct { func (x *SetPreferenceRequest) Reset() { *x = SetPreferenceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[14] + mi := &file_vm_vm_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1240,7 +1183,7 @@ func (x *SetPreferenceRequest) String() string { func (*SetPreferenceRequest) ProtoMessage() {} func (x *SetPreferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[14] + mi := &file_vm_vm_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1253,7 +1196,7 @@ func (x *SetPreferenceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetPreferenceRequest.ProtoReflect.Descriptor instead. func (*SetPreferenceRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{14} + return file_vm_vm_proto_rawDescGZIP(), []int{13} } func (x *SetPreferenceRequest) GetId() []byte { @@ -1277,7 +1220,7 @@ type BlockVerifyRequest struct { func (x *BlockVerifyRequest) Reset() { *x = BlockVerifyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[15] + mi := &file_vm_vm_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1290,7 +1233,7 @@ func (x *BlockVerifyRequest) String() string { func (*BlockVerifyRequest) ProtoMessage() {} func (x *BlockVerifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[15] + mi := &file_vm_vm_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1246,7 @@ func (x *BlockVerifyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockVerifyRequest.ProtoReflect.Descriptor instead. func (*BlockVerifyRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{15} + return file_vm_vm_proto_rawDescGZIP(), []int{14} } func (x *BlockVerifyRequest) GetBytes() []byte { @@ -1331,7 +1274,7 @@ type BlockVerifyResponse struct { func (x *BlockVerifyResponse) Reset() { *x = BlockVerifyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[16] + mi := &file_vm_vm_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1344,7 +1287,7 @@ func (x *BlockVerifyResponse) String() string { func (*BlockVerifyResponse) ProtoMessage() {} func (x *BlockVerifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[16] + mi := &file_vm_vm_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1357,7 +1300,7 @@ func (x *BlockVerifyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockVerifyResponse.ProtoReflect.Descriptor instead. func (*BlockVerifyResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{16} + return file_vm_vm_proto_rawDescGZIP(), []int{15} } func (x *BlockVerifyResponse) GetTimestamp() *timestamppb.Timestamp { @@ -1378,7 +1321,7 @@ type BlockAcceptRequest struct { func (x *BlockAcceptRequest) Reset() { *x = BlockAcceptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[17] + mi := &file_vm_vm_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1391,7 +1334,7 @@ func (x *BlockAcceptRequest) String() string { func (*BlockAcceptRequest) ProtoMessage() {} func (x *BlockAcceptRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[17] + mi := &file_vm_vm_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1404,7 +1347,7 @@ func (x *BlockAcceptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockAcceptRequest.ProtoReflect.Descriptor instead. func (*BlockAcceptRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{17} + return file_vm_vm_proto_rawDescGZIP(), []int{16} } func (x *BlockAcceptRequest) GetId() []byte { @@ -1425,7 +1368,7 @@ type BlockRejectRequest struct { func (x *BlockRejectRequest) Reset() { *x = BlockRejectRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[18] + mi := &file_vm_vm_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1438,7 +1381,7 @@ func (x *BlockRejectRequest) String() string { func (*BlockRejectRequest) ProtoMessage() {} func (x *BlockRejectRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[18] + mi := &file_vm_vm_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +1394,7 @@ func (x *BlockRejectRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockRejectRequest.ProtoReflect.Descriptor instead. func (*BlockRejectRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{18} + return file_vm_vm_proto_rawDescGZIP(), []int{17} } func (x *BlockRejectRequest) GetId() []byte { @@ -1472,7 +1415,7 @@ type HealthResponse struct { func (x *HealthResponse) Reset() { *x = HealthResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[19] + mi := &file_vm_vm_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1485,7 +1428,7 @@ func (x *HealthResponse) String() string { func (*HealthResponse) ProtoMessage() {} func (x *HealthResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[19] + mi := &file_vm_vm_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1498,7 +1441,7 @@ func (x *HealthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthResponse.ProtoReflect.Descriptor instead. func (*HealthResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{19} + return file_vm_vm_proto_rawDescGZIP(), []int{18} } func (x *HealthResponse) GetDetails() []byte { @@ -1519,7 +1462,7 @@ type VersionResponse struct { func (x *VersionResponse) Reset() { *x = VersionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[20] + mi := &file_vm_vm_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1532,7 +1475,7 @@ func (x *VersionResponse) String() string { func (*VersionResponse) ProtoMessage() {} func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[20] + mi := &file_vm_vm_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1545,7 +1488,7 @@ func (x *VersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{20} + return file_vm_vm_proto_rawDescGZIP(), []int{19} } func (x *VersionResponse) GetVersion() string { @@ -1573,7 +1516,7 @@ type AppRequestMsg struct { func (x *AppRequestMsg) Reset() { *x = AppRequestMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[21] + mi := &file_vm_vm_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1586,7 +1529,7 @@ func (x *AppRequestMsg) String() string { func (*AppRequestMsg) ProtoMessage() {} func (x *AppRequestMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[21] + mi := &file_vm_vm_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1599,7 +1542,7 @@ func (x *AppRequestMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppRequestMsg.ProtoReflect.Descriptor instead. func (*AppRequestMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{21} + return file_vm_vm_proto_rawDescGZIP(), []int{20} } func (x *AppRequestMsg) GetNodeId() []byte { @@ -1644,7 +1587,7 @@ type AppRequestFailedMsg struct { func (x *AppRequestFailedMsg) Reset() { *x = AppRequestFailedMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[22] + mi := &file_vm_vm_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1657,7 +1600,7 @@ func (x *AppRequestFailedMsg) String() string { func (*AppRequestFailedMsg) ProtoMessage() {} func (x *AppRequestFailedMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[22] + mi := &file_vm_vm_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1670,7 +1613,7 @@ func (x *AppRequestFailedMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppRequestFailedMsg.ProtoReflect.Descriptor instead. func (*AppRequestFailedMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{22} + return file_vm_vm_proto_rawDescGZIP(), []int{21} } func (x *AppRequestFailedMsg) GetNodeId() []byte { @@ -1703,7 +1646,7 @@ type AppResponseMsg struct { func (x *AppResponseMsg) Reset() { *x = AppResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[23] + mi := &file_vm_vm_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1716,7 +1659,7 @@ func (x *AppResponseMsg) String() string { func (*AppResponseMsg) ProtoMessage() {} func (x *AppResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[23] + mi := &file_vm_vm_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1729,7 +1672,7 @@ func (x *AppResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppResponseMsg.ProtoReflect.Descriptor instead. func (*AppResponseMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{23} + return file_vm_vm_proto_rawDescGZIP(), []int{22} } func (x *AppResponseMsg) GetNodeId() []byte { @@ -1767,7 +1710,7 @@ type AppGossipMsg struct { func (x *AppGossipMsg) Reset() { *x = AppGossipMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[24] + mi := &file_vm_vm_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1780,7 +1723,7 @@ func (x *AppGossipMsg) String() string { func (*AppGossipMsg) ProtoMessage() {} func (x *AppGossipMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[24] + mi := &file_vm_vm_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1793,7 +1736,7 @@ func (x *AppGossipMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use AppGossipMsg.ProtoReflect.Descriptor instead. func (*AppGossipMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{24} + return file_vm_vm_proto_rawDescGZIP(), []int{23} } func (x *AppGossipMsg) GetNodeId() []byte { @@ -1828,7 +1771,7 @@ type CrossChainAppRequestMsg struct { func (x *CrossChainAppRequestMsg) Reset() { *x = CrossChainAppRequestMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[25] + mi := &file_vm_vm_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1841,7 +1784,7 @@ func (x *CrossChainAppRequestMsg) String() string { func (*CrossChainAppRequestMsg) ProtoMessage() {} func (x *CrossChainAppRequestMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[25] + mi := &file_vm_vm_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1854,7 +1797,7 @@ func (x *CrossChainAppRequestMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppRequestMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppRequestMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{25} + return file_vm_vm_proto_rawDescGZIP(), []int{24} } func (x *CrossChainAppRequestMsg) GetChainId() []byte { @@ -1899,7 +1842,7 @@ type CrossChainAppRequestFailedMsg struct { func (x *CrossChainAppRequestFailedMsg) Reset() { *x = CrossChainAppRequestFailedMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[26] + mi := &file_vm_vm_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1912,7 +1855,7 @@ func (x *CrossChainAppRequestFailedMsg) String() string { func (*CrossChainAppRequestFailedMsg) ProtoMessage() {} func (x *CrossChainAppRequestFailedMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[26] + mi := &file_vm_vm_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1925,7 +1868,7 @@ func (x *CrossChainAppRequestFailedMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppRequestFailedMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppRequestFailedMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{26} + return file_vm_vm_proto_rawDescGZIP(), []int{25} } func (x *CrossChainAppRequestFailedMsg) GetChainId() []byte { @@ -1958,7 +1901,7 @@ type CrossChainAppResponseMsg struct { func (x *CrossChainAppResponseMsg) Reset() { *x = CrossChainAppResponseMsg{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[27] + mi := &file_vm_vm_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1971,7 +1914,7 @@ func (x *CrossChainAppResponseMsg) String() string { func (*CrossChainAppResponseMsg) ProtoMessage() {} func (x *CrossChainAppResponseMsg) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[27] + mi := &file_vm_vm_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1984,7 +1927,7 @@ func (x *CrossChainAppResponseMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use CrossChainAppResponseMsg.ProtoReflect.Descriptor instead. func (*CrossChainAppResponseMsg) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{27} + return file_vm_vm_proto_rawDescGZIP(), []int{26} } func (x *CrossChainAppResponseMsg) GetChainId() []byte { @@ -2020,7 +1963,7 @@ type ConnectedRequest struct { func (x *ConnectedRequest) Reset() { *x = ConnectedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[28] + mi := &file_vm_vm_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2033,7 +1976,7 @@ func (x *ConnectedRequest) String() string { func (*ConnectedRequest) ProtoMessage() {} func (x *ConnectedRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[28] + mi := &file_vm_vm_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2046,7 +1989,7 @@ func (x *ConnectedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConnectedRequest.ProtoReflect.Descriptor instead. func (*ConnectedRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{28} + return file_vm_vm_proto_rawDescGZIP(), []int{27} } func (x *ConnectedRequest) GetNodeId() []byte { @@ -2074,7 +2017,7 @@ type DisconnectedRequest struct { func (x *DisconnectedRequest) Reset() { *x = DisconnectedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[29] + mi := &file_vm_vm_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2087,7 +2030,7 @@ func (x *DisconnectedRequest) String() string { func (*DisconnectedRequest) ProtoMessage() {} func (x *DisconnectedRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[29] + mi := &file_vm_vm_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2100,7 +2043,7 @@ func (x *DisconnectedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DisconnectedRequest.ProtoReflect.Descriptor instead. func (*DisconnectedRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{29} + return file_vm_vm_proto_rawDescGZIP(), []int{28} } func (x *DisconnectedRequest) GetNodeId() []byte { @@ -2124,7 +2067,7 @@ type GetAncestorsRequest struct { func (x *GetAncestorsRequest) Reset() { *x = GetAncestorsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[30] + mi := &file_vm_vm_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2137,7 +2080,7 @@ func (x *GetAncestorsRequest) String() string { func (*GetAncestorsRequest) ProtoMessage() {} func (x *GetAncestorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[30] + mi := &file_vm_vm_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2150,7 +2093,7 @@ func (x *GetAncestorsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAncestorsRequest.ProtoReflect.Descriptor instead. func (*GetAncestorsRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{30} + return file_vm_vm_proto_rawDescGZIP(), []int{29} } func (x *GetAncestorsRequest) GetBlkId() []byte { @@ -2192,7 +2135,7 @@ type GetAncestorsResponse struct { func (x *GetAncestorsResponse) Reset() { *x = GetAncestorsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[31] + mi := &file_vm_vm_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2205,7 +2148,7 @@ func (x *GetAncestorsResponse) String() string { func (*GetAncestorsResponse) ProtoMessage() {} func (x *GetAncestorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[31] + mi := &file_vm_vm_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2218,7 +2161,7 @@ func (x *GetAncestorsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAncestorsResponse.ProtoReflect.Descriptor instead. func (*GetAncestorsResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{31} + return file_vm_vm_proto_rawDescGZIP(), []int{30} } func (x *GetAncestorsResponse) GetBlksBytes() [][]byte { @@ -2239,7 +2182,7 @@ type BatchedParseBlockRequest struct { func (x *BatchedParseBlockRequest) Reset() { *x = BatchedParseBlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[32] + mi := &file_vm_vm_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2252,7 +2195,7 @@ func (x *BatchedParseBlockRequest) String() string { func (*BatchedParseBlockRequest) ProtoMessage() {} func (x *BatchedParseBlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[32] + mi := &file_vm_vm_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2265,7 +2208,7 @@ func (x *BatchedParseBlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchedParseBlockRequest.ProtoReflect.Descriptor instead. func (*BatchedParseBlockRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{32} + return file_vm_vm_proto_rawDescGZIP(), []int{31} } func (x *BatchedParseBlockRequest) GetRequest() [][]byte { @@ -2286,7 +2229,7 @@ type BatchedParseBlockResponse struct { func (x *BatchedParseBlockResponse) Reset() { *x = BatchedParseBlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[33] + mi := &file_vm_vm_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2299,7 +2242,7 @@ func (x *BatchedParseBlockResponse) String() string { func (*BatchedParseBlockResponse) ProtoMessage() {} func (x *BatchedParseBlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[33] + mi := &file_vm_vm_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2312,7 +2255,7 @@ func (x *BatchedParseBlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchedParseBlockResponse.ProtoReflect.Descriptor instead. func (*BatchedParseBlockResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{33} + return file_vm_vm_proto_rawDescGZIP(), []int{32} } func (x *BatchedParseBlockResponse) GetResponse() []*ParseBlockResponse { @@ -2333,7 +2276,7 @@ type VerifyHeightIndexResponse struct { func (x *VerifyHeightIndexResponse) Reset() { *x = VerifyHeightIndexResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[34] + mi := &file_vm_vm_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2346,7 +2289,7 @@ func (x *VerifyHeightIndexResponse) String() string { func (*VerifyHeightIndexResponse) ProtoMessage() {} func (x *VerifyHeightIndexResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[34] + mi := &file_vm_vm_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2359,7 +2302,7 @@ func (x *VerifyHeightIndexResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyHeightIndexResponse.ProtoReflect.Descriptor instead. func (*VerifyHeightIndexResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{34} + return file_vm_vm_proto_rawDescGZIP(), []int{33} } func (x *VerifyHeightIndexResponse) GetErr() Error { @@ -2380,7 +2323,7 @@ type GetBlockIDAtHeightRequest struct { func (x *GetBlockIDAtHeightRequest) Reset() { *x = GetBlockIDAtHeightRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[35] + mi := &file_vm_vm_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2393,7 +2336,7 @@ func (x *GetBlockIDAtHeightRequest) String() string { func (*GetBlockIDAtHeightRequest) ProtoMessage() {} func (x *GetBlockIDAtHeightRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[35] + mi := &file_vm_vm_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2406,7 +2349,7 @@ func (x *GetBlockIDAtHeightRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockIDAtHeightRequest.ProtoReflect.Descriptor instead. func (*GetBlockIDAtHeightRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{35} + return file_vm_vm_proto_rawDescGZIP(), []int{34} } func (x *GetBlockIDAtHeightRequest) GetHeight() uint64 { @@ -2428,7 +2371,7 @@ type GetBlockIDAtHeightResponse struct { func (x *GetBlockIDAtHeightResponse) Reset() { *x = GetBlockIDAtHeightResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[36] + mi := &file_vm_vm_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2441,7 +2384,7 @@ func (x *GetBlockIDAtHeightResponse) String() string { func (*GetBlockIDAtHeightResponse) ProtoMessage() {} func (x *GetBlockIDAtHeightResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[36] + mi := &file_vm_vm_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2454,7 +2397,7 @@ func (x *GetBlockIDAtHeightResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBlockIDAtHeightResponse.ProtoReflect.Descriptor instead. func (*GetBlockIDAtHeightResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{36} + return file_vm_vm_proto_rawDescGZIP(), []int{35} } func (x *GetBlockIDAtHeightResponse) GetBlkId() []byte { @@ -2482,7 +2425,7 @@ type GatherResponse struct { func (x *GatherResponse) Reset() { *x = GatherResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[37] + mi := &file_vm_vm_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2495,7 +2438,7 @@ func (x *GatherResponse) String() string { func (*GatherResponse) ProtoMessage() {} func (x *GatherResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[37] + mi := &file_vm_vm_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2508,7 +2451,7 @@ func (x *GatherResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GatherResponse.ProtoReflect.Descriptor instead. func (*GatherResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{37} + return file_vm_vm_proto_rawDescGZIP(), []int{36} } func (x *GatherResponse) GetMetricFamilies() []*_go.MetricFamily { @@ -2530,7 +2473,7 @@ type StateSyncEnabledResponse struct { func (x *StateSyncEnabledResponse) Reset() { *x = StateSyncEnabledResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[38] + mi := &file_vm_vm_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2543,7 +2486,7 @@ func (x *StateSyncEnabledResponse) String() string { func (*StateSyncEnabledResponse) ProtoMessage() {} func (x *StateSyncEnabledResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[38] + mi := &file_vm_vm_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2556,7 +2499,7 @@ func (x *StateSyncEnabledResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSyncEnabledResponse.ProtoReflect.Descriptor instead. func (*StateSyncEnabledResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{38} + return file_vm_vm_proto_rawDescGZIP(), []int{37} } func (x *StateSyncEnabledResponse) GetEnabled() bool { @@ -2587,7 +2530,7 @@ type GetOngoingSyncStateSummaryResponse struct { func (x *GetOngoingSyncStateSummaryResponse) Reset() { *x = GetOngoingSyncStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[39] + mi := &file_vm_vm_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2600,7 +2543,7 @@ func (x *GetOngoingSyncStateSummaryResponse) String() string { func (*GetOngoingSyncStateSummaryResponse) ProtoMessage() {} func (x *GetOngoingSyncStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[39] + mi := &file_vm_vm_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2613,7 +2556,7 @@ func (x *GetOngoingSyncStateSummaryResponse) ProtoReflect() protoreflect.Message // Deprecated: Use GetOngoingSyncStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetOngoingSyncStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{39} + return file_vm_vm_proto_rawDescGZIP(), []int{38} } func (x *GetOngoingSyncStateSummaryResponse) GetId() []byte { @@ -2658,7 +2601,7 @@ type GetLastStateSummaryResponse struct { func (x *GetLastStateSummaryResponse) Reset() { *x = GetLastStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[40] + mi := &file_vm_vm_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2671,7 +2614,7 @@ func (x *GetLastStateSummaryResponse) String() string { func (*GetLastStateSummaryResponse) ProtoMessage() {} func (x *GetLastStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[40] + mi := &file_vm_vm_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2684,7 +2627,7 @@ func (x *GetLastStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetLastStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetLastStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{40} + return file_vm_vm_proto_rawDescGZIP(), []int{39} } func (x *GetLastStateSummaryResponse) GetId() []byte { @@ -2726,7 +2669,7 @@ type ParseStateSummaryRequest struct { func (x *ParseStateSummaryRequest) Reset() { *x = ParseStateSummaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[41] + mi := &file_vm_vm_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2739,7 +2682,7 @@ func (x *ParseStateSummaryRequest) String() string { func (*ParseStateSummaryRequest) ProtoMessage() {} func (x *ParseStateSummaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[41] + mi := &file_vm_vm_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2752,7 +2695,7 @@ func (x *ParseStateSummaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseStateSummaryRequest.ProtoReflect.Descriptor instead. func (*ParseStateSummaryRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{41} + return file_vm_vm_proto_rawDescGZIP(), []int{40} } func (x *ParseStateSummaryRequest) GetBytes() []byte { @@ -2775,7 +2718,7 @@ type ParseStateSummaryResponse struct { func (x *ParseStateSummaryResponse) Reset() { *x = ParseStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[42] + mi := &file_vm_vm_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2788,7 +2731,7 @@ func (x *ParseStateSummaryResponse) String() string { func (*ParseStateSummaryResponse) ProtoMessage() {} func (x *ParseStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[42] + mi := &file_vm_vm_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2801,7 +2744,7 @@ func (x *ParseStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseStateSummaryResponse.ProtoReflect.Descriptor instead. func (*ParseStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{42} + return file_vm_vm_proto_rawDescGZIP(), []int{41} } func (x *ParseStateSummaryResponse) GetId() []byte { @@ -2836,7 +2779,7 @@ type GetStateSummaryRequest struct { func (x *GetStateSummaryRequest) Reset() { *x = GetStateSummaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[43] + mi := &file_vm_vm_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2849,7 +2792,7 @@ func (x *GetStateSummaryRequest) String() string { func (*GetStateSummaryRequest) ProtoMessage() {} func (x *GetStateSummaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[43] + mi := &file_vm_vm_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2862,7 +2805,7 @@ func (x *GetStateSummaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateSummaryRequest.ProtoReflect.Descriptor instead. func (*GetStateSummaryRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{43} + return file_vm_vm_proto_rawDescGZIP(), []int{42} } func (x *GetStateSummaryRequest) GetHeight() uint64 { @@ -2885,7 +2828,7 @@ type GetStateSummaryResponse struct { func (x *GetStateSummaryResponse) Reset() { *x = GetStateSummaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[44] + mi := &file_vm_vm_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2898,7 +2841,7 @@ func (x *GetStateSummaryResponse) String() string { func (*GetStateSummaryResponse) ProtoMessage() {} func (x *GetStateSummaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[44] + mi := &file_vm_vm_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2911,7 +2854,7 @@ func (x *GetStateSummaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateSummaryResponse.ProtoReflect.Descriptor instead. func (*GetStateSummaryResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{44} + return file_vm_vm_proto_rawDescGZIP(), []int{43} } func (x *GetStateSummaryResponse) GetId() []byte { @@ -2946,7 +2889,7 @@ type StateSummaryAcceptRequest struct { func (x *StateSummaryAcceptRequest) Reset() { *x = StateSummaryAcceptRequest{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[45] + mi := &file_vm_vm_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2959,7 +2902,7 @@ func (x *StateSummaryAcceptRequest) String() string { func (*StateSummaryAcceptRequest) ProtoMessage() {} func (x *StateSummaryAcceptRequest) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[45] + mi := &file_vm_vm_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2972,7 +2915,7 @@ func (x *StateSummaryAcceptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSummaryAcceptRequest.ProtoReflect.Descriptor instead. func (*StateSummaryAcceptRequest) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{45} + return file_vm_vm_proto_rawDescGZIP(), []int{44} } func (x *StateSummaryAcceptRequest) GetBytes() []byte { @@ -2994,7 +2937,7 @@ type StateSummaryAcceptResponse struct { func (x *StateSummaryAcceptResponse) Reset() { *x = StateSummaryAcceptResponse{} if protoimpl.UnsafeEnabled { - mi := &file_vm_vm_proto_msgTypes[46] + mi := &file_vm_vm_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3007,7 +2950,7 @@ func (x *StateSummaryAcceptResponse) String() string { func (*StateSummaryAcceptResponse) ProtoMessage() {} func (x *StateSummaryAcceptResponse) ProtoReflect() protoreflect.Message { - mi := &file_vm_vm_proto_msgTypes[46] + mi := &file_vm_vm_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3020,7 +2963,7 @@ func (x *StateSummaryAcceptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateSummaryAcceptResponse.ProtoReflect.Descriptor instead. func (*StateSummaryAcceptResponse) Descriptor() ([]byte, []int) { - return file_vm_vm_proto_rawDescGZIP(), []int{46} + return file_vm_vm_proto_rawDescGZIP(), []int{45} } func (x *StateSummaryAcceptResponse) GetMode() StateSummaryAcceptResponse_Mode { @@ -3047,7 +2990,7 @@ var file_vm_vm_proto_rawDesc = []byte{ 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xec, 0x03, 0x0a, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, + 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x03, 0x0a, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, @@ -3072,11 +3015,10 @@ var file_vm_vm_proto_rawDesc = []byte{ 0x79, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x0a, 0x64, - 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x76, 0x6d, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x44, 0x42, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x09, 0x64, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x64, + 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x62, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x22, 0xdd, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x61, 0x73, @@ -3092,12 +3034,7 @@ var file_vm_vm_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x22, 0x4e, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x44, - 0x42, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x22, 0x32, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x6d, 0x70, 0x22, 0x32, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x76, 0x6d, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x53, 0x74, @@ -3545,7 +3482,7 @@ func file_vm_vm_proto_rawDescGZIP() []byte { } var file_vm_vm_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_vm_vm_proto_msgTypes = make([]protoimpl.MessageInfo, 47) +var file_vm_vm_proto_msgTypes = make([]protoimpl.MessageInfo, 46) var file_vm_vm_proto_goTypes = []interface{}{ (State)(0), // 0: vm.State (Status)(0), // 1: vm.Status @@ -3553,155 +3490,153 @@ var file_vm_vm_proto_goTypes = []interface{}{ (StateSummaryAcceptResponse_Mode)(0), // 3: vm.StateSummaryAcceptResponse.Mode (*InitializeRequest)(nil), // 4: vm.InitializeRequest (*InitializeResponse)(nil), // 5: vm.InitializeResponse - (*VersionedDBServer)(nil), // 6: vm.VersionedDBServer - (*SetStateRequest)(nil), // 7: vm.SetStateRequest - (*SetStateResponse)(nil), // 8: vm.SetStateResponse - (*CreateHandlersResponse)(nil), // 9: vm.CreateHandlersResponse - (*CreateStaticHandlersResponse)(nil), // 10: vm.CreateStaticHandlersResponse - (*Handler)(nil), // 11: vm.Handler - (*BuildBlockRequest)(nil), // 12: vm.BuildBlockRequest - (*BuildBlockResponse)(nil), // 13: vm.BuildBlockResponse - (*ParseBlockRequest)(nil), // 14: vm.ParseBlockRequest - (*ParseBlockResponse)(nil), // 15: vm.ParseBlockResponse - (*GetBlockRequest)(nil), // 16: vm.GetBlockRequest - (*GetBlockResponse)(nil), // 17: vm.GetBlockResponse - (*SetPreferenceRequest)(nil), // 18: vm.SetPreferenceRequest - (*BlockVerifyRequest)(nil), // 19: vm.BlockVerifyRequest - (*BlockVerifyResponse)(nil), // 20: vm.BlockVerifyResponse - (*BlockAcceptRequest)(nil), // 21: vm.BlockAcceptRequest - (*BlockRejectRequest)(nil), // 22: vm.BlockRejectRequest - (*HealthResponse)(nil), // 23: vm.HealthResponse - (*VersionResponse)(nil), // 24: vm.VersionResponse - (*AppRequestMsg)(nil), // 25: vm.AppRequestMsg - (*AppRequestFailedMsg)(nil), // 26: vm.AppRequestFailedMsg - (*AppResponseMsg)(nil), // 27: vm.AppResponseMsg - (*AppGossipMsg)(nil), // 28: vm.AppGossipMsg - (*CrossChainAppRequestMsg)(nil), // 29: vm.CrossChainAppRequestMsg - (*CrossChainAppRequestFailedMsg)(nil), // 30: vm.CrossChainAppRequestFailedMsg - (*CrossChainAppResponseMsg)(nil), // 31: vm.CrossChainAppResponseMsg - (*ConnectedRequest)(nil), // 32: vm.ConnectedRequest - (*DisconnectedRequest)(nil), // 33: vm.DisconnectedRequest - (*GetAncestorsRequest)(nil), // 34: vm.GetAncestorsRequest - (*GetAncestorsResponse)(nil), // 35: vm.GetAncestorsResponse - (*BatchedParseBlockRequest)(nil), // 36: vm.BatchedParseBlockRequest - (*BatchedParseBlockResponse)(nil), // 37: vm.BatchedParseBlockResponse - (*VerifyHeightIndexResponse)(nil), // 38: vm.VerifyHeightIndexResponse - (*GetBlockIDAtHeightRequest)(nil), // 39: vm.GetBlockIDAtHeightRequest - (*GetBlockIDAtHeightResponse)(nil), // 40: vm.GetBlockIDAtHeightResponse - (*GatherResponse)(nil), // 41: vm.GatherResponse - (*StateSyncEnabledResponse)(nil), // 42: vm.StateSyncEnabledResponse - (*GetOngoingSyncStateSummaryResponse)(nil), // 43: vm.GetOngoingSyncStateSummaryResponse - (*GetLastStateSummaryResponse)(nil), // 44: vm.GetLastStateSummaryResponse - (*ParseStateSummaryRequest)(nil), // 45: vm.ParseStateSummaryRequest - (*ParseStateSummaryResponse)(nil), // 46: vm.ParseStateSummaryResponse - (*GetStateSummaryRequest)(nil), // 47: vm.GetStateSummaryRequest - (*GetStateSummaryResponse)(nil), // 48: vm.GetStateSummaryResponse - (*StateSummaryAcceptRequest)(nil), // 49: vm.StateSummaryAcceptRequest - (*StateSummaryAcceptResponse)(nil), // 50: vm.StateSummaryAcceptResponse - (*timestamppb.Timestamp)(nil), // 51: google.protobuf.Timestamp - (*_go.MetricFamily)(nil), // 52: io.prometheus.client.MetricFamily - (*emptypb.Empty)(nil), // 53: google.protobuf.Empty + (*SetStateRequest)(nil), // 6: vm.SetStateRequest + (*SetStateResponse)(nil), // 7: vm.SetStateResponse + (*CreateHandlersResponse)(nil), // 8: vm.CreateHandlersResponse + (*CreateStaticHandlersResponse)(nil), // 9: vm.CreateStaticHandlersResponse + (*Handler)(nil), // 10: vm.Handler + (*BuildBlockRequest)(nil), // 11: vm.BuildBlockRequest + (*BuildBlockResponse)(nil), // 12: vm.BuildBlockResponse + (*ParseBlockRequest)(nil), // 13: vm.ParseBlockRequest + (*ParseBlockResponse)(nil), // 14: vm.ParseBlockResponse + (*GetBlockRequest)(nil), // 15: vm.GetBlockRequest + (*GetBlockResponse)(nil), // 16: vm.GetBlockResponse + (*SetPreferenceRequest)(nil), // 17: vm.SetPreferenceRequest + (*BlockVerifyRequest)(nil), // 18: vm.BlockVerifyRequest + (*BlockVerifyResponse)(nil), // 19: vm.BlockVerifyResponse + (*BlockAcceptRequest)(nil), // 20: vm.BlockAcceptRequest + (*BlockRejectRequest)(nil), // 21: vm.BlockRejectRequest + (*HealthResponse)(nil), // 22: vm.HealthResponse + (*VersionResponse)(nil), // 23: vm.VersionResponse + (*AppRequestMsg)(nil), // 24: vm.AppRequestMsg + (*AppRequestFailedMsg)(nil), // 25: vm.AppRequestFailedMsg + (*AppResponseMsg)(nil), // 26: vm.AppResponseMsg + (*AppGossipMsg)(nil), // 27: vm.AppGossipMsg + (*CrossChainAppRequestMsg)(nil), // 28: vm.CrossChainAppRequestMsg + (*CrossChainAppRequestFailedMsg)(nil), // 29: vm.CrossChainAppRequestFailedMsg + (*CrossChainAppResponseMsg)(nil), // 30: vm.CrossChainAppResponseMsg + (*ConnectedRequest)(nil), // 31: vm.ConnectedRequest + (*DisconnectedRequest)(nil), // 32: vm.DisconnectedRequest + (*GetAncestorsRequest)(nil), // 33: vm.GetAncestorsRequest + (*GetAncestorsResponse)(nil), // 34: vm.GetAncestorsResponse + (*BatchedParseBlockRequest)(nil), // 35: vm.BatchedParseBlockRequest + (*BatchedParseBlockResponse)(nil), // 36: vm.BatchedParseBlockResponse + (*VerifyHeightIndexResponse)(nil), // 37: vm.VerifyHeightIndexResponse + (*GetBlockIDAtHeightRequest)(nil), // 38: vm.GetBlockIDAtHeightRequest + (*GetBlockIDAtHeightResponse)(nil), // 39: vm.GetBlockIDAtHeightResponse + (*GatherResponse)(nil), // 40: vm.GatherResponse + (*StateSyncEnabledResponse)(nil), // 41: vm.StateSyncEnabledResponse + (*GetOngoingSyncStateSummaryResponse)(nil), // 42: vm.GetOngoingSyncStateSummaryResponse + (*GetLastStateSummaryResponse)(nil), // 43: vm.GetLastStateSummaryResponse + (*ParseStateSummaryRequest)(nil), // 44: vm.ParseStateSummaryRequest + (*ParseStateSummaryResponse)(nil), // 45: vm.ParseStateSummaryResponse + (*GetStateSummaryRequest)(nil), // 46: vm.GetStateSummaryRequest + (*GetStateSummaryResponse)(nil), // 47: vm.GetStateSummaryResponse + (*StateSummaryAcceptRequest)(nil), // 48: vm.StateSummaryAcceptRequest + (*StateSummaryAcceptResponse)(nil), // 49: vm.StateSummaryAcceptResponse + (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp + (*_go.MetricFamily)(nil), // 51: io.prometheus.client.MetricFamily + (*emptypb.Empty)(nil), // 52: google.protobuf.Empty } var file_vm_vm_proto_depIdxs = []int32{ - 6, // 0: vm.InitializeRequest.db_servers:type_name -> vm.VersionedDBServer - 51, // 1: vm.InitializeResponse.timestamp:type_name -> google.protobuf.Timestamp - 0, // 2: vm.SetStateRequest.state:type_name -> vm.State - 51, // 3: vm.SetStateResponse.timestamp:type_name -> google.protobuf.Timestamp - 11, // 4: vm.CreateHandlersResponse.handlers:type_name -> vm.Handler - 11, // 5: vm.CreateStaticHandlersResponse.handlers:type_name -> vm.Handler - 51, // 6: vm.BuildBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 1, // 7: vm.ParseBlockResponse.status:type_name -> vm.Status - 51, // 8: vm.ParseBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 1, // 9: vm.GetBlockResponse.status:type_name -> vm.Status - 51, // 10: vm.GetBlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 2, // 11: vm.GetBlockResponse.err:type_name -> vm.Error - 51, // 12: vm.BlockVerifyResponse.timestamp:type_name -> google.protobuf.Timestamp - 51, // 13: vm.AppRequestMsg.deadline:type_name -> google.protobuf.Timestamp - 51, // 14: vm.CrossChainAppRequestMsg.deadline:type_name -> google.protobuf.Timestamp - 15, // 15: vm.BatchedParseBlockResponse.response:type_name -> vm.ParseBlockResponse - 2, // 16: vm.VerifyHeightIndexResponse.err:type_name -> vm.Error - 2, // 17: vm.GetBlockIDAtHeightResponse.err:type_name -> vm.Error - 52, // 18: vm.GatherResponse.metric_families:type_name -> io.prometheus.client.MetricFamily - 2, // 19: vm.StateSyncEnabledResponse.err:type_name -> vm.Error - 2, // 20: vm.GetOngoingSyncStateSummaryResponse.err:type_name -> vm.Error - 2, // 21: vm.GetLastStateSummaryResponse.err:type_name -> vm.Error - 2, // 22: vm.ParseStateSummaryResponse.err:type_name -> vm.Error - 2, // 23: vm.GetStateSummaryResponse.err:type_name -> vm.Error - 3, // 24: vm.StateSummaryAcceptResponse.mode:type_name -> vm.StateSummaryAcceptResponse.Mode - 2, // 25: vm.StateSummaryAcceptResponse.err:type_name -> vm.Error - 4, // 26: vm.VM.Initialize:input_type -> vm.InitializeRequest - 7, // 27: vm.VM.SetState:input_type -> vm.SetStateRequest - 53, // 28: vm.VM.Shutdown:input_type -> google.protobuf.Empty - 53, // 29: vm.VM.CreateHandlers:input_type -> google.protobuf.Empty - 53, // 30: vm.VM.CreateStaticHandlers:input_type -> google.protobuf.Empty - 32, // 31: vm.VM.Connected:input_type -> vm.ConnectedRequest - 33, // 32: vm.VM.Disconnected:input_type -> vm.DisconnectedRequest - 12, // 33: vm.VM.BuildBlock:input_type -> vm.BuildBlockRequest - 14, // 34: vm.VM.ParseBlock:input_type -> vm.ParseBlockRequest - 16, // 35: vm.VM.GetBlock:input_type -> vm.GetBlockRequest - 18, // 36: vm.VM.SetPreference:input_type -> vm.SetPreferenceRequest - 53, // 37: vm.VM.Health:input_type -> google.protobuf.Empty - 53, // 38: vm.VM.Version:input_type -> google.protobuf.Empty - 25, // 39: vm.VM.AppRequest:input_type -> vm.AppRequestMsg - 26, // 40: vm.VM.AppRequestFailed:input_type -> vm.AppRequestFailedMsg - 27, // 41: vm.VM.AppResponse:input_type -> vm.AppResponseMsg - 28, // 42: vm.VM.AppGossip:input_type -> vm.AppGossipMsg - 53, // 43: vm.VM.Gather:input_type -> google.protobuf.Empty - 29, // 44: vm.VM.CrossChainAppRequest:input_type -> vm.CrossChainAppRequestMsg - 30, // 45: vm.VM.CrossChainAppRequestFailed:input_type -> vm.CrossChainAppRequestFailedMsg - 31, // 46: vm.VM.CrossChainAppResponse:input_type -> vm.CrossChainAppResponseMsg - 34, // 47: vm.VM.GetAncestors:input_type -> vm.GetAncestorsRequest - 36, // 48: vm.VM.BatchedParseBlock:input_type -> vm.BatchedParseBlockRequest - 53, // 49: vm.VM.VerifyHeightIndex:input_type -> google.protobuf.Empty - 39, // 50: vm.VM.GetBlockIDAtHeight:input_type -> vm.GetBlockIDAtHeightRequest - 53, // 51: vm.VM.StateSyncEnabled:input_type -> google.protobuf.Empty - 53, // 52: vm.VM.GetOngoingSyncStateSummary:input_type -> google.protobuf.Empty - 53, // 53: vm.VM.GetLastStateSummary:input_type -> google.protobuf.Empty - 45, // 54: vm.VM.ParseStateSummary:input_type -> vm.ParseStateSummaryRequest - 47, // 55: vm.VM.GetStateSummary:input_type -> vm.GetStateSummaryRequest - 19, // 56: vm.VM.BlockVerify:input_type -> vm.BlockVerifyRequest - 21, // 57: vm.VM.BlockAccept:input_type -> vm.BlockAcceptRequest - 22, // 58: vm.VM.BlockReject:input_type -> vm.BlockRejectRequest - 49, // 59: vm.VM.StateSummaryAccept:input_type -> vm.StateSummaryAcceptRequest - 5, // 60: vm.VM.Initialize:output_type -> vm.InitializeResponse - 8, // 61: vm.VM.SetState:output_type -> vm.SetStateResponse - 53, // 62: vm.VM.Shutdown:output_type -> google.protobuf.Empty - 9, // 63: vm.VM.CreateHandlers:output_type -> vm.CreateHandlersResponse - 10, // 64: vm.VM.CreateStaticHandlers:output_type -> vm.CreateStaticHandlersResponse - 53, // 65: vm.VM.Connected:output_type -> google.protobuf.Empty - 53, // 66: vm.VM.Disconnected:output_type -> google.protobuf.Empty - 13, // 67: vm.VM.BuildBlock:output_type -> vm.BuildBlockResponse - 15, // 68: vm.VM.ParseBlock:output_type -> vm.ParseBlockResponse - 17, // 69: vm.VM.GetBlock:output_type -> vm.GetBlockResponse - 53, // 70: vm.VM.SetPreference:output_type -> google.protobuf.Empty - 23, // 71: vm.VM.Health:output_type -> vm.HealthResponse - 24, // 72: vm.VM.Version:output_type -> vm.VersionResponse - 53, // 73: vm.VM.AppRequest:output_type -> google.protobuf.Empty - 53, // 74: vm.VM.AppRequestFailed:output_type -> google.protobuf.Empty - 53, // 75: vm.VM.AppResponse:output_type -> google.protobuf.Empty - 53, // 76: vm.VM.AppGossip:output_type -> google.protobuf.Empty - 41, // 77: vm.VM.Gather:output_type -> vm.GatherResponse - 53, // 78: vm.VM.CrossChainAppRequest:output_type -> google.protobuf.Empty - 53, // 79: vm.VM.CrossChainAppRequestFailed:output_type -> google.protobuf.Empty - 53, // 80: vm.VM.CrossChainAppResponse:output_type -> google.protobuf.Empty - 35, // 81: vm.VM.GetAncestors:output_type -> vm.GetAncestorsResponse - 37, // 82: vm.VM.BatchedParseBlock:output_type -> vm.BatchedParseBlockResponse - 38, // 83: vm.VM.VerifyHeightIndex:output_type -> vm.VerifyHeightIndexResponse - 40, // 84: vm.VM.GetBlockIDAtHeight:output_type -> vm.GetBlockIDAtHeightResponse - 42, // 85: vm.VM.StateSyncEnabled:output_type -> vm.StateSyncEnabledResponse - 43, // 86: vm.VM.GetOngoingSyncStateSummary:output_type -> vm.GetOngoingSyncStateSummaryResponse - 44, // 87: vm.VM.GetLastStateSummary:output_type -> vm.GetLastStateSummaryResponse - 46, // 88: vm.VM.ParseStateSummary:output_type -> vm.ParseStateSummaryResponse - 48, // 89: vm.VM.GetStateSummary:output_type -> vm.GetStateSummaryResponse - 20, // 90: vm.VM.BlockVerify:output_type -> vm.BlockVerifyResponse - 53, // 91: vm.VM.BlockAccept:output_type -> google.protobuf.Empty - 53, // 92: vm.VM.BlockReject:output_type -> google.protobuf.Empty - 50, // 93: vm.VM.StateSummaryAccept:output_type -> vm.StateSummaryAcceptResponse - 60, // [60:94] is the sub-list for method output_type - 26, // [26:60] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 50, // 0: vm.InitializeResponse.timestamp:type_name -> google.protobuf.Timestamp + 0, // 1: vm.SetStateRequest.state:type_name -> vm.State + 50, // 2: vm.SetStateResponse.timestamp:type_name -> google.protobuf.Timestamp + 10, // 3: vm.CreateHandlersResponse.handlers:type_name -> vm.Handler + 10, // 4: vm.CreateStaticHandlersResponse.handlers:type_name -> vm.Handler + 50, // 5: vm.BuildBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 1, // 6: vm.ParseBlockResponse.status:type_name -> vm.Status + 50, // 7: vm.ParseBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 1, // 8: vm.GetBlockResponse.status:type_name -> vm.Status + 50, // 9: vm.GetBlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 2, // 10: vm.GetBlockResponse.err:type_name -> vm.Error + 50, // 11: vm.BlockVerifyResponse.timestamp:type_name -> google.protobuf.Timestamp + 50, // 12: vm.AppRequestMsg.deadline:type_name -> google.protobuf.Timestamp + 50, // 13: vm.CrossChainAppRequestMsg.deadline:type_name -> google.protobuf.Timestamp + 14, // 14: vm.BatchedParseBlockResponse.response:type_name -> vm.ParseBlockResponse + 2, // 15: vm.VerifyHeightIndexResponse.err:type_name -> vm.Error + 2, // 16: vm.GetBlockIDAtHeightResponse.err:type_name -> vm.Error + 51, // 17: vm.GatherResponse.metric_families:type_name -> io.prometheus.client.MetricFamily + 2, // 18: vm.StateSyncEnabledResponse.err:type_name -> vm.Error + 2, // 19: vm.GetOngoingSyncStateSummaryResponse.err:type_name -> vm.Error + 2, // 20: vm.GetLastStateSummaryResponse.err:type_name -> vm.Error + 2, // 21: vm.ParseStateSummaryResponse.err:type_name -> vm.Error + 2, // 22: vm.GetStateSummaryResponse.err:type_name -> vm.Error + 3, // 23: vm.StateSummaryAcceptResponse.mode:type_name -> vm.StateSummaryAcceptResponse.Mode + 2, // 24: vm.StateSummaryAcceptResponse.err:type_name -> vm.Error + 4, // 25: vm.VM.Initialize:input_type -> vm.InitializeRequest + 6, // 26: vm.VM.SetState:input_type -> vm.SetStateRequest + 52, // 27: vm.VM.Shutdown:input_type -> google.protobuf.Empty + 52, // 28: vm.VM.CreateHandlers:input_type -> google.protobuf.Empty + 52, // 29: vm.VM.CreateStaticHandlers:input_type -> google.protobuf.Empty + 31, // 30: vm.VM.Connected:input_type -> vm.ConnectedRequest + 32, // 31: vm.VM.Disconnected:input_type -> vm.DisconnectedRequest + 11, // 32: vm.VM.BuildBlock:input_type -> vm.BuildBlockRequest + 13, // 33: vm.VM.ParseBlock:input_type -> vm.ParseBlockRequest + 15, // 34: vm.VM.GetBlock:input_type -> vm.GetBlockRequest + 17, // 35: vm.VM.SetPreference:input_type -> vm.SetPreferenceRequest + 52, // 36: vm.VM.Health:input_type -> google.protobuf.Empty + 52, // 37: vm.VM.Version:input_type -> google.protobuf.Empty + 24, // 38: vm.VM.AppRequest:input_type -> vm.AppRequestMsg + 25, // 39: vm.VM.AppRequestFailed:input_type -> vm.AppRequestFailedMsg + 26, // 40: vm.VM.AppResponse:input_type -> vm.AppResponseMsg + 27, // 41: vm.VM.AppGossip:input_type -> vm.AppGossipMsg + 52, // 42: vm.VM.Gather:input_type -> google.protobuf.Empty + 28, // 43: vm.VM.CrossChainAppRequest:input_type -> vm.CrossChainAppRequestMsg + 29, // 44: vm.VM.CrossChainAppRequestFailed:input_type -> vm.CrossChainAppRequestFailedMsg + 30, // 45: vm.VM.CrossChainAppResponse:input_type -> vm.CrossChainAppResponseMsg + 33, // 46: vm.VM.GetAncestors:input_type -> vm.GetAncestorsRequest + 35, // 47: vm.VM.BatchedParseBlock:input_type -> vm.BatchedParseBlockRequest + 52, // 48: vm.VM.VerifyHeightIndex:input_type -> google.protobuf.Empty + 38, // 49: vm.VM.GetBlockIDAtHeight:input_type -> vm.GetBlockIDAtHeightRequest + 52, // 50: vm.VM.StateSyncEnabled:input_type -> google.protobuf.Empty + 52, // 51: vm.VM.GetOngoingSyncStateSummary:input_type -> google.protobuf.Empty + 52, // 52: vm.VM.GetLastStateSummary:input_type -> google.protobuf.Empty + 44, // 53: vm.VM.ParseStateSummary:input_type -> vm.ParseStateSummaryRequest + 46, // 54: vm.VM.GetStateSummary:input_type -> vm.GetStateSummaryRequest + 18, // 55: vm.VM.BlockVerify:input_type -> vm.BlockVerifyRequest + 20, // 56: vm.VM.BlockAccept:input_type -> vm.BlockAcceptRequest + 21, // 57: vm.VM.BlockReject:input_type -> vm.BlockRejectRequest + 48, // 58: vm.VM.StateSummaryAccept:input_type -> vm.StateSummaryAcceptRequest + 5, // 59: vm.VM.Initialize:output_type -> vm.InitializeResponse + 7, // 60: vm.VM.SetState:output_type -> vm.SetStateResponse + 52, // 61: vm.VM.Shutdown:output_type -> google.protobuf.Empty + 8, // 62: vm.VM.CreateHandlers:output_type -> vm.CreateHandlersResponse + 9, // 63: vm.VM.CreateStaticHandlers:output_type -> vm.CreateStaticHandlersResponse + 52, // 64: vm.VM.Connected:output_type -> google.protobuf.Empty + 52, // 65: vm.VM.Disconnected:output_type -> google.protobuf.Empty + 12, // 66: vm.VM.BuildBlock:output_type -> vm.BuildBlockResponse + 14, // 67: vm.VM.ParseBlock:output_type -> vm.ParseBlockResponse + 16, // 68: vm.VM.GetBlock:output_type -> vm.GetBlockResponse + 52, // 69: vm.VM.SetPreference:output_type -> google.protobuf.Empty + 22, // 70: vm.VM.Health:output_type -> vm.HealthResponse + 23, // 71: vm.VM.Version:output_type -> vm.VersionResponse + 52, // 72: vm.VM.AppRequest:output_type -> google.protobuf.Empty + 52, // 73: vm.VM.AppRequestFailed:output_type -> google.protobuf.Empty + 52, // 74: vm.VM.AppResponse:output_type -> google.protobuf.Empty + 52, // 75: vm.VM.AppGossip:output_type -> google.protobuf.Empty + 40, // 76: vm.VM.Gather:output_type -> vm.GatherResponse + 52, // 77: vm.VM.CrossChainAppRequest:output_type -> google.protobuf.Empty + 52, // 78: vm.VM.CrossChainAppRequestFailed:output_type -> google.protobuf.Empty + 52, // 79: vm.VM.CrossChainAppResponse:output_type -> google.protobuf.Empty + 34, // 80: vm.VM.GetAncestors:output_type -> vm.GetAncestorsResponse + 36, // 81: vm.VM.BatchedParseBlock:output_type -> vm.BatchedParseBlockResponse + 37, // 82: vm.VM.VerifyHeightIndex:output_type -> vm.VerifyHeightIndexResponse + 39, // 83: vm.VM.GetBlockIDAtHeight:output_type -> vm.GetBlockIDAtHeightResponse + 41, // 84: vm.VM.StateSyncEnabled:output_type -> vm.StateSyncEnabledResponse + 42, // 85: vm.VM.GetOngoingSyncStateSummary:output_type -> vm.GetOngoingSyncStateSummaryResponse + 43, // 86: vm.VM.GetLastStateSummary:output_type -> vm.GetLastStateSummaryResponse + 45, // 87: vm.VM.ParseStateSummary:output_type -> vm.ParseStateSummaryResponse + 47, // 88: vm.VM.GetStateSummary:output_type -> vm.GetStateSummaryResponse + 19, // 89: vm.VM.BlockVerify:output_type -> vm.BlockVerifyResponse + 52, // 90: vm.VM.BlockAccept:output_type -> google.protobuf.Empty + 52, // 91: vm.VM.BlockReject:output_type -> google.protobuf.Empty + 49, // 92: vm.VM.StateSummaryAccept:output_type -> vm.StateSummaryAcceptResponse + 59, // [59:93] is the sub-list for method output_type + 25, // [25:59] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_vm_vm_proto_init() } @@ -3735,18 +3670,6 @@ func file_vm_vm_proto_init() { } } file_vm_vm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionedDBServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_vm_vm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetStateRequest); i { case 0: return &v.state @@ -3758,7 +3681,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetStateResponse); i { case 0: return &v.state @@ -3770,7 +3693,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateHandlersResponse); i { case 0: return &v.state @@ -3782,7 +3705,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateStaticHandlersResponse); i { case 0: return &v.state @@ -3794,7 +3717,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Handler); i { case 0: return &v.state @@ -3806,7 +3729,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BuildBlockRequest); i { case 0: return &v.state @@ -3818,7 +3741,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BuildBlockResponse); i { case 0: return &v.state @@ -3830,7 +3753,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseBlockRequest); i { case 0: return &v.state @@ -3842,7 +3765,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseBlockResponse); i { case 0: return &v.state @@ -3854,7 +3777,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockRequest); i { case 0: return &v.state @@ -3866,7 +3789,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockResponse); i { case 0: return &v.state @@ -3878,7 +3801,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetPreferenceRequest); i { case 0: return &v.state @@ -3890,7 +3813,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockVerifyRequest); i { case 0: return &v.state @@ -3902,7 +3825,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockVerifyResponse); i { case 0: return &v.state @@ -3914,7 +3837,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockAcceptRequest); i { case 0: return &v.state @@ -3926,7 +3849,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlockRejectRequest); i { case 0: return &v.state @@ -3938,7 +3861,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HealthResponse); i { case 0: return &v.state @@ -3950,7 +3873,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VersionResponse); i { case 0: return &v.state @@ -3962,7 +3885,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppRequestMsg); i { case 0: return &v.state @@ -3974,7 +3897,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppRequestFailedMsg); i { case 0: return &v.state @@ -3986,7 +3909,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppResponseMsg); i { case 0: return &v.state @@ -3998,7 +3921,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AppGossipMsg); i { case 0: return &v.state @@ -4010,7 +3933,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppRequestMsg); i { case 0: return &v.state @@ -4022,7 +3945,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppRequestFailedMsg); i { case 0: return &v.state @@ -4034,7 +3957,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CrossChainAppResponseMsg); i { case 0: return &v.state @@ -4046,7 +3969,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ConnectedRequest); i { case 0: return &v.state @@ -4058,7 +3981,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DisconnectedRequest); i { case 0: return &v.state @@ -4070,7 +3993,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAncestorsRequest); i { case 0: return &v.state @@ -4082,7 +4005,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAncestorsResponse); i { case 0: return &v.state @@ -4094,7 +4017,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchedParseBlockRequest); i { case 0: return &v.state @@ -4106,7 +4029,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchedParseBlockResponse); i { case 0: return &v.state @@ -4118,7 +4041,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VerifyHeightIndexResponse); i { case 0: return &v.state @@ -4130,7 +4053,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockIDAtHeightRequest); i { case 0: return &v.state @@ -4142,7 +4065,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBlockIDAtHeightResponse); i { case 0: return &v.state @@ -4154,7 +4077,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GatherResponse); i { case 0: return &v.state @@ -4166,7 +4089,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSyncEnabledResponse); i { case 0: return &v.state @@ -4178,7 +4101,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetOngoingSyncStateSummaryResponse); i { case 0: return &v.state @@ -4190,7 +4113,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLastStateSummaryResponse); i { case 0: return &v.state @@ -4202,7 +4125,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseStateSummaryRequest); i { case 0: return &v.state @@ -4214,7 +4137,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParseStateSummaryResponse); i { case 0: return &v.state @@ -4226,7 +4149,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateSummaryRequest); i { case 0: return &v.state @@ -4238,7 +4161,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateSummaryResponse); i { case 0: return &v.state @@ -4250,7 +4173,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSummaryAcceptRequest); i { case 0: return &v.state @@ -4262,7 +4185,7 @@ func file_vm_vm_proto_init() { return nil } } - file_vm_vm_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_vm_vm_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateSummaryAcceptResponse); i { case 0: return &v.state @@ -4275,15 +4198,15 @@ func file_vm_vm_proto_init() { } } } - file_vm_vm_proto_msgTypes[8].OneofWrappers = []interface{}{} - file_vm_vm_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_vm_vm_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_vm_vm_proto_msgTypes[14].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vm_vm_proto_rawDesc, NumEnums: 4, - NumMessages: 47, + NumMessages: 46, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/vm/vm.proto b/proto/vm/vm.proto index e005dabf66e9..0eca74b46041 100644 --- a/proto/vm/vm.proto +++ b/proto/vm/vm.proto @@ -127,7 +127,7 @@ message InitializeRequest { bytes genesis_bytes = 10; bytes upgrade_bytes = 11; bytes config_bytes = 12; - repeated VersionedDBServer db_servers = 13; + string db_server_addr = 13; // server_addr is the address of the gRPC server which serves // the messenger, keystore, shared memory, blockchain alias, // subnet alias, and appSender services @@ -142,13 +142,6 @@ message InitializeResponse { google.protobuf.Timestamp timestamp = 5; } -message VersionedDBServer { - string version = 1; - // server_addr is the address of the gRPC server which serves the - // Database service - string server_addr = 2; -} - message SetStateRequest { State state = 1; } diff --git a/snow/engine/avalanche/vertex/mock_vm.go b/snow/engine/avalanche/vertex/mock_vm.go index 973ba6690801..b8d2637c7311 100644 --- a/snow/engine/avalanche/vertex/mock_vm.go +++ b/snow/engine/avalanche/vertex/mock_vm.go @@ -13,7 +13,7 @@ import ( reflect "reflect" time "time" - manager "github.com/ava-labs/avalanchego/database/manager" + database "github.com/ava-labs/avalanchego/database" ids "github.com/ava-labs/avalanchego/ids" snow "github.com/ava-labs/avalanchego/snow" snowman "github.com/ava-labs/avalanchego/snow/consensus/snowman" @@ -263,7 +263,7 @@ func (mr *MockLinearizableVMMockRecorder) HealthCheck(arg0 interface{}) *gomock. } // Initialize mocks base method. -func (m *MockLinearizableVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 manager.Manager, arg3, arg4, arg5 []byte, arg6 chan<- common.Message, arg7 []*common.Fx, arg8 common.AppSender) error { +func (m *MockLinearizableVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 database.Database, arg3, arg4, arg5 []byte, arg6 chan<- common.Message, arg7 []*common.Fx, arg8 common.AppSender) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Initialize", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) ret0, _ := ret[0].(error) diff --git a/snow/engine/common/test_vm.go b/snow/engine/common/test_vm.go index 254401388e6e..9d1a77ef2a9f 100644 --- a/snow/engine/common/test_vm.go +++ b/snow/engine/common/test_vm.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/version" @@ -49,7 +49,7 @@ type TestVM struct { CantAppRequest, CantAppResponse, CantAppGossip, CantAppRequestFailed, CantCrossChainAppRequest, CantCrossChainAppResponse, CantCrossChainAppRequestFailed bool - InitializeF func(ctx context.Context, chainCtx *snow.Context, db manager.Manager, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, msgChan chan<- Message, fxs []*Fx, appSender AppSender) error + InitializeF func(ctx context.Context, chainCtx *snow.Context, db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, msgChan chan<- Message, fxs []*Fx, appSender AppSender) error SetStateF func(ctx context.Context, state snow.State) error ShutdownF func(context.Context) error CreateHandlersF func(context.Context) (map[string]http.Handler, error) @@ -89,7 +89,7 @@ func (vm *TestVM) Default(cant bool) { func (vm *TestVM) Initialize( ctx context.Context, chainCtx *snow.Context, - db manager.Manager, + db database.Database, genesisBytes, upgradeBytes, configBytes []byte, diff --git a/snow/engine/common/vm.go b/snow/engine/common/vm.go index 07cfe1272a6c..e77bdd552bbf 100644 --- a/snow/engine/common/vm.go +++ b/snow/engine/common/vm.go @@ -8,7 +8,7 @@ import ( "net/http" "github.com/ava-labs/avalanchego/api/health" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/validators" ) @@ -47,7 +47,7 @@ type VM interface { Initialize( ctx context.Context, chainCtx *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, diff --git a/snow/engine/snowman/block/mocks/chain_vm.go b/snow/engine/snowman/block/mocks/chain_vm.go index bea5f558d89b..2a2446a94ee5 100644 --- a/snow/engine/snowman/block/mocks/chain_vm.go +++ b/snow/engine/snowman/block/mocks/chain_vm.go @@ -13,7 +13,7 @@ import ( reflect "reflect" time "time" - manager "github.com/ava-labs/avalanchego/database/manager" + database "github.com/ava-labs/avalanchego/database" ids "github.com/ava-labs/avalanchego/ids" snow "github.com/ava-labs/avalanchego/snow" snowman "github.com/ava-labs/avalanchego/snow/consensus/snowman" @@ -262,7 +262,7 @@ func (mr *MockChainVMMockRecorder) HealthCheck(arg0 interface{}) *gomock.Call { } // Initialize mocks base method. -func (m *MockChainVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 manager.Manager, arg3, arg4, arg5 []byte, arg6 chan<- common.Message, arg7 []*common.Fx, arg8 common.AppSender) error { +func (m *MockChainVM) Initialize(arg0 context.Context, arg1 *snow.Context, arg2 database.Database, arg3, arg4, arg5 []byte, arg6 chan<- common.Message, arg7 []*common.Fx, arg8 common.AppSender) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Initialize", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) ret0, _ := ret[0].(error) diff --git a/vms/avm/block/builder/builder_test.go b/vms/avm/block/builder/builder_test.go index 244b5db71561..fdab9d6cf064 100644 --- a/vms/avm/block/builder/builder_test.go +++ b/vms/avm/block/builder/builder_test.go @@ -16,7 +16,7 @@ import ( "go.uber.org/mock/gomock" "github.com/ava-labs/avalanchego/codec" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" @@ -26,7 +26,6 @@ import ( "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/avm/block" "github.com/ava-labs/avalanchego/vms/avm/fxs" "github.com/ava-labs/avalanchego/vms/avm/metrics" @@ -525,8 +524,7 @@ func TestBlockBuilderAddLocalTx(t *testing.T) { Codec: parser.Codec(), } - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - baseDB := versiondb.New(baseDBManager.Current().Database) + baseDB := versiondb.New(memdb.New()) state, err := states.New(baseDB, parser, registerer, trackChecksums) require.NoError(err) diff --git a/vms/avm/environment_test.go b/vms/avm/environment_test.go index 89fa15bd917c..e1e9e29f630e 100644 --- a/vms/avm/environment_test.go +++ b/vms/avm/environment_test.go @@ -15,7 +15,7 @@ import ( "github.com/ava-labs/avalanchego/api/keystore" "github.com/ava-labs/avalanchego/chains/atomic" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" @@ -28,8 +28,8 @@ import ( "github.com/ava-labs/avalanchego/utils/formatting/address" "github.com/ava-labs/avalanchego/utils/json" "github.com/ava-labs/avalanchego/utils/linkedhashmap" + "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/sampler" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/avm/block/executor" "github.com/ava-labs/avalanchego/vms/avm/config" "github.com/ava-labs/avalanchego/vms/avm/fxs" @@ -133,17 +133,15 @@ func setup(tb testing.TB, c *envConfig) *environment { genesisBytes := buildGenesisTestWithArgs(tb, genesisArgs) ctx := newContext(tb) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - - m := atomic.NewMemory(prefixdb.New([]byte{0}, baseDBManager.Current().Database)) + baseDB := memdb.New() + m := atomic.NewMemory(prefixdb.New([]byte{0}, baseDB)) ctx.SharedMemory = m.NewSharedMemory(ctx.ChainID) // NB: this lock is intentionally left locked when this function returns. // The caller of this function is responsible for unlocking. ctx.Lock.Lock() - userKeystore, err := keystore.CreateTestKeystore() - require.NoError(err) + userKeystore := keystore.New(logging.NoLog{}, memdb.New()) ctx.Keystore = userKeystore.NewBlockchainKeyStore(ctx.ChainID) for _, user := range c.keystoreUsers { @@ -181,7 +179,7 @@ func setup(tb testing.TB, c *envConfig) *environment { require.NoError(vm.Initialize( context.Background(), ctx, - baseDBManager.NewPrefixDBManager([]byte{1}), + prefixdb.New([]byte{1}, baseDB), genesisBytes, nil, configBytes, diff --git a/vms/avm/txs/executor/semantic_verifier_test.go b/vms/avm/txs/executor/semantic_verifier_test.go index f73fb47a9a9b..72638762c39b 100644 --- a/vms/avm/txs/executor/semantic_verifier_test.go +++ b/vms/avm/txs/executor/semantic_verifier_test.go @@ -13,7 +13,7 @@ import ( "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/validators" @@ -21,7 +21,6 @@ import ( "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/avm/fxs" "github.com/ava-labs/avalanchego/vms/avm/states" "github.com/ava-labs/avalanchego/vms/avm/txs" @@ -882,8 +881,7 @@ func TestSemanticVerifierImportTx(t *testing.T) { validatorState.EXPECT().GetSubnetID(gomock.Any(), ctx.CChainID).AnyTimes().Return(ctx.SubnetID, nil) ctx.ValidatorState = validatorState - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - m := atomic.NewMemory(prefixdb.New([]byte{0}, baseDBManager.Current().Database)) + m := atomic.NewMemory(prefixdb.New([]byte{0}, memdb.New())) ctx.SharedMemory = m.NewSharedMemory(ctx.ChainID) typeToFxIndex := make(map[reflect.Type]int) diff --git a/vms/avm/vm.go b/vms/avm/vm.go index e115b2d6d640..cae4514ff3a6 100644 --- a/vms/avm/vm.go +++ b/vms/avm/vm.go @@ -20,7 +20,6 @@ import ( "github.com/ava-labs/avalanchego/cache" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/pubsub" @@ -144,7 +143,7 @@ type Config struct { func (vm *VM) Initialize( _ context.Context, ctx *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, _ []byte, configBytes []byte, @@ -181,7 +180,6 @@ func (vm *VM) Initialize( vm.AddressManager = avax.NewAddressManager(ctx) vm.Aliaser = ids.NewAliaser() - db := dbManager.Current().Database vm.ctx = ctx vm.appSender = appSender vm.baseDB = db diff --git a/vms/avm/vm_test.go b/vms/avm/vm_test.go index 10a8ed50d051..3b4dc9558807 100644 --- a/vms/avm/vm_test.go +++ b/vms/avm/vm_test.go @@ -13,12 +13,11 @@ import ( "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/avm/config" "github.com/ava-labs/avalanchego/vms/avm/fxs" "github.com/ava-labs/avalanchego/vms/avm/txs" @@ -42,14 +41,14 @@ func TestInvalidGenesis(t *testing.T) { err := vm.Initialize( context.Background(), - ctx, // context - manager.NewMemDB(version.Semantic1_0_0), // dbManager - nil, // genesisState - nil, // upgradeBytes - nil, // configBytes - make(chan common.Message, 1), // engineMessenger - nil, // fxs - nil, // AppSender + ctx, // context + memdb.New(), // database + nil, // genesisState + nil, // upgradeBytes + nil, // configBytes + make(chan common.Message, 1), // engineMessenger + nil, // fxs + nil, // AppSender ) require.ErrorIs(err, codec.ErrCantUnpackVersion) } @@ -68,12 +67,12 @@ func TestInvalidFx(t *testing.T) { genesisBytes := buildGenesisTest(t) err := vm.Initialize( context.Background(), - ctx, // context - manager.NewMemDB(version.Semantic1_0_0), // dbManager - genesisBytes, // genesisState - nil, // upgradeBytes - nil, // configBytes - make(chan common.Message, 1), // engineMessenger + ctx, // context + memdb.New(), // database + genesisBytes, // genesisState + nil, // upgradeBytes + nil, // configBytes + make(chan common.Message, 1), // engineMessenger []*common.Fx{ // fxs nil, }, @@ -96,12 +95,12 @@ func TestFxInitializationFailure(t *testing.T) { genesisBytes := buildGenesisTest(t) err := vm.Initialize( context.Background(), - ctx, // context - manager.NewMemDB(version.Semantic1_0_0), // dbManager - genesisBytes, // genesisState - nil, // upgradeBytes - nil, // configBytes - make(chan common.Message, 1), // engineMessenger + ctx, // context + memdb.New(), // database + genesisBytes, // genesisState + nil, // upgradeBytes + nil, // configBytes + make(chan common.Message, 1), // engineMessenger []*common.Fx{{ // fxs ID: ids.Empty, Fx: &FxTest{ diff --git a/vms/example/xsvm/vm.go b/vms/example/xsvm/vm.go index f164787e9972..3150fc59b481 100644 --- a/vms/example/xsvm/vm.go +++ b/vms/example/xsvm/vm.go @@ -13,7 +13,6 @@ import ( "go.uber.org/zap" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" @@ -52,7 +51,7 @@ type VM struct { func (vm *VM) Initialize( _ context.Context, chainContext *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, _ []byte, _ []byte, @@ -67,8 +66,7 @@ func (vm *VM) Initialize( ) vm.chainContext = chainContext - vm.db = dbManager.Current().Database - + vm.db = db g, err := genesis.Parse(genesisBytes) if err != nil { return fmt.Errorf("failed to parse genesis bytes: %w", err) diff --git a/vms/metervm/block_vm.go b/vms/metervm/block_vm.go index 89200c3561cf..8f9fee1e247d 100644 --- a/vms/metervm/block_vm.go +++ b/vms/metervm/block_vm.go @@ -9,7 +9,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/ava-labs/avalanchego/api/metrics" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowman" @@ -50,7 +50,7 @@ func NewBlockVM(vm block.ChainVM) block.ChainVM { func (vm *blockVM) Initialize( ctx context.Context, chainCtx *snow.Context, - db manager.Manager, + db database.Database, genesisBytes, upgradeBytes, configBytes []byte, diff --git a/vms/metervm/vertex_vm.go b/vms/metervm/vertex_vm.go index aa8a0e71d3d5..827bb535fcbd 100644 --- a/vms/metervm/vertex_vm.go +++ b/vms/metervm/vertex_vm.go @@ -9,7 +9,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/ava-labs/avalanchego/api/metrics" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowstorm" "github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex" @@ -37,7 +37,7 @@ type vertexVM struct { func (vm *vertexVM) Initialize( ctx context.Context, chainCtx *snow.Context, - db manager.Manager, + db database.Database, genesisBytes, upgradeBytes, configBytes []byte, diff --git a/vms/platformvm/block/builder/helpers_test.go b/vms/platformvm/block/builder/helpers_test.go index f68f0f4628e4..187c0eb92a70 100644 --- a/vms/platformvm/block/builder/helpers_test.go +++ b/vms/platformvm/block/builder/helpers_test.go @@ -18,7 +18,7 @@ import ( "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" @@ -35,7 +35,6 @@ import ( "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/utils/units" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/api" "github.com/ava-labs/avalanchego/vms/platformvm/config" @@ -115,8 +114,7 @@ func newEnvironment(t *testing.T) *environment { } res.isBootstrapped.Set(true) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - res.baseDB = versiondb.New(baseDBManager.Current().Database) + res.baseDB = versiondb.New(memdb.New()) res.ctx, res.msm = defaultCtx(res.baseDB) res.ctx.Lock.Lock() diff --git a/vms/platformvm/block/executor/helpers_test.go b/vms/platformvm/block/executor/helpers_test.go index c13c4b635343..7d5a67566472 100644 --- a/vms/platformvm/block/executor/helpers_test.go +++ b/vms/platformvm/block/executor/helpers_test.go @@ -19,6 +19,7 @@ import ( "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" @@ -35,7 +36,6 @@ import ( "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/utils/units" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/api" "github.com/ava-labs/avalanchego/vms/platformvm/config" @@ -50,7 +50,6 @@ import ( "github.com/ava-labs/avalanchego/vms/platformvm/utxo" "github.com/ava-labs/avalanchego/vms/secp256k1fx" - db_manager "github.com/ava-labs/avalanchego/database/manager" p_tx_builder "github.com/ava-labs/avalanchego/vms/platformvm/txs/builder" pvalidators "github.com/ava-labs/avalanchego/vms/platformvm/validators" ) @@ -134,8 +133,7 @@ func newEnvironment(t *testing.T, ctrl *gomock.Controller) *environment { } res.isBootstrapped.Set(true) - baseDBManager := db_manager.NewMemDB(version.Semantic1_0_0) - res.baseDB = versiondb.New(baseDBManager.Current().Database) + res.baseDB = versiondb.New(memdb.New()) res.ctx = defaultCtx(res.baseDB) res.fx = defaultFx(res.clk, res.ctx.Log, res.isBootstrapped.Get()) diff --git a/vms/platformvm/service_test.go b/vms/platformvm/service_test.go index 2db9dc2fc6f4..b3eebf31659d 100644 --- a/vms/platformvm/service_test.go +++ b/vms/platformvm/service_test.go @@ -23,7 +23,7 @@ import ( "github.com/ava-labs/avalanchego/cache" "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" @@ -35,7 +35,6 @@ import ( "github.com/ava-labs/avalanchego/utils/formatting" "github.com/ava-labs/avalanchego/utils/json" "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/block" "github.com/ava-labs/avalanchego/vms/platformvm/state" @@ -77,7 +76,7 @@ func defaultService(t *testing.T) (*Service, *mutableSharedMemory) { vm, _, mutableSharedMemory := defaultVM(t) vm.ctx.Lock.Lock() defer vm.ctx.Lock.Unlock() - ks := keystore.New(logging.NoLog{}, manager.NewMemDB(version.Semantic1_0_0)) + ks := keystore.New(logging.NoLog{}, memdb.New()) require.NoError(t, ks.CreateUser(testUsername, testPassword)) vm.ctx.Keystore = ks.NewBlockchainKeyStore(vm.ctx.ChainID) @@ -179,7 +178,7 @@ func TestGetTxStatus(t *testing.T) { recipientKey, err := secp256k1.NewPrivateKey() require.NoError(err) - m := atomic.NewMemory(prefixdb.New([]byte{}, service.vm.dbManager.Current().Database)) + m := atomic.NewMemory(prefixdb.New([]byte{}, service.vm.db)) sm := m.NewSharedMemory(service.vm.ctx.ChainID) peerSharedMemory := m.NewSharedMemory(xChainID) diff --git a/vms/platformvm/txs/executor/helpers_test.go b/vms/platformvm/txs/executor/helpers_test.go index cf16196dba63..aee0d184d5f8 100644 --- a/vms/platformvm/txs/executor/helpers_test.go +++ b/vms/platformvm/txs/executor/helpers_test.go @@ -20,7 +20,7 @@ import ( "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" @@ -36,7 +36,6 @@ import ( "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/utils/units" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/api" "github.com/ava-labs/avalanchego/vms/platformvm/config" @@ -117,8 +116,7 @@ func newEnvironment(t *testing.T, postBanff, postCortina bool) *environment { config := defaultConfig(postBanff, postCortina) clk := defaultClock(postBanff || postCortina) - baseDBManager := manager.NewMemDB(version.CurrentDatabase) - baseDB := versiondb.New(baseDBManager.Current().Database) + baseDB := versiondb.New(memdb.New()) ctx, msm := defaultCtx(baseDB) fx := defaultFx(clk, ctx.Log, isBootstrapped.Get()) diff --git a/vms/platformvm/validator_set_property_test.go b/vms/platformvm/validator_set_property_test.go index d984a1a986b0..fab84cc6d50b 100644 --- a/vms/platformvm/validator_set_property_test.go +++ b/vms/platformvm/validator_set_property_test.go @@ -20,7 +20,7 @@ import ( "github.com/ava-labs/avalanchego/chains" "github.com/ava-labs/avalanchego/chains/atomic" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" @@ -36,7 +36,6 @@ import ( "github.com/ava-labs/avalanchego/utils/json" "github.com/ava-labs/avalanchego/utils/timer/mockable" "github.com/ava-labs/avalanchego/utils/units" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/api" "github.com/ava-labs/avalanchego/vms/platformvm/block" @@ -748,9 +747,9 @@ func buildVM(t *testing.T) (*VM, ids.ID, error) { }} vm.clock.Set(forkTime.Add(time.Second)) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - chainDBManager := baseDBManager.NewPrefixDBManager([]byte{0}) - atomicDB := prefixdb.New([]byte{1}, baseDBManager.Current().Database) + baseDB := memdb.New() + chainDB := prefixdb.New([]byte{0}, baseDB) + atomicDB := prefixdb.New([]byte{1}, baseDB) msgChan := make(chan common.Message, 1) ctx := defaultContext(t) @@ -774,7 +773,7 @@ func buildVM(t *testing.T) (*VM, ids.ID, error) { err = vm.Initialize( context.Background(), ctx, - chainDBManager, + chainDB, genesisBytes, nil, nil, diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index ee2fa308ebdb..c1a911f5b919 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -17,7 +17,7 @@ import ( "github.com/ava-labs/avalanchego/cache" "github.com/ava-labs/avalanchego/codec" "github.com/ava-labs/avalanchego/codec/linearcodec" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowman" @@ -72,8 +72,8 @@ type VM struct { uptimeManager uptime.Manager // The context of this vm - ctx *snow.Context - dbManager manager.Manager + ctx *snow.Context + db database.Database state state.State @@ -95,7 +95,7 @@ type VM struct { func (vm *VM) Initialize( ctx context.Context, chainCtx *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, _ []byte, configBytes []byte, @@ -123,7 +123,7 @@ func (vm *VM) Initialize( } vm.ctx = chainCtx - vm.dbManager = dbManager + vm.db = db vm.codecRegistry = linearcodec.NewDefault() vm.fx = &secp256k1fx.Fx{} @@ -134,7 +134,7 @@ func (vm *VM) Initialize( rewards := reward.NewCalculator(vm.RewardConfig) vm.state, err = state.New( - vm.dbManager.Current().Database, + vm.db, genesisBytes, registerer, &vm.Config, @@ -339,7 +339,7 @@ func (vm *VM) SetState(_ context.Context, state snow.State) error { // Shutdown this blockchain func (vm *VM) Shutdown(context.Context) error { - if vm.dbManager == nil { + if vm.db == nil { return nil } @@ -365,7 +365,7 @@ func (vm *VM) Shutdown(context.Context) error { return utils.Err( vm.state.Close(), - vm.dbManager.Close(), + vm.db.Close(), ) } diff --git a/vms/platformvm/vm_regression_test.go b/vms/platformvm/vm_regression_test.go index 83ac4fd71285..8416c4114662 100644 --- a/vms/platformvm/vm_regression_test.go +++ b/vms/platformvm/vm_regression_test.go @@ -17,7 +17,7 @@ import ( "github.com/ava-labs/avalanchego/chains" "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow/choices" @@ -29,7 +29,6 @@ import ( "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/bls" "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/avax" "github.com/ava-labs/avalanchego/vms/platformvm/block" "github.com/ava-labs/avalanchego/vms/platformvm/config" @@ -343,8 +342,8 @@ func TestUnverifiedParentPanicRegression(t *testing.T) { require := require.New(t) _, genesisBytes := defaultGenesis(t) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - atomicDB := prefixdb.New([]byte{1}, baseDBManager.Current().Database) + baseDB := memdb.New() + atomicDB := prefixdb.New([]byte{1}, baseDB) vm := &VM{Config: config.Config{ Chains: chains.TestManager, @@ -367,7 +366,7 @@ func TestUnverifiedParentPanicRegression(t *testing.T) { require.NoError(vm.Initialize( context.Background(), ctx, - baseDBManager, + baseDB, genesisBytes, nil, nil, @@ -652,7 +651,7 @@ func TestRejectedStateRegressionInvalidValidatorTimestamp(t *testing.T) { vm.Config.Validators = validators.NewManager() execCfg, _ := config.GetExecutionConfig(nil) newState, err := state.New( - vm.dbManager.Current().Database, + vm.db, nil, prometheus.NewRegistry(), &vm.Config, @@ -961,7 +960,7 @@ func TestRejectedStateRegressionInvalidValidatorReward(t *testing.T) { vm.Config.Validators = validators.NewManager() execCfg, _ := config.GetExecutionConfig(nil) newState, err := state.New( - vm.dbManager.Current().Database, + vm.db, nil, prometheus.NewRegistry(), &vm.Config, diff --git a/vms/platformvm/vm_test.go b/vms/platformvm/vm_test.go index 691a656af88e..7b0bbba58cdf 100644 --- a/vms/platformvm/vm_test.go +++ b/vms/platformvm/vm_test.go @@ -17,7 +17,7 @@ import ( "github.com/ava-labs/avalanchego/chains" "github.com/ava-labs/avalanchego/chains/atomic" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/message" @@ -315,9 +315,9 @@ func defaultVM(t *testing.T) (*VM, database.Database, *mutableSharedMemory) { BanffTime: banffForkTime, }} - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - chainDBManager := baseDBManager.NewPrefixDBManager([]byte{0}) - atomicDB := prefixdb.New([]byte{1}, baseDBManager.Current().Database) + db := memdb.New() + chainDB := prefixdb.New([]byte{0}, db) + atomicDB := prefixdb.New([]byte{1}, db) vm.clock.Set(banffForkTime.Add(time.Second)) msgChan := make(chan common.Message, 1) @@ -341,7 +341,7 @@ func defaultVM(t *testing.T) (*VM, database.Database, *mutableSharedMemory) { require.NoError(vm.Initialize( context.Background(), ctx, - chainDBManager, + chainDB, genesisBytes, nil, nil, @@ -371,7 +371,7 @@ func defaultVM(t *testing.T) (*VM, database.Database, *mutableSharedMemory) { require.NoError(blk.Accept(context.Background())) require.NoError(vm.SetPreference(context.Background(), vm.manager.LastAccepted())) - return vm, baseDBManager.Current().Database, msm + return vm, db, msm } // Ensure genesis state is parsed from bytes and stored correctly @@ -1172,9 +1172,9 @@ func TestOptimisticAtomicImport(t *testing.T) { func TestRestartFullyAccepted(t *testing.T) { require := require.New(t) _, genesisBytes := defaultGenesis(t) - db := manager.NewMemDB(version.Semantic1_0_0) + db := memdb.New() - firstDB := db.NewPrefixDBManager([]byte{}) + firstDB := prefixdb.New([]byte{}, db) firstVM := &VM{Config: config.Config{ Chains: chains.TestManager, Validators: validators.NewManager(), @@ -1187,8 +1187,8 @@ func TestRestartFullyAccepted(t *testing.T) { firstCtx := defaultContext(t) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - atomicDB := prefixdb.New([]byte{1}, baseDBManager.Current().Database) + baseDB := memdb.New() + atomicDB := prefixdb.New([]byte{1}, baseDB) m := atomic.NewMemory(atomicDB) msm := &mutableSharedMemory{ SharedMemory: m.NewSharedMemory(firstCtx.ChainID), @@ -1279,7 +1279,7 @@ func TestRestartFullyAccepted(t *testing.T) { secondCtx.Lock.Unlock() }() - secondDB := db.NewPrefixDBManager([]byte{}) + secondDB := prefixdb.New([]byte{}, db) secondMsgChan := make(chan common.Message, 1) require.NoError(secondVM.Initialize( context.Background(), @@ -1304,10 +1304,9 @@ func TestBootstrapPartiallyAccepted(t *testing.T) { _, genesisBytes := defaultGenesis(t) - baseDBManager := manager.NewMemDB(version.Semantic1_0_0) - vmDBManager := baseDBManager.NewPrefixDBManager([]byte("vm")) - bootstrappingDB := prefixdb.New([]byte("bootstrapping"), baseDBManager.Current().Database) - + baseDB := memdb.New() + vmDB := prefixdb.New([]byte("vm"), baseDB) + bootstrappingDB := prefixdb.New([]byte("bootstrapping"), baseDB) blocked, err := queue.NewWithMissing(bootstrappingDB, "", prometheus.NewRegistry()) require.NoError(err) @@ -1325,7 +1324,7 @@ func TestBootstrapPartiallyAccepted(t *testing.T) { vm.clock.Set(initialClkTime) ctx := defaultContext(t) - atomicDB := prefixdb.New([]byte{1}, baseDBManager.Current().Database) + atomicDB := prefixdb.New([]byte{1}, baseDB) m := atomic.NewMemory(atomicDB) msm := &mutableSharedMemory{ SharedMemory: m.NewSharedMemory(ctx.ChainID), @@ -1340,7 +1339,7 @@ func TestBootstrapPartiallyAccepted(t *testing.T) { require.NoError(vm.Initialize( context.Background(), ctx, - vmDBManager, + vmDB, genesisBytes, nil, nil, @@ -1630,7 +1629,6 @@ func TestBootstrapPartiallyAccepted(t *testing.T) { func TestUnverifiedParent(t *testing.T) { require := require.New(t) _, genesisBytes := defaultGenesis(t) - dbManager := manager.NewMemDB(version.Semantic1_0_0) vm := &VM{Config: config.Config{ Chains: chains.TestManager, @@ -1655,7 +1653,7 @@ func TestUnverifiedParent(t *testing.T) { require.NoError(vm.Initialize( context.Background(), ctx, - dbManager, + memdb.New(), genesisBytes, nil, nil, @@ -1787,9 +1785,9 @@ func TestMaxStakeAmount(t *testing.T) { func TestUptimeDisallowedWithRestart(t *testing.T) { require := require.New(t) _, genesisBytes := defaultGenesis(t) - db := manager.NewMemDB(version.Semantic1_0_0) + db := memdb.New() - firstDB := db.NewPrefixDBManager([]byte{}) + firstDB := prefixdb.New([]byte{}, db) const firstUptimePercentage = 20 // 20% firstVM := &VM{Config: config.Config{ Chains: chains.TestManager, @@ -1833,7 +1831,7 @@ func TestUptimeDisallowedWithRestart(t *testing.T) { firstCtx.Lock.Unlock() // Restart the VM with a larger uptime requirement - secondDB := db.NewPrefixDBManager([]byte{}) + secondDB := prefixdb.New([]byte{}, db) const secondUptimePercentage = 21 // 21% > firstUptimePercentage, so uptime for reward is not met now secondVM := &VM{Config: config.Config{ Chains: chains.TestManager, @@ -1925,7 +1923,7 @@ func TestUptimeDisallowedWithRestart(t *testing.T) { func TestUptimeDisallowedAfterNeverConnecting(t *testing.T) { require := require.New(t) _, genesisBytes := defaultGenesis(t) - db := manager.NewMemDB(version.Semantic1_0_0) + db := memdb.New() vm := &VM{Config: config.Config{ Chains: chains.TestManager, diff --git a/vms/proposervm/batched_vm_test.go b/vms/proposervm/batched_vm_test.go index 76f5e7ca31b8..499025c6b2f4 100644 --- a/vms/proposervm/batched_vm_test.go +++ b/vms/proposervm/batched_vm_test.go @@ -11,7 +11,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" + "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" @@ -21,7 +23,6 @@ import ( "github.com/ava-labs/avalanchego/snow/validators" "github.com/ava-labs/avalanchego/utils/math" "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/proposervm/proposer" ) @@ -984,7 +985,7 @@ func initTestRemoteProposerVM( coreVM.InitializeF = func( context.Context, *snow.Context, - manager.Manager, + database.Database, []byte, []byte, []byte, @@ -1061,13 +1062,10 @@ func initTestRemoteProposerVM( ctx.NodeID = ids.NodeIDFromCert(pTestCert) ctx.ValidatorState = valState - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + prefixdb.New([]byte{}, memdb.New()), // make sure that DBs are compressed correctly initialState, nil, nil, diff --git a/vms/proposervm/post_fork_option_test.go b/vms/proposervm/post_fork_option_test.go index d713faffb551..09fe29730b6f 100644 --- a/vms/proposervm/post_fork_option_test.go +++ b/vms/proposervm/post_fork_option_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" @@ -672,7 +671,7 @@ func TestOptionTimestampValidity(t *testing.T) { coreVM.InitializeF = func( context.Context, *snow.Context, - manager.Manager, + database.Database, []byte, []byte, []byte, diff --git a/vms/proposervm/state_syncable_vm_test.go b/vms/proposervm/state_syncable_vm_test.go index 888ea5ebeee3..826f8b877987 100644 --- a/vms/proposervm/state_syncable_vm_test.go +++ b/vms/proposervm/state_syncable_vm_test.go @@ -11,14 +11,14 @@ import ( "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/proposervm/summary" statelessblock "github.com/ava-labs/avalanchego/vms/proposervm/block" @@ -51,7 +51,7 @@ func helperBuildStateSyncTestObjects(t *testing.T) (*fullVM, *VM) { HeightV: 0, BytesV: []byte("genesis state"), } - innerVM.InitializeF = func(context.Context, *snow.Context, manager.Manager, + innerVM.InitializeF = func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender, ) error { @@ -67,10 +67,7 @@ func helperBuildStateSyncTestObjects(t *testing.T) (*fullVM, *VM) { return innerGenesisBlk, nil } - // createVM - dbManager := manager.NewMemDB(version.Semantic1_0_0) - dbManager = dbManager.NewPrefixDBManager([]byte{}) - + // create the VM vm := New( innerVM, time.Time{}, @@ -87,7 +84,7 @@ func helperBuildStateSyncTestObjects(t *testing.T) (*fullVM, *VM) { require.NoError(vm.Initialize( context.Background(), ctx, - dbManager, + prefixdb.New([]byte{}, memdb.New()), innerGenesisBlk.Bytes(), nil, nil, diff --git a/vms/proposervm/vm.go b/vms/proposervm/vm.go index a101be86f574..ae9691ab380e 100644 --- a/vms/proposervm/vm.go +++ b/vms/proposervm/vm.go @@ -18,7 +18,6 @@ import ( "github.com/ava-labs/avalanchego/cache" "github.com/ava-labs/avalanchego/cache/metercacher" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/database/versiondb" "github.com/ava-labs/avalanchego/ids" @@ -167,7 +166,7 @@ func New( func (vm *VM) Initialize( ctx context.Context, chainCtx *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, @@ -193,9 +192,7 @@ func (vm *VM) Initialize( chainCtx.Metrics = optionalGatherer vm.ctx = chainCtx - rawDB := dbManager.Current().Database - prefixDB := prefixdb.New(dbPrefix, rawDB) - vm.db = versiondb.New(prefixDB) + vm.db = versiondb.New(prefixdb.New(dbPrefix, db)) baseState, err := state.NewMetered(vm.db, "state", registerer) if err != nil { return err @@ -237,7 +234,7 @@ func (vm *VM) Initialize( err = vm.ChainVM.Initialize( ctx, chainCtx, - dbManager, + db, genesisBytes, upgradeBytes, configBytes, diff --git a/vms/proposervm/vm_regression_test.go b/vms/proposervm/vm_regression_test.go index 351d63459ab4..0a27c43e112a 100644 --- a/vms/proposervm/vm_regression_test.go +++ b/vms/proposervm/vm_regression_test.go @@ -11,11 +11,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" + "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" - "github.com/ava-labs/avalanchego/version" ) func TestProposerVMInitializeShouldFailIfInnerVMCantVerifyItsHeightIndex(t *testing.T) { @@ -36,7 +37,7 @@ func TestProposerVMInitializeShouldFailIfInnerVMCantVerifyItsHeightIndex(t *test return customError } - innerVM.InitializeF = func(context.Context, *snow.Context, manager.Manager, + innerVM.InitializeF = func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender, ) error { @@ -58,14 +59,12 @@ func TestProposerVMInitializeShouldFailIfInnerVMCantVerifyItsHeightIndex(t *test }() ctx := snow.DefaultContextTest() - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) initialState := []byte("genesis state") err := proVM.Initialize( context.Background(), ctx, - dummyDBManager, + prefixdb.New([]byte{}, memdb.New()), initialState, nil, nil, diff --git a/vms/proposervm/vm_test.go b/vms/proposervm/vm_test.go index 102ec2b37a33..b3c22862f9bf 100644 --- a/vms/proposervm/vm_test.go +++ b/vms/proposervm/vm_test.go @@ -17,7 +17,8 @@ import ( "go.uber.org/mock/gomock" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" @@ -29,7 +30,6 @@ import ( "github.com/ava-labs/avalanchego/staking" "github.com/ava-labs/avalanchego/utils" "github.com/ava-labs/avalanchego/utils/timer/mockable" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/proposervm/proposer" "github.com/ava-labs/avalanchego/vms/proposervm/state" @@ -80,7 +80,7 @@ func initTestProposerVM( *validators.TestState, *VM, *snowman.TestBlock, - manager.Manager, + database.Database, ) { require := require.New(t) @@ -106,7 +106,7 @@ func initTestProposerVM( }, } - coreVM.InitializeF = func(context.Context, *snow.Context, manager.Manager, + coreVM.InitializeF = func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender, ) error { @@ -177,8 +177,7 @@ func initTestProposerVM( ctx.NodeID = ids.NodeIDFromCert(pTestCert) ctx.ValidatorState = valState - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) + db := prefixdb.New([]byte{0}, memdb.New()) // signal height index is complete coreVM.VerifyHeightIndexF = func(context.Context) error { @@ -188,7 +187,7 @@ func initTestProposerVM( require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + db, initialState, nil, nil, @@ -203,7 +202,7 @@ func initTestProposerVM( require.NoError(proVM.SetState(context.Background(), snow.NormalOp)) require.NoError(proVM.SetPreference(context.Background(), coreGenBlk.IDV)) - return coreVM, valState, proVM, coreGenBlk, dummyDBManager + return coreVM, valState, proVM, coreGenBlk, db } // VM.BuildBlock tests section @@ -905,14 +904,13 @@ func TestExpiredBuildBlock(t *testing.T) { ctx.NodeID = ids.NodeIDFromCert(pTestCert) ctx.ValidatorState = valState - dbManager := manager.NewMemDB(version.Semantic1_0_0) toEngine := make(chan common.Message, 1) var toScheduler chan<- common.Message coreVM.InitializeF = func( _ context.Context, _ *snow.Context, - _ manager.Manager, + _ database.Database, _ []byte, _ []byte, _ []byte, @@ -931,7 +929,7 @@ func TestExpiredBuildBlock(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dbManager, + memdb.New(), nil, nil, nil, @@ -1200,7 +1198,7 @@ func TestInnerVMRollback(t *testing.T) { coreVM.InitializeF = func( context.Context, *snow.Context, - manager.Manager, + database.Database, []byte, []byte, []byte, @@ -1214,7 +1212,7 @@ func TestInnerVMRollback(t *testing.T) { return nil } - dbManager := manager.NewMemDB(version.Semantic1_0_0) + db := memdb.New() proVM := New( coreVM, @@ -1229,7 +1227,7 @@ func TestInnerVMRollback(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dbManager, + db, nil, nil, nil, @@ -1316,7 +1314,7 @@ func TestInnerVMRollback(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dbManager, + db, nil, nil, nil, @@ -1769,7 +1767,7 @@ func TestRejectedHeightNotIndexed(t *testing.T) { }, } - coreVM.InitializeF = func(context.Context, *snow.Context, manager.Manager, + coreVM.InitializeF = func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender, ) error { @@ -1839,13 +1837,10 @@ func TestRejectedHeightNotIndexed(t *testing.T) { ctx.NodeID = ids.NodeIDFromCert(pTestCert) ctx.ValidatorState = valState - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + prefixdb.New([]byte{}, memdb.New()), // make sure that DBs are compressed correctly initialState, nil, nil, @@ -1973,7 +1968,7 @@ func TestRejectedOptionHeightNotIndexed(t *testing.T) { }, } - coreVM.InitializeF = func(context.Context, *snow.Context, manager.Manager, + coreVM.InitializeF = func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender, ) error { @@ -2043,13 +2038,10 @@ func TestRejectedOptionHeightNotIndexed(t *testing.T) { ctx.NodeID = ids.NodeIDFromCert(pTestCert) ctx.ValidatorState = valState - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + prefixdb.New([]byte{}, memdb.New()), // make sure that DBs are compressed correctly initialState, nil, nil, @@ -2169,10 +2161,6 @@ func TestVMInnerBlkCache(t *testing.T) { pTestCert, ) - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) - // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) - innerVM.EXPECT().Initialize( gomock.Any(), gomock.Any(), @@ -2200,7 +2188,7 @@ func TestVMInnerBlkCache(t *testing.T) { require.NoError(vm.Initialize( context.Background(), ctx, - dummyDBManager, + prefixdb.New([]byte{}, memdb.New()), // make sure that DBs are compressed correctly nil, nil, nil, @@ -2402,9 +2390,8 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { pTestCert, ) - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) + db := prefixdb.New([]byte{}, memdb.New()) innerVM.EXPECT().Initialize( gomock.Any(), @@ -2433,7 +2420,7 @@ func TestVM_VerifyBlockWithContext(t *testing.T) { require.NoError(vm.Initialize( context.Background(), snowCtx, - dummyDBManager, + db, nil, nil, nil, @@ -2552,7 +2539,7 @@ func TestHistoricalBlockDeletion(t *testing.T) { coreVM := &block.TestVM{ TestVM: common.TestVM{ T: t, - InitializeF: func(context.Context, *snow.Context, manager.Manager, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender) error { + InitializeF: func(context.Context, *snow.Context, database.Database, []byte, []byte, []byte, chan<- common.Message, []*common.Fx, common.AppSender) error { return nil }, }, @@ -2601,9 +2588,8 @@ func TestHistoricalBlockDeletion(t *testing.T) { }, } - dummyDBManager := manager.NewMemDB(version.Semantic1_0_0) // make sure that DBs are compressed correctly - dummyDBManager = dummyDBManager.NewPrefixDBManager([]byte{}) + db := prefixdb.New([]byte{}, memdb.New()) proVM := New( coreVM, @@ -2618,7 +2604,7 @@ func TestHistoricalBlockDeletion(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + db, initialState, nil, nil, @@ -2716,7 +2702,7 @@ func TestHistoricalBlockDeletion(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + db, initialState, nil, nil, @@ -2758,7 +2744,7 @@ func TestHistoricalBlockDeletion(t *testing.T) { require.NoError(proVM.Initialize( context.Background(), ctx, - dummyDBManager, + db, initialState, nil, nil, diff --git a/vms/rpcchainvm/batched_vm_test.go b/vms/rpcchainvm/batched_vm_test.go index dbadedad988f..817037dc6e3e 100644 --- a/vms/rpcchainvm/batched_vm_test.go +++ b/vms/rpcchainvm/batched_vm_test.go @@ -12,14 +12,13 @@ import ( "go.uber.org/mock/gomock" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/components/chain" ) @@ -88,9 +87,8 @@ func TestBatchedParseBlockCaching(t *testing.T) { defer stopper.Stop(context.Background()) ctx := snow.DefaultContextTest() - dbManager := manager.NewMemDB(version.Semantic1_0_0) - require.NoError(vm.Initialize(context.Background(), ctx, dbManager, nil, nil, nil, nil, nil, nil)) + require.NoError(vm.Initialize(context.Background(), ctx, memdb.New(), nil, nil, nil, nil, nil, nil)) // Call should parse the first block blk, err := vm.ParseBlock(context.Background(), blkBytes1) diff --git a/vms/rpcchainvm/state_syncable_vm_test.go b/vms/rpcchainvm/state_syncable_vm_test.go index ffd486df94eb..241062616c9b 100644 --- a/vms/rpcchainvm/state_syncable_vm_test.go +++ b/vms/rpcchainvm/state_syncable_vm_test.go @@ -13,7 +13,8 @@ import ( "go.uber.org/mock/gomock" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" + "github.com/ava-labs/avalanchego/database/prefixdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/choices" @@ -21,7 +22,6 @@ import ( "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/version" "github.com/ava-labs/avalanchego/vms/rpcchainvm/grpcutils" "github.com/ava-labs/avalanchego/vms/rpcchainvm/runtime" "github.com/ava-labs/avalanchego/vms/rpcchainvm/runtime/subprocess" @@ -471,10 +471,8 @@ func TestLastAcceptedBlockPostStateSummaryAccept(t *testing.T) { // Step 1: initialize VM and check initial LastAcceptedBlock ctx := snow.DefaultContextTest() - dbManager := manager.NewMemDB(version.Semantic1_0_0) - dbManager = dbManager.NewPrefixDBManager([]byte{}) - require.NoError(vm.Initialize(context.Background(), ctx, dbManager, nil, nil, nil, nil, nil, nil)) + require.NoError(vm.Initialize(context.Background(), ctx, prefixdb.New([]byte{}, memdb.New()), nil, nil, nil, nil, nil, nil)) blkID, err := vm.LastAccepted(context.Background()) require.NoError(err) diff --git a/vms/rpcchainvm/vm_client.go b/vms/rpcchainvm/vm_client.go index 430bb18201a5..9a7823979348 100644 --- a/vms/rpcchainvm/vm_client.go +++ b/vms/rpcchainvm/vm_client.go @@ -29,7 +29,6 @@ import ( "github.com/ava-labs/avalanchego/api/metrics" "github.com/ava-labs/avalanchego/chains/atomic/gsharedmemory" "github.com/ava-labs/avalanchego/database" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/rpcdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/ids/galiasreader" @@ -129,7 +128,7 @@ func (vm *VMClient) SetProcess(runtime runtime.Stopper, pid int, processTracker func (vm *VMClient) Initialize( ctx context.Context, chainCtx *snow.Context, - dbManager manager.Manager, + db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, @@ -155,33 +154,21 @@ func (vm *VMClient) Initialize( return err } - // Initialize and serve each database and construct the db manager - // initialize request parameters - versionedDBs := dbManager.GetDatabases() - versionedDBServers := make([]*vmpb.VersionedDBServer, len(versionedDBs)) - for i, semDB := range versionedDBs { - dbVersion := semDB.Version.String() - serverListener, err := grpcutils.NewListener() - if err != nil { - return err - } - serverAddr := serverListener.Addr().String() - - go grpcutils.Serve(serverListener, vm.newDBServer(semDB.Database)) - chainCtx.Log.Info("grpc: serving database", - zap.String("version", dbVersion), - zap.String("address", serverAddr), - ) - - versionedDBServers[i] = &vmpb.VersionedDBServer{ - ServerAddr: serverAddr, - Version: dbVersion, - } + // Initialize the database + dbServerListener, err := grpcutils.NewListener() + if err != nil { + return err } + dbServerAddr := dbServerListener.Addr().String() + + go grpcutils.Serve(dbServerListener, vm.newDBServer(db)) + chainCtx.Log.Info("grpc: serving database", + zap.String("address", dbServerAddr), + ) vm.messenger = messenger.NewServer(toEngine) vm.keystore = gkeystore.NewServer(chainCtx.Keystore) - vm.sharedMemory = gsharedmemory.NewServer(chainCtx.SharedMemory, dbManager.Current().Database) + vm.sharedMemory = gsharedmemory.NewServer(chainCtx.SharedMemory, db) vm.bcLookup = galiasreader.NewServer(chainCtx.BCLookup) vm.appSender = appsender.NewServer(appSender) vm.validatorStateServer = gvalidators.NewServer(chainCtx.ValidatorState) @@ -211,7 +198,7 @@ func (vm *VMClient) Initialize( GenesisBytes: genesisBytes, UpgradeBytes: upgradeBytes, ConfigBytes: configBytes, - DbServers: versionedDBServers, + DbServerAddr: dbServerAddr, ServerAddr: serverAddr, }) if err != nil { diff --git a/vms/rpcchainvm/vm_server.go b/vms/rpcchainvm/vm_server.go index 6f78009d0f41..7ee82a241506 100644 --- a/vms/rpcchainvm/vm_server.go +++ b/vms/rpcchainvm/vm_server.go @@ -21,8 +21,8 @@ import ( "github.com/ava-labs/avalanchego/api/keystore/gkeystore" "github.com/ava-labs/avalanchego/api/metrics" "github.com/ava-labs/avalanchego/chains/atomic/gsharedmemory" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/database/corruptabledb" - "github.com/ava-labs/avalanchego/database/manager" "github.com/ava-labs/avalanchego/database/rpcdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/ids/galiasreader" @@ -75,7 +75,7 @@ type VMServer struct { allowShutdown *utils.Atomic[bool] processMetrics prometheus.Gatherer - dbManager manager.Manager + db database.Database log logging.Logger serverCloser grpcutils.ServerCloser @@ -150,40 +150,19 @@ func (vm *VMServer) Initialize(ctx context.Context, req *vmpb.InitializeRequest) // Register metrics for each Go plugin processes vm.processMetrics = registerer - // Dial each database in the request and construct the database manager - versionedDBs := make([]*manager.VersionedDatabase, len(req.DbServers)) - for i, vDBReq := range req.DbServers { - version, err := version.Parse(vDBReq.Version) - if err != nil { - // Ignore closing errors to return the original error - _ = vm.connCloser.Close() - return nil, err - } - - clientConn, err := grpcutils.Dial( - vDBReq.ServerAddr, - grpcutils.WithChainUnaryInterceptor(grpcClientMetrics.UnaryClientInterceptor()), - grpcutils.WithChainStreamInterceptor(grpcClientMetrics.StreamClientInterceptor()), - ) - if err != nil { - // Ignore closing errors to return the original error - _ = vm.connCloser.Close() - return nil, err - } - vm.connCloser.Add(clientConn) - db := rpcdb.NewClient(rpcdbpb.NewDatabaseClient(clientConn)) - versionedDBs[i] = &manager.VersionedDatabase{ - Database: corruptabledb.New(db), - Version: version, - } - } - dbManager, err := manager.NewManagerFromDBs(versionedDBs) + // Dial the database + dbClientConn, err := grpcutils.Dial( + req.DbServerAddr, + grpcutils.WithChainUnaryInterceptor(grpcClientMetrics.UnaryClientInterceptor()), + grpcutils.WithChainStreamInterceptor(grpcClientMetrics.StreamClientInterceptor()), + ) if err != nil { - // Ignore closing errors to return the original error - _ = vm.connCloser.Close() return nil, err } - vm.dbManager = dbManager + vm.connCloser.Add(dbClientConn) + vm.db = corruptabledb.New( + rpcdb.NewClient(rpcdbpb.NewDatabaseClient(dbClientConn)), + ) // TODO: Allow the logger to be configured by the client vm.log = logging.NewLogger( @@ -259,7 +238,7 @@ func (vm *VMServer) Initialize(ctx context.Context, req *vmpb.InitializeRequest) ChainDataDir: req.ChainDataDir, } - if err := vm.vm.Initialize(ctx, vm.ctx, dbManager, req.GenesisBytes, req.UpgradeBytes, req.ConfigBytes, toEngine, nil, appSenderClient); err != nil { + if err := vm.vm.Initialize(ctx, vm.ctx, vm.db, req.GenesisBytes, req.UpgradeBytes, req.ConfigBytes, toEngine, nil, appSenderClient); err != nil { // Ignore errors closing resources to return the original error _ = vm.connCloser.Close() close(vm.closed) @@ -518,7 +497,7 @@ func (vm *VMServer) Health(ctx context.Context, _ *emptypb.Empty) (*vmpb.HealthR if err != nil { return &vmpb.HealthResponse{}, err } - dbHealth, err := vm.dbHealthChecks(ctx) + dbHealth, err := vm.db.HealthCheck(ctx) if err != nil { return &vmpb.HealthResponse{}, err } @@ -533,22 +512,6 @@ func (vm *VMServer) Health(ctx context.Context, _ *emptypb.Empty) (*vmpb.HealthR }, err } -func (vm *VMServer) dbHealthChecks(ctx context.Context) (interface{}, error) { - details := make(map[string]interface{}, len(vm.dbManager.GetDatabases())) - - // Check Database health - for _, client := range vm.dbManager.GetDatabases() { - // Shared gRPC client don't close - health, err := client.Database.HealthCheck(ctx) - if err != nil { - return nil, fmt.Errorf("failed to check db health %q: %w", client.Version.String(), err) - } - details[client.Version.String()] = health - } - - return details, nil -} - func (vm *VMServer) Version(ctx context.Context, _ *emptypb.Empty) (*vmpb.VersionResponse, error) { version, err := vm.vm.Version(ctx) return &vmpb.VersionResponse{ diff --git a/vms/rpcchainvm/with_context_vm_test.go b/vms/rpcchainvm/with_context_vm_test.go index a6d72e1a64bb..65d1e4396964 100644 --- a/vms/rpcchainvm/with_context_vm_test.go +++ b/vms/rpcchainvm/with_context_vm_test.go @@ -12,13 +12,12 @@ import ( "go.uber.org/mock/gomock" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database/memdb" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowman" "github.com/ava-labs/avalanchego/snow/engine/snowman/block" "github.com/ava-labs/avalanchego/snow/engine/snowman/block/mocks" - "github.com/ava-labs/avalanchego/version" ) var ( @@ -100,9 +99,8 @@ func TestContextVMSummary(t *testing.T) { defer stopper.Stop(context.Background()) ctx := snow.DefaultContextTest() - dbManager := manager.NewMemDB(version.Semantic1_0_0) - require.NoError(vm.Initialize(context.Background(), ctx, dbManager, nil, nil, nil, nil, nil, nil)) + require.NoError(vm.Initialize(context.Background(), ctx, memdb.New(), nil, nil, nil, nil, nil, nil)) blkIntf, err := vm.BuildBlockWithContext(context.Background(), blockContext) require.NoError(err) diff --git a/vms/tracedvm/block_vm.go b/vms/tracedvm/block_vm.go index b82466f3a420..969a6bc09637 100644 --- a/vms/tracedvm/block_vm.go +++ b/vms/tracedvm/block_vm.go @@ -11,7 +11,7 @@ import ( oteltrace "go.opentelemetry.io/otel/trace" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowman" @@ -100,7 +100,7 @@ func NewBlockVM(vm block.ChainVM, name string, tracer trace.Tracer) block.ChainV func (vm *blockVM) Initialize( ctx context.Context, chainCtx *snow.Context, - db manager.Manager, + db database.Database, genesisBytes, upgradeBytes, configBytes []byte, diff --git a/vms/tracedvm/vertex_vm.go b/vms/tracedvm/vertex_vm.go index 9c23f882ea40..53189f5cee70 100644 --- a/vms/tracedvm/vertex_vm.go +++ b/vms/tracedvm/vertex_vm.go @@ -10,7 +10,7 @@ import ( oteltrace "go.opentelemetry.io/otel/trace" - "github.com/ava-labs/avalanchego/database/manager" + "github.com/ava-labs/avalanchego/database" "github.com/ava-labs/avalanchego/snow" "github.com/ava-labs/avalanchego/snow/consensus/snowstorm" "github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex" @@ -35,7 +35,7 @@ func NewVertexVM(vm vertex.LinearizableVMWithEngine, tracer trace.Tracer) vertex func (vm *vertexVM) Initialize( ctx context.Context, chainCtx *snow.Context, - db manager.Manager, + db database.Database, genesisBytes, upgradeBytes, configBytes []byte,