Skip to content

Commit

Permalink
chore: update sdk and tm (backport #3093) (#3098)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 26, 2024
1 parent af3a790 commit 9676c4d
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr

// build the square from the set of valid and prioritised transactions.
// The txs returned are the ones used in the square and block
dataSquare, txs, err := square.Build(txs, app.GetBaseApp().AppVersion(), app.GovSquareSizeUpperBound(sdkCtx))
dataSquare, txs, err := square.Build(txs, app.GetBaseApp().AppVersion(sdkCtx), app.GovSquareSizeUpperBound(sdkCtx))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion app/process_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (app *App) ProcessProposal(req abci.RequestProcessProposal) (resp abci.Resp
}

// Construct the data square from the block's transactions
dataSquare, err := square.Construct(req.BlockData.Txs, app.GetBaseApp().AppVersion(), app.GovSquareSizeUpperBound(sdkCtx))
dataSquare, err := square.Construct(req.BlockData.Txs, app.GetBaseApp().AppVersion(sdkCtx), app.GovSquareSizeUpperBound(sdkCtx))
if err != nil {
logInvalidPropBlockError(app.Logger(), req.Header, "failure to compute data square from transactions:", err)
return reject()
Expand Down
4 changes: 2 additions & 2 deletions app/square_size.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (app *App) GovSquareSizeUpperBound(ctx sdk.Context) int {

gmax := int(app.BlobKeeper.GovMaxSquareSize(ctx))
// perform a secondary check on the max square size.
if gmax > appconsts.SquareSizeUpperBound(app.AppVersion()) {
gmax = appconsts.SquareSizeUpperBound(app.AppVersion())
if gmax > appconsts.SquareSizeUpperBound(app.AppVersion(ctx)) {
gmax = appconsts.SquareSizeUpperBound(app.AppVersion(ctx))
}

return gmax
Expand Down
2 changes: 1 addition & 1 deletion app/test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (s *IntegrationTestSuite) TestMaxBlockSize() {
for i, tx := range txs {
res, err := s.cctx.Context.BroadcastTxSync(tx)
require.NoError(t, err)
assert.Equal(t, abci.CodeTypeOK, res.Code)
assert.Equal(t, abci.CodeTypeOK, res.Code, res)
if res.Code != abci.CodeTypeOK {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/celestia-appd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func NewAppServer(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts se
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
baseapp.SetSnapshot(snapshotStore, snapshottypes.NewSnapshotOptions(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)))),
func(b *baseapp.BaseApp) {
b.SetProtocolVersion(appconsts.LatestVersion)
b.SetAppVersion(sdk.Context{}, appconsts.LatestVersion)
},
)
}
Expand Down
13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ require (
)

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
github.com/BurntSushi/toml v1.2.1
github.com/celestiaorg/quantum-gravity-bridge/v2 v2.1.2
github.com/celestiaorg/rsmt2d v0.11.0
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.46.14
github.com/cosmos/cosmos-sdk v0.46.16
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/v6 v6.2.0
github.com/rs/zerolog v1.31.0
github.com/spf13/pflag v1.0.5
github.com/tendermint/tendermint v0.34.28
github.com/tendermint/tendermint v0.34.29
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -220,8 +220,11 @@ require (
)

replace (
github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.18.3-sdk-v0.46.14
github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.20.1-sdk-v0.46.16
// Pin to ledger-cosmos-go v0.12.4 to avoid a breaking change introduced in v0.13.0
// The following replace statement can be removed when we upgrade to cosmos-sdk >= v0.50.0
github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.32.0-tm-v0.34.29
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.34.0-tm-v0.34.29
)
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuW
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w=
cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=
cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0=
cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM=
cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -317,10 +317,10 @@ github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/celestiaorg/celestia-core v1.32.0-tm-v0.34.29 h1:eun5AzyFZcoBGjz/XegRmPm79JCQ5XdIzpWRvV7XISE=
github.com/celestiaorg/celestia-core v1.32.0-tm-v0.34.29/go.mod h1:ime8Wp2TLrncpFuduj5rzDZZs/KEo+dM5xWr6p70mgk=
github.com/celestiaorg/cosmos-sdk v1.18.3-sdk-v0.46.14 h1:+Te28r5Zp4Vp69f82kcON9/BIF8f1BNXb0go2+achuc=
github.com/celestiaorg/cosmos-sdk v1.18.3-sdk-v0.46.14/go.mod h1:Og5KKgoBEiQlI6u56lDLG191pfknIdXctFn3COWLQP8=
github.com/celestiaorg/celestia-core v1.34.0-tm-v0.34.29 h1:xIUzZvM8Wxu7zCHvgnDKE8WbIQ7T8OtVlRR5orAEnVw=
github.com/celestiaorg/celestia-core v1.34.0-tm-v0.34.29/go.mod h1:ime8Wp2TLrncpFuduj5rzDZZs/KEo+dM5xWr6p70mgk=
github.com/celestiaorg/cosmos-sdk v1.20.1-sdk-v0.46.16 h1:9U9UthIJSOyVjabD5PkD6aczvqlWOyAFTOXw0duPT5k=
github.com/celestiaorg/cosmos-sdk v1.20.1-sdk-v0.46.16/go.mod h1:Tvsc3YnqvflXTYC8xIy/Q07Es95xZ1pZC/imoKogtbg=
github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc=
github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA=
github.com/celestiaorg/nmt v0.20.0 h1:9i7ultZ8Wv5ytt8ZRaxKQ5KOOMo4A2K2T/aPGjIlSas=
Expand Down Expand Up @@ -418,8 +418,8 @@ github.com/cosmos/iavl v0.19.6 h1:XY78yEeNPrEYyNCKlqr9chrwoeSDJ0bV2VjocTk//OU=
github.com/cosmos/iavl v0.19.6/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/ibc-go/v6 v6.2.0 h1:HKS5WNxQrlmjowHb73J9LqlNJfvTnvkbhXZ9QzNTU7Q=
github.com/cosmos/ibc-go/v6 v6.2.0/go.mod h1:+S3sxcNwOhgraYDJAhIFDg5ipXHaUnJrg7tOQqGyWlc=
github.com/cosmos/ledger-cosmos-go v0.13.2 h1:aY0KZSmUwNKbBm9OvbIjvf7Ozz2YzzpAbgvN2C8x2T0=
github.com/cosmos/ledger-cosmos-go v0.13.2/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8=
github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw=
github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
Expand Down
2 changes: 1 addition & 1 deletion test/util/malicious/out_of_order_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (a *App) OutOfOrderPrepareProposal(req abci.RequestPrepareProposal) abci.Re

// build the square from the set of valid and prioritised transactions.
// The txs returned are the ones used in the square and block
dataSquare, txs, err := Build(txs, a.GetBaseApp().AppVersion(), a.GovSquareSizeUpperBound(sdkCtx), OutOfOrderExport)
dataSquare, txs, err := Build(txs, a.GetBaseApp().AppVersion(sdkCtx), a.GovSquareSizeUpperBound(sdkCtx), OutOfOrderExport)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/util/malicious/test_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewAppServer(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts se
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
baseapp.SetSnapshot(snapshotStore, snapshottypes.NewSnapshotOptions(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)))),
func(b *baseapp.BaseApp) {
b.SetProtocolVersion(appconsts.LatestVersion)
b.SetAppVersion(sdk.Context{}, appconsts.LatestVersion)
},
)
}
2 changes: 1 addition & 1 deletion test/util/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func DefaultConfig() network.Config {
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
func(b *baseapp.BaseApp) {
b.SetProtocolVersion(appconsts.LatestVersion)
b.SetAppVersion(sdk.Context{}, appconsts.LatestVersion)
},
)
},
Expand Down
2 changes: 1 addition & 1 deletion test/util/test_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func SetupTestAppWithGenesisValSet(cparams *tmproto.ConsensusParams, genAccounts
encCfg,
emptyOpts,
)
testApp.GetBaseApp().SetProtocolVersion(appconsts.LatestVersion)
testApp.GetBaseApp().SetAppVersion(sdk.Context{}, appconsts.LatestVersion)

genesisState, valSet, kr := GenesisStateWithSingleValidator(testApp, genAccounts...)

Expand Down
1 change: 1 addition & 0 deletions test/util/testnode/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func DefaultParams() *tmproto.ConsensusParams {
cparams := types.DefaultConsensusParams()
cparams.Block.TimeIotaMs = 1
cparams.Block.MaxBytes = appconsts.DefaultMaxBytes
cparams.Version.AppVersion = appconsts.LatestVersion
return cparams
}

Expand Down
2 changes: 1 addition & 1 deletion x/blob/ante/max_total_blob_size_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (d MaxTotalBlobSizeDecorator) getMaxSquareSize(ctx sdk.Context) int {
return int(appconsts.DefaultGovMaxSquareSize)
}

upperBound := appconsts.SquareSizeUpperBound(ctx.ConsensusParams().Version.AppVersion)
upperBound := appconsts.SquareSizeUpperBound(ctx.BlockHeader().Version.App)
govParam := d.k.GovMaxSquareSize(ctx)
return min(upperBound, int(govParam))
}
Expand Down

0 comments on commit 9676c4d

Please sign in to comment.