@agoric/cosmos 0.34.2-dev-27669cc.0.27669cc → 0.34.2-dev-4dc0c9e.0.4dc0c9e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +0 -1
- package/ante/ante.go +2 -2
- package/app/app.go +96 -73
- package/app/sim_test.go +2 -0
- package/app/upgrade.go +6 -6
- package/daemon/cmd/root_test.go +0 -1
- package/git-revision.txt +1 -1
- package/go.mod +116 -83
- package/go.sum +130 -162
- package/package.json +2 -2
- package/proto/agoric/swingset/msgs.proto +0 -1
- package/proto/agoric/vbank/msgs.proto +1 -5
- package/proto/agoric/vibc/msgs.proto +2 -45
- package/scripts/protocgen.sh +1 -10
- package/tests/integrations/types/aminojson_test.go +2 -18
- package/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +3 -2
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +3 -2
- package/third_party/proto/ibc/core/channel/v1/channel.proto +22 -6
- package/third_party/proto/ibc/core/client/v1/client.proto +53 -6
- package/types/address_hooks.go +2 -2
- package/types/address_hooks_test.go +3 -3
- package/types/ibc_packet.go +3 -3
- package/types/ibc_packet_test.go +3 -3
- package/x/swingset/types/msgs.pb.go +89 -90
- package/x/vbank/types/msgs.pb.go +8 -10
- package/x/vibc/alias.go +1 -0
- package/x/vibc/keeper/keeper.go +81 -40
- package/x/vibc/keeper/migrations.go +1 -1
- package/x/vibc/keeper/triggers.go +4 -8
- package/x/vibc/types/expected_keepers.go +20 -7
- package/x/vibc/types/ibc_module.go +20 -13
- package/x/vibc/types/msgs.go +3 -60
- package/x/vibc/types/msgs.pb.go +31 -683
- package/x/vibc/types/receiver.go +2 -2
- package/x/vlocalchain/vlocalchain_test.go +1 -1
- package/x/vtransfer/ibc_middleware.go +17 -15
- package/x/vtransfer/ibc_middleware_test.go +53 -30
- package/x/vtransfer/keeper/keeper.go +28 -19
- package/x/vtransfer/types/expected_keepers.go +8 -15
- package/x/vtransfer/utils_test.go +9 -4
- package/go.work +0 -39
- package/go.work.sum +0 -2636
- package/proto/Dockerfile +0 -14
- package/x/vibc/keeper/dynamic_router.go +0 -176
- package/x/vibc/keeper/dynamic_router_test.go +0 -240
- package/x/vibc/keeper/scope.go +0 -114
package/Makefile
CHANGED
package/ante/ante.go
CHANGED
|
@@ -5,8 +5,8 @@ import (
|
|
|
5
5
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
6
6
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
|
7
7
|
"github.com/cosmos/cosmos-sdk/x/auth/ante"
|
|
8
|
-
ibcante "github.com/cosmos/ibc-go/
|
|
9
|
-
ibckeeper "github.com/cosmos/ibc-go/
|
|
8
|
+
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
|
|
9
|
+
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
|
package/app/app.go
CHANGED
|
@@ -88,7 +88,10 @@ import (
|
|
|
88
88
|
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
|
89
89
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
90
90
|
"github.com/cosmos/gogoproto/proto"
|
|
91
|
-
|
|
91
|
+
"github.com/cosmos/ibc-go/modules/capability"
|
|
92
|
+
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
|
|
93
|
+
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
|
|
94
|
+
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
|
|
92
95
|
|
|
93
96
|
"cosmossdk.io/log"
|
|
94
97
|
abci "github.com/cometbft/cometbft/abci/types"
|
|
@@ -96,19 +99,21 @@ import (
|
|
|
96
99
|
tmos "github.com/cometbft/cometbft/libs/os"
|
|
97
100
|
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
|
98
101
|
dbm "github.com/cosmos/cosmos-db"
|
|
99
|
-
icahost "github.com/cosmos/ibc-go/
|
|
100
|
-
icahostkeeper "github.com/cosmos/ibc-go/
|
|
101
|
-
icahosttypes "github.com/cosmos/ibc-go/
|
|
102
|
-
icatypes "github.com/cosmos/ibc-go/
|
|
103
|
-
ibctransfer "github.com/cosmos/ibc-go/
|
|
104
|
-
ibctransferkeeper "github.com/cosmos/ibc-go/
|
|
105
|
-
ibctransfertypes "github.com/cosmos/ibc-go/
|
|
106
|
-
ibc "github.com/cosmos/ibc-go/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
|
|
103
|
+
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
|
|
104
|
+
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
|
|
105
|
+
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
|
|
106
|
+
ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer"
|
|
107
|
+
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
|
|
108
|
+
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
|
|
109
|
+
ibc "github.com/cosmos/ibc-go/v8/modules/core"
|
|
110
|
+
ibcclient "github.com/cosmos/ibc-go/v8/modules/core/02-client"
|
|
111
|
+
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
|
|
112
|
+
ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
|
|
113
|
+
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
|
|
114
|
+
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
|
|
115
|
+
ibcsolo "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine"
|
|
116
|
+
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
|
|
112
117
|
"github.com/gorilla/mux"
|
|
113
118
|
"github.com/rakyll/statik/fs"
|
|
114
119
|
"github.com/spf13/cast"
|
|
@@ -126,18 +131,17 @@ import (
|
|
|
126
131
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank"
|
|
127
132
|
vbanktypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types"
|
|
128
133
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc"
|
|
129
|
-
vibckeeper "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/keeper"
|
|
130
134
|
vibctypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
|
|
131
135
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain"
|
|
132
136
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage"
|
|
133
137
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer"
|
|
134
138
|
vtransferkeeper "github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer/keeper"
|
|
135
|
-
|
|
139
|
+
testtypes "github.com/cosmos/ibc-go/v8/testing/types"
|
|
136
140
|
|
|
137
141
|
// Import the packet forward middleware
|
|
138
|
-
packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/
|
|
139
|
-
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/
|
|
140
|
-
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/
|
|
142
|
+
packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward"
|
|
143
|
+
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper"
|
|
144
|
+
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types"
|
|
141
145
|
// unnamed import of statik for swagger UI support
|
|
142
146
|
// XXX figure out how to build the docs
|
|
143
147
|
// _ "github.com/cosmos/cosmos-sdk/client/docs/statik"
|
|
@@ -186,7 +190,7 @@ var (
|
|
|
186
190
|
var (
|
|
187
191
|
_ runtime.AppI = (*GaiaApp)(nil)
|
|
188
192
|
_ servertypes.Application = (*GaiaApp)(nil)
|
|
189
|
-
_ ibctesting.TestingApp = (*GaiaApp)(nil)
|
|
193
|
+
// _ ibctesting.TestingApp = (*GaiaApp)(nil)
|
|
190
194
|
)
|
|
191
195
|
|
|
192
196
|
// GaiaApp extends an ABCI application, but with most of its parameters exported.
|
|
@@ -224,6 +228,7 @@ type GaiaApp struct { // nolint: golint
|
|
|
224
228
|
// keepers
|
|
225
229
|
AccountKeeper authkeeper.AccountKeeper
|
|
226
230
|
BankKeeper bankkeeper.Keeper
|
|
231
|
+
CapabilityKeeper *capabilitykeeper.Keeper
|
|
227
232
|
StakingKeeper *stakingkeeper.Keeper
|
|
228
233
|
SlashingKeeper slashingkeeper.Keeper
|
|
229
234
|
MintKeeper mintkeeper.Keeper
|
|
@@ -250,6 +255,12 @@ type GaiaApp struct { // nolint: golint
|
|
|
250
255
|
VlocalchainKeeper vlocalchain.Keeper
|
|
251
256
|
VtransferKeeper vtransferkeeper.Keeper
|
|
252
257
|
|
|
258
|
+
// make scoped keepers public for test purposes
|
|
259
|
+
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
|
|
260
|
+
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
|
|
261
|
+
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
|
|
262
|
+
ScopedVibcKeeper capabilitykeeper.ScopedKeeper
|
|
263
|
+
|
|
253
264
|
// the module managers
|
|
254
265
|
ModuleManager *module.Manager
|
|
255
266
|
BasicModuleManager module.BasicManager
|
|
@@ -350,11 +361,12 @@ func NewAgoricApp(
|
|
|
350
361
|
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
|
|
351
362
|
govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey,
|
|
352
363
|
evidencetypes.StoreKey, ibctransfertypes.StoreKey, packetforwardtypes.StoreKey,
|
|
353
|
-
feegrant.StoreKey, authzkeeper.StoreKey, icahosttypes.StoreKey,
|
|
364
|
+
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, icahosttypes.StoreKey,
|
|
354
365
|
swingset.StoreKey, vstorage.StoreKey, vibc.StoreKey,
|
|
355
366
|
vlocalchain.StoreKey, vtransfer.StoreKey, vbank.StoreKey, consensusparamstypes.StoreKey,
|
|
356
367
|
)
|
|
357
368
|
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, vbanktypes.TStoreKey)
|
|
369
|
+
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
|
|
358
370
|
|
|
359
371
|
app := &GaiaApp{
|
|
360
372
|
BaseApp: bApp,
|
|
@@ -367,6 +379,7 @@ func NewAgoricApp(
|
|
|
367
379
|
invCheckPeriod: invCheckPeriod,
|
|
368
380
|
keys: keys,
|
|
369
381
|
tkeys: tkeys,
|
|
382
|
+
memKeys: memKeys,
|
|
370
383
|
}
|
|
371
384
|
|
|
372
385
|
app.ParamsKeeper = initParamsKeeper(
|
|
@@ -386,6 +399,14 @@ func NewAgoricApp(
|
|
|
386
399
|
// set the BaseApp's parameter store
|
|
387
400
|
bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)
|
|
388
401
|
|
|
402
|
+
// add capability keeper and ScopeToModule for ibc module
|
|
403
|
+
app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey])
|
|
404
|
+
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
|
|
405
|
+
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
|
|
406
|
+
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
|
|
407
|
+
scopedVibcKeeper := app.CapabilityKeeper.ScopeToModule(vibc.ModuleName)
|
|
408
|
+
app.CapabilityKeeper.Seal()
|
|
409
|
+
|
|
389
410
|
// add keepers
|
|
390
411
|
|
|
391
412
|
app.AccountKeeper = authkeeper.NewAccountKeeper(
|
|
@@ -479,9 +500,11 @@ func NewAgoricApp(
|
|
|
479
500
|
|
|
480
501
|
app.IBCKeeper = ibckeeper.NewKeeper(
|
|
481
502
|
appCodec,
|
|
482
|
-
|
|
503
|
+
keys[ibcexported.StoreKey],
|
|
483
504
|
app.GetSubspace(ibcexported.ModuleName),
|
|
505
|
+
app.StakingKeeper,
|
|
484
506
|
app.UpgradeKeeper,
|
|
507
|
+
scopedIBCKeeper,
|
|
485
508
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
486
509
|
)
|
|
487
510
|
|
|
@@ -544,47 +567,26 @@ func NewAgoricApp(
|
|
|
544
567
|
getSwingStoreExportDataShadowCopyReader,
|
|
545
568
|
)
|
|
546
569
|
|
|
547
|
-
// Light client modules
|
|
548
|
-
clientKeeper := app.IBCKeeper.ClientKeeper
|
|
549
|
-
storeProvider := app.IBCKeeper.ClientKeeper.GetStoreProvider()
|
|
550
|
-
|
|
551
|
-
tmLightClientModule := ibctm.NewLightClientModule(appCodec, storeProvider)
|
|
552
|
-
clientKeeper.AddRoute(ibctm.ModuleName, &tmLightClientModule)
|
|
553
|
-
|
|
554
|
-
soloLightClientModule := ibcsolo.NewLightClientModule(appCodec, storeProvider)
|
|
555
|
-
clientKeeper.AddRoute(ibcsolo.ModuleName, &soloLightClientModule)
|
|
556
|
-
|
|
557
|
-
// wasmLightClientModule := ibcwasm.NewLightClientModule(app.WasmClientKeeper, storeProvider)
|
|
558
|
-
// clientKeeper.AddRoute(ibcwasmtypes.ModuleName, &wasmLightClientModule)
|
|
559
|
-
|
|
560
|
-
// Create the IBC router, which maps *module names* (not PortIDs) to modules.
|
|
561
|
-
ibcRouter := ibcporttypes.NewRouter()
|
|
562
|
-
vibcDynamicRouter := vibckeeper.NewDynamicPortRouter(ibcRouter)
|
|
563
|
-
vibcScope := vibckeeper.NewDynamicPortScope(
|
|
564
|
-
runtime.NewKVStoreService(keys[vibc.StoreKey]),
|
|
565
|
-
vibcDynamicRouter,
|
|
566
|
-
app.SwingSetKeeper.PushAction,
|
|
567
|
-
)
|
|
568
|
-
|
|
569
570
|
app.VibcKeeper = vibc.NewKeeper(
|
|
570
571
|
appCodec,
|
|
571
572
|
app.IBCKeeper.ChannelKeeper,
|
|
573
|
+
app.IBCKeeper.PortKeeper,
|
|
572
574
|
app.IBCKeeper.ClientKeeper,
|
|
573
|
-
).WithScope(
|
|
575
|
+
).WithScope(
|
|
576
|
+
runtime.NewKVStoreService(keys[vibc.StoreKey]),
|
|
577
|
+
scopedVibcKeeper,
|
|
578
|
+
app.SwingSetKeeper.PushAction,
|
|
579
|
+
)
|
|
574
580
|
|
|
575
581
|
vibcModule := vibc.NewAppModule(app.VibcKeeper, app.BankKeeper)
|
|
576
582
|
vibcIBCModule := vibc.NewIBCModule(app.VibcKeeper)
|
|
577
|
-
vibcScope.SetDynamicModule(vibcIBCModule)
|
|
578
|
-
vibcDynamicRouter.AddLegacyPrefixRoute("icacontroller-", vibcIBCModule)
|
|
579
|
-
vibcDynamicRouter.AddLegacyPrefixRoute("icqcontroller-", vibcIBCModule)
|
|
580
|
-
vibcDynamicRouter.AddLegacyPrefixRoute("port-", vibcIBCModule)
|
|
581
|
-
vibcDynamicRouter.AddLegacyPrefixRoute("custom-", vibcIBCModule)
|
|
582
583
|
app.vibcPort = app.AgdServer.MustRegisterPortHandler("vibc", vibc.NewReceiver(app.VibcKeeper))
|
|
583
584
|
|
|
584
585
|
app.VtransferKeeper = vtransferkeeper.NewKeeper(
|
|
585
586
|
appCodec,
|
|
586
587
|
runtime.NewKVStoreService(keys[vtransfer.StoreKey]),
|
|
587
588
|
app.VibcKeeper,
|
|
589
|
+
scopedTransferKeeper,
|
|
588
590
|
app.SwingSetKeeper.PushAction,
|
|
589
591
|
)
|
|
590
592
|
|
|
@@ -609,6 +611,7 @@ func NewAgoricApp(
|
|
|
609
611
|
govRouter.
|
|
610
612
|
AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
|
|
611
613
|
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
|
|
614
|
+
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
|
|
612
615
|
AddRoute(swingsettypes.RouterKey, swingset.NewSwingSetProposalHandler(app.SwingSetKeeper))
|
|
613
616
|
govConfig := govtypes.DefaultConfig()
|
|
614
617
|
|
|
@@ -635,7 +638,7 @@ func NewAgoricApp(
|
|
|
635
638
|
// It's important to note that the PFM Keeper must be initialized before the Transfer Keeper
|
|
636
639
|
app.PacketForwardKeeper = packetforwardkeeper.NewKeeper(
|
|
637
640
|
appCodec,
|
|
638
|
-
|
|
641
|
+
keys[packetforwardtypes.StoreKey],
|
|
639
642
|
app.TransferKeeper, // will be zero-value here, reference is set later on with SetTransferKeeper.
|
|
640
643
|
app.IBCKeeper.ChannelKeeper,
|
|
641
644
|
app.BankKeeper,
|
|
@@ -646,13 +649,14 @@ func NewAgoricApp(
|
|
|
646
649
|
|
|
647
650
|
app.TransferKeeper = ibctransferkeeper.NewKeeper(
|
|
648
651
|
appCodec,
|
|
649
|
-
|
|
652
|
+
keys[ibctransfertypes.StoreKey],
|
|
650
653
|
app.GetSubspace(ibctransfertypes.ModuleName),
|
|
651
654
|
app.PacketForwardKeeper, // Wire in the middleware ICS4Wrapper.
|
|
652
655
|
app.IBCKeeper.ChannelKeeper,
|
|
653
|
-
app.
|
|
656
|
+
app.IBCKeeper.PortKeeper,
|
|
654
657
|
app.AccountKeeper,
|
|
655
658
|
app.BankKeeper,
|
|
659
|
+
scopedTransferKeeper,
|
|
656
660
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
657
661
|
)
|
|
658
662
|
|
|
@@ -662,40 +666,46 @@ func NewAgoricApp(
|
|
|
662
666
|
// tie a circular knot with IBC middleware before icahostkeeper.NewKeeper
|
|
663
667
|
// can be called.
|
|
664
668
|
app.ICAHostKeeper = icahostkeeper.NewKeeper(
|
|
665
|
-
appCodec,
|
|
666
|
-
runtime.NewKVStoreService(keys[icahosttypes.StoreKey]),
|
|
669
|
+
appCodec, keys[icahosttypes.StoreKey],
|
|
667
670
|
app.GetSubspace(icahosttypes.SubModuleName),
|
|
668
671
|
app.IBCKeeper.ChannelKeeper, // This is where middleware binding would happen.
|
|
669
672
|
app.IBCKeeper.ChannelKeeper,
|
|
673
|
+
app.IBCKeeper.PortKeeper,
|
|
670
674
|
app.AccountKeeper,
|
|
675
|
+
scopedICAHostKeeper,
|
|
671
676
|
app.MsgServiceRouter(),
|
|
672
|
-
app.GRPCQueryRouter(),
|
|
673
677
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
674
678
|
)
|
|
679
|
+
app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())
|
|
675
680
|
|
|
676
681
|
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)
|
|
677
682
|
icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper)
|
|
678
683
|
|
|
679
684
|
ics20TransferModule := ibctransfer.NewAppModule(app.TransferKeeper)
|
|
685
|
+
// Create the IBC router, which maps *module names* (not PortIDs) to modules.
|
|
686
|
+
ibcRouter := ibcporttypes.NewRouter()
|
|
680
687
|
|
|
681
688
|
// Add an IBC route for the ICA Host.
|
|
682
689
|
ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)
|
|
683
690
|
|
|
691
|
+
// Add an IBC route for vIBC.
|
|
692
|
+
ibcRouter.AddRoute(vibc.ModuleName, vibcIBCModule)
|
|
693
|
+
|
|
684
694
|
// Add an IBC route for ICS-20 fungible token transfers, wrapping base
|
|
685
695
|
// Cosmos functionality with middleware (from the inside out, Cosmos
|
|
686
696
|
// packet-forwarding and then our own "vtransfer").
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
697
|
+
var ics20TransferIBCModule ibcporttypes.IBCModule = ibctransfer.NewIBCModule(app.TransferKeeper)
|
|
698
|
+
ics20TransferIBCModule = packetforward.NewIBCMiddleware(
|
|
699
|
+
ics20TransferIBCModule,
|
|
690
700
|
app.PacketForwardKeeper,
|
|
691
701
|
0, // retries on timeout
|
|
692
702
|
packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout
|
|
693
703
|
)
|
|
694
|
-
|
|
695
|
-
ibcRouter.AddRoute(ibctransfertypes.ModuleName,
|
|
704
|
+
ics20TransferIBCModule = vtransfer.NewIBCMiddleware(ics20TransferIBCModule, app.VtransferKeeper)
|
|
705
|
+
ibcRouter.AddRoute(ibctransfertypes.ModuleName, ics20TransferIBCModule)
|
|
696
706
|
|
|
697
707
|
// Seal the router
|
|
698
|
-
app.IBCKeeper.SetRouter(
|
|
708
|
+
app.IBCKeeper.SetRouter(ibcRouter)
|
|
699
709
|
|
|
700
710
|
// The local chain keeper provides ICA/ICQ-like support for the VM to
|
|
701
711
|
// control a fresh account and/or query this Cosmos-SDK instance.
|
|
@@ -738,6 +748,7 @@ func NewAgoricApp(
|
|
|
738
748
|
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
|
|
739
749
|
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
|
|
740
750
|
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
|
|
751
|
+
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
|
|
741
752
|
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
|
|
742
753
|
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
|
|
743
754
|
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
|
|
@@ -748,8 +759,8 @@ func NewAgoricApp(
|
|
|
748
759
|
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
|
|
749
760
|
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
|
|
750
761
|
ibc.NewAppModule(app.IBCKeeper),
|
|
751
|
-
ibctm.NewAppModule(
|
|
752
|
-
ibcsolo.NewAppModule(
|
|
762
|
+
ibctm.NewAppModule(),
|
|
763
|
+
ibcsolo.NewAppModule(),
|
|
753
764
|
params.NewAppModule(app.ParamsKeeper),
|
|
754
765
|
ics20TransferModule,
|
|
755
766
|
icaModule,
|
|
@@ -790,10 +801,7 @@ func NewAgoricApp(
|
|
|
790
801
|
//upgrade types need to be added to the pre-blocker. While this part has been implemented, the guide also states
|
|
791
802
|
//that these types should be removed from begin blocker. If we need to actually remove them, we would need to modify
|
|
792
803
|
// the SetOrderBeginBlockers logic. However, it's unclear whether this removal is strictly required or optional.
|
|
793
|
-
app.ModuleManager.SetOrderPreBlockers(
|
|
794
|
-
upgradetypes.ModuleName,
|
|
795
|
-
authtypes.ModuleName,
|
|
796
|
-
)
|
|
804
|
+
app.ModuleManager.SetOrderPreBlockers(upgradetypes.ModuleName)
|
|
797
805
|
app.SetPreBlocker(app.PreBlocker)
|
|
798
806
|
|
|
799
807
|
// During begin block slashing happens after distr.BeginBlocker so that
|
|
@@ -803,6 +811,7 @@ func NewAgoricApp(
|
|
|
803
811
|
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
|
|
804
812
|
app.ModuleManager.SetOrderBeginBlockers(
|
|
805
813
|
// Cosmos-SDK modules appear roughly in the order used by simapp and gaiad.
|
|
814
|
+
capabilitytypes.ModuleName,
|
|
806
815
|
// params influence many other modules, so it should be near the top.
|
|
807
816
|
paramstypes.ModuleName,
|
|
808
817
|
govtypes.ModuleName,
|
|
@@ -843,6 +852,7 @@ func NewAgoricApp(
|
|
|
843
852
|
packetforwardtypes.ModuleName,
|
|
844
853
|
feegrant.ModuleName,
|
|
845
854
|
authz.ModuleName,
|
|
855
|
+
capabilitytypes.ModuleName,
|
|
846
856
|
authtypes.ModuleName,
|
|
847
857
|
banktypes.ModuleName,
|
|
848
858
|
distrtypes.ModuleName,
|
|
@@ -866,9 +876,13 @@ func NewAgoricApp(
|
|
|
866
876
|
// NOTE: The genutils module must occur after staking so that pools are
|
|
867
877
|
// properly initialized with tokens from genesis accounts.
|
|
868
878
|
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
|
|
879
|
+
// NOTE: Capability module must occur first so that it can initialize any capabilities
|
|
880
|
+
// so that other modules that want to create or claim capabilities afterwards in InitChain
|
|
881
|
+
// can do so safely.
|
|
869
882
|
|
|
870
883
|
moduleOrderForGenesisAndUpgrade := []string{
|
|
871
884
|
paramstypes.ModuleName,
|
|
885
|
+
capabilitytypes.ModuleName,
|
|
872
886
|
authtypes.ModuleName,
|
|
873
887
|
banktypes.ModuleName,
|
|
874
888
|
distrtypes.ModuleName,
|
|
@@ -924,6 +938,7 @@ func NewAgoricApp(
|
|
|
924
938
|
// initialize stores
|
|
925
939
|
app.MountKVStores(keys)
|
|
926
940
|
app.MountTransientStores(tkeys)
|
|
941
|
+
app.MountMemoryStores(memKeys)
|
|
927
942
|
|
|
928
943
|
anteHandler, err := appante.NewAnteHandler(
|
|
929
944
|
appante.HandlerOptions{
|
|
@@ -962,7 +977,9 @@ func NewAgoricApp(
|
|
|
962
977
|
// another, which shouldn't re-run store upgrades.
|
|
963
978
|
if isPrimaryUpgradeName(upgradeInfo.Name) && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
|
|
964
979
|
storeUpgrades := storetypes.StoreUpgrades{
|
|
965
|
-
Added:
|
|
980
|
+
Added: []string{
|
|
981
|
+
capabilitytypes.MemStoreKey,
|
|
982
|
+
},
|
|
966
983
|
Deleted: []string{},
|
|
967
984
|
}
|
|
968
985
|
|
|
@@ -974,11 +991,12 @@ func NewAgoricApp(
|
|
|
974
991
|
if err := app.LoadLatestVersion(); err != nil {
|
|
975
992
|
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
|
|
976
993
|
}
|
|
977
|
-
if err := app.VibcKeeper.LoadDynamicPortBindings(app.NewUncachedContext(false, tmproto.Header{})); err != nil {
|
|
978
|
-
panic(fmt.Errorf("failed to load vibc dynamic port bindings: %s", err))
|
|
979
|
-
}
|
|
980
994
|
}
|
|
981
995
|
|
|
996
|
+
app.ScopedIBCKeeper = scopedIBCKeeper
|
|
997
|
+
app.ScopedVibcKeeper = scopedVibcKeeper
|
|
998
|
+
app.ScopedTransferKeeper = scopedTransferKeeper
|
|
999
|
+
app.ScopedICAHostKeeper = scopedICAHostKeeper
|
|
982
1000
|
snapshotManager := app.SnapshotManager()
|
|
983
1001
|
if snapshotManager != nil {
|
|
984
1002
|
if err = snapshotManager.RegisterExtensions(&app.SwingSetSnapshotter); err != nil {
|
|
@@ -1367,7 +1385,7 @@ func (app *GaiaApp) GetBaseApp() *baseapp.BaseApp {
|
|
|
1367
1385
|
}
|
|
1368
1386
|
|
|
1369
1387
|
// GetStakingKeeper implements the TestingApp interface.
|
|
1370
|
-
func (app *GaiaApp) GetStakingKeeper()
|
|
1388
|
+
func (app *GaiaApp) GetStakingKeeper() testtypes.StakingKeeper {
|
|
1371
1389
|
return app.StakingKeeper
|
|
1372
1390
|
}
|
|
1373
1391
|
|
|
@@ -1376,6 +1394,11 @@ func (app *GaiaApp) GetIBCKeeper() *ibckeeper.Keeper {
|
|
|
1376
1394
|
return app.IBCKeeper
|
|
1377
1395
|
}
|
|
1378
1396
|
|
|
1397
|
+
// GetScopedIBCKeeper implements the TestingApp interface.
|
|
1398
|
+
func (app *GaiaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {
|
|
1399
|
+
return app.ScopedIBCKeeper
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1379
1402
|
// GetTxConfig implements the TestingApp interface.
|
|
1380
1403
|
func (app *GaiaApp) GetTxConfig() client.TxConfig {
|
|
1381
1404
|
return app.txConfig
|
package/app/sim_test.go
CHANGED
|
@@ -34,6 +34,7 @@ import (
|
|
|
34
34
|
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"
|
|
35
35
|
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
|
|
36
36
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
37
|
+
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
// SimAppChainID hardcoded chainID for simulation
|
|
@@ -207,6 +208,7 @@ func TestAppImportExport(t *testing.T) {
|
|
|
207
208
|
{app.GetKey(paramtypes.StoreKey), newApp.GetKey(paramtypes.StoreKey), [][]byte{}},
|
|
208
209
|
{app.GetKey(govtypes.StoreKey), newApp.GetKey(govtypes.StoreKey), [][]byte{}},
|
|
209
210
|
{app.GetKey(evidencetypes.StoreKey), newApp.GetKey(evidencetypes.StoreKey), [][]byte{}},
|
|
211
|
+
{app.GetKey(capabilitytypes.StoreKey), newApp.GetKey(capabilitytypes.StoreKey), [][]byte{}},
|
|
210
212
|
{app.GetKey(authzkeeper.StoreKey), newApp.GetKey(authzkeeper.StoreKey), [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}},
|
|
211
213
|
}
|
|
212
214
|
|
package/app/upgrade.go
CHANGED
|
@@ -13,12 +13,12 @@ import (
|
|
|
13
13
|
upgradetypes "cosmossdk.io/x/upgrade/types"
|
|
14
14
|
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
|
15
15
|
|
|
16
|
-
icahosttypes "github.com/cosmos/ibc-go/
|
|
17
|
-
ibctransfertypes "github.com/cosmos/ibc-go/
|
|
18
|
-
ibcclienttypes "github.com/cosmos/ibc-go/
|
|
19
|
-
ibcconnectiontypes "github.com/cosmos/ibc-go/
|
|
20
|
-
ibcexported "github.com/cosmos/ibc-go/
|
|
21
|
-
ibctmmigrations "github.com/cosmos/ibc-go/
|
|
16
|
+
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
|
|
17
|
+
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
|
|
18
|
+
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
|
|
19
|
+
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
|
|
20
|
+
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
|
|
21
|
+
ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations"
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
var upgradeNamesOfThisVersion = []string{
|
package/daemon/cmd/root_test.go
CHANGED
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4dc0c9e
|