diff --git a/app/prepare_proposal.go b/app/prepare_proposal.go index c8d06b664e..1e19b65543 100644 --- a/app/prepare_proposal.go +++ b/app/prepare_proposal.go @@ -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) } diff --git a/app/process_proposal.go b/app/process_proposal.go index 0aaf791840..6c7c472223 100644 --- a/app/process_proposal.go +++ b/app/process_proposal.go @@ -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() diff --git a/app/square_size.go b/app/square_size.go index f0c3825580..9af83aef55 100644 --- a/app/square_size.go +++ b/app/square_size.go @@ -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 diff --git a/cmd/celestia-appd/cmd/root.go b/cmd/celestia-appd/cmd/root.go index 34b1993015..c69adeacb9 100644 --- a/cmd/celestia-appd/cmd/root.go +++ b/cmd/celestia-appd/cmd/root.go @@ -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) }, ) } diff --git a/test/util/malicious/out_of_order_prepare.go b/test/util/malicious/out_of_order_prepare.go index ebc23bc31b..24a6bff664 100644 --- a/test/util/malicious/out_of_order_prepare.go +++ b/test/util/malicious/out_of_order_prepare.go @@ -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) } diff --git a/test/util/malicious/test_app.go b/test/util/malicious/test_app.go index c7f0b80329..faef795a1d 100644 --- a/test/util/malicious/test_app.go +++ b/test/util/malicious/test_app.go @@ -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) }, ) } diff --git a/test/util/network/network.go b/test/util/network/network.go index b3b0c298d2..5abda35891 100644 --- a/test/util/network/network.go +++ b/test/util/network/network.go @@ -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) }, ) }, diff --git a/test/util/test_app.go b/test/util/test_app.go index 139a8e70f8..ac0b0c0d5c 100644 --- a/test/util/test_app.go +++ b/test/util/test_app.go @@ -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...)