refactor!: migrate Cosmos SDK to CometBFT (#14897)

This commit is contained in:
Julien Robert
2023-02-05 14:51:33 +01:00
committed by GitHub
parent 6978710699
commit 41a3dfeced
391 changed files with 3405 additions and 2984 deletions
+2 -2
View File
@@ -8,13 +8,13 @@ import (
"sync"
"time"
"github.com/cometbft/cometbft/libs/log"
tmrpcserver "github.com/cometbft/cometbft/rpc/jsonrpc/server"
gateway "github.com/cosmos/gogogateway"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/improbable-eng/grpc-web/go/grpcweb"
"github.com/tendermint/tendermint/libs/log"
tmrpcserver "github.com/tendermint/tendermint/rpc/jsonrpc/server"
"google.golang.org/grpc"
"github.com/cosmos/cosmos-sdk/client"
+2 -2
View File
@@ -3,9 +3,9 @@ package cmd
import (
"context"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/spf13/cobra"
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
+2 -2
View File
@@ -4,9 +4,9 @@ import (
"fmt"
"os"
tmjson "github.com/cometbft/cometbft/libs/json"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/spf13/cobra"
tmjson "github.com/tendermint/tendermint/libs/json"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server/types"
+3 -3
View File
@@ -7,10 +7,10 @@ import (
"fmt"
"path/filepath"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
"github.com/cometbft/cometbft/types"
db "github.com/cosmos/cosmos-db"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/types"
"google.golang.org/grpc"
storetypes "cosmossdk.io/store/types"
+3 -3
View File
@@ -5,10 +5,10 @@ import (
"testing"
"time"
abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cometbft/cometbft/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
)
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"os"
"testing"
abci "github.com/tendermint/tendermint/abci/types"
tmlog "github.com/tendermint/tendermint/libs/log"
abci "github.com/cometbft/cometbft/abci/types"
tmlog "github.com/cometbft/cometbft/libs/log"
)
// SetupApp returns an application as well as a clean-up function to be used to
+5 -2
View File
@@ -3,14 +3,16 @@ package server
import (
"fmt"
tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server/types"
"github.com/spf13/cobra"
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
)
// NewRollbackCmd creates a command to rollback tendermint and multistore state by one height.
func NewRollbackCmd(appCreator types.AppCreator, defaultNodeHome string) *cobra.Command {
var removeBlock bool
cmd := &cobra.Command{
Use: "rollback",
Short: "rollback cosmos-sdk and tendermint state by one height",
@@ -32,7 +34,7 @@ application.
}
app := appCreator(ctx.Logger, db, nil, ctx.Viper)
// rollback tendermint state
height, hash, err := tmcmd.RollbackState(ctx.Config)
height, hash, err := tmcmd.RollbackState(ctx.Config, removeBlock)
if err != nil {
return fmt.Errorf("failed to rollback tendermint state: %w", err)
}
@@ -48,5 +50,6 @@ application.
}
cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory")
cmd.Flags().BoolVar(&removeBlock, "hard", false, "remove last block as well as state")
return cmd
}
+7 -7
View File
@@ -7,14 +7,14 @@ import (
"runtime/pprof"
"time"
"github.com/cometbft/cometbft/abci/server"
tcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
"github.com/cometbft/cometbft/node"
"github.com/cometbft/cometbft/p2p"
pvm "github.com/cometbft/cometbft/privval"
"github.com/cometbft/cometbft/proxy"
"github.com/cometbft/cometbft/rpc/client/local"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/abci/server"
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
"github.com/tendermint/tendermint/node"
"github.com/tendermint/tendermint/p2p"
pvm "github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/rpc/client/local"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
+3 -3
View File
@@ -3,10 +3,10 @@ package server
import (
"fmt"
"github.com/cometbft/cometbft/p2p"
pvm "github.com/cometbft/cometbft/privval"
tversion "github.com/cometbft/cometbft/version"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/p2p"
pvm "github.com/tendermint/tendermint/privval"
tversion "github.com/tendermint/tendermint/version"
"sigs.k8s.io/yaml"
"github.com/cosmos/cosmos-sdk/client"
+4 -4
View File
@@ -7,12 +7,12 @@ import (
dbm "github.com/cosmos/cosmos-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/gogoproto/grpc"
"github.com/spf13/cobra"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
storetypes "cosmossdk.io/store/types"
+5 -5
View File
@@ -16,15 +16,15 @@ import (
dbm "github.com/cosmos/cosmos-db"
tmcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
tmcfg "github.com/cometbft/cometbft/config"
tmcli "github.com/cometbft/cometbft/libs/cli"
tmflags "github.com/cometbft/cometbft/libs/cli/flags"
tmlog "github.com/cometbft/cometbft/libs/log"
"github.com/spf13/cast"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
tmflags "github.com/tendermint/tendermint/libs/cli/flags"
tmlog "github.com/tendermint/tendermint/libs/log"
"cosmossdk.io/store"
"cosmossdk.io/store/snapshots"
+1 -1
View File
@@ -10,9 +10,9 @@ import (
"strings"
"testing"
tmcfg "github.com/cometbft/cometbft/config"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"
tmcfg "github.com/tendermint/tendermint/config"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"