Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: ibc 8.3 not used #1519

Merged
merged 16 commits into from
Aug 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:
if: env.GIT_DIFF
run: |
make proto-gen-ci # proto-swagger-gen FIXME swagger-gen result is not reproducible in CI
git checkout -- go.mod go.sum docs/api/proto-docs.md # FIXME doc gen not reproducible in CI
git checkout -- go.mod go.sum # FIXME doc gen not reproducible in CI
- name: check working directory is clean
uses: numtide/clean-git-action@main
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#1394](https://github.com/crypto-org-chain/cronos/pull/1394) Add icahost wirings but disable in parameters.
* [#1414](https://github.com/crypto-org-chain/cronos/pull/1414) Integrate new evm tx format.
* [#1458](https://github.com/crypto-org-chain/cronos/pull/1458) Adjust require gas for recvPacket when ReceiverChainIsSource.
* [#1519](https://github.com/crypto-org-chain/cronos/pull/1519) Upgrade ibc-go to 8.3 and remove icaauth module.
* [#1518](https://github.com/crypto-org-chain/cronos/pull/1518) Keep versiondb/memiavl compatible with upstream sdk, stop supporting other streaming service.

### Improvements
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,38 +158,38 @@ $(BINDIR)/runsim:

test-sim-nondeterminism:
@echo "Running non-determinism test..."
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
@go test -tags=objstore -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
-NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h

test-sim-random-genesis-fast:
@echo "Running random genesis simulation..."
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation \
@go test -tags=objstore -mod=readonly $(SIMAPP) -run TestFullAppSimulation \
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h

test-sim-import-export: runsim
@echo "Running application import/export simulation. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport
@$(BINDIR)/runsim -Tags=objstore -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport

test-sim-after-import: runsim
@echo "Running application simulation-after-import. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport
@$(BINDIR)/runsim -Tags=objstore -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport

test-sim-custom-genesis-multi-seed: runsim
@echo "Running multi-seed custom genesis simulation..."
@echo "By default, ${HOME}/.cronosd/config/genesis.json will be used."
@$(BINDIR)/runsim -Genesis=${HOME}/.cronosd/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation
@$(BINDIR)/runsim -Tags=objstore -Genesis=${HOME}/.cronosd/config/genesis.json -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation

test-sim-multi-seed-long: runsim
@echo "Running long multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation
@$(BINDIR)/runsim -Tags=objstore -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation

test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation
@$(BINDIR)/runsim -Tags=objstore -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation

test-sim-benchmark-invariants:
@echo "Running simulation invariant benchmarks..."
@go test -mod=readonly $(SIMAPP) -benchmem -bench=BenchmarkInvariants -run=^$ \
@go test -tags=objstore -mod=readonly $(SIMAPP) -benchmem -bench=BenchmarkInvariants -run=^$ \
-Enabled=true -NumBlocks=1000 -BlockSize=200 \
-Period=1 -Commit=true -Seed=57 -v -timeout 24h

Expand All @@ -209,12 +209,12 @@ SIM_COMMIT ?= true

test-sim-benchmark:
@echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!"
@go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \
@go test -tags=objstore -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \
-Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h

test-sim-profile:
@echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!"
@go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \
@go test -tags=objstore -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \
-Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out

.PHONY: test-sim-profile test-sim-benchmark
Expand Down
26 changes: 4 additions & 22 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ import (
cronosprecompiles "github.com/crypto-org-chain/cronos/v2/x/cronos/keeper/precompiles"
"github.com/crypto-org-chain/cronos/v2/x/cronos/middleware"
cronostypes "github.com/crypto-org-chain/cronos/v2/x/cronos/types"
icaauth "github.com/crypto-org-chain/cronos/v2/x/icaauth"
icaauthkeeper "github.com/crypto-org-chain/cronos/v2/x/icaauth/keeper"
icaauthtypes "github.com/crypto-org-chain/cronos/v2/x/icaauth/types"

e2ee "github.com/crypto-org-chain/cronos/v2/x/e2ee"
e2eekeeper "github.com/crypto-org-chain/cronos/v2/x/e2ee/keeper"
Expand Down Expand Up @@ -252,7 +249,6 @@ func StoreKeys() (
ibcfeetypes.StoreKey,
// ica keys
icacontrollertypes.StoreKey,
icaauthtypes.StoreKey,
icahosttypes.StoreKey,
// ethermint keys
evmtypes.StoreKey, feemarkettypes.StoreKey,
Expand Down Expand Up @@ -314,7 +310,6 @@ type App struct {
IBCFeeKeeper ibcfeekeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
ICAAuthKeeper icaauthkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
Expand All @@ -324,7 +319,6 @@ type App struct {
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedICAAuthKeeper capabilitykeeper.ScopedKeeper

// Ethermint keepers
EvmKeeper *evmkeeper.Keeper
Expand Down Expand Up @@ -452,7 +446,6 @@ func New(
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedICAAuthKeeper := app.CapabilityKeeper.ScopeToModule(icaauthtypes.ModuleName)

// Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating
// their scoped modules in `NewApp` with `ScopeToModule`
Expand Down Expand Up @@ -579,12 +572,13 @@ func New(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec, keys[icahosttypes.StoreKey], ICAHostMockSubspace{},
appCodec, keys[icahosttypes.StoreKey], nil,
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper,
app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())
icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper)

// Create Transfer Keepers
Expand Down Expand Up @@ -622,7 +616,7 @@ func New(
return cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, rules, app.Logger())
},
func(ctx sdk.Context, rules ethparams.Rules) vm.PrecompiledContract {
return cronosprecompiles.NewIcaContract(ctx, &app.ICAAuthKeeper, &app.CronosKeeper, appCodec, gasConfig)
return cronosprecompiles.NewIcaContract(ctx, app.ICAControllerKeeper, &app.CronosKeeper, appCodec, gasConfig)
},
},
)
Expand Down Expand Up @@ -685,17 +679,12 @@ func New(
evmhandlers.NewSendToIbcV2Handler(app.BankKeeper, app.CronosKeeper),
))

app.ICAAuthKeeper = *icaauthkeeper.NewKeeper(appCodec, keys[icaauthtypes.StoreKey], keys[icaauthtypes.MemStoreKey], app.ICAControllerKeeper, scopedICAAuthKeeper, scopedICAControllerKeeper)
icaAuthIBCModule := icaauth.NewIBCModule(app.ICAAuthKeeper)

var icaControllerStack porttypes.IBCModule
icaControllerStack = icacontroller.NewIBCMiddleware(icaAuthIBCModule, app.ICAControllerKeeper)
icaControllerStack = icacontroller.NewIBCMiddleware(nil, app.ICAControllerKeeper)
icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper)
// Since the callbacks middleware itself is an ics4wrapper, it needs to be passed to the ica controller keeper
ics4Wrapper := icaControllerStack.(porttypes.Middleware)
app.ICAControllerKeeper.WithICS4Wrapper(ics4Wrapper)
app.ICAAuthKeeper.WithICS4Wrapper(ics4Wrapper)
icaAuthModule := icaauth.NewAppModule(appCodec, app.ICAAuthKeeper, ics4Wrapper)
// we don't limit gas usage here, because the cronos keeper will use network parameter to control it.
icaControllerStack = ibccallbacks.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper, app.CronosKeeper, math.MaxUint64)

Expand All @@ -707,7 +696,6 @@ func New(
ibcRouter := porttypes.NewRouter()
// Add controller & ica auth modules to IBC router
ibcRouter.
AddRoute(icaauthtypes.ModuleName, icaControllerStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack).
AddRoute(ibctransfertypes.ModuleName, transferStack)
Expand Down Expand Up @@ -772,7 +760,6 @@ func New(
ibctm.AppModule{},
transferModule,
icaModule,
icaAuthModule,
feeModule,

// Ethermint app modules
Expand Down Expand Up @@ -815,7 +802,6 @@ func New(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
icatypes.ModuleName,
icaauthtypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
Expand All @@ -837,7 +823,6 @@ func New(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
icatypes.ModuleName,
icaauthtypes.ModuleName,
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
Expand Down Expand Up @@ -880,7 +865,6 @@ func New(
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
icatypes.ModuleName,
icaauthtypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
Expand Down Expand Up @@ -1007,7 +991,6 @@ func New(
app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
app.ScopedICAControllerKeeper = scopedICAControllerKeeper
app.ScopedICAAuthKeeper = scopedICAAuthKeeper
// this line is used by starport scaffolding # stargate/app/beforeInitReturn

return app
Expand Down Expand Up @@ -1340,7 +1323,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())
paramsKeeper.Subspace(icaauthtypes.ModuleName)
paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(v0evmtypes.ParamKeyTable()) //nolint: staticcheck
paramsKeeper.Subspace(feemarkettypes.ModuleName).WithKeyTable(feemarkettypes.ParamKeyTable())
// this line is used by starport scaffolding # stargate/app/paramSubspace
Expand Down
18 changes: 0 additions & 18 deletions app/icahost.go

This file was deleted.

5 changes: 2 additions & 3 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"github.com/cosmos/cosmos-sdk/types/module"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper"
e2eetypes "github.com/crypto-org-chain/cronos/v2/x/e2ee/types"
)

func (app *App) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clientkeeper.Keeper) {
planName := "v1.3"
planName := "v1.4"
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
m, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
Expand All @@ -40,8 +39,8 @@
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storetypes.StoreUpgrades{
Added: []string{
icahosttypes.StoreKey,
e2eetypes.StoreKey,
},
Deleted: []string{"icaauth"},

Check warning on line 43 in app/upgrades.go

View check run for this annotation

Codecov / codecov/patch

app/upgrades.go#L43

Added line #L43 was not covered by tests
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
}))
}
}
Expand Down
8 changes: 0 additions & 8 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,6 @@
"Params": "InterchainAccountsControllerParams"
}
}
},
{
"url": "./tmp-swagger-gen/icaauth/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IcaauthParams"
}
}
}
]
}
Loading
Loading