Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Contains all the PRs that improved the code without changing the behaviors.

### Added
- [#604](https://github.com/archway-network/archway/pull/604) - Move Dockerfile.deprecated -> Dockerfile.legacy and update wasmvm versions. Dockerfile.legacy will be maintained due to existing demand
- Add the [`x/usdcmigration`](https://github.com/disperze/usdc-migration) module (Noble USDC wind-down) and the `v11.0.0` upgrade handler, which enables it on the Noble channel `channel-29`

## [v10.1.0](https://github.com/archway-network/archway/releases/tag/v10.1.0)

Expand Down
23 changes: 22 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ import (

extendedGov "github.com/archway-network/archway/x/gov"

"github.com/disperze/usdc-migration/v8/x/usdcmigration"
usdcmigrationkeeper "github.com/disperze/usdc-migration/v8/x/usdcmigration/keeper"
usdcmigrationtypes "github.com/disperze/usdc-migration/v8/x/usdcmigration/types"

"github.com/CosmWasm/wasmd/x/wasm"

archwayappparams "github.com/archway-network/archway/app/params"
Expand Down Expand Up @@ -229,6 +233,7 @@ var (
cwfees.AppModule{},
cwica.AppModuleBasic{},
cwerrors.AppModuleBasic{},
usdcmigration.AppModule{},
)

// module account permissions
Expand Down Expand Up @@ -335,6 +340,7 @@ func NewArchwayApp(
icacontrollertypes.StoreKey, icahosttypes.StoreKey, ibcfeetypes.StoreKey, crisistypes.StoreKey, group.StoreKey, nftkeeper.StoreKey, cwicatypes.StoreKey,

trackingTypes.StoreKey, rewardsTypes.StoreKey, callbackTypes.StoreKey, cwfees.ModuleName, cwerrorsTypes.StoreKey,
usdcmigrationtypes.StoreKey,
)
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, cwerrorsTypes.TStoreKey)
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -499,12 +505,23 @@ func NewArchwayApp(
app.Keepers.IBCKeeper.PortKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper,
)

// USDC migration keeper: wraps the fee keeper and is the transfer keeper's
// ICS4 Wrapper, so every ICS20 send passes through its Noble USDC send block.
// It must be created before the transfer keeper.
app.Keepers.UsdcMigrationKeeper = usdcmigrationkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[usdcmigrationtypes.StoreKey]),
app.Keepers.IBCFeeKeeper,
scopedTransferKeeper,
govModuleAddr,
)

