Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Comet v0.38 Integration #15519

Merged
merged 97 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
dd39461
updates
alexanderbez Mar 22, 2023
30a8d57
updates
alexanderbez Mar 22, 2023
b76f5b1
updates
alexanderbez Mar 22, 2023
670e3bb
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 23, 2023
fb9d7f1
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 23, 2023
991a71c
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 24, 2023
29313ae
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 28, 2023
cca096c
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 28, 2023
1b28b85
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 28, 2023
6ac64ad
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 29, 2023
8c3c4fa
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Mar 29, 2023
fe0efb9
updates
alexanderbez Mar 29, 2023
3409cbf
updates
alexanderbez Mar 29, 2023
440c385
updates
alexanderbez Mar 29, 2023
fb20463
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Apr 4, 2023
5b89b14
updates
alexanderbez Apr 4, 2023
a0f42b8
updates
alexanderbez Apr 5, 2023
35e4c69
updates
alexanderbez Apr 5, 2023
053e0b1
updates
alexanderbez Apr 6, 2023
9e648a5
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Apr 6, 2023
6b75a80
updates
alexanderbez Apr 6, 2023
2dd4d6d
updates
alexanderbez Apr 6, 2023
79ec01f
updates
alexanderbez Apr 6, 2023
26f766b
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Apr 6, 2023
03e9b8d
update comet proto types
tac0turtle Apr 7, 2023
12dfd99
refactor: update store to 0.38 comet (#15738)
tac0turtle Apr 10, 2023
2cc6351
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle Apr 12, 2023
4f82b5b
updates
alexanderbez Apr 12, 2023
db68890
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle Apr 14, 2023
4bac04f
updates
alexanderbez Apr 14, 2023
3692862
abci: integrate endblocker (#15843)
tac0turtle Apr 17, 2023
036e624
updates
alexanderbez Apr 17, 2023
72d98da
refactor: update x/bank to comet v0.38 (#15872)
alexanderbez Apr 18, 2023
ff6ee2a
feat!: [Comet v0.38 Integration] Vote Extensions (#15766)
alexanderbez Apr 19, 2023
6502300
updates
alexanderbez Apr 19, 2023
c4dec48
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez Apr 19, 2023
10afbfc
updates
alexanderbez Apr 19, 2023
d9b2105
updates
alexanderbez Apr 19, 2023
69352bf
refactor(baseapp): abci2.0 (#15899)
tac0turtle Apr 21, 2023
2fa8840
updates
alexanderbez Apr 26, 2023
df3cb78
updates
alexanderbez Apr 26, 2023
629f191
updates
alexanderbez Apr 26, 2023
d7d5f67
updates
alexanderbez Apr 27, 2023
9167fbc
refactor(baseapp): fix tests abci 2.0 (#15959)
tac0turtle Apr 28, 2023
279c7af
refactor(core): abci 2.0 integration (#15960)
tac0turtle May 1, 2023
a6401fe
fix: store module unit test failings (#16000)
cool-develope May 1, 2023
e626a18
chore: ABCI UX Improvements (#16007)
alexanderbez May 3, 2023
a0ee162
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle May 4, 2023
5a70b20
chore: Update ValidateVoteExtensions (#16022)
alexanderbez May 4, 2023
71f5fba
refactor(core): abci++ migration (#16031)
tac0turtle May 4, 2023
a4e42a6
refactor(core): abci++ migration (#16031)
tac0turtle May 4, 2023
c0ee494
chore: vote ext opts (#16063)
alexanderbez May 8, 2023
8a6a532
refactor(types & client): fix tests (#16064)
tac0turtle May 8, 2023
024850c
refactor(core): use working hash in finalizeblock instead of flush (#…
tac0turtle May 9, 2023
d89e05c
fix(tools/rosetta): update sdk version (#16072)
cool-develope May 10, 2023
0445cc1
refactor: abci++ integration and fixing tests (#16069)
tac0turtle May 10, 2023
3622eb4
chore(ABCI++): update/fix testutil tests (#16088)
alexanderbez May 10, 2023
6bc54ae
fix(staking): fix staking test failures (#16091)
cool-develope May 11, 2023
4d4c38e
refactor: abci++ integration (#16109)
tac0turtle May 11, 2023
043c786
fix: x/bank tests refactor to work with abci 2.0 (#16093)
kocubinski May 11, 2023
b4347f3
test: update group/gov test for abci 2.0 (#16114)
julienrbrt May 11, 2023
02b9a50
fix(x/evidence): tests and nil guard for empty block info (#16119)
kocubinski May 11, 2023
28f9a1c
updates
alexanderbez May 12, 2023
798c681
fix(slashing): slashing test failures (#16116)
cool-develope May 15, 2023
9cdbbc7
updates
alexanderbez May 15, 2023
a4d768d
fix(staking): update the staking sim tests (#16180)
cool-develope May 16, 2023
e9bc71e
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle May 16, 2023
6cd6152
fix build
tac0turtle May 16, 2023
50150d1
refactor(baseapp): fix tests (#16132)
tac0turtle May 16, 2023
ec660a1
gofumpt
tac0turtle May 16, 2023
08f47f3
fix rosetta build
tac0turtle May 16, 2023
de1c5e0
fix module builds
tac0turtle May 16, 2023
ad7a196
fix nft and circuit builds
tac0turtle May 16, 2023
05ff72f
fix genutil tests
tac0turtle May 16, 2023
22ec2e5
fix client tests
tac0turtle May 16, 2023
eb9d040
fix testutil router initchain errors
tac0turtle May 16, 2023
0fba762
fix nft
tac0turtle May 17, 2023
0e36e9b
fix integration testutil
tac0turtle May 17, 2023
5427afb
go mod tidy
tac0turtle May 17, 2023
2bac2e6
minor fixes
tac0turtle May 17, 2023
bad68ee
refactor: ABCI++ Simulation (#16196)
alexanderbez May 17, 2023
7c6e787
updates
alexanderbez May 17, 2023
b70334d
Merge branch 'main' into bez/feature/abci-2.0-base
alexanderbez May 17, 2023
5d2e29f
fix(tests): fix long tests for abci 2.0 (#16198)
julienrbrt May 18, 2023
0fbdf96
fix lint
tac0turtle May 18, 2023
aab7bfb
Merge branch 'main' into bez/feature/abci-2.0-base
julienrbrt May 19, 2023
af38979
refactor: add abci wrapper (#16199)
julienrbrt May 22, 2023
c0b0547
chore: audit errors in ABCI methods (#16250)
alexanderbez May 22, 2023
e7ccbcd
updates
alexanderbez May 22, 2023
a136345
merge main
tac0turtle May 24, 2023
8e23eb4
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle May 24, 2023
5fed90f
fix comments
tac0turtle May 24, 2023
3201d73
Update Makefile
tac0turtle May 24, 2023
21d0c7f
Merge branch 'main' into bez/feature/abci-2.0-base
tac0turtle May 24, 2023
9c130e4
fix build
tac0turtle May 24, 2023
5761c92
fix build
tac0turtle May 24, 2023
3d86511
slow the machine down for ci
tac0turtle May 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,058 changes: 2,014 additions & 44 deletions api/cosmos/base/abci/v1beta1/abci.pulsar.go

Large diffs are not rendered by default.

992 changes: 541 additions & 451 deletions baseapp/abci.go

Large diffs are not rendered by default.

56 changes: 27 additions & 29 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const (
runTxModeCheck runTxMode = iota // Check a transaction
runTxModeReCheck // Recheck a (pending) transaction after a commit
runTxModeSimulate // Simulate a transaction
runTxModeDeliver // Deliver a transaction
runTxPrepareProposal // Prepare a TM block proposal
runTxProcessProposal // Process a TM block proposal
runTxModeFinalize // Finalize a block
runTxPrepareProposal // Prepare a block proposal
runTxProcessProposal // Process a block proposal
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
)

var _ abci.Application = (*BaseApp)(nil)
Expand All @@ -66,10 +66,10 @@ type BaseApp struct { //nolint: maligned
anteHandler sdk.AnteHandler // ante handler for fee and auth
postHandler sdk.PostHandler // post handler, optional, e.g. for tips
initChainer sdk.InitChainer // initialize state with validators and state blob
beginBlocker sdk.BeginBlocker // logic to run before any txs
beginBlocker sdk.LegacyBeginBlocker // logic to run before any txs
processProposal sdk.ProcessProposalHandler // the handler which runs on ABCI ProcessProposal
prepareProposal sdk.PrepareProposalHandler // the handler which runs on ABCI PrepareProposal
endBlocker sdk.EndBlocker // logic to run after all txs, and to determine valset changes
endBlocker sdk.LegacyEndBlocker // logic to run after all txs, and to determine valset changes
addrPeerFilter sdk.PeerFilter // filter peers by address and port
idPeerFilter sdk.PeerFilter // filter peers by node ID
fauxMerkleMode bool // if true, IAVL MountStores uses MountStoresDB for simulation speed.
Expand All @@ -79,12 +79,13 @@ type BaseApp struct { //nolint: maligned

// volatile states:
//
// checkState is set on InitChain and reset on Commit
// deliverState is set on InitChain and BeginBlock and set to nil on Commit
// - checkState is set on InitChain and reset on Commit
// - finalizeBlockState is set on InitChain and FinalizeBlock and set to nil
// on Commit.
checkState *state // for CheckTx
deliverState *state // for DeliverTx
processProposalState *state // for ProcessProposal
prepareProposalState *state // for PrepareProposal
finalizeBlockState *state // for FinalizeBlock

// an inter-block write-through cache provided to the context during deliverState
interBlockCache storetypes.MultiStorePersistentCache
Expand Down Expand Up @@ -150,8 +151,6 @@ type BaseApp struct { //nolint: maligned
// NewBaseApp returns a reference to an initialized BaseApp. It accepts a
// variadic number of option functions, which act on the BaseApp to set
// configuration choices.
//
// NOTE: The db is used to store the version number for now.
func NewBaseApp(
name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp),
) *BaseApp {
Expand Down Expand Up @@ -415,18 +414,18 @@ func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) {

switch mode {
case runTxModeCheck:
// Minimum gas prices are also set. It is set on InitChain and reset on Commit.
baseState.ctx = baseState.ctx.WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices)
app.checkState = baseState
case runTxModeDeliver:
// It is set on InitChain and BeginBlock and set to nil on Commit.
app.deliverState = baseState

case runTxModeFinalize:
app.finalizeBlockState = baseState

case runTxPrepareProposal:
// It is set on InitChain and Commit.
app.prepareProposalState = baseState

case runTxProcessProposal:
// It is set on InitChain and Commit.
app.processProposalState = baseState

default:
panic(fmt.Sprintf("invalid runTxMode for setState: %d", mode))
}
Expand All @@ -447,15 +446,17 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams
return cp
}

// StoreConsensusParams sets the consensus parameters to the baseapp's param store.
// StoreConsensusParams sets the consensus parameters to the BaseApp's param
// store.
//
// NOTE: We're explicitly not storing the CometBFT app_version in the param store.
// It's stored instead in the x/upgrade store, with its own bump logic.
func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp cmtproto.ConsensusParams) error {
if app.paramStore == nil {
panic("cannot store consensus params with no params store set")
}

return app.paramStore.Set(ctx, cp)
// We're explicitly not storing the CometBFT app_version in the param store. It's
// stored instead in the x/upgrade store, with its own bump logic.
}

// AddRunTxRecoveryHandler adds custom app.runTx method panic handlers.
Expand Down Expand Up @@ -488,9 +489,9 @@ func (app *BaseApp) GetMaximumBlockGas(ctx sdk.Context) uint64 {
}
}

func (app *BaseApp) validateHeight(req abci.RequestBeginBlock) error {
if req.Header.Height < 1 {
return fmt.Errorf("invalid height: %d", req.Header.Height)
func (app *BaseApp) validateFinalizeBlockHeight(req *abci.RequestFinalizeBlock) error {
if req.Height < 1 {
return fmt.Errorf("invalid height: %d", req.Height)
}

// expectedHeight holds the expected height to validate.
Expand All @@ -508,8 +509,8 @@ func (app *BaseApp) validateHeight(req abci.RequestBeginBlock) error {
expectedHeight = app.LastBlockHeight() + 1
}

if req.Header.Height != expectedHeight {
return fmt.Errorf("invalid height: %d; expected: %d", req.Header.Height, expectedHeight)
if req.Height != expectedHeight {
return fmt.Errorf("invalid height: %d; expected: %d", req.Height, expectedHeight)
}

return nil
Expand All @@ -531,13 +532,10 @@ func validateBasicTxMsgs(msgs []sdk.Msg) error {
return nil
}

// Returns the application's deliverState if app is in runTxModeDeliver,
// prepareProposalState if app is in runTxPrepareProposal, processProposalState
// if app is in runTxProcessProposal, and checkState otherwise.
func (app *BaseApp) getState(mode runTxMode) *state {
switch mode {
case runTxModeDeliver:
return app.deliverState
case runTxModeFinalize:
return app.finalizeBlockState

case runTxPrepareProposal:
return app.prepareProposalState
Expand Down
10 changes: 5 additions & 5 deletions baseapp/grpcrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewGRPCQueryRouter() *GRPCQueryRouter {

// GRPCQueryHandler defines a function type which handles ABCI Query requests
// using gRPC
type GRPCQueryHandler = func(ctx sdk.Context, req abci.RequestQuery) (abci.ResponseQuery, error)
type GRPCQueryHandler = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error)

// Route returns the GRPCQueryHandler for a given query route path or nil
// if not found
Expand Down Expand Up @@ -76,25 +76,25 @@ func (qrt *GRPCQueryRouter) RegisterService(sd *grpc.ServiceDesc, handler interf
)
}

qrt.routes[fqName] = func(ctx sdk.Context, req abci.RequestQuery) (abci.ResponseQuery, error) {
qrt.routes[fqName] = func(ctx sdk.Context, req *abci.RequestQuery) (*abci.ResponseQuery, error) {
// call the method handler from the service description with the handler object,
// a wrapped sdk.Context with proto-unmarshaled data from the ABCI request data
res, err := methodHandler(handler, ctx, func(i interface{}) error {
return qrt.cdc.Unmarshal(req.Data, i)
}, nil)
if err != nil {
return abci.ResponseQuery{}, err
return nil, err
}

// proto marshal the result bytes
var resBytes []byte
resBytes, err = qrt.cdc.Marshal(res)
if err != nil {
return abci.ResponseQuery{}, err
return nil, err
}

// return the result bytes as the response value
return abci.ResponseQuery{
return &abci.ResponseQuery{
Height: req.Height,
Value: resBytes,
}, nil
Expand Down
10 changes: 3 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/chzyer/readline v1.5.1
github.com/cockroachdb/apd/v2 v2.0.2
github.com/cockroachdb/errors v1.9.1
github.com/cometbft/cometbft v0.37.0
github.com/cometbft/cometbft v0.38.0-alpha.1
github.com/cosmos/btcutil v1.0.5
github.com/cosmos/cosmos-db v1.0.0-rc.1
github.com/cosmos/cosmos-proto v1.0.0-beta.3
Expand Down Expand Up @@ -67,11 +67,10 @@ require (
require (
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/bufbuild/protocompile v0.4.0 // indirect
github.com/bufbuild/protocompile v0.5.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -81,7 +80,6 @@ require (
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/iavl v0.21.0-beta.1 // indirect
github.com/creachadair/taskgroup v0.4.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand All @@ -106,8 +104,6 @@ require (
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-plugin v1.4.9 // indirect
Expand All @@ -123,11 +119,11 @@ require (
github.com/linxGnu/grocksdb v1.7.15 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
Expand Down
Loading