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