// Create Transfer Keepers
app.Keepers.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
app.getSubspace(ibctransfertypes.ModuleName),
app.Keepers.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.Keepers.UsdcMigrationKeeper, // ISC4 Wrapper: usdcmigration -> fee IBC middleware
app.Keepers.IBCKeeper.ChannelKeeper,
app.Keepers.IBCKeeper.PortKeeper,
app.Keepers.AccountKeeper,
Expand Down Expand Up @@ -680,6 +697,8 @@ func NewArchwayApp(
transferStack = transfer.NewIBCModule(app.Keepers.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, app.Keepers.IBCFeeKeeper)
transferStack = ibchooks.NewIBCMiddleware(transferStack, &hooksIcs4Wrapper)
// usdcmigration must be the outermost middleware of the transfer stack
transferStack = usdcmigration.NewIBCMiddleware(app.Keepers.UsdcMigrationKeeper, transferStack)

// Create Interchain Accounts Stack

Expand Down Expand Up @@ -758,6 +777,7 @@ func NewArchwayApp(
callback.NewAppModule(app.appCodec, app.Keepers.CallbackKeeper, app.Keepers.WASMKeeper, app.Keepers.CWErrorsKeeper),
cwica.NewAppModule(appCodec, app.Keepers.CWICAKeeper, app.Keepers.AccountKeeper),
cwerrors.NewAppModule(app.appCodec, app.Keepers.CWErrorsKeeper, app.Keepers.WASMKeeper),
usdcmigration.NewAppModule(app.Keepers.UsdcMigrationKeeper),
crisis.NewAppModule(&app.Keepers.CrisisKeeper, skipGenesisInvariants, app.getSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
)

Expand Down Expand Up @@ -879,6 +899,7 @@ func NewArchwayApp(
// additional non simd modules
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
usdcmigrationtypes.ModuleName,
ibcfeetypes.ModuleName,
icatypes.ModuleName,
// wasm after ibc transfer
Expand Down
2 changes: 2 additions & 0 deletions app/app_upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/archway-network/archway/app/upgrades"
upgrade_0_6 "github.com/archway-network/archway/app/upgrades/06"
upgrade10_0_0 "github.com/archway-network/archway/app/upgrades/10_0_0"
upgrade11_0_0 "github.com/archway-network/archway/app/upgrades/11_0_0"
upgrade1_0_0_rc_4 "github.com/archway-network/archway/app/upgrades/1_0_0_rc_4"
upgrade2_0_0 "github.com/archway-network/archway/app/upgrades/2_0_0"
upgrade3_0_0 "github.com/archway-network/archway/app/upgrades/3_0_0"
Expand All @@ -34,6 +35,7 @@ var Upgrades = []upgrades.Upgrade{
// upgrade8_0_0.Upgrade, // v8.0.0: was reserved for a consensus breaking wasmd upgrade
upgrade9_0_0.Upgrade, // v9.0.0
upgrade10_0_0.Upgrade, // v10.0.0
upgrade11_0_0.Upgrade, // v11.0.0
upgradelatest.Upgrade,

// constantine only
Expand Down
5 changes: 5 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
cwicaKeeper "github.com/archway-network/archway/x/cwica/keeper"
rewardsKeeper "github.com/archway-network/archway/x/rewards/keeper"
trackingKeeper "github.com/archway-network/archway/x/tracking/keeper"

usdcmigrationkeeper "github.com/disperze/usdc-migration/v8/x/usdcmigration/keeper"
)

type ArchwayKeepers struct {
Expand Down Expand Up @@ -69,4 +71,7 @@ type ArchwayKeepers struct {
CallbackKeeper callbackKeeper.Keeper
CWErrorsKeeper cwerrorsKeeper.Keeper
CWICAKeeper cwicaKeeper.Keeper

// UsdcMigrationKeeper is a pointer: the transfer keeper holds it as its ICS4 wrapper.
UsdcMigrationKeeper *usdcmigrationkeeper.Keeper
}
58 changes: 58 additions & 0 deletions app/upgrades/11_0_0/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package upgrade11_0_0

import (
"context"

storetypes "cosmossdk.io/store/types"
upgradetypes "cosmossdk.io/x/upgrade/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
usdcmigrationtypes "github.com/disperze/usdc-migration/v8/x/usdcmigration/types"

"github.com/archway-network/archway/app/keepers"
"github.com/archway-network/archway/app/upgrades"
)

const Name = "v11.0.0"
const NameAsciiArt = `
# # ### ###
# # ## ## # # # #
# # # # # # # #
# # # # # # #
### ### # ### # ###

`

// NobleChannel is the Archway end of the transfer channel to Noble (noble-1
// channel-12). It is a var so local testnets can override it with
// -ldflags "-X github.com/archway-network/archway/app/upgrades/11_0_0.NobleChannel=channel-0".
var NobleChannel = "channel-29"

var Upgrade = upgrades.Upgrade{
UpgradeName: Name,
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator, keepers keepers.ArchwayKeepers) upgradetypes.UpgradeHandler {
return func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
migrations, err := mm.RunMigrations(ctx, cfg, fromVM)
if err != nil {
return nil, err
}

// RunMigrations runs InitGenesis of x/usdcmigration with its default (inert)
// params, so the Noble channel is set afterwards. From this height on, Noble
// USDC can no longer be received from Noble or sent out of Archway.
params := usdcmigrationtypes.DefaultParams()
params.NobleChannels = []string{NobleChannel}
if err := keepers.UsdcMigrationKeeper.SetParams(ctx, params); err != nil {
return nil, err
}

sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.Logger().Info("usdcmigration enabled", "noble_channels", params.NobleChannels)
sdkCtx.Logger().Info(upgrades.ArchwayLogo + NameAsciiArt)
return migrations, nil
}
},
StoreUpgrades: storetypes.StoreUpgrades{
Added: []string{usdcmigrationtypes.StoreKey},
},
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ require (
github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240820215527-05462618a4e8
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/v8 v8.7.0
github.com/disperze/usdc-migration/v8 v8.0.0
github.com/dvsekhvalnov/jose2go v1.6.0
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91/go.mod h1:sw
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/disperze/usdc-migration/v8 v8.0.0 h1:p4IAPGK+dQ5RUKL+T73/4mg4iB+foNzJ/4myCra07O4=
github.com/disperze/usdc-migration/v8 v8.0.0/go.mod h1:RVp75Fr0rdy5eBIrbVqaWmcqgjD7Jvi0MZMYjXQ27uQ=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
Expand Down
Loading