Skip to content

Commit

Permalink
publish agoric-upgrade-13 (#8633)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman authored Dec 7, 2023
2 parents 26244e8 + 5a6cdeb commit b0c1f78
Show file tree
Hide file tree
Showing 153 changed files with 3,509 additions and 1,142 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,6 @@ jobs:
test-docker-build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
bootstrap-version: ['test', 'main']
steps:
- name: free up additional worker space
run: |
Expand All @@ -571,7 +568,7 @@ jobs:
# XXX skip TAP test output and collection for now; it hides the output from the logs
run: cd packages/deployment && make docker-build-sdk
- name: docker build upgrade test
run: cd packages/deployment/upgrade-test && docker build --build-arg BOOTSTRAP_MODE=${{ matrix.bootstrap-version }} --build-arg DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest -t docker-upgrade-test:latest -f Dockerfile upgrade-test-scripts
run: cd packages/deployment/upgrade-test && docker build --build-arg DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest -t docker-upgrade-test:latest -f Dockerfile upgrade-test-scripts
- name: docker run upgrade final stage
run: docker run --env "DEST=0" docker-upgrade-test:latest
- uses: ./.github/actions/post-test
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

## Unreleased

* Cosmos-SDK updates
* Consensus library to cometbft/cometbft v0.34.27
* Cosmos library to cosmos/cosmos-sdk v0.45.16
* IBC module to cosmos/ibc-go v4.5.1

## Mainnet1B (agoric-upgrade-10)

* Vaults
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ prior=$(git tag -l | sed -ne 's!^@agoric/sdk@\([0-9]*\).*!\1!p' | sort -n | tail
SDKVER=$(( prior + 1 ))
git tag @agoric/sdk@$SDKVER
# Push the branch.
git push -u origin release-$now
git push -u origin prepare-release-$now
# Tell which packages have actual news.
scripts/have-news HEAD^ > have-news.md
```
Expand Down
24 changes: 24 additions & 0 deletions golang/cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.35.0-u13.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/[email protected]...@agoric/[email protected]) (2023-12-07)


### Features

* **cosmos:** un-wire x/crisis ([#8582](https://github.com/Agoric/agoric-sdk/issues/8582)) ([19404a3](https://github.com/Agoric/agoric-sdk/commit/19404a3c5cd10d9c454f190b60cbf0aa715f605c))
* **x/swingset:** auto-provision smart wallet ([5073800](https://github.com/Agoric/agoric-sdk/commit/5073800f87c92a194a21c9cc59ad1bb570a39b95))
* **x/swingset:** refuse smart wallet messages if not provisioned ([50a5a55](https://github.com/Agoric/agoric-sdk/commit/50a5a557956562fc05b8c2defd99a0102a35153f))
* pick up return-grants from latest cosmos-sdk ([975533e](https://github.com/Agoric/agoric-sdk/commit/975533e088f96c80cf8d6f6b7c5f45665e3495ba))
* update ibc-go to v4, adapt packages and API ([6672e5c](https://github.com/Agoric/agoric-sdk/commit/6672e5cb780c8baa530ac59bff27d793e1ff8f50))


### Bug Fixes

* handle hang-on-halt behavior from agoric-labs/cosmos-sdk[#305](https://github.com/Agoric/agoric-sdk/issues/305) ([7ae9a70](https://github.com/Agoric/agoric-sdk/commit/7ae9a705478727d1d7ace7c665861cfee14b5f28))
* update dependencies to fix tests ([9d750dd](https://github.com/Agoric/agoric-sdk/commit/9d750dd39993d380a5e889ea7faa4bb78c3257aa))


### Reverts

* Revert "fix: handle hang-on-halt behavior from agoric-labs/cosmos-sdk#305" ([3a37f5e](https://github.com/Agoric/agoric-sdk/commit/3a37f5e472405d1d3bee2075b47ecd3632ba4073)), closes [agoric-labs/cosmos-sdk#305](https://github.com/agoric-labs/cosmos-sdk/issues/305) [agoric-labs/cosmos-sdk#305](https://github.com/agoric-labs/cosmos-sdk/issues/305)



## [0.35.0-u12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/[email protected]...@agoric/[email protected]) (2023-11-10)


Expand Down
2 changes: 1 addition & 1 deletion golang/cosmos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ t:

TM_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/tendermint/tendermint)/proto/tendermint
GOGO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf)
IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v3)/proto/ibc/core
IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v4)/proto/ibc/core
COSMOS_SDK_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk)/proto/cosmos

GOGO_PROTO_TYPES = third_party/proto/gogoproto
Expand Down
4 changes: 2 additions & 2 deletions golang/cosmos/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
8 changes: 8 additions & 0 deletions golang/cosmos/ante/inbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,11 @@ func (msk mockSwingsetKeeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdk.Ui
func (msk mockSwingsetKeeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdk.Uint) error {
return fmt.Errorf("not implemented")
}

func (msk mockSwingsetKeeper) GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) swingtypes.SmartWalletState {
panic(fmt.Errorf("not implemented"))
}

func (msk mockSwingsetKeeper) ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error {
return fmt.Errorf("not implemented")
}
89 changes: 44 additions & 45 deletions golang/cosmos/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/simapp"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -43,8 +44,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
Expand Down Expand Up @@ -79,22 +78,22 @@ import (
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"

icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
"github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"

icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand All @@ -103,7 +102,6 @@ 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 @@ -160,7 +158,6 @@ var (
swingsetclient.CoreEvalProposalHandler,
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
authzmodule.AppModuleBasic{},
Expand Down Expand Up @@ -234,7 +231,6 @@ type GaiaApp struct { // nolint: golint
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
Expand Down Expand Up @@ -415,12 +411,6 @@ func NewAgoricApp(
&stakingKeeper,
app.GetSubspace(slashingtypes.ModuleName),
)
app.CrisisKeeper = crisiskeeper.NewKeeper(
app.GetSubspace(crisistypes.ModuleName),
invCheckPeriod,
app.BankKeeper,
vbanktypes.ReservePoolName,
)
app.UpgradeKeeper = upgradekeeper.NewKeeper(
skipUpgradeHeights,
keys[upgradetypes.StoreKey],
Expand Down Expand Up @@ -596,7 +586,6 @@ func NewAgoricApp(

app.EvidenceKeeper = *evidenceKeeper

skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
swingStoreExportDir := cast.ToString(appOpts.Get(FlagSwingStoreExportDir))

// NOTE: Any module instantiated in the module manager that is later modified
Expand All @@ -612,7 +601,6 @@ func NewAgoricApp(
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
Expand Down Expand Up @@ -642,7 +630,6 @@ func NewAgoricApp(
// upgrades should be run first
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
ibctransfertypes.ModuleName,
Expand Down Expand Up @@ -671,7 +658,6 @@ func NewAgoricApp(
vibc.ModuleName,
vbank.ModuleName,
lien.ModuleName,
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
ibctransfertypes.ModuleName,
Expand Down Expand Up @@ -712,7 +698,6 @@ func NewAgoricApp(
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibctransfertypes.ModuleName,
ibchost.ModuleName,
icatypes.ModuleName,
Expand All @@ -733,7 +718,6 @@ func NewAgoricApp(
app.mm.SetOrderInitGenesis(moduleOrderForGenesisAndUpgrade...)
app.mm.SetOrderMigrations(moduleOrderForGenesisAndUpgrade...)

app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)

app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
Expand Down Expand Up @@ -792,19 +776,34 @@ func NewAgoricApp(
app.SetEndBlocker(app.EndBlocker)

const (
upgradeName = "agoric-upgrade-12"
upgradeNameTest = "agorictest-upgrade-12"
upgradeName = "agoric-upgrade-13"
upgradeNameTest = "agorictest-upgrade-13"
)

app.UpgradeKeeper.SetUpgradeHandler(
upgradeName,
upgrade12Handler(app, upgradeName),
upgrade13Handler(app, upgradeName),
)
app.UpgradeKeeper.SetUpgradeHandler(
upgradeNameTest,
upgrade12Handler(app, upgradeNameTest),
upgrade13Handler(app, upgradeNameTest),
)

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(err)
}
if (upgradeInfo.Name == upgradeName || upgradeInfo.Name == upgradeNameTest) && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Deleted: []string{
crisistypes.ModuleName, // The SDK discontinued the crisis module in v0.51.0
},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
Expand All @@ -825,24 +824,25 @@ func NewAgoricApp(
return app
}

// upgrade12Handler performs standard upgrade actions plus custom actions for upgrade-12.
func upgrade12Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
// upgrade13Handler performs standard upgrade actions plus custom actions for upgrade-13.
func upgrade13Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
app.CheckControllerInited(false)
// 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 {
return mvm, err
}

m := swingsetkeeper.NewMigrator(app.SwingSetKeeper)
err = m.MigrateParams(ctx)
if err != nil {
return mvm, err
}

return mvm, nil
}
}
Expand Down Expand Up @@ -1177,7 +1177,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
Expand Down
3 changes: 0 additions & 3 deletions golang/cosmos/app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
allowedAddrsMap[addr] = true
}

/* Just to be safe, assert the invariants on current state. */
app.CrisisKeeper.AssertInvariants(ctx)

/* Handle fee distribution state. */

// withdraw all validator commission
Expand Down
8 changes: 4 additions & 4 deletions golang/cosmos/app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"os"
"testing"

gaia "github.com/cosmos/gaia/v7/app"
gaia "github.com/Agoric/agoric-sdk/golang/cosmos/app"

"github.com/cosmos/gaia/v7/app/helpers"
"github.com/Agoric/agoric-sdk/golang/cosmos/app/helpers"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/rand"
Expand Down Expand Up @@ -76,8 +76,8 @@ func interBlockCacheOpt() func(*baseapp.BaseApp) {
return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager())
}

//// TODO: Make another test for the fuzzer itself, which just has noOp txs
//// and doesn't depend on the application.
// // TODO: Make another test for the fuzzer itself, which just has noOp txs
// // and doesn't depend on the application.
func TestAppStateDeterminism(t *testing.T) {
if !simapp.FlagEnabledValue {
t.Skip("skipping application simulation")
Expand Down
2 changes: 0 additions & 2 deletions golang/cosmos/daemon/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/types"
vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/spf13/cast"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -155,7 +154,6 @@ func initRootCmd(sender Sender, rootCmd *cobra.Command, encodingConfig params.En
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
}

func queryCommand() *cobra.Command {
Expand Down
Loading

0 comments on commit b0c1f78

Please sign in to comment.