Skip to content

Commit

Permalink
Merge pull request #8484 from Agoric/mhofman/max-block-size
Browse files Browse the repository at this point in the history
chore(cosmos): update max block size
  • Loading branch information
mergify[bot] committed Nov 6, 2023
2 parents 97f26d4 + 5fb6334 commit de3efa5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
8 changes: 7 additions & 1 deletion golang/cosmos/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ import (
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

gaiaappparams "github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
Expand Down Expand Up @@ -795,7 +796,7 @@ func NewAgoricApp(
upgradeName = "agoric-upgrade-12"
upgradeNameTest = "agorictest-upgrade-12"
)

app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
upgrade12Handler(app, upgradeName),
Expand Down Expand Up @@ -832,6 +833,11 @@ func upgrade12Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgr
// Record the plan to send to SwingSet
app.upgradePlan = &plan

// Reflect default BlockParams.MaxBytes change to current params
cp := app.BaseApp.GetConsensusParams(ctx)
cp.Block.MaxBytes = tmtypes.DefaultBlockParams().MaxBytes
app.BaseApp.StoreConsensusParams(ctx, cp)

// Always run module migrations
mvm, err := app.mm.RunMigrations(ctx, app.configurator, fromVm)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions golang/cosmos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.23
github.com/tendermint/tm-db v0.6.7
Expand Down Expand Up @@ -105,7 +106,6 @@ require (
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.13.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/btcd v0.1.1 // indirect
Expand Down Expand Up @@ -142,7 +142,7 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2

// At least until post-v0.34.14 is released with
// https://github.com/tendermint/tendermint/issue/6899 resolved.
replace github.com/tendermint/tendermint => github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.3
replace github.com/tendermint/tendermint => github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.4

// We need a fork of cosmos-sdk until all of the differences are merged.
replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.45.11-alpha.agoric.3
Expand Down
4 changes: 2 additions & 2 deletions golang/cosmos/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ github.com/agoric-labs/cosmos-sdk v0.45.11-alpha.agoric.3 h1:CMWOJYFHoRpKnNt2l90
github.com/agoric-labs/cosmos-sdk v0.45.11-alpha.agoric.3/go.mod h1:fdXvzy+wmYB+W+N139yb0+szbT7zAGgUjmxm5DBrjto=
github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1 h1:2jvHI/2d+psWAZy6FQ0vXJCHUtfU3ZbbW+pQFL04arQ=
github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.3 h1:aq6F1r3RQkKUYNeMNjRxgGn3dayvKnDK/R6gQF0WoFs=
github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.3/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI=
github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.4 h1:NWqGDUk5UkkXxsEVRtCWFpMeuCtu2MyRtC0Cib7sKH8=
github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.4/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down
2 changes: 1 addition & 1 deletion packages/deployment/upgrade-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
ARG DEST_IMAGE
FROM ${DEST_IMAGE} as agoric-upgrade-12
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import test from 'ava';

import { waitForBlock } from '../commonUpgradeHelpers.js';
import { agd } from '../cliHelper.js';
import { getIncarnation } from './tools/vat-status.js';

test.before(async () => {
Expand All @@ -18,3 +19,14 @@ test('Ensure Network Vat is at 0', async t => {
const incarnation = await getIncarnation('network');
t.is(incarnation, 0);
});

test('Ensure MaxBytes param was updated', async t => {
const { value: rawParams } = await agd.query(
'params',
'subspace',
'baseapp',
'BlockParams',
);
const blockParams = JSON.parse(rawParams);
t.is(blockParams.max_bytes, '5242880');
});

0 comments on commit de3efa5

Please sign in to comment.