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
+5 -5
View File
@@ -10,9 +10,9 @@ import (
"syscall"
"time"
abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/gogoproto/proto"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
@@ -259,14 +259,14 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
// provided by the client's request.
//
// Ref: https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-060-abci-1.0.md
// Ref: https://github.com/tendermint/tendermint/blob/main/spec/abci/abci%2B%2B_basic_concepts.md
// Ref: https://github.com/cometbft/cometbft/blob/main/spec/abci/abci%2B%2B_basic_concepts.md
func (app *BaseApp) PrepareProposal(req abci.RequestPrepareProposal) (resp abci.ResponsePrepareProposal) {
if app.prepareProposal == nil {
panic("PrepareProposal method not set")
}
// Tendermint must never call PrepareProposal with a height of 0.
// Ref: https://github.com/tendermint/tendermint/blob/059798a4f5b0c9f52aa8655fa619054a0154088c/spec/core/state.md?plain=1#L37-L38
// Ref: https://github.com/cometbft/cometbft/blob/059798a4f5b0c9f52aa8655fa619054a0154088c/spec/core/state.md?plain=1#L37-L38
if req.Height < 1 {
panic("PrepareProposal called with invalid height")
}
@@ -309,7 +309,7 @@ func (app *BaseApp) PrepareProposal(req abci.RequestPrepareProposal) (resp abci.
// handler, it will be recovered and we will reject the proposal.
//
// Ref: https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-060-abci-1.0.md
// Ref: https://github.com/tendermint/tendermint/blob/main/spec/abci/abci%2B%2B_basic_concepts.md
// Ref: https://github.com/cometbft/cometbft/blob/main/spec/abci/abci%2B%2B_basic_concepts.md
func (app *BaseApp) ProcessProposal(req abci.RequestProcessProposal) (resp abci.ResponseProcessProposal) {
if app.processProposal == nil {
panic("app.ProcessProposal is not set")
+2 -2
View File
@@ -9,10 +9,10 @@ import (
dbm "github.com/cosmos/cosmos-db"
abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/gogoproto/jsonpb"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
pruningtypes "cosmossdk.io/store/pruning/types"
"cosmossdk.io/store/snapshots"
+4 -4
View File
@@ -6,12 +6,12 @@ import (
"sort"
"strings"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/crypto/tmhash"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/gogoproto/proto"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"golang.org/x/exp/maps"
"cosmossdk.io/store"
+3 -3
View File
@@ -6,11 +6,11 @@ import (
"testing"
"time"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"cosmossdk.io/store/metrics"
pruningtypes "cosmossdk.io/store/pruning/types"
+4 -4
View File
@@ -7,12 +7,12 @@ import (
"cosmossdk.io/depinject"
sdkmath "cosmossdk.io/math"
abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
store "cosmossdk.io/store/types"
+1 -1
View File
@@ -3,8 +3,8 @@ package baseapp
import (
"fmt"
abci "github.com/cometbft/cometbft/abci/types"
gogogrpc "github.com/cosmos/gogoproto/grpc"
abci "github.com/tendermint/tendermint/abci/types"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
+1 -1
View File
@@ -4,8 +4,8 @@ import (
gocontext "context"
"fmt"
abci "github.com/cometbft/cometbft/abci/types"
gogogrpc "github.com/cosmos/gogoproto/grpc"
abci "github.com/tendermint/tendermint/abci/types"
"google.golang.org/grpc"
"github.com/cosmos/cosmos-sdk/codec/types"
+1 -1
View File
@@ -6,9 +6,9 @@ import (
"sync"
"testing"
"github.com/cometbft/cometbft/libs/log"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
"cosmossdk.io/depinject"
"github.com/cosmos/cosmos-sdk/baseapp"
+3 -3
View File
@@ -4,11 +4,11 @@ import (
"os"
"testing"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"cosmossdk.io/depinject"
"github.com/cosmos/cosmos-sdk/client/tx"
+1 -1
View File
@@ -1,7 +1,7 @@
package baseapp
import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"errors"
"fmt"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package baseapp
import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+3 -3
View File
@@ -19,11 +19,11 @@ import (
"cosmossdk.io/core/appconfig"
"cosmossdk.io/depinject"
sdkmath "cosmossdk.io/math"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"
dbm "github.com/cosmos/cosmos-db"
"github.com/stretchr/testify/require"
"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"