diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fa6a08a8..1c3db882 100755 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.ci + file: ./Dockerfile.static push: true tags: odinprotocol/core:${{ env.GITHUB_REF_SLUG }} @@ -36,7 +36,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.ci + file: ./Dockerfile.static push: true tags: odinprotocol/core:latest diff --git a/Dockerfile.static b/Dockerfile.static index b15244a3..27885885 100644 --- a/Dockerfile.static +++ b/Dockerfile.static @@ -7,18 +7,25 @@ WORKDIR /chain COPY . /chain RUN go mod download -RUN GO_OWASM_VERSION=$(go list -m github.com/odin-protocol/go-owasm | cut -d ' ' -f 2) && \ - wget https://github.com/odin-protocol/go-owasm/releases/download/$GO_OWASM_VERSION/libgo_owasm_muslc.x86_64.a -O /lib/libgo_owasm_muslc.x86_64.a -RUN sha256sum /lib/libgo_owasm_muslc.x86_64.a | grep 52b43f1d1ee7f93eba2316b0dd0ba5bd8eefbf93b11bc7b44447b91a694dc74e +#RUN GO_OWASM_VERSION=$(go list -m github.com/odin-protocol/go-owasm | cut -d ' ' -f 2) && \ +# wget https://github.com/odin-protocol/go-owasm/releases/download/$GO_OWASM_VERSION/libgo_owasm_muslc.x86_64.a -O /lib/libgo_owasm_muslc.x86_64.a +#RUN sha256sum /lib/libgo_owasm_muslc.x86_64.a | grep b4ebce01c2c742c32ba0312793ea3936e4738c50362a631a47b1e42bff878e5d # Copy the library you want to the final location that will be found by the linker flag `-lgo_owasm_muslc` -RUN cp /lib/libgo_owasm_muslc.x86_64.a /lib/libgo_owasm_muslc.a +#RUN cp /lib/libgo_owasm_muslc.x86_64.a /lib/libgo_owasm_muslc.a + +ADD https://github.com/ODIN-PROTOCOL/wasmvm/releases/download/v2.0.18/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/ODIN-PROTOCOL/wasmvm/releases/download/v2.0.18/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +#RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 860ba8d7ee4c89c1b0dc3abd4b3658d07ddf5531d2de970cada0699689cc1e33 +#RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 85de2ab3c40236935dbd023c9211130d49c5464494c4b9b09ea33e27a2d6bf87 # force it to use static lib (from above) not standard libgo_owasm.so file RUN LEDGER_ENABLED=true BUILD_TAGS=muslc LINK_STATICALLY=true make install \ && echo "Ensuring binary is statically linked ..." \ && (file /go/bin/odind | grep "statically linked") +#RUN go test ./... + # -------------------------------------------------------- FROM alpine:3.16 diff --git a/app/ante.go b/app/ante.go index 4e6c3432..26c56aa6 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,9 +1,12 @@ package odin import ( + corestoretypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" circuitante "cosmossdk.io/x/circuit/ante" oraclekeeper "github.com/ODIN-PROTOCOL/odin-core/x/oracle/keeper" + wasmkeeper "github.com/ODIN-PROTOCOL/wasmd/x/wasm/keeper" + wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -16,13 +19,13 @@ import ( // channel keeper. type HandlerOptions struct { ante.HandlerOptions - OracleKeeper *oraclekeeper.Keeper - IBCKeeper *ibckeeper.Keeper - StakingKeeper *stakingkeeper.Keeper - CircuitKeeper circuitante.CircuitBreaker - //WasmKeeper *wasmkeeper.Keeper - //WasmConfig *wasmtypes.WasmConfig - //TXCounterStoreKey storetypes.StoreKey + OracleKeeper *oraclekeeper.Keeper + IBCKeeper *ibckeeper.Keeper + StakingKeeper *stakingkeeper.Keeper + CircuitKeeper circuitante.CircuitBreaker + WasmKeeper *wasmkeeper.Keeper + WasmConfig *wasmtypes.WasmConfig + TXCounterStoreKey corestoretypes.KVStoreService } func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { @@ -44,12 +47,12 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { if options.StakingKeeper == nil { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "Staking keeper is required for AnteHandler") } - //if options.WasmConfig == nil { - // return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") - //} - //if options.TXCounterStoreKey == nil { - // return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder") - //} + if options.WasmConfig == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") + } + if options.TXCounterStoreKey == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder") + } sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { @@ -59,9 +62,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first(), circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper), - //wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early - //wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey), - //wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()), + wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early + wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey), + wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), diff --git a/app/app.go b/app/app.go index 8670e00e..a518e3e8 100644 --- a/app/app.go +++ b/app/app.go @@ -15,15 +15,25 @@ import ( "cosmossdk.io/core/appmodule" circuitkeeper "cosmossdk.io/x/circuit/keeper" circuittypes "cosmossdk.io/x/circuit/types" + wasmkeeper "github.com/ODIN-PROTOCOL/wasmd/x/wasm/keeper" + wasmvm "github.com/ODIN-PROTOCOL/wasmvm/v2" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + icq "github.com/cosmos/ibc-apps/modules/async-icq/v8" + icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" + wasmlc "github.com/cosmos/ibc-go/modules/light-clients/08-wasm" + wasmlckeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" + wasmlctypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" + "github.com/prometheus/client_golang/prometheus" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" - //"github.com/CosmWasm/wasmd/x/wasm" - //wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - //wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + //"github.com/ODIN-PROTOCOL/wasmd/x/wasm" + //wasmkeeper "github.com/ODIN-PROTOCOL/wasmd/x/wasm/keeper" + //wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types" "cosmossdk.io/log" "github.com/ODIN-PROTOCOL/odin-core/x/mint" mintkeeper "github.com/ODIN-PROTOCOL/odin-core/x/mint/keeper" @@ -47,6 +57,9 @@ import ( "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/ODIN-PROTOCOL/wasmd/x/wasm" + wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types" + owasm "github.com/ODIN-PROTOCOL/wasmvm/v2" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -128,7 +141,6 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" "github.com/gorilla/mux" - owasm "github.com/odin-protocol/go-owasm/api" //"github.com/prometheus/client_golang/prometheus" "github.com/rakyll/statik/fs" @@ -140,6 +152,7 @@ import ( "github.com/ODIN-PROTOCOL/odin-core/app/upgrades/v7_11" "github.com/ODIN-PROTOCOL/odin-core/app/upgrades/v7_12" "github.com/ODIN-PROTOCOL/odin-core/app/upgrades/v8_3" + "github.com/ODIN-PROTOCOL/odin-core/app/upgrades/v9_3" nodeservice "github.com/ODIN-PROTOCOL/odin-core/client/grpc/node" proofservice "github.com/ODIN-PROTOCOL/odin-core/client/grpc/oracle/proof" odinbank "github.com/ODIN-PROTOCOL/odin-core/x/bank" @@ -196,7 +209,9 @@ var ( oracle.AppModuleBasic{}, nftmodule.AppModuleBasic{}, circuit.AppModuleBasic{}, - //wasm.AppModuleBasic{}, + wasm.AppModuleBasic{}, + wasmlc.AppModuleBasic{}, + icq.AppModuleBasic{}, ) // module account permissions maccPerms = map[string][]string{ @@ -210,7 +225,8 @@ var ( ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, oracletypes.ModuleName: nil, nft.ModuleName: nil, - //wasmtypes.ModuleName: {authtypes.Burner}, + wasmtypes.ModuleName: {authtypes.Burner}, + icqtypes.ModuleName: nil, } Upgrades = []upgrades.Upgrade{ @@ -219,6 +235,7 @@ var ( v7_11.Upgrade, v7_12.Upgrade, v8_3.Upgrade, + v9_3.Upgrade, } ) @@ -320,7 +337,9 @@ func NewOdinApp( nft.StoreKey, circuittypes.StoreKey, oracletypes.StoreKey, - //wasmtypes.StoreKey, + wasmtypes.StoreKey, + wasmlctypes.StoreKey, + icqtypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -334,7 +353,7 @@ func NewOdinApp( tkeys: tkeys, memKeys: memKeys, } - owasmVM, err := owasm.NewVm(owasmCacheSize) + owasmVM, err := owasm.NewOracleVm(owasmCacheSize) if err != nil { panic(err) } @@ -365,7 +384,8 @@ func NewOdinApp( scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) scopedOracleKeeper := app.CapabilityKeeper.ScopeToModule(oracletypes.ModuleName) scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - //scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) + scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) + scopedICQKeeper := app.CapabilityKeeper.ScopeToModule(icqtypes.ModuleName) app.CapabilityKeeper.Seal() // Add keepers. @@ -552,6 +572,19 @@ func NewOdinApp( transferModule := transfer.NewAppModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) + // ICQ Keeper + app.ICQKeeper = icqkeeper.NewKeeper( + appCodec, + app.keys[icqtypes.StoreKey], + app.IBCKeeper.ChannelKeeper, // may be replaced with middleware + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + scopedICQKeeper, + bApp.GRPCQueryRouter(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + icqStack := icq.NewIBCModule(app.ICQKeeper) + app.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), @@ -563,39 +596,100 @@ func NewOdinApp( app.MsgServiceRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) icaModule := ica.NewAppModule(nil, &app.ICAHostKeeper) icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) - //wasmDir := filepath.Join(homePath, "wasm") - //wasmConfig, err := wasm.ReadWasmConfig(appOpts) - //if err != nil { - // panic(fmt.Sprintf("error while reading wasm config: %s", err)) - //} - // + wasmDir := filepath.Join(homePath, "wasm") + wasmConfig, err := wasm.ReadWasmConfig(appOpts) + if err != nil { + panic(fmt.Sprintf("error while reading wasm config: %s", err)) + } + + wasmConfig.MemoryCacheSize = 1000000 + wasmConfig.ContractDebugMode = true + + acceptedStargateQueries := wasmkeeper.AcceptedQueries{ + // ibc + "/ibc.core.client.v1.Query/ClientState": &ibcclienttypes.QueryClientStateResponse{}, + "/ibc.core.client.v1.Query/ConsensusState": &ibcclienttypes.QueryConsensusStateResponse{}, + "/ibc.core.connection.v1.Query/Connection": &ibcconnectiontypes.QueryConnectionResponse{}, + + // governance + "/cosmos.gov.v1beta1.Query/Vote": &govv1.QueryVoteResponse{}, + + // distribution + "/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationRewardsResponse{}, + + // staking + "/cosmos.staking.v1beta1.Query/Delegation": &stakingtypes.QueryDelegationResponse{}, + "/cosmos.staking.v1beta1.Query/Redelegations": &stakingtypes.QueryRedelegationsResponse{}, + "/cosmos.staking.v1beta1.Query/UnbondingDelegation": &stakingtypes.QueryUnbondingDelegationResponse{}, + "/cosmos.staking.v1beta1.Query/Validator": &stakingtypes.QueryValidatorResponse{}, + "/cosmos.staking.v1beta1.Query/Params": &stakingtypes.QueryParamsResponse{}, + "/cosmos.staking.v1beta1.Query/Pool": &stakingtypes.QueryPoolResponse{}, + } + + querierOpts := wasmkeeper.WithQueryPlugins( + &wasmkeeper.QueryPlugins{ + Stargate: wasmkeeper.AcceptListStargateQuerier(acceptedStargateQueries, bApp.GRPCQueryRouter(), appCodec), + }) + + wasmOpts := append(GetWasmOpts(appOpts), querierOpts) + //// The last arguments can contain custom message handlers, and custom query handlers, //// if we want to allow any custom callbacks - //availableCapabilities := strings.Join(AllCapabilities(), ",") - //app.WasmKeeper = wasmkeeper.NewKeeper( - // appCodec, - // keys[wasmtypes.StoreKey], - // app.AccountKeeper, - // app.BankKeeper, - // app.StakingKeeper, - // distrkeeper.NewQuerier(app.DistrKeeper), - // app.IBCKeeper.ChannelKeeper, // ISC4 Wrapper: fee IBC middleware - // app.IBCKeeper.ChannelKeeper, - // &app.IBCKeeper.PortKeeper, - // scopedWasmKeeper, - // app.TransferKeeper, - // app.MsgServiceRouter(), - // app.GRPCQueryRouter(), - // wasmDir, - // wasmConfig, - // availableCapabilities, - // authtypes.NewModuleAddress(govtypes.ModuleName).String(), - // GetWasmOpts(appOpts)..., - //) + app.WasmKeeper = wasmkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + distrkeeper.NewQuerier(app.DistrKeeper), + app.IBCKeeper.ChannelKeeper, // ISC4 Wrapper: fee IBC middleware + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + scopedWasmKeeper, + app.TransferKeeper, + app.MsgServiceRouter(), + app.GRPCQueryRouter(), + wasmDir, + wasmConfig, + wasmkeeper.BuiltInCapabilities(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + wasmOpts..., + ) + + lcWasmer, err := wasmvm.NewVM(filepath.Join(homePath, "light-client-wasm"), wasmkeeper.BuiltInCapabilities(), 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) + if err != nil { + panic(fmt.Sprintf("failed to create odin wasm vm for 08-wasm: %s", err)) + } + + // 08-wasm light client + accepted := make([]string, 0) + for k := range acceptedStargateQueries { + accepted = append(accepted, k) + } + + wasmLightClientQuerier := wasmlctypes.QueryPlugins{ + // Custom: MyCustomQueryPlugin(), + // `myAcceptList` is a `[]string` containing the list of gRPC query paths that the chain wants to allow for the `08-wasm` module to query. + // These queries must be registered in the chain's gRPC query router, be deterministic, and track their gas usage. + // The `AcceptListStargateQuerier` function will return a query plugin that will only allow queries for the paths in the `myAcceptList`. + // The query responses are encoded in protobuf unlike the implementation in `x/wasm`. + Stargate: wasmlctypes.AcceptListStargateQuerier(accepted), + } + + app.WasmClientKeeper = wasmlckeeper.NewKeeperWithVM( + appCodec, + runtime.NewKVStoreService(keys[wasmlctypes.StoreKey]), + app.IBCKeeper.ClientKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + lcWasmer, + bApp.GRPCQueryRouter(), + wasmlckeeper.WithQueryPlugins(&wasmLightClientQuerier), + ) app.OracleKeeper = oraclekeeper.NewKeeper( appCodec, @@ -617,16 +711,17 @@ func NewOdinApp( oracleModule := oracle.NewAppModule(app.OracleKeeper, app.GetSubspace(oracletypes.ModuleName)) oracleIBCModule := oracle.NewIBCModule(app.OracleKeeper) - //var wasmStack porttypes.IBCModule - //wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper) + var wasmStack porttypes.IBCModule + wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper) // Create static IBC router, add transfer route, then set and seal it ibcRouter := porttypes.NewRouter() ibcRouter. AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(oracletypes.ModuleName, oracleIBCModule) - //AddRoute(wasmtypes.ModuleName, wasmStack) + AddRoute(oracletypes.ModuleName, oracleIBCModule). + AddRoute(wasmtypes.ModuleName, wasmStack). + AddRoute(icqtypes.ModuleName, icqStack) app.IBCKeeper.SetRouter(ibcRouter) @@ -715,7 +810,9 @@ func NewOdinApp( transferModule, icaModule, oracleModule, - //wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasmlc.NewAppModule(app.AppKeepers.WasmClientKeeper), + icq.NewAppModule(app.AppKeepers.ICQKeeper, app.GetSubspace(icqtypes.ModuleName)), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -764,7 +861,9 @@ func NewOdinApp( paramstypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName, - //wasmtypes.ModuleName, + wasmtypes.ModuleName, + icqtypes.ModuleName, + wasmlctypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( crisistypes.ModuleName, @@ -789,7 +888,9 @@ func NewOdinApp( upgradetypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName, - //wasmtypes.ModuleName, + wasmtypes.ModuleName, + icqtypes.ModuleName, + wasmlctypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are // properly initialized with tokens from genesis accounts. @@ -822,7 +923,9 @@ func NewOdinApp( consensusparamtypes.ModuleName, oracletypes.ModuleName, circuittypes.ModuleName, - //wasmtypes.ModuleName, + wasmtypes.ModuleName, + icqtypes.ModuleName, + wasmlctypes.ModuleName, ) // NOTE: upgrade module is required to be prioritized @@ -873,13 +976,13 @@ func NewOdinApp( FeegrantKeeper: app.FeegrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - OracleKeeper: &app.OracleKeeper, - IBCKeeper: app.IBCKeeper, - StakingKeeper: app.StakingKeeper, - CircuitKeeper: &app.CircuitKeeper, - //WasmKeeper: &app.WasmKeeper, - //WasmConfig: &wasmConfig, - //TXCounterStoreKey: keys[wasmtypes.StoreKey], + OracleKeeper: &app.OracleKeeper, + IBCKeeper: app.IBCKeeper, + StakingKeeper: app.StakingKeeper, + CircuitKeeper: &app.CircuitKeeper, + WasmKeeper: &app.WasmKeeper, + WasmConfig: &wasmConfig, + TXCounterStoreKey: runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), }, ) if err != nil { @@ -896,7 +999,8 @@ func NewOdinApp( if snapshotManager := app.SnapshotManager(); snapshotManager != nil { err := snapshotManager.RegisterExtensions( oraclekeeper.NewOracleSnapshotter(app.CommitMultiStore(), &app.OracleKeeper), - //wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper), + wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper), + wasmlckeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.AppKeepers.WasmClientKeeper), ) if err != nil { panic(fmt.Errorf("failed to register snapshot extension: %s", err)) @@ -909,19 +1013,24 @@ func NewOdinApp( tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) } - //ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) + ctx := app.BaseApp.NewUncachedContext(true, cmtproto.Header{}) + + if err := wasmlckeeper.InitializePinnedCodes(ctx); err != nil { + tmos.Exit(fmt.Sprintf("wasmlckeeper failed initialize pinned codes %s", err)) + } // Initialize pinned codes in wasmvm as they are not persisted there - //if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { - // tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) - //} + if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + panic(fmt.Sprintf("failed initialize pinned codes %s", err)) + } } app.ScopedIBCKeeper = scopedIBCKeeper app.ScopedTransferKeeper = scopedTransferKeeper app.ScopedOracleKeeper = scopedOracleKeeper - //app.ScopedWasmKeeper = scopedWasmKeeper + app.ScopedWasmKeeper = scopedWasmKeeper app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedICQKeeper = scopedICQKeeper return app } @@ -1166,7 +1275,8 @@ func initParamsKeeper( paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) paramsKeeper.Subspace(oracletypes.ModuleName) - //paramsKeeper.Subspace(wasmtypes.ModuleName) + paramsKeeper.Subspace(wasmtypes.ModuleName) + paramsKeeper.Subspace(icqtypes.ModuleName) return paramsKeeper } @@ -1204,25 +1314,11 @@ func (app *OdinApp) setupUpgradeStoreLoaders() { } } -func AllCapabilities() []string { - return []string{ - "iterator", - "staking", - "stargate", - "cosmwasm_1_1", - "cosmwasm_1_2", - "cosmwasm_1_3", - "cosmwasm_1_4", +func GetWasmOpts(appOpts servertypes.AppOptions) []wasmkeeper.Option { + var wasmOpts []wasmkeeper.Option + if cast.ToBool(appOpts.Get("telemetry.enabled")) { + wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) } -} -//func GetWasmOpts(appOpts servertypes.AppOptions) []wasmkeeper.Option { -// var wasmOpts []wasmkeeper.Option -// if cast.ToBool(appOpts.Get("telemetry.enabled")) { -// wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) -// } -// -// //wasmOpts = append(wasmOpts, wasmkeeper.WithGasRegister(NewWasmGasRegister())) -// -// return wasmOpts -//} + return wasmOpts +} diff --git a/app/genesis.go b/app/genesis.go index 0f7e202d..cc6aed5f 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -16,6 +16,8 @@ import ( "cosmossdk.io/x/upgrade" upgradetypes "cosmossdk.io/x/upgrade/types" minttypes "github.com/ODIN-PROTOCOL/odin-core/x/mint/types" + "github.com/ODIN-PROTOCOL/wasmd/x/wasm" + wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" @@ -107,6 +109,6 @@ func NewDefaultGenesisState() GenesisState { oracletypes.ModuleName: cdc.MustMarshalJSON(oracleGenesis), nft.ModuleName: nftmodule.AppModuleBasic{}.DefaultGenesis(cdc), circuittypes.ModuleName: circuit.AppModuleBasic{}.DefaultGenesis(cdc), - //wasmtypes.ModuleName: wasm.AppModuleBasic{}.DefaultGenesis(cdc), + wasmtypes.ModuleName: wasm.AppModuleBasic{}.DefaultGenesis(cdc), } } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index f02226d7..60e9927b 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -7,9 +7,11 @@ import ( nftkeeper "cosmossdk.io/x/nft/keeper" upgradekeeper "cosmossdk.io/x/upgrade/keeper" oraclekeeper "github.com/ODIN-PROTOCOL/odin-core/x/oracle/keeper" + icqkeeper "github.com/cosmos/ibc-apps/modules/async-icq/v8/keeper" + wasmlckeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" - //wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" mintkeeper "github.com/ODIN-PROTOCOL/odin-core/x/mint/keeper" + wasmkeeper "github.com/ODIN-PROTOCOL/wasmd/x/wasm/keeper" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" @@ -53,12 +55,15 @@ type AppKeepers struct { CircuitKeeper circuitkeeper.Keeper OracleKeeper oraclekeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper - //WasmKeeper wasmkeeper.Keeper + WasmKeeper wasmkeeper.Keeper + WasmClientKeeper wasmlckeeper.Keeper + ICQKeeper icqkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedOracleKeeper capabilitykeeper.ScopedKeeper - //ScopedWasmKeeper capabilitykeeper.ScopedKeeper + ScopedWasmKeeper capabilitykeeper.ScopedKeeper + ScopedICQKeeper capabilitykeeper.ScopedKeeper } diff --git a/app/upgrades/v9_3/upgrades.go b/app/upgrades/v9_3/upgrades.go new file mode 100644 index 00000000..dd45adf4 --- /dev/null +++ b/app/upgrades/v9_3/upgrades.go @@ -0,0 +1,43 @@ +package v9_3 + +import ( + "context" + + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/ODIN-PROTOCOL/odin-core/app/keepers" + "github.com/ODIN-PROTOCOL/odin-core/app/upgrades" + wasmtypes "github.com/ODIN-PROTOCOL/wasmd/x/wasm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v8/types" + wasmlctypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + _ upgrades.AppManager, + _ *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + goCtx := sdk.UnwrapSDKContext(ctx) + goCtx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + goCtx.Logger().Info("Upgrade v9 complete") + return vm, nil + } +} + +var Upgrade = upgrades.Upgrade{ + UpgradeName: "v0.9.3", + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{ + Added: []string{wasmtypes.StoreKey, wasmlctypes.StoreKey, icqtypes.StoreKey}, + }, +} diff --git a/app/wasm_config.go b/app/wasm_config.go deleted file mode 100644 index b69a47da..00000000 --- a/app/wasm_config.go +++ /dev/null @@ -1,25 +0,0 @@ -package odin - -//import ( -// wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" -//) -// -//const ( -// // DefaultInstanceCost is initially set the same as in wasmd -// DefaultInstanceCost uint64 = 60_000 -// // DefaultCompileCost set to a large number for testing -// DefaultCompileCost uint64 = 100 -//) -// -//// GasRegisterConfig is defaults plus a custom compile amount -//func GasRegisterConfig() wasmtypes.WasmGasRegisterConfig { -// gasConfig := wasmtypes.DefaultGasRegisterConfig() -// gasConfig.InstanceCost = DefaultInstanceCost -// gasConfig.CompileCost = DefaultCompileCost -// -// return gasConfig -//} -// -//func NewWasmGasRegister() wasmtypes.WasmGasRegister { -// return wasmtypes.NewWasmGasRegister(GasRegisterConfig()) -//} diff --git a/benchmark/helper_test.go b/benchmark/helper_test.go index e29c0b6b..a284b63b 100644 --- a/benchmark/helper_test.go +++ b/benchmark/helper_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + owasm "github.com/ODIN-PROTOCOL/wasmvm/v2" types "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" @@ -16,7 +17,6 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - owasm "github.com/odin-protocol/go-owasm/api" "github.com/stretchr/testify/require" "github.com/ODIN-PROTOCOL/odin-core/pkg/obi" @@ -157,7 +157,7 @@ func DecodeEvents(events []types.Event) []Event { for _, event := range events { attrs := make(map[string]string, 0) for _, attributes := range event.Attributes { - attrs[string(attributes.Key)] = string(attributes.Value) + attrs[attributes.Key] = attributes.Value } evs = append(evs, Event{ Type: event.Type, @@ -182,7 +182,7 @@ func LogEvents(b testing.TB, events []types.Event) { func GetFirstAttributeOfLastEventValue(events []types.Event) (int, error) { evt := events[len(events)-1] attr := evt.Attributes[0] - value, err := strconv.Atoi(string(attr.Value)) + value, err := strconv.Atoi(attr.Value) return value, err } @@ -195,7 +195,7 @@ func InitOwasmTestEnv( stringLength int, ) (*owasm.Vm, []byte, oracletypes.Request) { // prepare owasm vm - owasmVM, err := owasm.NewVm(cacheSize) + owasmVM, err := owasm.NewOracleVm(cacheSize) require.NoError(b, err) // prepare owasm code diff --git a/cmd/odind/cmd/genos.go b/cmd/odind/cmd/genos.go index 6bc65fec..2cce2b1c 100644 --- a/cmd/odind/cmd/genos.go +++ b/cmd/odind/cmd/genos.go @@ -3,16 +3,16 @@ package cmd import ( "encoding/json" "fmt" - "io/ioutil" + "os" "path/filepath" + api "github.com/ODIN-PROTOCOL/wasmvm/v2" "github.com/cometbft/cometbft/libs/cli" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/odin-protocol/go-owasm/api" "github.com/spf13/cobra" "github.com/ODIN-PROTOCOL/odin-core/pkg/filecache" @@ -34,11 +34,11 @@ func AddGenesisOracleScriptCmd(defaultNodeHome string) *cobra.Command { config.SetRoot(clientCtx.HomeDir) f := filecache.New(filepath.Join(defaultNodeHome, "files")) - data, err := ioutil.ReadFile(args[5]) + data, err := os.ReadFile(args[5]) if err != nil { return err } - vm, err := api.NewVm(0) // The compilation doesn't use cache + vm, err := api.NewOracleVm(0) // The compilation doesn't use cache if err != nil { return err } diff --git a/go.mod b/go.mod index e5a75400..1c81107e 100644 --- a/go.mod +++ b/go.mod @@ -14,24 +14,28 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.0 + cosmossdk.io/tools/confix v0.1.1 cosmossdk.io/x/circuit v0.1.0 cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.1.0 cosmossdk.io/x/nft v0.1.1 cosmossdk.io/x/tx v0.13.3 cosmossdk.io/x/upgrade v0.1.1 + github.com/ODIN-PROTOCOL/wasmd v0.51.1 + github.com/ODIN-PROTOCOL/wasmvm/v2 v2.0.18 github.com/bytecodealliance/wasmtime-go/v20 v20.0.0 - github.com/cometbft/cometbft v0.38.7 + github.com/cometbft/cometbft v0.38.10 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.7 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 - github.com/cosmos/ibc-go/v8 v8.2.0 + github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20240522213455-a80c693d2262 + github.com/cosmos/ibc-go/v8 v8.3.1 github.com/cosmos/ics23/go v0.10.0 - github.com/ethereum/go-ethereum v1.13.14 + github.com/ethereum/go-ethereum v1.14.0 github.com/gin-gonic/gin v1.10.0 github.com/golang/protobuf v1.5.4 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 @@ -40,14 +44,13 @@ require ( github.com/kyokomi/emoji v2.2.4+incompatible github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a github.com/oasisprotocol/oasis-core/go v0.2202.7 - github.com/odin-protocol/go-owasm v0.3.1 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/prometheus/client_golang v1.19.1 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.19.0 - github.com/strangelove-ventures/interchaintest/v8 v8.2.0 + github.com/strangelove-ventures/interchaintest/v8 v8.4.0 github.com/stretchr/testify v1.9.0 go.uber.org/mock v0.4.0 go.uber.org/zap v1.27.0 @@ -71,6 +74,8 @@ require ( github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 // indirect + github.com/CosmWasm/wasmd v0.42.1-0.20230928145107-894076a25cb2 // indirect + github.com/CosmWasm/wasmvm v1.4.0 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect @@ -101,6 +106,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/interchain-security/v5 v5.0.0-alpha1.0.20240424193412-7cd900ad2a74 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect @@ -114,8 +120,9 @@ require ( github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.7+incompatible // indirect + github.com/docker/docker v24.0.9+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -135,8 +142,6 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.20.0 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect @@ -149,6 +154,7 @@ require ( github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect @@ -161,7 +167,7 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.3 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-metrics v0.5.3 // indirect @@ -183,7 +189,6 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect @@ -215,6 +220,7 @@ require ( github.com/multiformats/go-multicodec v0.9.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-varint v0.0.7 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect @@ -281,16 +287,13 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect - lukechampine.com/uint128 v1.2.0 // indirect - modernc.org/cc/v3 v3.40.0 // indirect - modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.29.0 // indirect + modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect + modernc.org/libc v1.49.3 // indirect modernc.org/mathutil v1.6.0 // indirect - modernc.org/memory v1.7.2 // indirect - modernc.org/opt v0.1.3 // indirect - modernc.org/sqlite v1.28.0 // indirect - modernc.org/strutil v1.1.3 // indirect - modernc.org/token v1.0.1 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/sqlite v1.29.9 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect nhooyr.io/websocket v1.8.7 // indirect pgregory.net/rapid v1.1.0 // indirect ) @@ -298,7 +301,7 @@ require ( replace ( github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0 - github.com/cometbft/cometbft => github.com/ODIN-PROTOCOL/cometbft v0.38.8 + github.com/cosmos/ibc-go/modules/light-clients/08-wasm => github.com/ODIN-PROTOCOL/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20240722162036-ab84c6f0f48b github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 diff --git a/go.sum b/go.sum index 8f173ace..bbbce952 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/tools/confix v0.1.0 h1:2OOZTtQsDT5e7P3FM5xqM0bPfluAxZlAwxqaDmYBE+E= -cosmossdk.io/tools/confix v0.1.0/go.mod h1:TdXKVYs4gEayav5wM+JHT+kTU2J7fozFNqoVaN+8CdY= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= @@ -235,6 +235,10 @@ github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRr github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 h1:oknQF/iIhf5lVjbwjsVDzDByupRhga8nhA3NAmwyHDA= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420/go.mod h1:KYkiMX5AbOlXXYfxkrYPrRPV6EbVUALTQh5ptUOJzu8= +github.com/CosmWasm/wasmd v0.42.1-0.20230928145107-894076a25cb2 h1:j8J9LnhC6IikohLEYMAFX0xPQmgPez9vsj0rNQISkiE= +github.com/CosmWasm/wasmd v0.42.1-0.20230928145107-894076a25cb2/go.mod h1:3sCglc35LoFUGmh4a/auoJALitaE4qw+jAqK53ak7+s= +github.com/CosmWasm/wasmvm v1.4.0 h1:84I3MlvvzcOo2z+ed0ztPi7eeDNk6/sYuK76uyXP1nI= +github.com/CosmWasm/wasmvm v1.4.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -248,8 +252,12 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/ODIN-PROTOCOL/cometbft v0.38.8 h1:SIbXWDE5fAbj5bh/Yg4X9WdxkhaEZqP3oz4OAHmYT20= -github.com/ODIN-PROTOCOL/cometbft v0.38.8/go.mod h1:xOoGZrtUT+A5izWfHSJgl0gYZUE7lu7Z2XIS1vWG/QQ= +github.com/ODIN-PROTOCOL/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20240722162036-ab84c6f0f48b h1:WYKMeZf8lRMnHuKxnxq71XIlX0oPtfCwbBBrfzDCLXs= +github.com/ODIN-PROTOCOL/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20240722162036-ab84c6f0f48b/go.mod h1:pz9iDcct3yc0VQN/10fhTezHMK+o6egGsmKSVXFkPIE= +github.com/ODIN-PROTOCOL/wasmd v0.51.1 h1:YrCKatR2QuHIJDjueLABfnU4XZ+tMmmTqiyXUqD43M0= +github.com/ODIN-PROTOCOL/wasmd v0.51.1/go.mod h1:/FFZ3fX20ATe5MPp4EkNTu9aMGQDkp7yXpmjtSmyyUw= +github.com/ODIN-PROTOCOL/wasmvm/v2 v2.0.18 h1:vdSThbSNpkXSSWyrPHO4mGpgn3KBj/E9QYVsCGAqcCw= +github.com/ODIN-PROTOCOL/wasmvm/v2 v2.0.18/go.mod h1:byVmvc+Sk1gIpmn1exL8EdAiXebWZCsLe5HtvI0PVpk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -354,8 +362,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -367,6 +375,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -393,12 +403,16 @@ github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8Jp github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0 h1:nKP2+Rzlz2iyvTosY5mvP+aEBPe06oaDl3G7xLGBpNI= +github.com/cosmos/ibc-apps/modules/async-icq/v8 v8.0.0/go.mod h1:D3Q380FpWRFtmUQWLosPxachi6w24Og2t5u/Tww5wtY= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.0 h1:7oCzyy1sZCcgpeQLnHxC56brsSz3KWwQGKXalXwXFzE= -github.com/cosmos/ibc-go/v8 v8.2.0/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ibc-go/v8 v8.3.1 h1:cUNWvTCftKQIcpbf2y/jVzo2OY3g4GVFw6tTC/pQ+tA= +github.com/cosmos/ibc-go/v8 v8.3.1/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/interchain-security/v5 v5.0.0-alpha1.0.20240424193412-7cd900ad2a74 h1:6atU/xizTL10q6EprP7oRuvfgUP2F6puvutnVoE+FRc= +github.com/cosmos/interchain-security/v5 v5.0.0-alpha1.0.20240424193412-7cd900ad2a74/go.mod h1:h/RkwOppo5AJj+1pkQyfjqU1MPdpohD/S6oEeAXpGZY= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -440,10 +454,12 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= +github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -471,8 +487,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= -github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= +github.com/ethereum/go-ethereum v1.14.0 h1:xRWC5NlB6g1x7vNy4HDBLuqVNbtLrc7v8S6+Uxim1LU= +github.com/ethereum/go-ethereum v1.14.0/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -653,8 +669,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b h1:h9U78+dx9a4BKdQkBBos92HalKpaGKHrp+3Uo6yTodo= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -716,8 +732,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= -github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -737,8 +753,8 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -804,8 +820,6 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -864,8 +878,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -930,6 +942,8 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -938,8 +952,6 @@ github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dl github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oasisprotocol/oasis-core/go v0.2202.7 h1:BAaqQMc474ctQeith+vkckPXi7Lpgag+9QI0QpUK60g= github.com/oasisprotocol/oasis-core/go v0.2202.7/go.mod h1:hKUgtuPPq371HokUQL5ashT5MZLZxK/VkWNKRLb9m+w= -github.com/odin-protocol/go-owasm v0.3.1 h1:YUSn2T5WXQPevCYRGdEL/+9IAK6bdkZsI/dJcx0Ckdg= -github.com/odin-protocol/go-owasm v0.3.1/go.mod h1:CT6sPI0cyx9BWESLV0GpHy/kHPDG/qSrlFdXJXHCJGU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -954,8 +966,8 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -973,6 +985,8 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 h1:WPEclU0y0PMwUzdDcaKZvld4aXpa3fkzjiUMQdcBEHg= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0/go.mod h1:S0r7HmKeCGsHmvIVFMjKWwswb4+30nCNWbXRMBVPkaU= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1098,8 +1112,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/strangelove-ventures/interchaintest/v8 v8.2.0 h1:EZXPvZXL1y/kvh9XI04A2stL+2UMvykhNUv28euRnL8= -github.com/strangelove-ventures/interchaintest/v8 v8.2.0/go.mod h1:pupV0YN3A56/u9kHj9U1F8MdDUEolBIn05F0W1q/0oI= +github.com/strangelove-ventures/interchaintest/v8 v8.4.0 h1:UHLmJfmkFXuJHfSE8qmOuEy4FWZWuRw4G6XZHm9hC6w= +github.com/strangelove-ventures/interchaintest/v8 v8.4.0/go.mod h1:nfPgRi1yjnzi+qF+0Fs9qN9kkS1Fk0oqgpKvqg5a200= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1852,34 +1866,32 @@ launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbc launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= -lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= -modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= -modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= -modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= -modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.29.0 h1:tTFRFq69YKCF2QyGNuRUQxKBm1uZZLubf6Cjh/pVHXs= -modernc.org/libc v1.29.0/go.mod h1:DaG/4Q3LRRdqpiLyP0C2m1B8ZMGkQ+cCgOIjEtQlYhQ= +modernc.org/cc/v4 v4.20.0 h1:45Or8mQfbUqJOG9WaxvlFYOAQO0lQ5RvqBcFCXngjxk= +modernc.org/cc/v4 v4.20.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.16.0 h1:ofwORa6vx2FMm0916/CkZjpFPSR70VwTjUCe2Eg5BnA= +modernc.org/ccgo/v4 v4.16.0/go.mod h1:dkNyWIjFrVIZ68DTo36vHK+6/ShBn4ysU61So6PIqCI= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.49.3 h1:j2MRCRdwJI2ls/sGbeSk0t2bypOG/uvPZUsGQFDulqg= +modernc.org/libc v1.49.3/go.mod h1:yMZuGkn7pXbKfoT/M35gFJOAEdSKdxL0q64sF7KqCDo= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= -modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ= -modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= -modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= -modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= -modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= -modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow= +modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= diff --git a/interchaintests/cosmos/chain_update_cosmos_v50_test.go b/interchaintests/cosmos/chain_update_cosmos_v50_test.go index ee0d5b32..2b271336 100644 --- a/interchaintests/cosmos/chain_update_cosmos_v50_test.go +++ b/interchaintests/cosmos/chain_update_cosmos_v50_test.go @@ -36,6 +36,8 @@ func TestOdinFlushIBC(t *testing.T) { } func CosmosChainFlushIBCTest(t *testing.T, chainName, initialVersion, upgradeContainerRepo, upgradeVersion, upgradeName string) { + t.Skip("old test") + if testing.Short() { t.Skip("skipping in short mode") } @@ -165,7 +167,7 @@ func CosmosChainFlushIBCTest(t *testing.T, chainName, initialVersion, upgradeCon propId, err := strconv.ParseUint(upgradeTx.ProposalID, 10, 64) require.NoError(t, err, "failed to convert proposal ID to uint64") - err = chain.VoteOnProposalAllValidators(ctx, upgradeTx.ProposalID, cosmos.ProposalVoteYes) + err = chain.VoteOnProposalAllValidators(ctx, propId, cosmos.ProposalVoteYes) require.NoError(t, err, "failed to submit vote") _, err = cosmos.PollForProposalStatus(ctx, chain, height, height+int64(haltHeightDelta)+1, propId, govv1beta1.StatusPassed) diff --git a/interchaintests/cosmos/chain_update_cosmos_wasmm_test.go b/interchaintests/cosmos/chain_update_cosmos_wasmm_test.go new file mode 100644 index 00000000..b4e0d12b --- /dev/null +++ b/interchaintests/cosmos/chain_update_cosmos_wasmm_test.go @@ -0,0 +1,355 @@ +package cosmos + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/strangelove-ventures/interchaintest/v8" + "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos/wasm" + "github.com/strangelove-ventures/interchaintest/v8/ibc" + "github.com/strangelove-ventures/interchaintest/v8/testreporter" + "github.com/strangelove-ventures/interchaintest/v8/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +//const ( +// haltHeightDelta = uint64(10) // will propose upgrade this many blocks in the future +// blocksAfterUpgrade = uint64(10) +// votingPeriod = "10s" +// maxDepositPeriod = "10s" +// odinChainID = "odin-mainnet-freya" +//) + +func TestOdinWasmIBC(t *testing.T) { + CosmosChainWasmIBCTest(t, "odin", "v0.8.4", "odinprotocol/core", "v0.9.3", "v0.9.0") +} + +func CosmosChainWasmIBCTest(t *testing.T, chainName, initialVersion, upgradeContainerRepo, upgradeVersion, upgradeName string) { + if testing.Short() { + t.Skip("skipping in short mode") + } + + t.Parallel() + + shortVoteGenesis := []cosmos.GenesisKV{ + cosmos.NewGenesisKV("app_state.gov.params.voting_period", votingPeriod), + cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", maxDepositPeriod), + cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.denom", "loki"), + cosmos.NewGenesisKV("app_state.gov.params.quorum", "0.001"), + cosmos.NewGenesisKV("app_state.gov.params.threshold", "0.001"), + cosmos.NewGenesisKV("app_state.mint.params.mint_air", true), + } + + one := int(1) + + chains := interchaintest.CreateChainsWithChainSpecs(t, []*interchaintest.ChainSpec{ + { + Name: chainName, + ChainName: chainName, + Version: initialVersion, + ChainConfig: ibc.ChainConfig{ + ModifyGenesis: cosmos.ModifyGenesis(shortVoteGenesis), + Type: "cosmos", + Name: "odin", + ChainID: odinChainID, + Images: []ibc.DockerImage{ + { + Repository: upgradeContainerRepo, // FOR LOCAL IMAGE USE: Docker Image Name + Version: initialVersion, // FOR LOCAL IMAGE USE: Docker Image Tag + UidGid: "1025:1025", + }, + }, + Bin: "odind", + Bech32Prefix: "odin", + Denom: "loki", + GasPrices: "0.00loki", + GasAdjustment: 1.3, + TrustingPeriod: "508h", + NoHostMount: false, + EncodingConfig: wasm.WasmEncoding(), + }, + NumValidators: &one, + NumFullNodes: &one, + }, + { + Name: "juno", + ChainName: "juno", + Version: "latest", + NumValidators: &one, + NumFullNodes: &one, + ChainConfig: ibc.ChainConfig{ + EncodingConfig: wasm.WasmEncoding(), + GasPrices: "0.00ujuno", + }, + }, + }) + + chain, counterpartyChain := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) + + // Relayer Factory + client, network := interchaintest.DockerSetup(t) + r := interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t)).Build( + t, client, network) + + // Prep Interchain + const ibcPath = "wasmpath" + ic := interchaintest.NewInterchain(). + AddChain(chain). + AddChain(counterpartyChain). + AddRelayer(r, "relayer"). + AddLink(interchaintest.InterchainLink{ + Chain1: chain, + Chain2: counterpartyChain, + Relayer: r, + Path: ibcPath, + }) + + ctx := context.Background() + + rep := testreporter.NewNopReporter() + + require.NoError(t, ic.Build(ctx, rep.RelayerExecReporter(t), interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: client, + NetworkID: network, + // BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + SkipPathCreation: true, + })) + t.Cleanup(func() { + _ = ic.Close() + }) + + height, err := chain.Height(ctx) + require.NoError(t, err, "error fetching height before submit upgrade proposal") + + t.Log("Sending upgrade proposal") + + haltHeight := height + int64(haltHeightDelta) + + govAddr, err := chain.AuthQueryModuleAddress(ctx, "gov") + require.NoError(t, err) + + prop, err := chain.BuildProposal([]cosmos.ProtoMessage{&upgradetypes.MsgSoftwareUpgrade{ + Authority: govAddr, + Plan: upgradetypes.Plan{ + Name: "v0.9.0", + Height: haltHeight, + Info: "", + }, + }}, "Chain upgrade", "sum", "", "1000000000"+chain.Config().Denom, "", false) + require.NoError(t, err) + + upgradeTx, err := chain.SubmitProposal(ctx, interchaintest.FaucetAccountKeyName, prop) + require.NoError(t, err) + + propId, err := strconv.ParseUint(upgradeTx.ProposalID, 10, 64) + require.NoError(t, err, "failed to convert proposal ID to uint64") + + err = chain.VoteOnProposalAllValidators(ctx, propId, cosmos.ProposalVoteYes) + require.NoError(t, err, "failed to submit vote") + + _, err = cosmos.PollForProposalStatus(ctx, chain, height, height+int64(haltHeightDelta)+1, propId, govv1beta1.StatusPassed) + require.NoError(t, err, "proposal status did not change to passed in expected number of blocks") + + height, err = chain.Height(ctx) + require.NoError(t, err, "error fetching height before upgrade") + + timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45) + defer timeoutCtxCancel() + + // this should timeout due to chain halt at upgrade height. + _ = testutil.WaitForBlocks(timeoutCtx, int(haltHeight-height)+1, chain) + + // bring down nodes to prepare for upgrade + err = chain.StopAllNodes(ctx) + require.NoError(t, err, "error stopping node(s)") + + t.Log("Upgrading chain") + + // upgrade version on all nodes + chain.UpgradeVersion(ctx, client, upgradeContainerRepo, upgradeVersion) + + // start all nodes back up. + // validators reach consensus on first block after upgrade height + // and chain block production resumes. + err = chain.StartAllNodes(ctx) + require.NoError(t, err, "error starting upgraded node(s)") + t.Log("Successful start") + timeoutCtx, timeoutCtxCancel = context.WithTimeout(ctx, time.Second*45) + defer timeoutCtxCancel() + + err = testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), chain) + require.NoError(t, err, "chain did not produce blocks after upgrade") + + t.Log("Upgrade successful") + + err = r.GeneratePath(ctx, rep.RelayerExecReporter(t), chain.Config().ChainID, counterpartyChain.Config().ChainID, ibcPath) + require.NoError(t, err, "error generating path") + + err = r.LinkPath(ctx, rep.RelayerExecReporter(t), ibcPath, ibc.DefaultChannelOpts(), ibc.DefaultClientOpts()) + require.NoError(t, err, "error linking path") + + // Create and Fund User Wallets + initBal := math.NewInt(100_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", initBal, chain, counterpartyChain) + odinUser := users[0] + junoUser := users[1] + + err = testutil.WaitForBlocks(ctx, 2, chain, counterpartyChain) + require.NoError(t, err) + + odinUserBalInitial, err := chain.GetBalance(ctx, odinUser.FormattedAddress(), chain.Config().Denom) + require.NoError(t, err) + require.True(t, odinUserBalInitial.Equal(initBal)) + + junoUserBalInitial, err := counterpartyChain.GetBalance(ctx, junoUser.FormattedAddress(), counterpartyChain.Config().Denom) + require.NoError(t, err) + require.True(t, junoUserBalInitial.Equal(initBal)) + + err = r.StartRelayer(ctx, rep.RelayerExecReporter(t), ibcPath) + require.NoError(t, err, "error starting relayer") + + t.Cleanup( + func() { + err := r.StopRelayer(ctx, rep.RelayerExecReporter(t)) + if err != nil { + t.Logf("an error occurred while stopping the relayer: %s", err) + } + }, + ) + + // Store ibc_reflect_send.wasm contract on juno1 + juno1ContractCodeId, err := chain.StoreContract( + ctx, odinUser.KeyName(), "sample_contracts/cw_ibc_example.wasm") + require.NoError(t, err) + + // Instantiate the contract on juno1 + juno1ContractAddr, err := chain.InstantiateContract( + ctx, odinUser.KeyName(), juno1ContractCodeId, "{}", true) + require.NoError(t, err) + + // Store ibc_reflect_send.wasm on juno2 + juno2ContractCodeId, err := counterpartyChain.StoreContract( + ctx, junoUser.KeyName(), "sample_contracts/cw_ibc_example.wasm") + require.NoError(t, err) + + // Instantiate contract on juno2 + juno2ContractAddr, err := counterpartyChain.InstantiateContract( + ctx, junoUser.KeyName(), juno2ContractCodeId, "{}", true) + require.NoError(t, err) + + err = testutil.WaitForBlocks(ctx, 1, chain, counterpartyChain) + require.NoError(t, err) + + // Query the reflect sender contract on Juno1 for it's port id + chainContractInfo, err := chain.QueryContractInfo(ctx, juno1ContractAddr) + require.NoError(t, err) + chainContractPortId := chainContractInfo.ContractInfo.IbcPortID + + // Query the reflect contract on Juno2 for it's port id + counterpartyContractInfo, err := counterpartyChain.QueryContractInfo(ctx, juno2ContractAddr) + require.NoError(t, err) + counterpartyContractPortId := counterpartyContractInfo.ContractInfo.IbcPortID + + // Create channel between Juno1 and Juno2 + err = r.CreateChannel(ctx, rep.RelayerExecReporter(t), ibcPath, ibc.CreateChannelOptions{ + SourcePortName: chainContractPortId, + DestPortName: counterpartyContractPortId, + Order: ibc.Unordered, + Version: "counter-1", + }) + require.NoError(t, err) + + // Wait for the channel to get set up and whoami message to exchange + err = testutil.WaitForBlocks(ctx, 10, chain, counterpartyChain) + require.NoError(t, err) + + // Get contract channel + chainChannelInfo, err := r.GetChannels(ctx, rep.RelayerExecReporter(t), chain.Config().ChainID) + require.NoError(t, err) + chainChannelID := chainChannelInfo[len(chainChannelInfo)-1].ChannelID + + // Get contract channel + counterpartyChannelInfo, err := r.GetChannels(ctx, rep.RelayerExecReporter(t), counterpartyChain.Config().ChainID) + require.NoError(t, err) + counterpartyChannelID := counterpartyChannelInfo[len(counterpartyChannelInfo)-1].ChannelID + + // Prepare the query and execute messages to interact with the contracts + queryChainCountMsg := fmt.Sprintf(`{"get_count":{"channel":"%s"}}`, chainChannelID) + queryCounterpartyCountMsg := fmt.Sprintf(`{"get_count":{"channel":"%s"}}`, counterpartyChannelID) + chainIncrementMsg := fmt.Sprintf(`{"increment": {"channel":"%s"}}`, chainChannelID) + counterpartyIncrementMsg := fmt.Sprintf(`{"increment": {"channel":"%s"}}`, counterpartyChannelID) + + _, err = chain.Height(ctx) + require.NoError(t, err) + + // Query the count of the contract on juno1- should be 0 as no packets have been sent through + var chainInitialCountResponse CwIbcCountResponse + err = chain.QueryContract(ctx, juno1ContractAddr, queryChainCountMsg, &chainInitialCountResponse) + require.NoError(t, err) + require.Equal(t, 0, chainInitialCountResponse.Data.Count) + + // Query the count of the contract on juno1- should be 0 as no packets have been sent through + var counterpartyInitialCountResponse CwIbcCountResponse + err = counterpartyChain.QueryContract(ctx, juno2ContractAddr, queryCounterpartyCountMsg, &counterpartyInitialCountResponse) + require.NoError(t, err) + require.Equal(t, 0, counterpartyInitialCountResponse.Data.Count) + + // Send packet from juno1 to juno2 and increment the juno2 contract count + juno1Increment, err := chain.ExecuteContract(ctx, odinUser.KeyName(), juno1ContractAddr, chainIncrementMsg) + require.NoError(t, err) + // Check if the transaction was successful + require.Equal(t, uint32(0), juno1Increment.Code) + + // Wait for the ibc packet to be delivered + err = testutil.WaitForBlocks(ctx, 2, chain, counterpartyChain) + require.NoError(t, err) + + // Query the count of the contract on juno2- should be 1 as a single packet has been sent through + var juno2IncrementedCountResponse CwIbcCountResponse + err = counterpartyChain.QueryContract(ctx, juno2ContractAddr, queryCounterpartyCountMsg, &juno2IncrementedCountResponse) + require.NoError(t, err) + require.Equal(t, 1, juno2IncrementedCountResponse.Data.Count) + + // Query the count of the contract on juno1- should still be 0 as no packets have been sent through + var juno1PreIncrementedCountResponse CwIbcCountResponse + err = chain.QueryContract(ctx, juno1ContractAddr, queryChainCountMsg, &juno1PreIncrementedCountResponse) + require.NoError(t, err) + require.Equal(t, 0, juno1PreIncrementedCountResponse.Data.Count) + + // send packet from juno2 to juno1 and increment the juno1 contract count + juno2Increment, err := counterpartyChain.ExecuteContract(ctx, junoUser.KeyName(), juno2ContractAddr, counterpartyIncrementMsg) + require.NoError(t, err) + require.Equal(t, uint32(0), juno2Increment.Code) + + // Wait for the ibc packet to be delivered + err = testutil.WaitForBlocks(ctx, 2, chain, counterpartyChain) + require.NoError(t, err) + + // Query the count of the contract on juno1- should still be 1 as a single packet has been sent through + var juno1IncrementedCountResponse CwIbcCountResponse + err = chain.QueryContract(ctx, juno1ContractAddr, queryChainCountMsg, &juno1IncrementedCountResponse) + require.NoError(t, err) + require.Equal(t, 1, juno1IncrementedCountResponse.Data.Count) + + // Query the count of the contract on juno2- should be 1 as a single packet has now been sent through from juno1 to juno2 + var juno2PreIncrementedCountResponse CwIbcCountResponse + err = counterpartyChain.QueryContract(ctx, juno2ContractAddr, queryCounterpartyCountMsg, &juno2PreIncrementedCountResponse) + require.NoError(t, err) + require.Equal(t, 1, juno2PreIncrementedCountResponse.Data.Count) +} + +// cw_ibc_example response data +type CwIbcCountResponse struct { + Data struct { + Count int `json:"count"` + } `json:"data"` +} diff --git a/interchaintests/cosmos/sample_contracts/cw_ibc_example.wasm b/interchaintests/cosmos/sample_contracts/cw_ibc_example.wasm new file mode 100644 index 00000000..9ba03703 Binary files /dev/null and b/interchaintests/cosmos/sample_contracts/cw_ibc_example.wasm differ diff --git a/interchaintests/cosmos/sample_contracts/icq.wasm b/interchaintests/cosmos/sample_contracts/icq.wasm new file mode 100644 index 00000000..3721d42a Binary files /dev/null and b/interchaintests/cosmos/sample_contracts/icq.wasm differ diff --git a/testing/testapp/setup.go b/testing/testapp/setup.go index 21d424b1..c2f341bc 100644 --- a/testing/testapp/setup.go +++ b/testing/testapp/setup.go @@ -15,6 +15,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" + owasm "github.com/ODIN-PROTOCOL/wasmvm/v2" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/crypto" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -37,7 +38,6 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" - owasm "github.com/odin-protocol/go-owasm/api" "github.com/stretchr/testify/require" odinapp "github.com/ODIN-PROTOCOL/odin-core/app" @@ -168,7 +168,7 @@ func init() { return Validators[i].PubKey.Address().String() < Validators[j].PubKey.Address().String() }) - owasmVM, err := owasm.NewVm(10) + owasmVM, err := owasm.NewOracleVm(10) if err != nil { panic(err) } diff --git a/x/oracle/handler_test.go b/x/oracle/handler_test.go index 8828e5da..b903b77f 100644 --- a/x/oracle/handler_test.go +++ b/x/oracle/handler_test.go @@ -15,12 +15,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/bank/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/odin-protocol/go-owasm/api" "github.com/stretchr/testify/require" "github.com/ODIN-PROTOCOL/odin-core/testing/testapp" "github.com/ODIN-PROTOCOL/odin-core/x/oracle" "github.com/ODIN-PROTOCOL/odin-core/x/oracle/types" + wasmtypes "github.com/ODIN-PROTOCOL/wasmvm/v2/types" ) func TestCreateDataSourceSuccess(t *testing.T) { @@ -274,7 +274,7 @@ func TestCreateOracleScriptFail(t *testing.T) { testapp.Alice.Address, ) res, err := oracle.NewHandler(k)(ctx, msg) - testapp.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", api.ErrValidation) + testapp.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", wasmtypes.ErrValidation) require.Nil(t, res) // Bad Gzip var buf bytes.Buffer @@ -383,7 +383,7 @@ func TestEditOracleScriptFail(t *testing.T) { testapp.Owner.Address, ) res, err = oracle.NewHandler(k)(ctx, msg) - testapp.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", api.ErrValidation) + testapp.CheckErrorf(t, err, types.ErrOwasmCompilation, "caused by %s", wasmtypes.ErrValidation) require.Nil(t, res) // Bad Gzip var buf bytes.Buffer diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 6baa8cff..78c42992 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -8,13 +8,13 @@ import ( "cosmossdk.io/collections" corestoretypes "cosmossdk.io/core/store" "cosmossdk.io/log" + owasm "github.com/ODIN-PROTOCOL/wasmvm/v2" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" - owasm "github.com/odin-protocol/go-owasm/api" "github.com/ODIN-PROTOCOL/odin-core/pkg/filecache" "github.com/ODIN-PROTOCOL/odin-core/x/oracle/types" diff --git a/x/oracle/types/exec_env.go b/x/oracle/types/exec_env.go index 99495be5..ee2827d2 100644 --- a/x/oracle/types/exec_env.go +++ b/x/oracle/types/exec_env.go @@ -3,12 +3,12 @@ package types import ( "time" - "github.com/odin-protocol/go-owasm/api" + "github.com/ODIN-PROTOCOL/wasmvm/v2/types" ) var ( - _ api.EnvInterface = (*PrepareEnv)(nil) - _ api.EnvInterface = (*ExecuteEnv)(nil) + _ types.EnvInterface = (*PrepareEnv)(nil) + _ types.EnvInterface = (*ExecuteEnv)(nil) ) // BaseEnv combines shared functions used in prepare and execution Owasm program, @@ -29,7 +29,7 @@ func (env *BaseEnv) GetCalldata() []byte { // SetReturnData implements Owasm ExecEnv interface. func (env *BaseEnv) SetReturnData(data []byte) error { - return api.ErrWrongPeriodAction + return types.ErrWrongPeriodAction } // GetAskCount implements Owasm ExecEnv interface. @@ -49,27 +49,27 @@ func (env *BaseEnv) GetPrepareTime() int64 { // GetExecuteTime implements Owasm ExecEnv interface. func (env *BaseEnv) GetExecuteTime() (int64, error) { - return 0, api.ErrWrongPeriodAction + return 0, types.ErrWrongPeriodAction } // GetAnsCount implements Owasm ExecEnv interface. func (env *BaseEnv) GetAnsCount() (int64, error) { - return 0, api.ErrWrongPeriodAction + return 0, types.ErrWrongPeriodAction } // AskExternalData implements Owasm ExecEnv interface. func (env *BaseEnv) AskExternalData(eid int64, did int64, data []byte) error { - return api.ErrWrongPeriodAction + return types.ErrWrongPeriodAction } // GetExternalDataStatus implements Owasm ExecEnv interface. func (env *BaseEnv) GetExternalDataStatus(eid int64, vid int64) (int64, error) { - return 0, api.ErrWrongPeriodAction + return 0, types.ErrWrongPeriodAction } // GetExternalData implements Owasm ExecEnv interface. func (env *BaseEnv) GetExternalData(eid int64, vid int64) ([]byte, error) { - return nil, api.ErrWrongPeriodAction + return nil, types.ErrWrongPeriodAction } // PrepareEnv implements ExecEnv interface only expected function and panic on non-prepare functions. @@ -95,14 +95,14 @@ func NewPrepareEnv(req Request, maxCalldataSize int64, maxRawRequests int64, spa // AskExternalData implements Owasm ExecEnv interface. func (env *PrepareEnv) AskExternalData(eid int64, did int64, data []byte) error { if int64(len(data)) > env.maxCalldataSize { - return api.ErrSpanTooSmall + return types.ErrSpanTooSmall } if int64(len(env.rawRequests)) >= env.maxRawRequests { - return api.ErrTooManyExternalData + return types.ErrTooManyExternalData } for _, raw := range env.rawRequests { if raw.ExternalID == ExternalID(eid) { - return api.ErrDuplicateExternalID + return types.ErrDuplicateExternalID } } env.rawRequests = append(env.rawRequests, NewRawRequest( @@ -157,7 +157,7 @@ func (env *ExecuteEnv) GetAnsCount() (int64, error) { // SetReturnData implements Owasm ExecEnv interface. func (env *ExecuteEnv) SetReturnData(data []byte) error { if env.Retdata != nil { - return api.ErrRepeatSetReturnData + return types.ErrRepeatSetReturnData } env.Retdata = data return nil @@ -165,7 +165,7 @@ func (env *ExecuteEnv) SetReturnData(data []byte) error { func (env *ExecuteEnv) getExternalDataFull(eid int64, valIdx int64) ([]byte, int64, error) { if valIdx < 0 || valIdx >= int64(len(env.request.RequestedValidators)) { - return nil, 0, api.ErrBadValidatorIndex + return nil, 0, types.ErrBadValidatorIndex } valAddr := env.request.RequestedValidators[valIdx] valReports, ok := env.reports[valAddr] @@ -174,7 +174,7 @@ func (env *ExecuteEnv) getExternalDataFull(eid int64, valIdx int64) ([]byte, int } valReport, ok := valReports[ExternalID(eid)] if !ok { - return nil, 0, api.ErrBadExternalID + return nil, 0, types.ErrBadExternalID } return valReport.Data, int64(valReport.ExitCode), nil } diff --git a/x/oracle/types/exec_env_test.go b/x/oracle/types/exec_env_test.go index e19ad90b..b90142c8 100644 --- a/x/oracle/types/exec_env_test.go +++ b/x/oracle/types/exec_env_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" + "github.com/ODIN-PROTOCOL/wasmvm/v2/types" "github.com/cometbft/cometbft/crypto/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - - "github.com/odin-protocol/go-owasm/api" ) var ( @@ -109,7 +108,7 @@ func TestSetReturnData(t *testing.T) { penv := mockFreshPrepareEnv() err := penv.SetReturnData(result) - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) eenv := mockExecEnv() err = eenv.SetReturnData(result) @@ -147,7 +146,7 @@ func TestGetExecuteTime(t *testing.T) { // Should return error if call on prepare environment. penv := mockFreshPrepareEnv() _, err := penv.GetExecuteTime() - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) eenv := mockExecEnv() v, err := eenv.GetExecuteTime() @@ -159,7 +158,7 @@ func TestGetAnsCount(t *testing.T) { // Should return error if call on prepare environment. penv := mockFreshPrepareEnv() _, err := penv.GetAnsCount() - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) eenv := mockExecEnv() v, err := eenv.GetAnsCount() @@ -185,19 +184,19 @@ func TestGetExternalData(t *testing.T) { require.Equal(t, int64(-1), status) _, err = env.GetExternalData(1, 100) - require.Equal(t, api.ErrBadValidatorIndex, err) + require.Equal(t, types.ErrBadValidatorIndex, err) _, err = env.GetExternalDataStatus(1, 100) - require.Equal(t, api.ErrBadValidatorIndex, err) + require.Equal(t, types.ErrBadValidatorIndex, err) _, err = env.GetExternalData(1, -1) - require.ErrorIs(t, err, api.ErrBadValidatorIndex) + require.ErrorIs(t, err, types.ErrBadValidatorIndex) _, err = env.GetExternalDataStatus(1, -1) - require.ErrorIs(t, err, api.ErrBadValidatorIndex) + require.ErrorIs(t, err, types.ErrBadValidatorIndex) _, err = env.GetExternalData(100, 0) - require.ErrorIs(t, err, api.ErrBadExternalID) + require.ErrorIs(t, err, types.ErrBadExternalID) _, err = env.GetExternalDataStatus(100, 0) - require.ErrorIs(t, err, api.ErrBadExternalID) + require.ErrorIs(t, err, types.ErrBadExternalID) } func TestFailedGetExternalData(t *testing.T) { @@ -205,9 +204,9 @@ func TestFailedGetExternalData(t *testing.T) { require.NoError(t, err) _, err = penv.GetExternalData(1, 1) - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) _, err = penv.GetExternalDataStatus(1, 1) - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) } func TestAskExternalData(t *testing.T) { @@ -232,7 +231,7 @@ func TestAskExternalDataOnTooSmallSpan(t *testing.T) { penv := mockFreshPrepareEnv() err := penv.AskExternalData(1, 3, make([]byte, DefaultMaxCalldataSize+1)) - require.Equal(t, api.ErrSpanTooSmall, err) + require.Equal(t, types.ErrSpanTooSmall, err) require.Equal(t, []RawRequest(nil), penv.GetRawRequests()) } func TestAskTooManyExternalData(t *testing.T) { @@ -253,7 +252,7 @@ func TestAskTooManyExternalData(t *testing.T) { require.Equal(t, expectRawReq, penv.GetRawRequests()) err = penv.AskExternalData(4, 4, []byte("CALLDATA4")) - require.Equal(t, api.ErrTooManyExternalData, err) + require.Equal(t, types.ErrTooManyExternalData, err) require.Equal(t, expectRawReq, penv.GetRawRequests()) } @@ -266,14 +265,14 @@ func TestAskDuplicateExternalID(t *testing.T) { require.NoError(t, err) err = penv.AskExternalData(1, 3, []byte("CALLDATA3")) - require.Equal(t, api.ErrDuplicateExternalID, err) + require.Equal(t, types.ErrDuplicateExternalID, err) } func TestAskExternalDataOnExecEnv(t *testing.T) { env := mockExecEnv() calldata := []byte("CALLDATA") err := env.AskExternalData(2, 2, calldata) - require.Equal(t, api.ErrWrongPeriodAction, err) + require.Equal(t, types.ErrWrongPeriodAction, err) } func TestGetRawRequests(t *testing.T) {