@agoric/cosmos 0.35.0 → 0.35.1-upgrade-23-dev-bd79330.0.bd79330
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 +11 -10
- package/ante/ante.go +2 -2
- package/app/app.go +74 -96
- package/app/sim_test.go +0 -2
- package/app/upgrade.go +20 -22
- package/daemon/cmd/root_test.go +1 -0
- package/git-revision.txt +1 -1
- package/go.mod +332 -131
- package/go.sum +801 -212
- 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 +101 -5
- package/proto/agoric/swingset/query.proto +26 -0
- package/proto/agoric/swingset/swingset.proto +95 -0
- package/proto/agoric/vbank/msgs.proto +5 -1
- package/proto/agoric/vibc/msgs.proto +45 -2
- package/proto/buf.gen.gogo.yaml +20 -5
- package/proto/buf.gen.swagger.yaml +12 -3
- package/proto/buf.yaml +1 -1
- package/scripts/mockgen.sh +4 -0
- package/scripts/protocgen.sh +13 -2
- package/tests/integrations/types/aminojson_test.go +18 -2
- package/tests/integrations/vbank/vbank_test.go +1 -0
- 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/types/kv_entry_helpers.go +0 -24
- package/x/swingset/abci.go +5 -0
- package/x/swingset/keeper/chunked_artifact_id_test.go +168 -0
- package/x/swingset/keeper/grpc_query.go +24 -0
- package/x/swingset/keeper/keeper.go +217 -8
- package/x/swingset/keeper/msg_server.go +230 -1
- package/x/swingset/keeper/msg_server_test.go +417 -0
- package/x/swingset/keeper/proposal.go +4 -0
- package/x/swingset/keeper/querier.go +1 -1
- package/x/swingset/keeper/test_utils.go +2 -2
- package/x/swingset/testing/queue.go +5 -2
- package/x/swingset/testutil/mocks.go +379 -0
- package/x/swingset/types/default-params.go +9 -0
- package/x/swingset/types/expected_keepers.go +25 -1
- package/x/swingset/types/list_tools.go +103 -0
- package/x/swingset/types/msgs.go +132 -21
- package/x/swingset/types/msgs.pb.go +1278 -98
- package/x/swingset/types/msgs_test.go +11 -21
- package/x/swingset/types/params.go +63 -13
- package/x/swingset/types/params_test.go +56 -26
- package/x/swingset/types/query.pb.go +526 -32
- package/x/swingset/types/query.pb.gw.go +101 -0
- package/x/swingset/types/swingset.pb.go +1288 -123
- package/x/vbank/genesis.go +1 -1
- package/x/vbank/keeper/rewards.go +4 -3
- package/x/vbank/types/msgs.pb.go +10 -8
- package/x/vbank/vbank.go +4 -1
- 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/vstorage/keeper/grpc_query.go +1 -1
- package/x/vstorage/keeper/keeper.go +4 -4
- package/x/vstorage/keeper/keeper_test.go +39 -35
- package/x/vstorage/keeper/querier.go +1 -1
- package/x/vstorage/vstorage.go +8 -8
- package/x/vstorage/vstorage_test.go +3 -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
|
@@ -6,7 +6,6 @@ GIT_COMMIT = $(shell hash=`git rev-parse --short HEAD 2>/dev/null`; if test -n "
|
|
|
6
6
|
PR_TARGET_REPO = https://github.com/Agoric/agoric-sdk.git
|
|
7
7
|
# TODO: figure out how to handle other branches like pismo-release
|
|
8
8
|
PR_TARGET_BRANCH = master
|
|
9
|
-
DOCKER := $(shell which docker)
|
|
10
9
|
|
|
11
10
|
default: all
|
|
12
11
|
|
|
@@ -91,24 +90,22 @@ endif
|
|
|
91
90
|
### Protobuf ###
|
|
92
91
|
###############################################################################
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
|
|
96
|
-
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
|
|
93
|
+
BUF_CMD = go tool buf
|
|
97
94
|
|
|
98
95
|
proto-all: proto-format proto-lint proto-gen
|
|
99
96
|
|
|
100
97
|
proto-gen:
|
|
101
98
|
@echo "Generating Protobuf files"
|
|
102
|
-
|
|
99
|
+
sh ./scripts/protocgen.sh
|
|
103
100
|
|
|
104
101
|
proto-format:
|
|
105
|
-
|
|
102
|
+
find ./proto -name "*.proto" -exec clang-format -i {} \;
|
|
106
103
|
|
|
107
104
|
proto-lint:
|
|
108
|
-
|
|
105
|
+
$(BUF_CMD) lint --error-format=json ./proto
|
|
109
106
|
|
|
110
107
|
proto-check-breaking:
|
|
111
|
-
|
|
108
|
+
$(BUF_CMD) breaking --against $(PR_TARGET_REPO)#branch=$(PR_TARGET_BRANCH),subdir=golang/cosmos
|
|
112
109
|
|
|
113
110
|
GOGO_PROTO_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/gogoproto)
|
|
114
111
|
# GOOGLE_API_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/googleapis/googleapis)/google/api
|
|
@@ -177,10 +174,14 @@ proto-update-deps:
|
|
|
177
174
|
mkdir -p $(COSMOS_SDK_AMINO_TYPES) && \
|
|
178
175
|
curl -sSL $$url/amino.proto > $(COSMOS_SDK_AMINO_TYPES)/amino.proto
|
|
179
176
|
|
|
180
|
-
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
|
|
177
|
+
.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps mocks
|
|
181
178
|
|
|
182
179
|
lint:
|
|
183
|
-
golangci-lint run
|
|
180
|
+
go tool golangci-lint run
|
|
184
181
|
|
|
185
182
|
test:
|
|
186
183
|
go test -coverprofile=coverage.txt -covermode=atomic ./...
|
|
184
|
+
|
|
185
|
+
mocks:
|
|
186
|
+
@echo "Generating mocks"
|
|
187
|
+
./scripts/mockgen.sh
|
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
|
|
|
@@ -532,6 +509,7 @@ func NewAgoricApp(
|
|
|
532
509
|
app.GetSubspace(swingset.ModuleName),
|
|
533
510
|
app.AccountKeeper, app.BankKeeper,
|
|
534
511
|
app.VstorageKeeper, vbanktypes.ReservePoolName,
|
|
512
|
+
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
535
513
|
callToController,
|
|
536
514
|
)
|
|
537
515
|
app.swingsetPort = app.AgdServer.MustRegisterPortHandler("swingset", swingset.NewPortHandler(app.SwingSetKeeper))
|
|
@@ -566,26 +544,47 @@ func NewAgoricApp(
|
|
|
566
544
|
getSwingStoreExportDataShadowCopyReader,
|
|
567
545
|
)
|
|
568
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
|
+
|
|
569
569
|
app.VibcKeeper = vibc.NewKeeper(
|
|
570
570
|
appCodec,
|
|
571
571
|
app.IBCKeeper.ChannelKeeper,
|
|
572
|
-
app.IBCKeeper.PortKeeper,
|
|
573
572
|
app.IBCKeeper.ClientKeeper,
|
|
574
|
-
).WithScope(
|
|
575
|
-
runtime.NewKVStoreService(keys[vibc.StoreKey]),
|
|
576
|
-
scopedVibcKeeper,
|
|
577
|
-
app.SwingSetKeeper.PushAction,
|
|
578
|
-
)
|
|
573
|
+
).WithScope(vibcScope)
|
|
579
574
|
|
|
580
575
|
vibcModule := vibc.NewAppModule(app.VibcKeeper, app.BankKeeper)
|
|
581
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)
|
|
582
582
|
app.vibcPort = app.AgdServer.MustRegisterPortHandler("vibc", vibc.NewReceiver(app.VibcKeeper))
|
|
583
583
|
|
|
584
584
|
app.VtransferKeeper = vtransferkeeper.NewKeeper(
|
|
585
585
|
appCodec,
|
|
586
586
|
runtime.NewKVStoreService(keys[vtransfer.StoreKey]),
|
|
587
587
|
app.VibcKeeper,
|
|
588
|
-
scopedTransferKeeper,
|
|
589
588
|
app.SwingSetKeeper.PushAction,
|
|
590
589
|
)
|
|
591
590
|
|
|
@@ -610,7 +609,6 @@ func NewAgoricApp(
|
|
|
610
609
|
govRouter.
|
|
611
610
|
AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
|
|
612
611
|
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
|
|
613
|
-
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
|
|
614
612
|
AddRoute(swingsettypes.RouterKey, swingset.NewSwingSetProposalHandler(app.SwingSetKeeper))
|
|
615
613
|
govConfig := govtypes.DefaultConfig()
|
|
616
614
|
|
|
@@ -637,7 +635,7 @@ func NewAgoricApp(
|
|
|
637
635
|
// It's important to note that the PFM Keeper must be initialized before the Transfer Keeper
|
|
638
636
|
app.PacketForwardKeeper = packetforwardkeeper.NewKeeper(
|
|
639
637
|
appCodec,
|
|
640
|
-
keys[packetforwardtypes.StoreKey],
|
|
638
|
+
runtime.NewKVStoreService(keys[packetforwardtypes.StoreKey]),
|
|
641
639
|
app.TransferKeeper, // will be zero-value here, reference is set later on with SetTransferKeeper.
|
|
642
640
|
app.IBCKeeper.ChannelKeeper,
|
|
643
641
|
app.BankKeeper,
|
|
@@ -648,14 +646,13 @@ func NewAgoricApp(
|
|
|
648
646
|
|
|
649
647
|
app.TransferKeeper = ibctransferkeeper.NewKeeper(
|
|
650
648
|
appCodec,
|
|
651
|
-
keys[ibctransfertypes.StoreKey],
|
|
649
|
+
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
|
|
652
650
|
app.GetSubspace(ibctransfertypes.ModuleName),
|
|
653
651
|
app.PacketForwardKeeper, // Wire in the middleware ICS4Wrapper.
|
|
654
652
|
app.IBCKeeper.ChannelKeeper,
|
|
655
|
-
app.
|
|
653
|
+
app.MsgServiceRouter(),
|
|
656
654
|
app.AccountKeeper,
|
|
657
655
|
app.BankKeeper,
|
|
658
|
-
scopedTransferKeeper,
|
|
659
656
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
660
657
|
)
|
|
661
658
|
|
|
@@ -665,46 +662,40 @@ func NewAgoricApp(
|
|
|
665
662
|
// tie a circular knot with IBC middleware before icahostkeeper.NewKeeper
|
|
666
663
|
// can be called.
|
|
667
664
|
app.ICAHostKeeper = icahostkeeper.NewKeeper(
|
|
668
|
-
appCodec,
|
|
665
|
+
appCodec,
|
|
666
|
+
runtime.NewKVStoreService(keys[icahosttypes.StoreKey]),
|
|
669
667
|
app.GetSubspace(icahosttypes.SubModuleName),
|
|
670
668
|
app.IBCKeeper.ChannelKeeper, // This is where middleware binding would happen.
|
|
671
669
|
app.IBCKeeper.ChannelKeeper,
|
|
672
|
-
app.IBCKeeper.PortKeeper,
|
|
673
670
|
app.AccountKeeper,
|
|
674
|
-
scopedICAHostKeeper,
|
|
675
671
|
app.MsgServiceRouter(),
|
|
672
|
+
app.GRPCQueryRouter(),
|
|
676
673
|
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
|
677
674
|
)
|
|
678
|
-
app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())
|
|
679
675
|
|
|
680
676
|
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)
|
|
681
677
|
icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper)
|
|
682
678
|
|
|
683
679
|
ics20TransferModule := ibctransfer.NewAppModule(app.TransferKeeper)
|
|
684
|
-
// Create the IBC router, which maps *module names* (not PortIDs) to modules.
|
|
685
|
-
ibcRouter := ibcporttypes.NewRouter()
|
|
686
680
|
|
|
687
681
|
// Add an IBC route for the ICA Host.
|
|
688
682
|
ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)
|
|
689
683
|
|
|
690
|
-
// Add an IBC route for vIBC.
|
|
691
|
-
ibcRouter.AddRoute(vibc.ModuleName, vibcIBCModule)
|
|
692
|
-
|
|
693
684
|
// Add an IBC route for ICS-20 fungible token transfers, wrapping base
|
|
694
685
|
// Cosmos functionality with middleware (from the inside out, Cosmos
|
|
695
686
|
// packet-forwarding and then our own "vtransfer").
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
687
|
+
transferIBCModule := ibctransfer.NewIBCModule(app.TransferKeeper)
|
|
688
|
+
var ics20TransferStack ibcporttypes.Middleware = packetforward.NewIBCMiddleware(
|
|
689
|
+
transferIBCModule,
|
|
699
690
|
app.PacketForwardKeeper,
|
|
700
691
|
0, // retries on timeout
|
|
701
692
|
packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout
|
|
702
693
|
)
|
|
703
|
-
|
|
704
|
-
ibcRouter.AddRoute(ibctransfertypes.ModuleName,
|
|
694
|
+
ics20TransferStack = vtransfer.NewIBCMiddleware(ics20TransferStack, app.VtransferKeeper)
|
|
695
|
+
ibcRouter.AddRoute(ibctransfertypes.ModuleName, ics20TransferStack)
|
|
705
696
|
|
|
706
697
|
// Seal the router
|
|
707
|
-
app.IBCKeeper.SetRouter(
|
|
698
|
+
app.IBCKeeper.SetRouter(vibcDynamicRouter)
|
|
708
699
|
|
|
709
700
|
// The local chain keeper provides ICA/ICQ-like support for the VM to
|
|
710
701
|
// control a fresh account and/or query this Cosmos-SDK instance.
|
|
@@ -747,7 +738,6 @@ func NewAgoricApp(
|
|
|
747
738
|
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
|
|
748
739
|
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
|
|
749
740
|
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
|
|
750
|
-
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
|
|
751
741
|
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
|
|
752
742
|
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
|
|
753
743
|
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
|
|
@@ -758,8 +748,8 @@ func NewAgoricApp(
|
|
|
758
748
|
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
|
|
759
749
|
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
|
|
760
750
|
ibc.NewAppModule(app.IBCKeeper),
|
|
761
|
-
ibctm.NewAppModule(),
|
|
762
|
-
ibcsolo.NewAppModule(),
|
|
751
|
+
ibctm.NewAppModule(tmLightClientModule),
|
|
752
|
+
ibcsolo.NewAppModule(soloLightClientModule),
|
|
763
753
|
params.NewAppModule(app.ParamsKeeper),
|
|
764
754
|
ics20TransferModule,
|
|
765
755
|
icaModule,
|
|
@@ -800,7 +790,10 @@ func NewAgoricApp(
|
|
|
800
790
|
//upgrade types need to be added to the pre-blocker. While this part has been implemented, the guide also states
|
|
801
791
|
//that these types should be removed from begin blocker. If we need to actually remove them, we would need to modify
|
|
802
792
|
// the SetOrderBeginBlockers logic. However, it's unclear whether this removal is strictly required or optional.
|
|
803
|
-
app.ModuleManager.SetOrderPreBlockers(
|
|
793
|
+
app.ModuleManager.SetOrderPreBlockers(
|
|
794
|
+
upgradetypes.ModuleName,
|
|
795
|
+
authtypes.ModuleName,
|
|
796
|
+
)
|
|
804
797
|
app.SetPreBlocker(app.PreBlocker)
|
|
805
798
|
|
|
806
799
|
// During begin block slashing happens after distr.BeginBlocker so that
|
|
@@ -810,7 +803,6 @@ func NewAgoricApp(
|
|
|
810
803
|
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
|
|
811
804
|
app.ModuleManager.SetOrderBeginBlockers(
|
|
812
805
|
// Cosmos-SDK modules appear roughly in the order used by simapp and gaiad.
|
|
813
|
-
capabilitytypes.ModuleName,
|
|
814
806
|
// params influence many other modules, so it should be near the top.
|
|
815
807
|
paramstypes.ModuleName,
|
|
816
808
|
govtypes.ModuleName,
|
|
@@ -851,7 +843,6 @@ func NewAgoricApp(
|
|
|
851
843
|
packetforwardtypes.ModuleName,
|
|
852
844
|
feegrant.ModuleName,
|
|
853
845
|
authz.ModuleName,
|
|
854
|
-
capabilitytypes.ModuleName,
|
|
855
846
|
authtypes.ModuleName,
|
|
856
847
|
banktypes.ModuleName,
|
|
857
848
|
distrtypes.ModuleName,
|
|
@@ -875,13 +866,9 @@ func NewAgoricApp(
|
|
|
875
866
|
// NOTE: The genutils module must occur after staking so that pools are
|
|
876
867
|
// properly initialized with tokens from genesis accounts.
|
|
877
868
|
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
|
|
878
|
-
// NOTE: Capability module must occur first so that it can initialize any capabilities
|
|
879
|
-
// so that other modules that want to create or claim capabilities afterwards in InitChain
|
|
880
|
-
// can do so safely.
|
|
881
869
|
|
|
882
870
|
moduleOrderForGenesisAndUpgrade := []string{
|
|
883
871
|
paramstypes.ModuleName,
|
|
884
|
-
capabilitytypes.ModuleName,
|
|
885
872
|
authtypes.ModuleName,
|
|
886
873
|
banktypes.ModuleName,
|
|
887
874
|
distrtypes.ModuleName,
|
|
@@ -937,7 +924,6 @@ func NewAgoricApp(
|
|
|
937
924
|
// initialize stores
|
|
938
925
|
app.MountKVStores(keys)
|
|
939
926
|
app.MountTransientStores(tkeys)
|
|
940
|
-
app.MountMemoryStores(memKeys)
|
|
941
927
|
|
|
942
928
|
anteHandler, err := appante.NewAnteHandler(
|
|
943
929
|
appante.HandlerOptions{
|
|
@@ -976,9 +962,7 @@ func NewAgoricApp(
|
|
|
976
962
|
// another, which shouldn't re-run store upgrades.
|
|
977
963
|
if isPrimaryUpgradeName(upgradeInfo.Name) && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
|
|
978
964
|
storeUpgrades := storetypes.StoreUpgrades{
|
|
979
|
-
Added:
|
|
980
|
-
capabilitytypes.MemStoreKey,
|
|
981
|
-
},
|
|
965
|
+
Added: []string{},
|
|
982
966
|
Deleted: []string{},
|
|
983
967
|
}
|
|
984
968
|
|
|
@@ -990,12 +974,11 @@ func NewAgoricApp(
|
|
|
990
974
|
if err := app.LoadLatestVersion(); err != nil {
|
|
991
975
|
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
|
|
992
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
|
+
}
|
|
993
980
|
}
|
|
994
981
|
|
|
995
|
-
app.ScopedIBCKeeper = scopedIBCKeeper
|
|
996
|
-
app.ScopedVibcKeeper = scopedVibcKeeper
|
|
997
|
-
app.ScopedTransferKeeper = scopedTransferKeeper
|
|
998
|
-
app.ScopedICAHostKeeper = scopedICAHostKeeper
|
|
999
982
|
snapshotManager := app.SnapshotManager()
|
|
1000
983
|
if snapshotManager != nil {
|
|
1001
984
|
if err = snapshotManager.RegisterExtensions(&app.SwingSetSnapshotter); err != nil {
|
|
@@ -1384,7 +1367,7 @@ func (app *GaiaApp) GetBaseApp() *baseapp.BaseApp {
|
|
|
1384
1367
|
}
|
|
1385
1368
|
|
|
1386
1369
|
// GetStakingKeeper implements the TestingApp interface.
|
|
1387
|
-
func (app *GaiaApp) GetStakingKeeper()
|
|
1370
|
+
func (app *GaiaApp) GetStakingKeeper() *stakingkeeper.Keeper {
|
|
1388
1371
|
return app.StakingKeeper
|
|
1389
1372
|
}
|
|
1390
1373
|
|
|
@@ -1393,11 +1376,6 @@ func (app *GaiaApp) GetIBCKeeper() *ibckeeper.Keeper {
|
|
|
1393
1376
|
return app.IBCKeeper
|
|
1394
1377
|
}
|
|
1395
1378
|
|
|
1396
|
-
// GetScopedIBCKeeper implements the TestingApp interface.
|
|
1397
|
-
func (app *GaiaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {
|
|
1398
|
-
return app.ScopedIBCKeeper
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
1379
|
// GetTxConfig implements the TestingApp interface.
|
|
1402
1380
|
func (app *GaiaApp) GetTxConfig() client.TxConfig {
|
|
1403
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,16 +13,16 @@ 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{
|
|
25
|
-
"agoric-upgrade-
|
|
25
|
+
"agoric-upgrade-23",
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// isUpgradeNameOfThisVersion returns whether the provided plan name is a
|
|
@@ -56,7 +56,7 @@ func isPrimaryUpgradeName(name string) bool {
|
|
|
56
56
|
return false
|
|
57
57
|
}
|
|
58
58
|
switch name {
|
|
59
|
-
case validUpgradeName("agoric-upgrade-
|
|
59
|
+
case validUpgradeName("agoric-upgrade-23"):
|
|
60
60
|
return true
|
|
61
61
|
default:
|
|
62
62
|
panic(fmt.Errorf("unexpected upgrade name %s", validUpgradeName(name)))
|
|
@@ -168,13 +168,13 @@ func (app *GaiaApp) RegisterUpgradeHandlers() {
|
|
|
168
168
|
for _, name := range upgradeNamesOfThisVersion {
|
|
169
169
|
app.UpgradeKeeper.SetUpgradeHandler(
|
|
170
170
|
name,
|
|
171
|
-
|
|
171
|
+
makeUpgrade23Handler(app, name),
|
|
172
172
|
)
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
//
|
|
177
|
-
func
|
|
176
|
+
// makeUpgrade23Handler performs standard upgrade actions plus custom actions for upgrade-23.
|
|
177
|
+
func makeUpgrade23Handler(app *GaiaApp, targetUpgrade string) upgradetypes.UpgradeHandler {
|
|
178
178
|
_ = targetUpgrade
|
|
179
179
|
return func(goCtx context.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
|
|
180
180
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
|
@@ -198,20 +198,18 @@ func upgrade22Handler(app *GaiaApp, targetUpgrade string) upgradetypes.UpgradeHa
|
|
|
198
198
|
return nil, err
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
// Upgrade the components that changed.
|
|
202
|
+
CoreProposalSteps = append(CoreProposalSteps,
|
|
203
|
+
vm.CoreProposalStepForModules(
|
|
204
|
+
"@agoric/builders/scripts/smart-wallet/build-wallet-factory2-upgrade.js",
|
|
205
|
+
),
|
|
206
|
+
)
|
|
207
|
+
|
|
201
208
|
// terminationTargets is a slice of "$boardID:$instanceKitLabel" strings.
|
|
202
209
|
var terminationTargets []string
|
|
203
210
|
switch ctx.ChainID() {
|
|
204
|
-
case "agoric-3": // MAINNET
|
|
205
|
-
terminationTargets = []string{
|
|
206
|
-
// v29 "zcf-b1-4522b-ATOM-USD_price_feed"
|
|
207
|
-
"board02963:ATOM-USD_price_feed",
|
|
208
|
-
// v68 "zcf-b1-4522b-stATOM-USD_price_feed"
|
|
209
|
-
"board012113:stATOM-USD_price_feed",
|
|
210
|
-
// v98 "zcf-b1-4522b-stOSMO-USD_price_feed"
|
|
211
|
-
"board002164:stOSMO-USD_price_feed",
|
|
212
|
-
// v104 "zcf-b1-4522b-stTIA-USD_price_feed"
|
|
213
|
-
"board043173:stTIA-USD_price_feed",
|
|
214
|
-
}
|
|
211
|
+
case "agoric-mainfork-1", "agoric-3": // MAINNET
|
|
212
|
+
terminationTargets = []string{}
|
|
215
213
|
}
|
|
216
214
|
if len(terminationTargets) > 0 {
|
|
217
215
|
terminationStep, err := buildProposalStepWithArgs(
|
package/daemon/cmd/root_test.go
CHANGED
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
bd79330
|