diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cf6c0168249..2866e868105 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -43,7 +43,7 @@ write a little note why. - [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/main/docs/dev/pull-requests.md#pull-request-targeting)). - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. -- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/build/building-modules/11-structure.md) and [Go style guide](../docs/dev/go-style-guide.md). +- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/11-structure.md) and [Go style guide](../docs/dev/go-style-guide.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/main/testing/README.md#ibc-testing-package). - [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`). - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). diff --git a/.github/mergify.yml b/.github/mergify.yml index 8a09ba4e469..ca0958ffa50 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -34,6 +34,14 @@ pull_request_rules: backport: branches: - callbacks/release/v0.1.x+ibc-go-v7.3.x + - name: backport patches to v0.2.x callbacks ibc-go v7.3.x branch + conditions: + - base=main + - label=backport-callbacks-to-v0.2.x+ibc-go-v7.3.x + actions: + backport: + branches: + - callbacks/release/v0.2.x+ibc-go-v7.3.x - name: backport patches to v4.4.x branch conditions: - base=main diff --git a/.github/workflows/callbacks.yml b/.github/workflows/callbacks.yml index d001c2bfadd..9a4cee57905 100644 --- a/.github/workflows/callbacks.yml +++ b/.github/workflows/callbacks.yml @@ -2,9 +2,9 @@ name: Callbacks Module # This workflow runs when a PR is opened that targets code that is part of the callbacks module. on: pull_request: - paths: - - '.github/workflows/callbacks.yml' - - 'modules/apps/callbacks/**' + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 6c9e8e43c4e..ead32f78e36 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -12,7 +12,7 @@ on: jobs: - upgrade-v5: + upgrade-v5-hermes: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main with: chain-image: ghcr.io/cosmos/ibc-go-simd @@ -24,8 +24,9 @@ jobs: test-entry-point: "TestUpgradeTestSuite" test: "TestIBCChainUpgrade" upload-logs: true + relayer-type: hermes - upgrade-v6: + upgrade-v6-hermes: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main with: chain-image: ghcr.io/cosmos/ibc-go-icad @@ -37,8 +38,9 @@ jobs: test-entry-point: "TestUpgradeTestSuite" test: "TestV5ToV6ChainUpgrade" upload-logs: true + relayer-type: hermes - upgrade-v7: + upgrade-v7-hermes: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main with: chain-image: ghcr.io/cosmos/ibc-go-simd @@ -50,8 +52,9 @@ jobs: test-entry-point: "TestUpgradeTestSuite" test: "TestV6ToV7ChainUpgrade" upload-logs: true + relayer-type: hermes - upgrade-v7_1: + upgrade-v7_1-hermes: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main with: chain-image: ghcr.io/cosmos/ibc-go-simd @@ -63,16 +66,98 @@ jobs: test-entry-point: "TestUpgradeTestSuite" test: "TestV7ToV7_1ChainUpgrade" upload-logs: true + relayer-type: hermes - upgrade-v8: + upgrade-v8-hermes: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main with: chain-image: ghcr.io/cosmos/ibc-go-simd chain-binary: simd chain-a-tag: v7.0.0 chain-b-tag: v7.0.0 - chain-upgrade-tag: pr-4591 # TODO: update this to a real tag once v8 is released + chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released upgrade-plan-name: "v8" test-entry-point: "TestUpgradeTestSuite" test: "TestV7ToV8ChainUpgrade" upload-logs: true + relayer-type: hermes + + upgrade-v5-rly: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-simd + chain-binary: simd + chain-a-tag: v4.4.1 + chain-b-tag: v4.4.1 + chain-upgrade-tag: v5.1.0 + upgrade-plan-name: "normal upgrade" + test-entry-point: "TestUpgradeTestSuite" + test: "TestIBCChainUpgrade" + upload-logs: true + relayer-type: rly + relayer-image: ghcr.io/cosmos/relayer + relayer-tag: latest + + upgrade-v6-rly: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-icad + chain-binary: icad + chain-a-tag: v0.3.5 + chain-b-tag: v0.3.5 + chain-upgrade-tag: v0.4.1 + upgrade-plan-name: "ibc-go/v6" + test-entry-point: "TestUpgradeTestSuite" + test: "TestV5ToV6ChainUpgrade" + upload-logs: true + relayer-type: rly + relayer-image: ghcr.io/cosmos/relayer + relayer-tag: latest + + upgrade-v7-rly: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-simd + chain-binary: simd + chain-a-tag: v6.1.0 + chain-b-tag: v6.1.0 + chain-upgrade-tag: v7.0.0 + upgrade-plan-name: "v7" + test-entry-point: "TestUpgradeTestSuite" + test: "TestV6ToV7ChainUpgrade" + upload-logs: true + relayer-type: rly + relayer-image: ghcr.io/cosmos/relayer + relayer-tag: latest + + upgrade-v7_1-rly: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-simd + chain-binary: simd + chain-a-tag: v7.0.0 + chain-b-tag: v7.0.0 + chain-upgrade-tag: v7.1.0 + upgrade-plan-name: "v7.1" + test-entry-point: "TestUpgradeTestSuite" + test: "TestV7ToV7_1ChainUpgrade" + upload-logs: true + relayer-type: rly + relayer-image: ghcr.io/cosmos/relayer + relayer-tag: latest + + upgrade-v8-rly: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-simd + chain-binary: simd + chain-a-tag: v7.0.0 + chain-b-tag: v7.0.0 + chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released + upgrade-plan-name: "v8" + test-entry-point: "TestUpgradeTestSuite" + test: "TestV7ToV8ChainUpgrade" + upload-logs: true + relayer-type: rly + relayer-image: ghcr.io/cosmos/relayer + relayer-tag: latest diff --git a/docs/apps/transfer/metrics.md b/docs/apps/transfer/metrics.md index 3d2bb4bd82f..9dc866deee8 100644 --- a/docs/apps/transfer/metrics.md +++ b/docs/apps/transfer/metrics.md @@ -4,7 +4,7 @@ order: 6 # Metrics -The IBC transfer application module exposes the following set of [metrics](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/advanced/09-telemetry.md). +The IBC transfer application module exposes the following set of [metrics](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/advanced/09-telemetry.md). | Metric | Description | Unit | Type | |:--------------------------------|:------------------------------------------------------------------------------------------|:----------------|:--------| diff --git a/docs/architecture/README.md b/docs/architecture/README.md index d83b7a00857..60e09a3de34 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -34,7 +34,7 @@ To suggest an ADR, please make use of the [ADR template](./adr-template.md) prov | [005](./adr-005-consensus-height-events.md) | `UpdateClient` events - `ClientState` consensus heights | Accepted | | [006](./adr-006-02-client-refactor.md) | ICS02 client refactor | Accepted | | [007](./adr-007-solomachine-signbytes.md) | ICS06 Solo machine sign bytes | -| [008](./adr-008-app-caller-cbs/adr-008-app-caller-cbs.md) | Callback to IBC ACtors | Accepted | +| [008](./adr-008-app-caller-cbs.md) | Callback to IBC ACtors | Accepted | | [009](./adr-009-v6-ics27-msgserver.md) | ICS27 message server addition | Accepted | | [010](./adr-010-light-clients-as-sdk-modules.md) | IBC light clients as SDK modules | Accepted | | [011](./adr-011-transfer-total-escrow-state-entry.md) | ICS20 state entry for total amount of tokens in escrow | Accepted | diff --git a/docs/architecture/adr-008-app-caller-cbs.md b/docs/architecture/adr-008-app-caller-cbs.md new file mode 100644 index 00000000000..2d6db9a3cd2 --- /dev/null +++ b/docs/architecture/adr-008-app-caller-cbs.md @@ -0,0 +1,543 @@ +# ADR 008: Callback to IBC Actors + +## Changelog + +* 2022-08-10: Initial Draft +* 2023-03-22: Merged +* 2023-09-13: Updated with decisions made in implementation + +## Status + +Accepted, middleware implemented + +## Context + +IBC was designed with callbacks between core IBC and IBC applications. IBC apps would send a packet to core IBC. When the result of the packet lifecycle eventually resolved into either an acknowledgement or a timeout, core IBC called a callback on the IBC application so that the IBC application could take action on the basis of the result (e.g. unescrow tokens for ICS-20). + +This setup worked well for off-chain users interacting with IBC applications. + +We are now seeing the desire for secondary applications (e.g. smart contracts, modules) to call into IBC apps as part of their state machine logic and then do some actions on the basis of the packet result. Or to receive a packet from IBC and do some logic upon receipt. + +Example Usecases: +- Send an ICS-20 packet, and if it is successful, then send an ICA-packet to swap tokens on LP and return funds to sender +- Execute some logic upon receipt of token transfer to a smart contract address + +This requires a second layer of callbacks. The IBC application already gets the result of the packet from core IBC, but currently there is no standardized way to pass this information on to an actor module/smart contract. + +## Definitions + +- Actor: an actor is an on-chain module (this may be a hardcoded module in the chain binary or a smart contract) that wishes to execute custom logic whenever IBC receives a packet flow that it has either sent or received. It **must** be addressable by a string value. + +## Decision + +Create a middleware that can interface between IBC applications and smart contract VMs. The IBC applications and smart contract VMs will implement respective interfaces that will then be composed together by the callback middleware to allow a smart contract of any compatible VM to interact programmatically with an IBC application. + +## Data structures + +The `CallbackPacketData` struct will get constructed from custom callback data in the application packet. The `CallbackAddress` is the IBC Actor address on which the callback should be called on. The `SenderAddress` is also provided to optionally allow a VM to ensure that the sender is the same as the callback address. + +The struct also defines a `CommitGasLimit` which is the maximum gas a callback is allowed to use. If the callback exceeds this limit, the callback will panic and the tx will commit without the callback's state changes. + +The `ExecutionGasLimit` is the practical limit of the tx execution that is set in the context gas meter. It is the minimum of the `CommitGasLimit` and the gas left in the context gas meter which is determined by the relayer's choice of tx gas limit. If `ExecutionGasLimit < CommitGasLimit`, then an out-of-gas error will revert the entire transaction without committing anything, allowing for a different relayer to retry with a larger tx gas limit. + +Any middleware targeting this interface for callback handling should define a global limit that caps the gas that a callback is allowed to take (especially on AcknowledgePacket and TimeoutPacket) so that a custom callback does not prevent the packet lifecycle from completing. However, since this is a global cap it is likely to be very large. Thus, users may specify a smaller limit to cap the amount of fees a relayer must pay in order to complete the packet lifecycle on the user's behalf. + +```go +// Implemented by any packet data type that wants to support PacketActor callbacks +// PacketActor's will be unable to act on any packet data type that does not implement +// this interface. +type CallbackPacketData struct { + CallbackAddress: string + ExecutionGasLimit: uint64 + SenderAddress: string + CommitGasLimit: uint64 +} +``` + +IBC Apps or middleware can then call the IBCActor callbacks like so in their own callbacks: + +### Callback Middleware + +The CallbackMiddleware wraps an underlying IBC application along with a contractKeeper that delegates the callback to a virtual machine. This allows the Callback middleware to interface any compatible IBC application with any compatible VM (e.g. EVM, WASM) so long as the application implements the `CallbacksCompatibleModule` interface and the VM implements the `ContractKeeper` interface. + +```go +// IBCMiddleware implements the ICS26 callbacks for the ibc-callbacks middleware given +// the underlying application. +type IBCMiddleware struct { + app types.CallbacksCompatibleModule + ics4Wrapper porttypes.ICS4Wrapper + + contractKeeper types.ContractKeeper + + // maxCallbackGas defines the maximum amount of gas that a callback actor can ask the + // relayer to pay for. If a callback fails due to insufficient gas, the entire tx + // is reverted if the relayer hadn't provided the minimum(userDefinedGas, maxCallbackGas). + // If the actor hasn't defined a gas limit, then it is assumed to be the maxCallbackGas. + maxCallbackGas uint64 +} +``` + +### Callback-Compatible IBC Application + +The `CallbacksCompatibleModule` extends `porttypes.IBCModule` to include an `UnmarshalPacketData` function that allows the middleware to request that the underlying app unmarshal the packet data. This will then allow the middleware to retrieve the callback specific data from an arbitrary set of IBC application packets. + +```go +// CallbacksCompatibleModule is an interface that combines the IBCModule and PacketDataUnmarshaler +// interfaces to assert that the underlying application supports both. +type CallbacksCompatibleModule interface { + porttypes.IBCModule + porttypes.PacketDataUnmarshaler +} + +// PacketDataUnmarshaler defines an optional interface which allows a middleware to +// request the packet data to be unmarshaled by the base application. +type PacketDataUnmarshaler interface { + // UnmarshalPacketData unmarshals the packet data into a concrete type + UnmarshalPacketData([]byte) (interface{}, error) +} +``` + +The application's packet data must additionally implement the following interfaces: + +```go +// PacketData defines an optional interface which an application's packet data structure may implement. +type PacketData interface { + // GetPacketSender returns the sender address of the packet data. + // If the packet sender is unknown or undefined, an empty string should be returned. + GetPacketSender(sourcePortID string) string +} + +// PacketDataProvider defines an optional interfaces for retrieving custom packet data stored on behalf of another application. +// An existing problem in the IBC middleware design is the inability for a middleware to define its own packet data type and insert packet sender provided information. +// A short term solution was introduced into several application's packet data to utilize a memo field to carry this information on behalf of another application. +// This interfaces standardizes that behaviour. Upon realization of the ability for middleware's to define their own packet data types, this interface will be deprecated and removed with time. +type PacketDataProvider interface { + // GetCustomPacketData returns the packet data held on behalf of another application. + // The name the information is stored under should be provided as the key. + // If no custom packet data exists for the key, nil should be returned. + GetCustomPacketData(key string) interface{} +} +``` + +The callback data can be embedded in an application packet by providing custom packet data for source and destination callback in the custom packet data under the appropriate key. + +```jsonc +// Custom Packet data embedded as a JSON object in the packet data + +// src callback custom data +{ + "src_callback": { + "address": "callbackAddressString", + // optional + "gas_limit": "userDefinedGasLimitString", + } +} + +// dest callback custom data +{ + "dest_callback": { + "address": "callbackAddressString", + // optional + "gas_limit": "userDefinedGasLimitString", + } +} + +// src and dest callback custom data embedded together +{ + "src_callback": { + "address": "callbackAddressString", + // optional + "gas_limit": "userDefinedGasLimitString", + }, + "dest_callback": { + "address": "callbackAddressString", + // optional + "gas_limit": "userDefinedGasLimitString", + } +} +``` + +## ContractKeeper + +The `ContractKeeper` interface must be implemented by any VM that wants to support IBC callbacks. This allows for separation of concerns +between the middleware which is handling logic intended for all VMs (e.g. setting gas meter, extracting callback data, emitting events), +while the ContractKeeper can handle the specific details of calling into the VM in question. + +The `ContractKeeper` **may** impose additional checks such as ensuring that the contract address is the same as the packet sender in source callbacks. +It may also disable certain callback methods by simply performing a no-op. + +```go +// ContractKeeper defines the entry points exposed to the VM module which invokes a smart contract +type ContractKeeper interface { + // IBCSendPacketCallback is called in the source chain when a PacketSend is executed. The + // packetSenderAddress is determined by the underlying module, and may be empty if the sender is + // unknown or undefined. The contract is expected to handle the callback within the user defined + // gas limit, and handle any errors, or panics gracefully. + // This entry point is called with a cached context. If an error is returned, then the changes in + // this context will not be persisted, and the error will be propagated to the underlying IBC + // application, resulting in a packet send failure. + // + // Implementations are provided with the packetSenderAddress and MAY choose to use this to perform + // validation on the origin of a given packet. It is recommended to perform the same validation + // on all source chain callbacks (SendPacket, AcknowledgementPacket, TimeoutPacket). This + // defensively guards against exploits due to incorrectly wired SendPacket ordering in IBC stacks. + IBCSendPacketCallback( + cachedCtx sdk.Context, + sourcePort string, + sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + packetData []byte, + contractAddress, + packetSenderAddress string, + ) error + // IBCOnAcknowledgementPacketCallback is called in the source chain when a packet acknowledgement + // is received. The packetSenderAddress is determined by the underlying module, and may be empty if + // the sender is unknown or undefined. The contract is expected to handle the callback within the + // user defined gas limit, and handle any errors, or panics gracefully. + // This entry point is called with a cached context. If an error is returned, then the changes in + // this context will not be persisted, but the packet lifecycle will not be blocked. + // + // Implementations are provided with the packetSenderAddress and MAY choose to use this to perform + // validation on the origin of a given packet. It is recommended to perform the same validation + // on all source chain callbacks (SendPacket, AcknowledgementPacket, TimeoutPacket). This + // defensively guards against exploits due to incorrectly wired SendPacket ordering in IBC stacks. + IBCOnAcknowledgementPacketCallback( + cachedCtx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, + contractAddress, + packetSenderAddress string, + ) error + // IBCOnTimeoutPacketCallback is called in the source chain when a packet is not received before + // the timeout height. The packetSenderAddress is determined by the underlying module, and may be + // empty if the sender is unknown or undefined. The contract is expected to handle the callback + // within the user defined gas limit, and handle any error, out of gas, or panics gracefully. + // This entry point is called with a cached context. If an error is returned, then the changes in + // this context will not be persisted, but the packet lifecycle will not be blocked. + // + // Implementations are provided with the packetSenderAddress and MAY choose to use this to perform + // validation on the origin of a given packet. It is recommended to perform the same validation + // on all source chain callbacks (SendPacket, AcknowledgementPacket, TimeoutPacket). This + // defensively guards against exploits due to incorrectly wired SendPacket ordering in IBC stacks. + IBCOnTimeoutPacketCallback( + cachedCtx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, + contractAddress, + packetSenderAddress string, + ) error + // IBCReceivePacketCallback is called in the destination chain when a packet acknowledgement is written. + // The contract is expected to handle the callback within the user defined gas limit, and handle any errors, + // out of gas, or panics gracefully. + // This entry point is called with a cached context. If an error is returned, then the changes in + // this context will not be persisted, but the packet lifecycle will not be blocked. + IBCReceivePacketCallback( + cachedCtx sdk.Context, + packet ibcexported.PacketI, + ack ibcexported.Acknowledgement, + contractAddress string, + ) error +} +``` + +### PacketCallbacks + +The packet callbacks implemented in the middleware will first call the underlying application and then route to the IBC actor callback in the post-processing step. +It will extract the callback data from the application packet and set the callback gas meter depending on the global limit, the user limit, and the gas left in the transaction gas meter. +The callback will then be routed through the callback keeper which will either panic or return a result (success or failure). In the event of a (non-oog) panic or an error, the callback state changes +are discarded and the transaction is committed. + +If the relayer-defined gas limit is exceeded before the user-defined gas limit or global callback gas limit is exceeded, then the entire transaction is reverted to allow for resubmission. If the chain-defined or user-defined gas limit is reached, +the callback state changes are reverted and the transaction is committed. + +For the `SendPacket` callback, we will revert the entire transaction on any kind of error or panic. This is because the packet lifecycle has not yet started, so we can revert completely to avoid starting the packet lifecycle if the callback is not successful. + +```go +// SendPacket implements source callbacks for sending packets. +// It defers to the underlying application and then calls the contract callback. +// If the contract callback returns an error, panics, or runs out of gas, then +// the packet send is rejected. +func (im IBCMiddleware) SendPacket( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + sourcePort string, + sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (uint64, error) { + // run underlying app logic first + // IBCActor logic will postprocess + seq, err := im.ics4Wrapper.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) + if err != nil { + return 0, err + } + + // use underlying app to get source callback information from packet data + callbackData, err := types.GetSourceCallbackData(im.app, data, sourcePort, ctx.GasMeter().GasRemaining(), im.maxCallbackGas) + // SendPacket is not blocked if the packet does not opt-in to callbacks + if err != nil { + return seq, nil + } + + callbackExecutor := func(cachedCtx sdk.Context) error { + return im.contractKeeper.IBCSendPacketCallback( + cachedCtx, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data, callbackData.CallbackAddress, callbackData.SenderAddress, + ) + } + + err = im.processCallback(ctx, types.CallbackTypeSendPacket, callbackData, callbackExecutor) + // contract keeper is allowed to reject the packet send. + if err != nil { + return 0, err + } + + types.EmitCallbackEvent(ctx, sourcePort, sourceChannel, seq, types.CallbackTypeSendPacket, callbackData, nil) + return seq, nil +} + +// WriteAcknowledgement implements the ReceivePacket destination callbacks for the ibc-callbacks middleware +// during asynchronous packet acknowledgement. +// It defers to the underlying application and then calls the contract callback. +// If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are +// reverted via a panic. +func (im IBCMiddleware) WriteAcknowledgement( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + packet ibcexported.PacketI, + ack ibcexported.Acknowledgement, +) error { + // run underlying app logic first + // IBCActor logic will postprocess + err := im.ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, ack) + if err != nil { + return err + } + + // use underlying app to get destination callback information from packet data + callbackData, err := types.GetDestCallbackData( + im.app, packet.GetData(), packet.GetSourcePort(), ctx.GasMeter().GasRemaining(), im.maxCallbackGas, + ) + // WriteAcknowledgement is not blocked if the packet does not opt-in to callbacks + if err != nil { + return nil + } + + callbackExecutor := func(cachedCtx sdk.Context) error { + return im.contractKeeper.IBCReceivePacketCallback(cachedCtx, packet, ack, callbackData.CallbackAddress) + } + + // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions + err = im.processCallback(ctx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) + // emit events + types.EmitCallbackEvent( + ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), + types.CallbackTypeAcknowledgementPacket, callbackData, err, + ) + + return nil +} + +// Call the IBCActor recvPacket callback after processing the packet +// if the recvPacket callback exists. If the callback returns an error +// then return an error ack to revert all packet data processing. +func (im IBCMiddleware) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) (ack exported.Acknowledgement) { + // run underlying app logic first + // IBCActor logic will postprocess + ack := im.app.OnRecvPacket(ctx, packet, relayer) + // if ack is nil (asynchronous acknowledgements), then the callback will be handled in WriteAcknowledgement + // if ack is not successful, all state changes are reverted. If a packet cannot be received, then there is + // no need to execute a callback on the receiving chain. + if ack == nil || !ack.Success() { + return ack + } + + // use underlying app to get destination callback information from packet data + callbackData, err := types.GetDestCallbackData( + im.app, packet.GetData(), packet.GetSourcePort(), ctx.GasMeter().GasRemaining(), im.maxCallbackGas, + ) + // OnRecvPacket is not blocked if the packet does not opt-in to callbacks + if err != nil { + return ack + } + + callbackExecutor := func(cachedCtx sdk.Context) error { + return im.contractKeeper.IBCReceivePacketCallback(cachedCtx, packet, ack, callbackData.CallbackAddress) + } + + // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions + err = im.processCallback(ctx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) + types.EmitCallbackEvent( + ctx, packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), + types.CallbackTypeReceivePacket, callbackData, err, + ) + + return ack +} + +// Call the IBCActor acknowledgementPacket callback after processing the packet +// if the ackPacket callback exists and returns an error +// DO NOT return the error upstream. The acknowledgement must complete for the packet +// lifecycle to end, so the custom callback cannot block completion. +// Instead we emit error events and set the error in state +// so that users and on-chain logic can handle this appropriately +func (im IBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + // we first call the underlying app to handle the acknowledgement + // IBCActor logic will postprocess + err := im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) + if err != nil { + return err + } + + // use underlying app to get source callback information from packet data + callbackData, err := types.GetSourceCallbackData( + im.app, packet.GetData(), packet.GetSourcePort(), ctx.GasMeter().GasRemaining(), im.maxCallbackGas, + ) + // OnAcknowledgementPacket is not blocked if the packet does not opt-in to callbacks + if err != nil { + return nil + } + + callbackExecutor := func(cachedCtx sdk.Context) error { + return im.contractKeeper.IBCOnAcknowledgementPacketCallback( + cachedCtx, packet, acknowledgement, relayer, callbackData.CallbackAddress, callbackData.SenderAddress, + ) + } + + // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions + err = im.processCallback(ctx, types.CallbackTypeAcknowledgementPacket, callbackData, callbackExecutor) + types.EmitCallbackEvent( + ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), + types.CallbackTypeAcknowledgementPacket, callbackData, err, + ) + + return nil +} + +// Call the IBCActor timeoutPacket callback after processing the packet +// if the timeoutPacket callback exists and returns an error +// DO NOT return the error upstream. The timeout must complete for the packet +// lifecycle to end, so the custom callback cannot block completion. +// Instead we emit error events and set the error in state +// so that users and on-chain logic can handle this appropriately +func (im IBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + // application-specific onTimeoutPacket logic + err := im.app.OnTimeoutPacket(ctx, packet, relayer) + if err != nil { + return err + } + + // use underlying app to get source callback information from packet data + callbackData, err := types.GetSourceCallbackData( + im.app, packet.GetData(), packet.GetSourcePort(), ctx.GasMeter().GasRemaining(), im.maxCallbackGas, + ) + // OnTimeoutPacket is not blocked if the packet does not opt-in to callbacks + if err != nil { + return nil + } + + callbackExecutor := func(cachedCtx sdk.Context) error { + return im.contractKeeper.IBCOnTimeoutPacketCallback(cachedCtx, packet, relayer, callbackData.CallbackAddress, callbackData.SenderAddress) + } + + // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions + err = im.processCallback(ctx, types.CallbackTypeTimeoutPacket, callbackData, callbackExecutor) + types.EmitCallbackEvent( + ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), + types.CallbackTypeTimeoutPacket, callbackData, err, + ) + + return nil +} + +// processCallback executes the callbackExecutor and reverts contract changes if the callbackExecutor fails. +// +// Error Precedence and Returns: +// - oogErr: Takes the highest precedence. If the callback runs out of gas, an error wrapped with types.ErrCallbackOutOfGas is returned. +// - panicErr: Takes the second-highest precedence. If a panic occurs and it is not propagated, an error wrapped with types.ErrCallbackPanic is returned. +// - callbackErr: If the callbackExecutor returns an error, it is returned as-is. +// +// panics if +// - the contractExecutor panics for any reason, and the callbackType is SendPacket, or +// - the contractExecutor runs out of gas and the relayer has not reserved gas grater than or equal to +// CommitGasLimit. +func (IBCMiddleware) processCallback( + ctx sdk.Context, callbackType types.CallbackType, + callbackData types.CallbackData, callbackExecutor func(sdk.Context) error, +) (err error) { + cachedCtx, writeFn := ctx.CacheContext() + cachedCtx = cachedCtx.WithGasMeter(storetypes.NewGasMeter(callbackData.ExecutionGasLimit)) + + defer func() { + // consume the minimum of g.consumed and g.limit + ctx.GasMeter().ConsumeGas(cachedCtx.GasMeter().GasConsumedToLimit(), fmt.Sprintf("ibc %s callback", callbackType)) + + // recover from all panics except during SendPacket callbacks + if r := recover(); r != nil { + if callbackType == types.CallbackTypeSendPacket { + panic(r) + } + err = errorsmod.Wrapf(types.ErrCallbackPanic, "ibc %s callback panicked with: %v", callbackType, r) + } + + // if the callback ran out of gas and the relayer has not reserved enough gas, then revert the state + if cachedCtx.GasMeter().IsPastLimit() { + if callbackData.AllowRetry() { + panic(storetypes.ErrorOutOfGas{Descriptor: fmt.Sprintf("ibc %s callback out of gas; commitGasLimit: %d", callbackType, callbackData.CommitGasLimit)}) + } + err = errorsmod.Wrapf(types.ErrCallbackOutOfGas, "ibc %s callback out of gas", callbackType) + } + + // allow the transaction to be committed, continuing the packet lifecycle + }() + + err = callbackExecutor(cachedCtx) + if err == nil { + writeFn() + } + + return err +} +``` + +Chains are expected to specify a `maxCallbackGas` to ensure that callbacks do not consume an arbitrary amount of gas. Thus, it should always be possible for a relayer to complete the packet lifecycle even if the actor callbacks cannot run successfully. + +## Consequences + +### Positive + +- IBC Actors can now programmatically execute logic that involves sending a packet and then performing some additional logic once the packet lifecycle is complete +- Middleware implementing ADR-8 can be generally used for any application +- Leverages a similar callback architecture to the one used between core IBC and IBC applications + +### Negative + +- Callbacks may now have unbounded gas consumption since the actor may execute arbitrary logic. Chains implementing this feature should take care to place limitations on how much gas an actor callback can consume. +- The relayer pays for the callback gas instead of the IBCActor + +### Neutral + +- Application packets that want to support ADR-8 must additionally have their packet data implement `PacketDataProvider` and `PacketData` interfaces. +- Applications must implement `PacketDataUnmarshaler` interface +- Callback receiving module must implement the `ContractKeeper` interface + +## References + +- [Original issue](https://github.com/cosmos/ibc-go/issues/1660) +- [CallbackPacketData interface implementation](https://github.com/cosmos/ibc-go/pull/3287) +- [ICS 20, ICS 27 implementations of the CallbackPacketData interface](https://github.com/cosmos/ibc-go/pull/3287) diff --git a/docs/architecture/adr-008-app-caller-cbs/adr-008-app-caller-cbs.md b/docs/architecture/adr-008-app-caller-cbs/adr-008-app-caller-cbs.md deleted file mode 100644 index b67275ccf49..00000000000 --- a/docs/architecture/adr-008-app-caller-cbs/adr-008-app-caller-cbs.md +++ /dev/null @@ -1,421 +0,0 @@ -# ADR 008: Callback to IBC Actors - -## Changelog - -* 2022-08-10: Initial Draft -* 2023-03-22: Merged - -## Status - -Accepted, packet callback interface implemented - -## Context - -IBC was designed with callbacks between core IBC and IBC applications. IBC apps would send a packet to core IBC. When the result of the packet lifecycle eventually resolved into either an acknowledgement or a timeout, core IBC called a callback on the IBC application so that the IBC application could take action on the basis of the result (e.g. unescrow tokens for ICS-20). - -This setup worked well for off-chain users interacting with IBC applications. - -We are now seeing the desire for secondary applications (e.g. smart contracts, modules) to call into IBC apps as part of their state machine logic and then do some actions on the basis of the packet result. Or to receive a packet from IBC and do some logic upon receipt. - -Example Usecases: -- Send an ICS-20 packet, and if it is successful, then send an ICA-packet to swap tokens on LP and return funds to sender -- Execute some logic upon receipt of token transfer to a smart contract address - -This requires a second layer of callbacks. The IBC application already gets the result of the packet from core IBC, but currently there is no standardized way to pass this information on to an actor module/smart contract. - -## Definitions - -- Actor: an actor is an on-chain module (this may be a hardcoded module in the chain binary or a smart contract) that wishes to execute custom logic whenever IBC receives a packet flow that it has either sent or received. It **must** be addressable by a string value. - -## Decision - -Create a standardized callback interface that actors can implement. IBC applications (or middleware that wraps IBC applications) can now call this callback to route the result of the packet/channel handshake from core IBC to the IBC application to the original actor on the sending chain. IBC applications can route the packet receipt to the destination actor on the receiving chain. - -IBC actors may implement the following interface: - -```go -type IBCActor interface { - // OnChannelOpen will be called on the IBCActor when the channel opens - // this will happen either on ChanOpenAck or ChanOpenConfirm - OnChannelOpen(ctx sdk.Context, portID, channelID, version string) - - // OnChannelClose will be called on the IBCActor if the channel closes - // this will be called on either ChanCloseInit or ChanCloseConfirm and if the channel handshake fails on our end - // NOTE: currently the channel does not automatically close if the counterparty fails the handhshake so actors must be prepared for an OpenInit to never return a callback for the time being - OnChannelClose(ctx sdk.Context, portID, channelID string) - - // IBCActor must also implement PacketActor interface - PacketActor -} - -// PacketActor is split out into its own separate interface since implementors may choose -// to only support callbacks for packet methods rather than supporting the full IBCActor interface -type PacketActor interface { - // OnRecvPacket will be called on the IBCActor after the IBC Application - // handles the RecvPacket callback if the packet has an IBC Actor as a receiver. - OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error - - // OnAcknowledgementPacket will be called on the IBC Actor - // after the IBC Application handles its own OnAcknowledgementPacket callback - OnAcknowledgmentPacket( - ctx sdk.Context, - packet channeltypes.Packet, - ack exported.Acknowledgement, - relayer sdk.AccAddress, - ) error - - // OnTimeoutPacket will be called on the IBC Actor - // after the IBC Application handles its own OnTimeoutPacket callback - OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, - ) error -} -``` - -The `CallbackPacketData` interface will get created to add `GetSourceCallbackAddress` and `GetDestCallbackAddress` methods. These may return an address -or they may return the empty string. The address may reference an PacketActor or it may be a regular user address. If the address is not a PacketActor, the actor callback must continue processing (no-op). Any IBC application or middleware that uses these methods must handle these cases. In most cases, the `GetSourceCallbackAddress` will be the sender address and the `GetDestCallbackAddress` will be the receiver address. However, these are named generically so that implementors may choose a different contract address for the callback if they choose. - -The interface also defines a `UserDefinedGasLimit` method. Any middleware targeting this interface for callback handling should cap the gas that a callback is allowed to take (especially on AcknowledgePacket and TimeoutPacket) so that a custom callback does not prevent the packet lifecycle from completing. However, since this is a global cap it is likely to be very large. Thus, users may specify a smaller limit to cap the amount of fees a relayer must pay in order to complete the packet lifecycle on the user's behalf. - -IBC applications which provide the base packet data type must implement the `CallbackPacketData` interface to allow `PacketActor` callbacks. - -```go -// Implemented by any packet data type that wants to support PacketActor callbacks -// PacketActor's will be unable to act on any packet data type that does not implement -// this interface. -type CallbackPacketData interface { - // GetSourceCallbackAddress should return the callback address of a packet data on the source chain. - // This may or may not be the sender of the packet. If no source callback address exists for the packet, - // an empty string may be returned. - GetSourceCallbackAddress() string - - // GetDestCallbackAddress should return the callback address of a packet data on the destination chain. - // This may or may not be the receiver of the packet. If no dest callback address exists for the packet, - // an empty string may be returned. - GetDestCallbackAddress() string - - // UserDefinedGasLimit allows the sender of the packet to define inside the packet data - // a gas limit for how much the ADR-8 callbacks can consume. If defined, this will be passed - // in as the gas limit so that the callback is guaranteed to complete within a specific limit. - // On recvPacket, a gas-overflow will just fail the transaction allowing it to timeout on the sender side. - // On ackPacket and timeoutPacket, a gas-overflow will reject state changes made during callback but still - // commit the transaction. This ensures the packet lifecycle can always complete. - // If the packet data returns 0, the remaining gas limit will be passed in (modulo any chain-defined limit) - // Otherwise, we will set the gas limit passed into the callback to the `min(ctx.GasLimit, UserDefinedGasLimit())` - UserDefinedGasLimit() uint64 -} -``` - -IBC Apps or middleware can then call the IBCActor callbacks like so in their own callbacks: - -### Handshake Callbacks - -The `OnChanOpenInit` handshake callback will need to include an additional field so that the initiating actor can be tracked and called upon during handshake completion. -The actor provided in the `OnChanOpenInit` callback will be the signer of the `MsgChanOpenInit` message. - -```go -func OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - channelCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, - actor string, -) (string, error) { - acc := k.getAccount(ctx, actor) - ibcActor, ok := acc.(IBCActor) - if ok { - k.setActor(ctx, portID, channelID, actor) - } - - // continued logic -} - -func OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - // run any necessary logic first - // negotiate final version - - actor := k.getActor(ctx, portID, channelID) - if actor != "" { - ibcActor, _ := acc.(IBCActor) - ibcActor.OnChanOpen(ctx, portID, channelID, version) - } - - // the same actor will be used for channel closure -} - -func OnChanCloseInit( - ctx sdk.Context, - portID, - channelID, -) error { - // run any necesssary logic first - - actor := k.getActor(ctx, portID, channelID) - if actor != "" { - ibcActor, _ := acc.(IBCActor) - ibcActor.OnChanClose(ctx, portID, channelID) - } - // cleanup state - k.deleteActor(ctx, portID, channelID) -} - -func OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - // run any necesssary logic first - - actor := k.getActor(ctx, portID, channelID) - if actor != "" { - ibcActor, _ := acc.(IBCActor) - ibcActor.OnChanClose(ctx, portID, channelID) - } - // cleanup state - k.deleteActor(ctx, portID, channelID) -} -``` - -NOTE: The handshake calls `OnChanOpenTry` and `OnChanOpenConfirm` are explicitly left out as it is still to be determined how the actor of the `OnChanOpenTry` step should be provided. Initially only the initiating side of the channel handshake may support setting a channel actor, future improvements should allow both sides of the channel handshake to set channel actors. - -### PacketCallbacks - -No packet callback API will need to change. - -```go -// Call the IBCActor recvPacket callback after processing the packet -// if the recvPacket callback exists. If the callback returns an error -// then return an error ack to revert all packet data processing. -func OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) (ack exported.Acknowledgement) { - // run any necesssary logic first - // IBCActor logic will postprocess - - // postprocessing should only if the underlying application - // returns a successful ack - - // unmarshal packet data into expected interface - var cbPacketData callbackPacketData - unmarshalInterface(packet.GetData(), cbPacketData) - - if cbPacketData == nil { - // the packet data does not implement the CallbackPacketData interface - // continue processing (no-op) - return - } - - acc := k.getAccount(ctx, cbPacketData.GetDstCallbackAddress()) - ibcActor, ok := acc.(IBCActor) - if ok { - // set gas limit for callback - gasLimit := getGasLimit(ctx, cbPacketData) - cbCtx = ctx.WithGasLimit(gasLimit) - - err := ibcActor.OnRecvPacket(cbCtx, packet, relayer) - - // deduct consumed gas from original context - ctx = ctx.WithGasLimit(ctx.GasMeter().RemainingGas() - cbCtx.GasMeter().GasConsumed()) - if err != nil { - // NOTE: by returning an error acknowledgement, it is assumed that the - // base IBC application on the counterparty callback stack will be able - // to properly unmarshal the error acknowledgement. It should not expect - // some custom error acknowledgement. If it does, failed acknowledgements - // will be unsuccessfully processed which can be catastrophic in processing - // refund logic. - // - // If this issue is a serious concern, an ADR 8 implementation can construct its own - // acknowledgement type which wraps the underlying application acknowledgement. This - // would require deployment on both sides of the packet flow, in addition to version - // negotiation to enable the custom acknowledgement type usage. - // - // Future improvmenets should allow for each IBC application in a stack of - // callbacks to provide their own acknowledgement without disrupting the unmarshaling - // of an application above or below it in the stack. - return AcknowledgementError(err) - } - } - return -} - -// Call the IBCActor acknowledgementPacket callback after processing the packet -// if the ackPacket callback exists and returns an error -// DO NOT return the error upstream. The acknowledgement must complete for the packet -// lifecycle to end, so the custom callback cannot block completion. -// Instead we emit error events and set the error in state -// so that users and on-chain logic can handle this appropriately -func (im IBCModule) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - // application-specific onAcknowledgmentPacket logic - - // unmarshal packet data into expected interface - var cbPacketData callbackPacketData - unmarshalInterface(packet.GetData(), cbPacketData) - - if cbPacketData == nil { - // the packet data does not implement the CallbackPacketData interface - // continue processing (no-op) - return - } - - // unmarshal ack bytes into the acknowledgment interface - var ack exported.Acknowledgement - unmarshal(acknowledgement, ack) - - // send acknowledgement to original actor - acc := k.getAccount(ctx, cbPacketData.GetSourceCallbackAddress()) - ibcActor, ok := acc.(IBCActor) - if ok { - gasLimit := getGasLimit(ctx, cbPacketData) - - - handleCallback := func() error { - // create cached context with gas limit - cacheCtx, writeFn := ctx.CacheContext() - cacheCtx = cacheCtx.WithGasLimit(gasLimit) - - defer func() { - if e := recover(); e != nil { - log("ran out of gas in callback. reverting callback state") - } else if err == nil { - // only write callback state if we did not panic during execution - // and the error returned is nil - writeFn() - } - } - - err := ibcActor.OnAcknowledgementPacket(cacheCtx, packet, ack, relayer) - - // deduct consumed gas from original context - ctx = ctx.WithGasLimit(ctx.GasMeter().RemainingGas() - cbCtx.GasMeter().GasConsumed()) - - return err - } - - if err := handleCallback(); err != nil { - setAckCallbackError(ctx, packet, err) // optional - emitAckCallbackErrorEvents(err) - } - } - - return nil -} - -// Call the IBCActor timeoutPacket callback after processing the packet -// if the timeoutPacket callback exists and returns an error -// DO NOT return the error upstream. The timeout must complete for the packet -// lifecycle to end, so the custom callback cannot block completion. -// Instead we emit error events and set the error in state -// so that users and on-chain logic can handle this appropriately -func (im IBCModule) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - // application-specific onTimeoutPacket logic - - // unmarshal packet data into expected interface - var cbPacketData callbackPacketData - unmarshalInterface(packet.GetData(), cbPacketData) - - if cbPacketData == nil { - // the packet data does not implement the CallbackPacketData interface - // continue processing (no-op) - return - } - - // call timeout callback on original actor - acc := k.getAccount(ctx, cbPacketData.GetSourceCallbackAddress()) - ibcActor, ok := acc.(IBCActor) - if ok { - gasLimit := getGasLimit(ctx, cbPacketData) - - handleCallback := func() error { - // create cached context with gas limit - cacheCtx, writeFn := ctx.CacheContext() - cacheCtx = cacheCtx.WithGasLimit(gasLimit) - - defer func() { - if e := recover(); e != nil { - log("ran out of gas in callback. reverting callback state") - } else if err == nil { - // only write callback state if we did not panic during execution - // and the error returned is nil - writeFn() - } - } - - err := ibcActor.OnTimeoutPacket(ctx, packet, relayer) - - // deduct consumed gas from original context - ctx = ctx.WithGasLimit(ctx.GasMeter().RemainingGas() - cbCtx.GasMeter().GasConsumed()) - - return err - } - - if err := handleCallback(); err != nil { - setTimeoutCallbackError(ctx, packet, err) // optional - emitTimeoutCallbackErrorEvents(err) - } - } - - return nil -} - -func getGasLimit(ctx sdk.Context, cbPacketData CallbackPacketData) uint64 { - // getGasLimit returns the gas limit to pass into the actor callback - // this will be the minimum of the remaining gas limit in the tx - // and the config defined gas limit. The config limit is itself - // the minimum of a user defined gas limit and the chain-defined gas limit - // for actor callbacks - var configLimit uint64 - if cbPacketData == 0 { - configLimit = chainDefinedActorCallbackLimit - } else { - configLimit = min(chainDefinedActorCallbackLimit, cbPacketData.UserDefinedGasLimit()) - } - return min(ctx.GasMeter().GasRemaining(), configLimit) -} -``` - -Chains are expected to specify a `chainDefinedActorCallbackLimit` to ensure that callbacks do not consume an arbitrary amount of gas. Thus, it should always be possible for a relayer to complete the packet lifecycle even if the actor callbacks cannot run successfully. - -## Consequences - -### Positive - -- IBC Actors can now programatically execute logic that involves sending a packet and then performing some additional logic once the packet lifecycle is complete -- Middleware implementing ADR-8 can be generally used for any application -- Leverages the same callback architecture used between core IBC and IBC applications - -### Negative - -- Callbacks may now have unbounded gas consumption since the actor may execute arbitrary logic. Chains implementing this feature should take care to place limitations on how much gas an actor callback can consume. - -### Neutral - -- Application packets that want to support ADR-8 must additionally have their packet data implement the `CallbackPacketData` interface and register their implementation on the chain codec - -## References - -- [Original issue](https://github.com/cosmos/ibc-go/issues/1660) -- [CallbackPacketData interface implementation](https://github.com/cosmos/ibc-go/pull/3287) -- [ICS 20, ICS 27 implementations of the CallbackPacketData interface](https://github.com/cosmos/ibc-go/pull/3287) diff --git a/docs/architecture/adr-008-app-caller-cbs/transfer-callback-scaffold.md b/docs/architecture/adr-008-app-caller-cbs/transfer-callback-scaffold.md deleted file mode 100644 index 904a6c52423..00000000000 --- a/docs/architecture/adr-008-app-caller-cbs/transfer-callback-scaffold.md +++ /dev/null @@ -1,223 +0,0 @@ -# Scaffold for ICS20 Callback Middleware - -The following is a very simple scaffold for middleware that implements actor callbacks for transfer channels. Since a channel does not need to be owned by a single actor, the handshake callbacks are no-ops. The packet callbacks will call into the relevant actor. For `OnRecvPacket`, this will be `data.Receiver`, and for `OnAcknowledgePacket` and `OnTimeoutPacket` this will be `data.Sender`. - -The exact nature of the callbacks to the smart contract will depend on the environment in question (e.g. cosmwasm, evm). Thus the place where the callbacks to the smart contract are stubbed out and commented so that it can be completed by implementers for the specific environment they are targetting. - -Implementers may wish to support callbacks to more IBC applications by adding a switch statement to unmarshal the specific packet data types they wish to support and passing them into the smart contract callback functions. - -### Scaffold Middleware - -```go -package callbacks - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - - transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" - "github.com/cosmos/ibc-go/v6/modules/core/exported" -) - -var _ porttypes.Middleware = &IBCMiddleware{} - -// IBCMiddleware implements the ICS26 callbacks for the fee middleware given the -// fee keeper and the underlying application. -type IBCMiddleware struct { - app porttypes.IBCModule - chanWrapper porttypes.ICS4Wrapper -} - -// NewIBCMiddleware creates a new IBCMiddlware given the keeper and underlying application -func NewIBCMiddleware(app porttypes.IBCModule, chanWrapper porttypes.ICS4Wrapper) IBCMiddleware { - return IBCMiddleware{ - app: app, - chanWrapper: chanWrapper, - } -} - -// OnChanOpenInit implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - // call underlying app's OnChanOpenInit callback - return im.app.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, - chanCap, counterparty, version) -} - -// OnChanOpenTry implements the IBCMiddleware interface -// If the channel is not fee enabled the underlying application version will be returned -// If the channel is fee enabled we merge the underlying application version with the ics29 version -func (im IBCMiddleware) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (string, error) { - // call underlying app's OnChanOpenTry callback - return im.app.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, chanCap, counterparty, counterpartyVersion) -} - -// OnChanOpenAck implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - // call underlying app's OnChanOpenAck callback - return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) -} - -// OnChanOpenConfirm implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanOpenConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - // call underlying app's OnChanOpenConfirm callback. - return im.app.OnChanOpenConfirm(ctx, portID, channelID) -} - -// OnChanCloseInit implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanCloseInit( - ctx sdk.Context, - portID, - channelID string, -) error { - // call underlying app's OnChanCloseInit callback. - return im.app.OnChanCloseInit(ctx, portID, channelID) -} - -// OnChanCloseConfirm implements the IBCMiddleware interface -func (im IBCMiddleware) OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - // call underlying app's OnChanCloseConfirm callback. - return im.app.OnChanCloseConfirm(ctx, portID, channelID) -} - -// OnRecvPacket implements the IBCMiddleware interface. -// If fees are not enabled, this callback will default to the ibc-core packet callback -func (im IBCMiddleware) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) exported.Acknowledgement { - // first do the underlying ibc app callback - ack := im.app.OnRecvPacket(ctx, packet, relayer) - - // postprocess the ibc application by executing a callback to the receiver smart contract - // if the receiver of the transfer packet is a smart contract - var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err == nil { - // check if data.Receiver is a smart contract address - // if it is a smart contract address - // then call the smart-contract defined callback for RecvPacket and pass in the transfer packet data - // if the callback returns an error, then return an error acknowledgement - if isSmartContract(data.Receiver) { - err := data.Receiver.recvPacketCallback(data) - if err != nil { - return channeltypes.NewErrorAcknowledgement(err) - } - } - } - return ack -} - -// OnAcknowledgementPacket implements the IBCMiddleware interface -// If fees are not enabled, this callback will default to the ibc-core packet callback -func (im IBCMiddleware) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - // call underlying callback - err := im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) - - // postprocess the ibc application by executing a callback to the sender smart contract - // if the sender of the transfer packet is a smart contract - var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err == nil { - // check if data.Sender is a smart contract address - // if it is a smart contract address - // then call the smart-contract defined callback for RecvPacket and pass in the transfer packet data - // if the callback returns an error, then return an error - if isSmartContract(data.Sender) { - data.Sender.ackPacketCallback(data) - } - } - return err -} - -// OnTimeoutPacket implements the IBCMiddleware interface -// If fees are not enabled, this callback will default to the ibc-core packet callback -func (im IBCMiddleware) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - // call underlying callback - err := im.app.OnTimeoutPacket(ctx, packet, relayer) - - // postprocess the ibc application by executing a callback to the sender smart contract - // if the sender of the transfer packet is a smart contract - var data transfertypes.FungibleTokenPacketData - if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err == nil { - // check if data.Sender is a smart contract address - // if it is a smart contract address - // then call the smart-contract defined callback for RecvPacket and pass in the transfer packet data - // if the callback returns an error, then return an error - if isSmartContract(data.Sender) { - data.Sender.timeoutPacketCallback(data) - } - } - return err -} - -// SendPacket implements the ICS4 Wrapper interface -func (im IBCMiddleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (uint64, error) { - return im.chanWrapper.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) -} - -// WriteAcknowledgement implements the ICS4 Wrapper interface -func (im IBCMiddleware) WriteAcknowledgement( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet exported.PacketI, - ack exported.Acknowledgement, -) error { - return im.chanWrapper.WriteAcknowledgement(ctx, chanCap, packet, ack) -} - -// GetAppVersion returns the application version of the underlying application -func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { - return im.chanWrapper.GetAppVersion(ctx, portID, channelID) -} -``` \ No newline at end of file diff --git a/docs/dev/project-structure.md b/docs/dev/project-structure.md index bb8e697d904..5056b325625 100644 --- a/docs/dev/project-structure.md +++ b/docs/dev/project-structure.md @@ -1,6 +1,6 @@ # Project structure -If you're not familiar with the overall module structure from the SDK modules, please check this [document](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/build/building-modules/11-structure.md) as prerequisite reading. +If you're not familiar with the overall module structure from the SDK modules, please check this [document](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/11-structure.md) as prerequisite reading. Every Interchain Standard (ICS) has been developed in its own package. The development team separated the IBC TAO (Transport, Authentication, Ordering) ICS specifications from the IBC application level specification. The following sections describe the architecture of the most relevant directories that comprise this repository. diff --git a/docs/ibc/apps.md b/docs/ibc/apps.md index 7e5293bfd0a..acb05a9c8c7 100644 --- a/docs/ibc/apps.md +++ b/docs/ibc/apps.md @@ -488,4 +488,4 @@ callbacks](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/ibc_ ## Next {hide} -Learn about [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/build/building-modules/00-intro.md) {hide} +Learn about [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/00-intro.md) {hide} diff --git a/docs/ibc/apps/apps.md b/docs/ibc/apps/apps.md index 93f86d464b0..7798c903b6c 100644 --- a/docs/ibc/apps/apps.md +++ b/docs/ibc/apps/apps.md @@ -48,4 +48,4 @@ callbacks](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/ibc_ ## Next {hide} -Learn about [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/build/building-modules/00-intro.md) {hide} +Learn about [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/00-intro.md) {hide} diff --git a/docs/ibc/integration.md b/docs/ibc/integration.md index ec8a78765f9..97482bd450c 100644 --- a/docs/ibc/integration.md +++ b/docs/ibc/integration.md @@ -157,7 +157,7 @@ func NewApp(...args) *App { ### Module Managers -In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager` in case your application supports [simulations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/build/building-modules/14-simulator.md). +In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager` in case your application supports [simulations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/14-simulator.md). ```go // app.go diff --git a/docs/ibc/overview.md b/docs/ibc/overview.md index 68c6d31ed8e..ca7c406a6cf 100644 --- a/docs/ibc/overview.md +++ b/docs/ibc/overview.md @@ -136,7 +136,7 @@ Proofs are passed from core IBC to light-clients as bytes. It is up to light cli [ICS-24 Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/core/ics-024-host-requirements). - The proof format that all implementations must be able to produce and verify is defined in [ICS-23 Proofs](https://github.com/cosmos/ics23) implementation. -### [Capabilities](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/advanced/10-ocap.md) +### [Capabilities](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/advanced/10-ocap.md) IBC is intended to work in execution environments where modules do not necessarily trust each other. Thus, IBC must authenticate module actions on ports and channels so that only modules with the diff --git a/docs/ibc/relayer.md b/docs/ibc/relayer.md index 7da4e73bf92..7348a854b09 100644 --- a/docs/ibc/relayer.md +++ b/docs/ibc/relayer.md @@ -7,7 +7,7 @@ order: 6 ## Pre-requisites Readings - [IBC Overview](./overview.md) {prereq} -- [Events](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/advanced/08-events.md) {prereq} +- [Events](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/advanced/08-events.md) {prereq} ## Events diff --git a/docs/middleware/callbacks/overview.md b/docs/middleware/callbacks/overview.md index 9a10b53388a..c7e64c28d4c 100644 --- a/docs/middleware/callbacks/overview.md +++ b/docs/middleware/callbacks/overview.md @@ -14,7 +14,7 @@ This setup worked well for off-chain users interacting with IBC applications. Ho The Callbacks Middleware allows for this functionality by allowing the packets of the underlying IBC applications to register callbacks to secondary applications for lifecycle events. These callbacks are then executed by the Callbacks Middleware when the corresponding packet lifecycle event occurs. -After much discussion, the design was expanded to [an ADR](../../architecture/adr-008-app-caller-cbs/adr-008-app-caller-cbs.md), and the Callbacks Middleware is an implementation of that ADR. +After much discussion, the design was expanded to [an ADR](../../architecture/adr-008-app-caller-cbs.md), and the Callbacks Middleware is an implementation of that ADR. ## Concepts diff --git a/docs/middleware/ics29-fee/fee-distribution.md b/docs/middleware/ics29-fee/fee-distribution.md index d1be7e2ff8a..6efb9972fd5 100644 --- a/docs/middleware/ics29-fee/fee-distribution.md +++ b/docs/middleware/ics29-fee/fee-distribution.md @@ -50,7 +50,7 @@ type MsgRegisterCounterpartyPayee struct { > > - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). > - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). -> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/beginner/03-accounts.md#addresses)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/beginner/03-accounts.md#addresses)). > - `CounterpartyPayee` is empty. See below for an example CLI command: @@ -95,8 +95,8 @@ type MsgRegisterPayee struct { > > - `PortId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators). > - `ChannelId` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). -> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/beginner/03-accounts.md#addresses)). -> - `Payee` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/develop/beginner/03-accounts.md#addresses)). +> - `Relayer` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/beginner/03-accounts.md#addresses)). +> - `Payee` is an invalid address (see [Cosmos SDK Addresses](https://github.com/cosmos/cosmos-sdk/blob/main/docs/develop/beginner/03-accounts.md#addresses)). See below for an example CLI command: diff --git a/docs/migrations/v7-to-v8.md b/docs/migrations/v7-to-v8.md index ec89e987124..cb806d9953c 100644 --- a/docs/migrations/v7-to-v8.md +++ b/docs/migrations/v7-to-v8.md @@ -14,6 +14,29 @@ There are four sections based on the four potential user groups of this document ## Chains +The type of the `PortKeeper` field of the IBC keeper have been changed to `*portkeeper.Keeper`: + +```diff +// Keeper defines each ICS keeper for IBC +type Keeper struct { + // implements gRPC QueryServer interface + types.QueryServer + + cdc codec.BinaryCodec + + ClientKeeper clientkeeper.Keeper + ConnectionKeeper connectionkeeper.Keeper + ChannelKeeper channelkeeper.Keeper +- PortKeeper portkeeper.Keeper ++ PortKeeper *portkeeper.Keeper + Router *porttypes.Router + + authority string +} +``` + +See [this PR](https://github.com/cosmos/ibc-go/pull/4703/files#diff-d18972debee5e64f16e40807b2ae112ddbe609504a93ea5e1c80a5d489c3a08a) for the changes required in `app.go`. + TODO: https://github.com/cosmos/ibc-go/pull/3505 (extra parameter added to transfer's `GenesisState`) - You must pass the `authority` to the icahost keeper. ([#3520](https://github.com/cosmos/ibc-go/pull/3520)) See [diff](https://github.com/cosmos/ibc-go/pull/3520/files#diff-d18972debee5e64f16e40807b2ae112ddbe609504a93ea5e1c80a5d489c3a08a). @@ -88,6 +111,39 @@ Each module has a corresponding `MsgUpdateParams` message with a `Params` which Legacy params subspaces must still be initialised in app.go in order to successfully migrate from x/params to the new self-contained approach. See reference: https://github.com/cosmos/ibc-go/blob/main/testing/simapp/app.go#L1001-L1006 +### Governance V1 migration + +Proposals have been migrated to [gov v1 messages](https://docs.cosmos.network/v0.50/modules/gov#messages) ref: [#4620](https://github.com/cosmos/ibc-go/pull/4620). The proposal `ClientUpdateProposal` has been removed and replaced with `MsgRecoverClient` and the proposal `UpgradeProposal` has been removed and replaced with `MsgIBCSoftwareUpgrade`. + +Ensure that the correct authority field is provided to the ibc keeper. + +Remove legacy proposal registration from app.go ref: [#4602](https://github.com/cosmos/ibc-go/pull/4602). + +Remove the 02-client proposal handler from the `govRouter`. + +```diff +govRouter := govv1beta1.NewRouter() +govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). +- AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) +``` + +Remove the UpgradeProposalHandler from the BasicModuleManager + +```diff +app.BasicModuleManager = module.NewBasicManagerFromManager( + app.ModuleManager, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, +- ibcclientclient.UpgradeProposalHandler, + }, + ), +}) +``` + ### Transfer migration An automatic migration handler (TODO: add link after https://github.com/cosmos/ibc-go/pull/3104 is merged) is configured in the transfer module to set the [denomination metadata](https://github.com/cosmos/cosmos-sdk/blob/95178ce036741ae6aa7af131fa9fccf3e13fff7a/proto/cosmos/bank/v1beta1/bank.proto#L96-L125) for the IBC denominations of all vouchers minted by the transfer module. diff --git a/e2e/go.mod b/e2e/go.mod index d332939a5c4..d24b31d4f4d 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -5,15 +5,15 @@ go 1.21 require ( cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.1.2 - cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 + cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d github.com/cometbft/cometbft v0.38.0 github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230915171831-2196edacb99d github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/v8 v8.0.0-20230906115913-46ee5f92e1af github.com/docker/docker v24.0.6+incompatible - github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230916025810-5e6836de5d1a + github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230913202406-3e11bf474a3b github.com/stretchr/testify v1.8.4 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/mod v0.12.0 google.golang.org/grpc v1.58.1 gopkg.in/yaml.v2 v2.4.0 @@ -40,18 +40,11 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect github.com/BurntSushi/toml v1.3.2 // indirect - 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/wasmvm v1.4.0 // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect - github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect github.com/Microsoft/go-winio v0.6.0 // indirect - github.com/StirlingMarketingGroup/go-namecase v1.0.0 // indirect github.com/avast/retry-go/v4 v4.5.0 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect - github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect @@ -80,10 +73,6 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set v1.8.0 // indirect - github.com/decred/base58 v1.0.4 // indirect - github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -95,7 +84,6 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/emicklei/dot v1.6.0 // indirect - github.com/ethereum/go-ethereum v1.12.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect @@ -104,9 +92,7 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect + github.com/gobwas/ws v1.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 @@ -119,6 +105,7 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect github.com/google/s2a-go v0.1.4 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect @@ -129,8 +116,6 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - 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.1 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect @@ -143,53 +128,38 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/holiman/uint256 v1.2.3 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/go-cid v0.4.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.16.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-libp2p v0.31.0 // indirect github.com/linxGnu/grocksdb v1.8.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect github.com/minio/highwayhash v1.0.2 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect - github.com/misko9/go-substrate-rpc-client/v4 v4.0.0-20230913220906-b988ea7da0c2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/multiformats/go-base32 v0.1.0 // indirect - github.com/multiformats/go-base36 v0.2.0 // indirect - github.com/multiformats/go-multiaddr v0.11.0 // indirect - github.com/multiformats/go-multibase v0.2.0 // indirect - 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/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce // indirect github.com/oklog/run v1.1.0 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b // indirect - github.com/pierrec/xxHash v0.1.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.16.0 // indirect @@ -202,7 +172,6 @@ require ( github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.30.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/cobra v1.7.0 // indirect @@ -213,8 +182,6 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect - github.com/tyler-smith/go-bip32 v1.0.0 // indirect - github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.1 // indirect @@ -239,10 +206,8 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.0 // 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 diff --git a/e2e/go.sum b/e2e/go.sum index d450d4bac63..9f87947d563 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -213,8 +213,8 @@ cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc h1:bekdwRzRK3iiKeRaDj cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:GDfsWm1pdR3YVVS955sBY+OuF3nwShRcFp8D80VShlQ= cosmossdk.io/x/tx v0.10.0 h1:LxWF/hksVDbeQmFj4voLM5ZCHyVZ1cCNIqKenfH9plc= cosmossdk.io/x/tx v0.10.0/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 h1:3wgUsnj/ElYA+B33h6Yn1KxWvB4hPFa+K90fw9gRO9M= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619/go.mod h1:bqexnYfkwMCqbXXN4SprKS9N7cTwT1lFholB7UQhoDU= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d h1:LH8NPa2+yoMFdCTxCFyQUX5zVDip4YDgtg7e0EecDqo= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -228,21 +228,11 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -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/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/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc= -github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:kGUqhHd//musdITWjFvNTHn90WG9bMLBEPQZ17Cmlpw= -github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec h1:1Qb69mGp/UtRPn422BH4/Y4Q3SLUrD9KHuDkm8iodFc= -github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec/go.mod h1:CD8UlnlLDiqb36L110uqiP2iSflVjx9g/3U9hCI4q2U= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= @@ -252,10 +242,6 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE 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= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/StirlingMarketingGroup/go-namecase v1.0.0 h1:2CzaNtCzc4iNHirR+5ru9OzGg8rQp860gqLBFqRI02Y= -github.com/StirlingMarketingGroup/go-namecase v1.0.0/go.mod h1:ZsoSKcafcAzuBx+sndbxHu/RjDcDTrEdT4UvhniHfio= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= @@ -283,8 +269,6 @@ github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+ github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -302,8 +286,6 @@ github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipus github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -332,8 +314,6 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw= -github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -379,7 +359,6 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQ github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230915171831-2196edacb99d h1:dBD7O1D3lxfMwKjR71ooQanLzclJ17NZMHplL6qd8ZU= github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230915171831-2196edacb99d/go.mod h1:8rNGga/Gg9/NIFvpqO4URts+8Cz/XVB0wTr5ZDm22UM= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -405,19 +384,8 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= -github.com/decred/base58 v1.0.4 h1:QJC6B0E0rXOPA8U/kw2rP+qiRJsUaE2Er+pYb3siUeA= -github.com/decred/base58 v1.0.4/go.mod h1:jJswKPEdvpFpvf7dsDvFZyLT22xZ9lWqEByX38oGd9E= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= -github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 h1:18HurQ6DfHeNvwIjvOmrgr44bPdtVaQAe/WWwHg9goM= -github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1/go.mod h1:XmyzkaXBy7ZvHdrTAlXAjpog8qKSAWa3ze7yqzWmgmc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= @@ -462,8 +430,6 @@ 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.12.1 h1:1kXDPxhLfyySuQYIfRxVBGYuaHdxNNxevA73vjIwsgk= -github.com/ethereum/go-ethereum v1.12.1/go.mod h1:zKetLweqBR8ZS+1O9iJWI8DvmmD2NzD19apjEWDCsnw= 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= @@ -509,8 +475,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -523,8 +487,7 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -684,11 +647,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -737,8 +695,6 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -757,8 +713,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= -github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/jhump/protoreflect v1.15.2 h1:7YppbATX94jEt9KLAc5hICx4h6Yt3SaavhQRsIUEHP0= github.com/jhump/protoreflect v1.15.2/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -792,8 +746,6 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -812,8 +764,6 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-libp2p v0.31.0 h1:LFShhP8F6xthWiBBq3euxbKjZsoRajVEyBS9snfHxYg= -github.com/libp2p/go-libp2p v0.31.0/go.mod h1:W/FEK1c/t04PbRH3fA9i5oucu5YcgrG0JVoBWT1B7Eg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= @@ -844,15 +794,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= 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= -github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b h1:QrHweqAtyJ9EwCaGHBu1fghwxIPiopAHV06JlXrMHjk= -github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b/go.mod h1:xxLb2ip6sSUts3g1irPVHyk/DGslwQsNOo9I7smJfNU= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/misko9/go-substrate-rpc-client/v4 v4.0.0-20230913220906-b988ea7da0c2 h1:G/cVeTAbB9S/6FSWWqpFV0v49hiuHLbJPu9hTZ0UR2A= -github.com/misko9/go-substrate-rpc-client/v4 v4.0.0-20230913220906-b988ea7da0c2/go.mod h1:Q5BxOd9FxJqYp4vCiLGVdetecPcWTmUQIu0bRigYosU= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -877,24 +820,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= -github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= -github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= -github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.11.0 h1:XqGyJ8ufbCE0HmTDwx2kPdsrQ36AGPZNZX6s6xfJH10= -github.com/multiformats/go-multiaddr v0.11.0/go.mod h1:gWUm0QLR4thQ6+ZF6SXUw8YjtwQSPapICM+NmCkxHSM= -github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= -github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= -github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= -github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= -github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= -github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= -github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= -github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -961,8 +888,6 @@ github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b h1:vab8deKC4QoIfm github.com/petermattis/goid v0.0.0-20230808133559-b036b712a89b/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/xxHash v0.1.5 h1:n/jBpwTHiER4xYvK3/CdPVnLDPchj8eTJFFLUb4QHBo= -github.com/pierrec/xxHash v0.1.5/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -1035,8 +960,6 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1071,8 +994,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230916025810-5e6836de5d1a h1:U+WeIVivB+YtdhbWKFOx1xroXcIdnc2eABXC5zEaKlk= -github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230916025810-5e6836de5d1a/go.mod h1:I+PKMZ6G+gb1iZ7YfyzV9Q1v1ZaF4LlPQCNEg2yx2Ag= +github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230913202406-3e11bf474a3b h1:B3VTNRBsh/kp9+TpMQVXsjUql38+82trUSxPOKd7R/k= +github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230913202406-3e11bf474a3b/go.mod h1:ELE57+yyFCeMuxuFHHu50Wxs3/CPmHxH2uBlvCF1lq4= 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= @@ -1081,7 +1004,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.1.5-0.20170601210322-f6abca593680/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1102,16 +1024,8 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip32 v1.0.0 h1:sDR9juArbUgX+bO/iblgZnMPeWY1KZMUC2AFUJdv5KE= -github.com/tyler-smith/go-bip32 v1.0.0/go.mod h1:onot+eHknzV4BVPwrzqY5OoVpyCvnwD7lMawL5aQupE= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= @@ -1166,9 +1080,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= -golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1177,7 +1090,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1387,6 +1299,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1431,7 +1344,6 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1510,6 +1422,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1781,8 +1694,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1811,10 +1722,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= -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= diff --git a/e2e/sample.config.yaml b/e2e/sample.config.yaml index 5392ad5664d..e7e185737ac 100644 --- a/e2e/sample.config.yaml +++ b/e2e/sample.config.yaml @@ -5,7 +5,7 @@ --- chains: # the entry at index 0 corresponds to CHAIN_A -- chainId: chain-a +- chainId: chainA-1 numValidators: 1 numFullNodes: 0 image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE @@ -13,7 +13,7 @@ chains: binary: simd # override with CHAIN_BINARY # the entry at index 1 corresponds to CHAIN_B -- chainId: chain-b +- chainId: chainB-1 numValidators: 1 numFullNodes: 0 image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 319159a6d8b..a3dfedcc6f8 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -94,9 +94,9 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() { s.Require().NoError(err) originalChainID := clientState.(*ibctm.ClientState).ChainId - revisionNumber := clienttypes.ParseChainID(fmt.Sprintf("%s-%d", originalChainID, 1)) + revisionNumber := clienttypes.ParseChainID(originalChainID) // increment revision number even with new chain ID to prevent loss of misbehaviour detection support - newChainID, err = clienttypes.SetRevisionNumber(fmt.Sprintf("%s-%d", originalChainID, 1), revisionNumber+1) + newChainID, err = clienttypes.SetRevisionNumber(originalChainID, revisionNumber+1) s.Require().NoError(err) s.Require().NotEqual(originalChainID, newChainID) diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index d2dd81c4659..fd871d6b647 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -103,15 +103,15 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { expected := testvalues.IBCTransferAmount s.Require().Equal(expected, actualBalance.Int64()) + + if testvalues.DenomMetadataFeatureReleases.IsSupported(chainBVersion) { + s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA) + } }) if testvalues.TokenMetadataFeatureReleases.IsSupported(chainBVersion) { - t.Run("metadata for token exists on chainB", func(t *testing.T) { - balances, err := s.QueryAllBalances(ctx, chainB, chainBAddress, true) - s.Require().NoError(err) - - // balance for IBC token returns a human-readable denomination - s.Require().Equal(chainBIBCToken.GetFullDenomPath(), balances[1].Denom) + t.Run("metadata for IBC denomination exists on chainB", func(t *testing.T) { + s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA) }) } diff --git a/e2e/tests/upgrades/genesis_test.go b/e2e/tests/upgrades/genesis_test.go index 9728549c184..9d1d367d4c0 100644 --- a/e2e/tests/upgrades/genesis_test.go +++ b/e2e/tests/upgrades/genesis_test.go @@ -2,7 +2,6 @@ package upgrades import ( "context" - "strings" "testing" "time" @@ -198,12 +197,6 @@ func (s *GenesisTestSuite) HaltChainAndExportGenesis(ctx context.Context, chain state, err := chain.ExportState(ctx, int64(haltHeight)) s.Require().NoError(err) - // state exports currently read from stdout which include log entries, this discards the log entry by the server module - // this may need to be updated if log entries are inserted in between exporting of state and the server module logging - // see issue: https://github.com/strangelove-ventures/interchaintest/issues/721 - str := strings.SplitAfter(state, "server") - state = str[1] - appTomlOverrides := make(test.Toml) appTomlOverrides["halt-height"] = 0 diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 1df81a1f3aa..68c395ea11f 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -8,6 +8,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/gogoproto/proto" + // intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types" interchaintest "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" @@ -20,6 +21,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + e2erelayer "github.com/cosmos/ibc-go/e2e/relayer" "github.com/cosmos/ibc-go/e2e/testsuite" "github.com/cosmos/ibc-go/e2e/testvalues" v7migrations "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7" @@ -563,6 +565,14 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() { s.UpgradeChain(ctx, chainA, chainAUpgradeProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag) }) + // see this issue https://github.com/informalsystems/hermes/issues/3579 + // this restart is a temporary workaround to a limitation in hermes requiring a restart + // in some cases after an upgrade. + tc := testsuite.LoadConfig() + if tc.RelayerConfig.Type == e2erelayer.Hermes { + s.RestartRelayer(ctx, relayer) + } + t.Run("check that the tendermint clients are active again after upgrade", func(t *testing.T) { status, err := s.QueryClientStatus(ctx, chainA, testvalues.TendermintClientID(0)) s.Require().NoError(err) @@ -669,6 +679,21 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { expectedTotalEscrow := sdk.NewCoin(chainADenom, sdkmath.NewInt(testvalues.IBCTransferAmount)) s.Require().Equal(expectedTotalEscrow, actualTotalEscrow) // migration has run and total escrow amount has been set }) + + t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + s.AssertTxSuccess(transferTxResp) + }) + + t.Run("packets are relayed", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount * 2 + s.Require().Equal(expected, actualBalance.Int64()) + }) } func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { @@ -721,21 +746,21 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") t.Run("upgrade chain", func(t *testing.T) { - govProposalWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) - s.UpgradeChain(ctx, chainA, govProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag) + govProposalWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) + s.UpgradeChain(ctx, chainB, govProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag) }) t.Run("update params", func(t *testing.T) { - authority, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) + authority, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainB) s.Require().NoError(err) s.Require().NotNil(authority) msg := clienttypes.NewMsgUpdateParams(authority.String(), clienttypes.NewParams(exported.Tendermint, "some-client")) - s.ExecuteGovV1Proposal(ctx, msg, chainA, chainAWallet) + s.ExecuteGovV1Proposal(ctx, msg, chainB, chainBWallet) }) t.Run("query params", func(t *testing.T) { - clientParams, err := s.GetChainGRCPClients(chainA).ClientQueryClient.ClientParams(ctx, &clienttypes.QueryClientParamsRequest{}) + clientParams, err := s.GetChainGRCPClients(chainB).ClientQueryClient.ClientParams(ctx, &clienttypes.QueryClientParamsRequest{}) s.Require().NoError(err) allowedClients := clientParams.Params.AllowedClients @@ -744,6 +769,25 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.Require().Contains(allowedClients, exported.Tendermint) s.Require().Contains(allowedClients, "some-client") }) + + t.Run("query human readable ibc denom", func(t *testing.T) { + s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA) + }) + + t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + s.AssertTxSuccess(transferTxResp) + }) + + t.Run("packets are relayed", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount * 2 + s.Require().Equal(expected, actualBalance.Int64()) + }) } // RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain. diff --git a/e2e/testsuite/grpc_query.go b/e2e/testsuite/grpc_query.go index fb71017aa6e..42afae1501c 100644 --- a/e2e/testsuite/grpc_query.go +++ b/e2e/testsuite/grpc_query.go @@ -279,20 +279,6 @@ func (s *E2ETestSuite) QueryCounterPartyPayee(ctx context.Context, chain ibc.Cha return res.CounterpartyPayee, nil } -// QueryBalances returns all the balances on the given chain for the provided address. -func (s *E2ETestSuite) QueryAllBalances(ctx context.Context, chain ibc.Chain, address string, resolveDenom bool) (sdk.Coins, error) { - queryClient := s.GetChainGRCPClients(chain).BankQueryClient - res, err := queryClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{ - Address: address, - ResolveDenom: resolveDenom, - }) - if err != nil { - return sdk.Coins{}, err - } - - return res.Balances, nil -} - // QueryProposalV1Beta1 queries the governance proposal on the given chain with the given proposal ID. func (s *E2ETestSuite) QueryProposalV1Beta1(ctx context.Context, chain ibc.Chain, proposalID uint64) (govtypesv1beta1.Proposal, error) { queryClient := s.GetChainGRCPClients(chain).GovQueryClient @@ -394,3 +380,30 @@ func (s *E2ETestSuite) QueryGranterGrants(ctx context.Context, chain *cosmos.Cos return grants.Grants, nil } + +// QueryBalances returns all the balances on the given chain for the provided address. +func (s *E2ETestSuite) QueryAllBalances(ctx context.Context, chain ibc.Chain, address string, resolveDenom bool) (sdk.Coins, error) { + queryClient := s.GetChainGRCPClients(chain).BankQueryClient + res, err := queryClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{ + Address: address, + ResolveDenom: resolveDenom, + }) + if err != nil { + return sdk.Coins{}, err + } + + return res.Balances, nil +} + +// QueryDenomMetadata queries the metadata for the given denom. +func (s *E2ETestSuite) QueryDenomMetadata(ctx context.Context, chain *cosmos.CosmosChain, denom string) (banktypes.Metadata, error) { + bankClient := s.GetChainGRCPClients(chain).BankQueryClient + queryRequest := &banktypes.QueryDenomMetadataRequest{ + Denom: denom, + } + res, err := bankClient.DenomMetadata(ctx, queryRequest) + if err != nil { + return banktypes.Metadata{}, err + } + return res.Metadata, nil +} diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index 541770be982..18c64bb2b67 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -114,7 +114,7 @@ func (tc TestConfig) GetChainAID() string { if tc.ChainConfigs[0].ChainID != "" { return tc.ChainConfigs[0].ChainID } - return "chain-a" + return "chainA-1" } // GetChainBID returns the chain-id for chain B. @@ -122,7 +122,7 @@ func (tc TestConfig) GetChainBID() string { if tc.ChainConfigs[1].ChainID != "" { return tc.ChainConfigs[1].ChainID } - return "chain-b" + return "chainB-1" } // UpgradeConfig holds values relevant to upgrade tests. diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index a0b2349c686..bf8e351db7d 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -284,6 +284,12 @@ func (s *E2ETestSuite) StopRelayer(ctx context.Context, ibcrelayer ibc.Relayer) s.Require().NoError(err) } +// RestartRelayer restarts the given relayer. +func (s *E2ETestSuite) RestartRelayer(ctx context.Context, ibcrelayer ibc.Relayer) { + s.StopRelayer(ctx, ibcrelayer) + s.StartRelayer(ibcrelayer) +} + // CreateUserOnChainA creates a user with the given amount of funds on chain A. func (s *E2ETestSuite) CreateUserOnChainA(ctx context.Context, amount int64) ibc.Wallet { chainA, _ := s.GetChains() @@ -322,6 +328,21 @@ func (s *E2ETestSuite) AssertPacketRelayed(ctx context.Context, chain *cosmos.Co s.Require().Empty(commitment) } +// AssertHumanReadableDenom asserts that a human readable denom is present for a given chain. +func (s *E2ETestSuite) AssertHumanReadableDenom(ctx context.Context, chain *cosmos.CosmosChain, counterpartyNativeDenom string, counterpartyChannel ibc.ChannelOutput) { + chainIBCDenom := GetIBCToken(counterpartyNativeDenom, counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID) + + denomMetadata, err := s.QueryDenomMetadata(ctx, chain, chainIBCDenom.IBCDenom()) + s.Require().NoError(err) + + s.Require().Equal(chainIBCDenom.IBCDenom(), denomMetadata.Base, "denom metadata base does not match expected %s: got %s", chainIBCDenom.IBCDenom(), denomMetadata.Base) + expectedName := fmt.Sprintf("%s/%s/%s IBC token", counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID, counterpartyNativeDenom) + s.Require().Equal(expectedName, denomMetadata.Name, "denom metadata name does not match expected %s: got %s", expectedName, denomMetadata.Name) + expectedDisplay := fmt.Sprintf("%s/%s/%s", counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID, counterpartyNativeDenom) + s.Require().Equal(expectedDisplay, denomMetadata.Display, "denom metadata display does not match expected %s: got %s", expectedDisplay, denomMetadata.Display) + s.Require().Equal(strings.ToUpper(counterpartyNativeDenom), denomMetadata.Symbol, "denom metadata symbol does not match expected %s: got %s", strings.ToUpper(counterpartyNativeDenom), denomMetadata.Symbol) +} + // createCosmosChains creates two separate chains in docker containers. // test and can be retrieved with GetChains. func (s *E2ETestSuite) createCosmosChains(chainOptions ChainOptions) (*cosmos.CosmosChain, *cosmos.CosmosChain) { diff --git a/e2e/testvalues/values.go b/e2e/testvalues/values.go index 41207196e49..e5a08ef4543 100644 --- a/e2e/testvalues/values.go +++ b/e2e/testvalues/values.go @@ -101,3 +101,8 @@ var LocalhostClientFeatureReleases = semverutil.FeatureReleases{ "v7.1", }, } + +// DenomMetadataFeatureReleases represents the releases the human readable denom feature was released in. +var DenomMetadataFeatureReleases = semverutil.FeatureReleases{ + MajorVersion: "v8", +} diff --git a/go.mod b/go.mod index 452cef91478..b2f8163ee7c 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,17 @@ module github.com/cosmos/ibc-go/v8 require ( cosmossdk.io/api v0.7.1 cosmossdk.io/client/v2 v2.0.0-20230915153641-245e21875f1a - cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/log v1.2.1 cosmossdk.io/math v1.1.2 cosmossdk.io/store v1.0.0-rc.0 - cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc + cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508 cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/evidence v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/tx v0.10.0 - cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 + cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d github.com/cometbft/cometbft v0.38.0 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 @@ -46,6 +45,7 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.1 // indirect cloud.google.com/go/storage v1.30.1 // indirect + cosmossdk.io/collections v0.4.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/go.sum b/go.sum index 3703825f710..b19ddf9f971 100644 --- a/go.sum +++ b/go.sum @@ -205,8 +205,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc h1:+8XcN/fVm2/3RCxmnCli9kURKWtJexm3dpeGGAujBPQ= -cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:BjHnrWAKPImcU/q23cFQoP+u22WhylkDz2JUL4r0Nd8= +cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508 h1:axKhxRa3M9QW2GdKJUsSyzo44gxcwSOTGeomtkbQClM= +cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508/go.mod h1:qcJ1zwLIMefpDHZuYSa73yBe/k5HyQ5H1Jg9PWv30Ts= cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc h1:zF3zmTxaRpWbUTQzVdqFiuz0T3OdYnQplIdzVjEU36Q= cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:QRG1bAlYXqOlRz+hImZ3mXlF1sSsLJneAO9luIoh5O4= cosmossdk.io/x/evidence v0.0.0-20230913185058-9b5a203d35bc h1:vDUvyyrwB4lTyIw8eP2wbFmRkxj1CPaq8C86OvN1fa8= @@ -215,8 +215,8 @@ cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc h1:bekdwRzRK3iiKeRaDj cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:GDfsWm1pdR3YVVS955sBY+OuF3nwShRcFp8D80VShlQ= cosmossdk.io/x/tx v0.10.0 h1:LxWF/hksVDbeQmFj4voLM5ZCHyVZ1cCNIqKenfH9plc= cosmossdk.io/x/tx v0.10.0/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 h1:3wgUsnj/ElYA+B33h6Yn1KxWvB4hPFa+K90fw9gRO9M= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619/go.mod h1:bqexnYfkwMCqbXXN4SprKS9N7cTwT1lFholB7UQhoDU= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d h1:LH8NPa2+yoMFdCTxCFyQUX5zVDip4YDgtg7e0EecDqo= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/internal/collections/collections.go b/internal/collections/collections.go deleted file mode 100644 index ae8c403f72e..00000000000 --- a/internal/collections/collections.go +++ /dev/null @@ -1,11 +0,0 @@ -package collections - -// Contains is a generic function which returns true if elem T exists within the list of elements []T. -func Contains[T comparable](elem T, elements []T) bool { - for _, e := range elements { - if elem == e { - return true - } - } - return false -} diff --git a/internal/collections/collections_test.go b/internal/collections/collections_test.go deleted file mode 100644 index 184de69d84e..00000000000 --- a/internal/collections/collections_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package collections_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/ibc-go/v8/internal/collections" -) - -func TestContainsString(t *testing.T) { - testCases := []struct { - name string - haystack []string - needle string - expected bool - }{ - {"failure empty haystack", []string{}, "needle", false}, - {"failure empty needle", []string{"hay", "stack"}, "", false}, - {"failure needle not in haystack", []string{"hay", "stack"}, "needle", false}, - {"success needle in haystack", []string{"hay", "stack", "needle"}, "needle", true}, - } - - for _, tc := range testCases { - require.Equal(t, tc.expected, collections.Contains(tc.needle, tc.haystack), tc.name) - } -} - -func TestContainsInt(t *testing.T) { - testCases := []struct { - name string - haystack []int - needle int - expected bool - }{ - {"failure empty haystack", []int{}, 1, false}, - {"failure needle not in haystack", []int{1, 2, 3}, 4, false}, - {"success needle in haystack", []int{1, 2, 3, 4}, 4, true}, - } - - for _, tc := range testCases { - require.Equal(t, tc.expected, collections.Contains(tc.needle, tc.haystack), tc.name) - } -} diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index 3dd1d3342a6..78980421d65 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -52,6 +52,10 @@ func NewKeeper( legacySubspace = legacySubspace.WithKeyTable(types.ParamKeyTable()) } + if strings.TrimSpace(authority) == "" { + panic(fmt.Errorf("authority must be non-empty")) + } + return Keeper{ storeKey: key, cdc: cdc, diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index 22e01d1a697..c420efca166 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -8,6 +8,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" genesistypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" @@ -107,6 +108,58 @@ func TestKeeperTestSuite(t *testing.T) { testifysuite.Run(t, new(KeeperTestSuite)) } +func (suite *KeeperTestSuite) TestNewKeeper() { + testCases := []struct { + name string + instantiateFn func() + expPass bool + }{ + {"success", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.SubModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().ScopedICAControllerKeeper, + suite.chainA.GetSimApp().MsgServiceRouter(), + suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), + ) + }, true}, + {"failure: empty authority", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.SubModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().ScopedICAControllerKeeper, + suite.chainA.GetSimApp().MsgServiceRouter(), + "", // authority + ) + }, false}, + } + + for _, tc := range testCases { + tc := tc + suite.SetupTest() + + suite.Run(tc.name, func() { + if tc.expPass { + suite.Require().NotPanics( + tc.instantiateFn, + ) + } else { + suite.Require().Panics( + tc.instantiateFn, + ) + } + }) + } +} + func (suite *KeeperTestSuite) TestGetAllPorts() { suite.SetupTest() diff --git a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go index 09c8fc11c89..4bb498300a7 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -192,7 +192,7 @@ var xxx_messageInfo_MsgSendTxResponse proto.InternalMessageInfo // MsgUpdateParams defines the payload for Msg/UpdateParams type MsgUpdateParams struct { - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // params defines the 27-interchain-accounts/controller parameters to update. // diff --git a/modules/apps/27-interchain-accounts/host/client/cli/tx.go b/modules/apps/27-interchain-accounts/host/client/cli/tx.go index 76a7f198bc8..78f204eb63b 100644 --- a/modules/apps/27-interchain-accounts/host/client/cli/tx.go +++ b/modules/apps/27-interchain-accounts/host/client/cli/tx.go @@ -3,6 +3,7 @@ package cli import ( "encoding/json" "fmt" + "slices" "github.com/cosmos/gogoproto/proto" "github.com/spf13/cobra" @@ -12,7 +13,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/ibc-go/v8/internal/collections" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" ) @@ -82,7 +82,7 @@ otherwise the encoding flag can be used in combination with either "proto3" or " return err } - if !collections.Contains(encoding, []string{icatypes.EncodingProtobuf, icatypes.EncodingProto3JSON}) { + if !slices.Contains([]string{icatypes.EncodingProtobuf, icatypes.EncodingProto3JSON}, encoding) { return fmt.Errorf("unsupported encoding type: %s", encoding) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper.go b/modules/apps/27-interchain-accounts/host/keeper/keeper.go index c9e442854e6..b60ac4d652c 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper.go @@ -59,6 +59,10 @@ func NewKeeper( legacySubspace = legacySubspace.WithKeyTable(types.ParamKeyTable()) } + if strings.TrimSpace(authority) == "" { + panic(fmt.Errorf("authority must be non-empty")) + } + return Keeper{ storeKey: key, cdc: cdc, diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go index 0c44b0f10d4..95dd3f8b89c 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go @@ -6,7 +6,10 @@ import ( testifysuite "github.com/stretchr/testify/suite" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + genesistypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types" + "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" @@ -127,6 +130,74 @@ func TestKeeperTestSuite(t *testing.T) { testifysuite.Run(t, new(KeeperTestSuite)) } +func (suite *KeeperTestSuite) TestNewKeeper() { + testCases := []struct { + name string + instantiateFn func() + expPass bool + }{ + {"success", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.SubModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().AccountKeeper, + suite.chainA.GetSimApp().ScopedICAHostKeeper, + suite.chainA.GetSimApp().MsgServiceRouter(), + suite.chainA.GetSimApp().ICAHostKeeper.GetAuthority(), + ) + }, true}, + {"failure: interchain accounts module account does not exist", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.SubModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + authkeeper.AccountKeeper{}, // empty account keeper + suite.chainA.GetSimApp().ScopedICAHostKeeper, + suite.chainA.GetSimApp().MsgServiceRouter(), + suite.chainA.GetSimApp().ICAHostKeeper.GetAuthority(), + ) + }, false}, + {"failure: empty mock staking keeper", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.SubModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().AccountKeeper, + suite.chainA.GetSimApp().ScopedICAHostKeeper, + suite.chainA.GetSimApp().MsgServiceRouter(), + "", // authority + ) + }, false}, + } + + for _, tc := range testCases { + tc := tc + suite.SetupTest() + + suite.Run(tc.name, func() { + if tc.expPass { + suite.Require().NotPanics( + tc.instantiateFn, + ) + } else { + suite.Require().Panics( + tc.instantiateFn, + ) + } + }) + } +} + func (suite *KeeperTestSuite) TestGetInterchainAccountAddress() { suite.SetupTest() diff --git a/modules/apps/27-interchain-accounts/host/types/tx.pb.go b/modules/apps/27-interchain-accounts/host/types/tx.pb.go index acbb5c8aa60..ebcc8995cb5 100644 --- a/modules/apps/27-interchain-accounts/host/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/host/types/tx.pb.go @@ -31,7 +31,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgUpdateParams defines the payload for Msg/UpdateParams type MsgUpdateParams struct { - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // params defines the 27-interchain-accounts/host parameters to update. // diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index e08857d7bf8..0236b295852 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -227,5 +227,6 @@ func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes. // RegisterStoreDecoder registers a decoder for interchain accounts module's types func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { - sdr[types.StoreKey] = simulation.NewDecodeStore() + sdr[controllertypes.StoreKey] = simulation.NewDecodeStore() + sdr[hosttypes.StoreKey] = simulation.NewDecodeStore() } diff --git a/modules/apps/27-interchain-accounts/types/keys.go b/modules/apps/27-interchain-accounts/types/keys.go index 2a062130ce2..ddd21716c61 100644 --- a/modules/apps/27-interchain-accounts/types/keys.go +++ b/modules/apps/27-interchain-accounts/types/keys.go @@ -17,9 +17,6 @@ const ( // Version defines the current version for interchain accounts Version = "ics27-1" - // StoreKey is the store key string for interchain accounts - StoreKey = ModuleName - // RouterKey is the message route for interchain accounts RouterKey = ModuleName diff --git a/modules/apps/27-interchain-accounts/types/metadata.go b/modules/apps/27-interchain-accounts/types/metadata.go index 1314ce087a0..29d1da45d42 100644 --- a/modules/apps/27-interchain-accounts/types/metadata.go +++ b/modules/apps/27-interchain-accounts/types/metadata.go @@ -1,11 +1,12 @@ package types import ( + "slices" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/v8/internal/collections" connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" ) @@ -134,7 +135,7 @@ func ValidateHostMetadata(ctx sdk.Context, channelKeeper ChannelKeeper, connecti // isSupportedEncoding returns true if the provided encoding is supported, otherwise false func isSupportedEncoding(encoding string) bool { - return collections.Contains(encoding, getSupportedEncoding()) + return slices.Contains(getSupportedEncoding(), encoding) } // getSupportedEncoding returns a string slice of supported encoding formats @@ -144,7 +145,7 @@ func getSupportedEncoding() []string { // isSupportedTxType returns true if the provided transaction type is supported, otherwise false func isSupportedTxType(txType string) bool { - return collections.Contains(txType, getSupportedTxTypes()) + return slices.Contains(getSupportedTxTypes(), txType) } // getSupportedTxTypes returns a string slice of supported transaction types diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 595d52f53fd..30cd91f6f52 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -18,12 +18,12 @@ require ( cosmossdk.io/log v1.2.1 cosmossdk.io/math v1.1.2 cosmossdk.io/store v1.0.0-rc.0 - cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc + cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508 cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/evidence v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc cosmossdk.io/x/tx v0.10.0 - cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 + cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d github.com/cometbft/cometbft v0.38.0 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230915171831-2196edacb99d diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 3703825f710..b19ddf9f971 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -205,8 +205,8 @@ cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/store v1.0.0-rc.0 h1:9DwOjuUYxDtYxn/REkTxGQAmxlIGfRroB35MQ8TrxF4= cosmossdk.io/store v1.0.0-rc.0/go.mod h1:FtBDOJmwtOZfmKKF65bKZbTYgS3bDNjjo3nP76dAegk= -cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc h1:+8XcN/fVm2/3RCxmnCli9kURKWtJexm3dpeGGAujBPQ= -cosmossdk.io/tools/confix v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:BjHnrWAKPImcU/q23cFQoP+u22WhylkDz2JUL4r0Nd8= +cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508 h1:axKhxRa3M9QW2GdKJUsSyzo44gxcwSOTGeomtkbQClM= +cosmossdk.io/tools/confix v0.0.0-20230818115413-c402c51a1508/go.mod h1:qcJ1zwLIMefpDHZuYSa73yBe/k5HyQ5H1Jg9PWv30Ts= cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc h1:zF3zmTxaRpWbUTQzVdqFiuz0T3OdYnQplIdzVjEU36Q= cosmossdk.io/x/circuit v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:QRG1bAlYXqOlRz+hImZ3mXlF1sSsLJneAO9luIoh5O4= cosmossdk.io/x/evidence v0.0.0-20230913185058-9b5a203d35bc h1:vDUvyyrwB4lTyIw8eP2wbFmRkxj1CPaq8C86OvN1fa8= @@ -215,8 +215,8 @@ cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc h1:bekdwRzRK3iiKeRaDj cosmossdk.io/x/feegrant v0.0.0-20230913185058-9b5a203d35bc/go.mod h1:GDfsWm1pdR3YVVS955sBY+OuF3nwShRcFp8D80VShlQ= cosmossdk.io/x/tx v0.10.0 h1:LxWF/hksVDbeQmFj4voLM5ZCHyVZ1cCNIqKenfH9plc= cosmossdk.io/x/tx v0.10.0/go.mod h1:MKo9/b5wsoL8dd9y9pvD2yOP1CMvzHIWYxi1l2oLPFo= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619 h1:3wgUsnj/ElYA+B33h6Yn1KxWvB4hPFa+K90fw9gRO9M= -cosmossdk.io/x/upgrade v0.0.0-20230915075604-076dc1ee9619/go.mod h1:bqexnYfkwMCqbXXN4SprKS9N7cTwT1lFholB7UQhoDU= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d h1:LH8NPa2+yoMFdCTxCFyQUX5zVDip4YDgtg7e0EecDqo= +cosmossdk.io/x/upgrade v0.0.0-20230915171831-2196edacb99d/go.mod h1:+5jCm6Lk/CrQhQvtJFy/tmuLfhQKNMn/U0vwrRz/dxQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/modules/apps/callbacks/testing/simapp/app.go b/modules/apps/callbacks/testing/simapp/app.go index 565d723507e..ed7d08be38c 100644 --- a/modules/apps/callbacks/testing/simapp/app.go +++ b/modules/apps/callbacks/testing/simapp/app.go @@ -479,14 +479,14 @@ func NewSimApp( appCodec, keys[ibcfeetypes.StoreKey], app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, ) // ICA Controller keeper app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -495,7 +495,7 @@ func NewSimApp( app.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -512,7 +512,7 @@ func NewSimApp( app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -522,7 +522,7 @@ func NewSimApp( // Mock Module setup for testing IBC and also acts as the interchain accounts authentication module // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do // not replicate if you do not need to test core IBC or light clients. - mockModule := ibcmock.NewAppModule(&app.IBCKeeper.PortKeeper) + mockModule := ibcmock.NewAppModule(app.IBCKeeper.PortKeeper) // The mock module is used for testing IBC mockIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp(ibcmock.ModuleName, scopedIBCMockKeeper)) @@ -667,13 +667,17 @@ func NewSimApp( app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) + // NOTE: upgrade module is required to be prioritized + app.ModuleManager.SetOrderPreBlockers( + upgradetypes.ModuleName, + ) + // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) app.ModuleManager.SetOrderBeginBlockers( - upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, @@ -762,6 +766,7 @@ func NewSimApp( // initialize BaseApp app.SetInitChainer(app.InitChainer) + app.SetPreBlocker(app.PreBlocker) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) app.setAnteHandler(txConfig) @@ -858,6 +863,11 @@ func (app *SimApp) setPostHandler() { // Name returns the name of the App func (app *SimApp) Name() string { return app.BaseApp.Name() } +// PreBlocker application updates every pre block +func (app *SimApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { + return app.ModuleManager.PreBlock(ctx) +} + // BeginBlocker application updates every begin block func (app *SimApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { return app.ModuleManager.BeginBlock(ctx) @@ -930,6 +940,7 @@ func (app *SimApp) AutoCliOpts() autocli.AppOptions { return autocli.AppOptions{ Modules: modules, + ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index a58ec865f45..e3e0da974fc 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -58,12 +58,15 @@ func NewKeeper( if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil { panic("the IBC transfer module account has not been set") } - // set KeyTable if it has not already been set if !legacySubspace.HasKeyTable() { legacySubspace = legacySubspace.WithKeyTable(types.ParamKeyTable()) } + if strings.TrimSpace(authority) == "" { + panic(fmt.Errorf("authority must be non-empty")) + } + return Keeper{ cdc: cdc, storeKey: key, diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index 56afd3fcbd5..2e164f05c5b 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -12,7 +12,9 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" ibctesting "github.com/cosmos/ibc-go/v8/testing" @@ -43,6 +45,74 @@ func TestKeeperTestSuite(t *testing.T) { testifysuite.Run(t, new(KeeperTestSuite)) } +func (suite *KeeperTestSuite) TestNewKeeper() { + testCases := []struct { + name string + instantiateFn func() + expPass bool + }{ + {"success", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.ModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().AccountKeeper, + suite.chainA.GetSimApp().BankKeeper, + suite.chainA.GetSimApp().ScopedTransferKeeper, + suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), + ) + }, true}, + {"failure: transfer module account does not exist", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.ModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + authkeeper.AccountKeeper{}, // empty account keeper + suite.chainA.GetSimApp().BankKeeper, + suite.chainA.GetSimApp().ScopedTransferKeeper, + suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), + ) + }, false}, + {"failure: empty authority", func() { + keeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(types.StoreKey), + suite.chainA.GetSimApp().GetSubspace(types.ModuleName), + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper, + suite.chainA.GetSimApp().IBCKeeper.PortKeeper, + suite.chainA.GetSimApp().AccountKeeper, + suite.chainA.GetSimApp().BankKeeper, + suite.chainA.GetSimApp().ScopedTransferKeeper, + "", // authority + ) + }, false}, + } + + for _, tc := range testCases { + tc := tc + suite.SetupTest() + + suite.Run(tc.name, func() { + if tc.expPass { + suite.Require().NotPanics( + tc.instantiateFn, + ) + } else { + suite.Require().Panics( + tc.instantiateFn, + ) + } + }) + } +} + func (suite *KeeperTestSuite) TestSetGetTotalEscrowForDenom() { const denom = "atom" var expAmount sdkmath.Int diff --git a/modules/apps/transfer/types/query.pb.go b/modules/apps/transfer/types/query.pb.go index e7e3343b0b4..2f7b696daa7 100644 --- a/modules/apps/transfer/types/query.pb.go +++ b/modules/apps/transfer/types/query.pb.go @@ -622,7 +622,7 @@ var fileDescriptor_a638e2800a01538c = []byte{ 0xc1, 0xd3, 0x40, 0x20, 0x1c, 0xa0, 0x52, 0xa1, 0xa5, 0xa5, 0xea, 0x01, 0x02, 0xa7, 0x72, 0x88, 0x26, 0xf6, 0xd4, 0xb1, 0x94, 0x78, 0x8c, 0xc7, 0x49, 0x85, 0x22, 0x2e, 0xfd, 0x04, 0x95, 0xf8, 0x12, 0x55, 0xa5, 0x6a, 0xbf, 0xc2, 0x1e, 0x39, 0xa2, 0x5d, 0x69, 0xc5, 0x69, 0x77, 0x05, 0xfb, - 0x41, 0x56, 0x1e, 0x8f, 0x13, 0x7b, 0x09, 0x21, 0xd9, 0x53, 0x3c, 0xf3, 0xfe, 0xfd, 0x7e, 0xef, + 0x41, 0x56, 0x1e, 0x8f, 0x13, 0x7b, 0x09, 0x21, 0xd9, 0x53, 0x3c, 0xf3, 0xfe, 0xfd, 0x7e, 0xbf, 0x37, 0xef, 0x29, 0xb0, 0xe2, 0xd4, 0x4c, 0x4c, 0x3c, 0xaf, 0xe1, 0x98, 0x24, 0x70, 0x98, 0xcb, 0x71, 0xe0, 0x13, 0x97, 0xff, 0x49, 0x7d, 0xdc, 0x2e, 0xe2, 0xf3, 0x16, 0xf5, 0x2f, 0x0c, 0xcf, 0x67, 0x01, 0x43, 0x0b, 0x4e, 0xcd, 0x34, 0x92, 0x9e, 0x46, 0xec, 0x69, 0xb4, 0x8b, 0xea, 0x8c, @@ -633,42 +633,42 @@ var fileDescriptor_a638e2800a01538c = []byte{ 0xea, 0xab, 0xf0, 0xe5, 0x71, 0x58, 0xec, 0x27, 0xea, 0xb2, 0xe6, 0xa9, 0x4f, 0x4c, 0x5a, 0xa1, 0xe7, 0x2d, 0xca, 0x03, 0x84, 0x60, 0xbc, 0x4e, 0x78, 0x7d, 0x4e, 0x59, 0x52, 0x56, 0x72, 0x15, 0xf1, 0xad, 0x5b, 0x30, 0xfb, 0xc0, 0x9b, 0x7b, 0xcc, 0xe5, 0x14, 0x1d, 0x42, 0xde, 0x0a, 0x6f, - 0xab, 0x41, 0x78, 0x2d, 0xa2, 0xf2, 0xeb, 0x2b, 0xc6, 0xa0, 0x4e, 0x19, 0x89, 0x34, 0x60, 0x75, - 0xbf, 0x75, 0xf2, 0xa0, 0x0a, 0x8f, 0x41, 0x1d, 0x00, 0xf4, 0xba, 0x21, 0x8b, 0x7c, 0x63, 0x44, - 0xad, 0x33, 0xc2, 0xd6, 0x19, 0x91, 0x4e, 0xb2, 0x75, 0xc6, 0x11, 0xb1, 0x63, 0x42, 0x95, 0x44, - 0xa4, 0xfe, 0x5c, 0x81, 0xb9, 0x87, 0x35, 0x24, 0x95, 0x33, 0xf8, 0x3c, 0x41, 0x85, 0xcf, 0x29, - 0x4b, 0x9f, 0x8c, 0xc2, 0x65, 0x6f, 0xea, 0xfa, 0xf5, 0x62, 0xe6, 0xbf, 0x37, 0x8b, 0x59, 0x99, - 0x37, 0xdf, 0xe3, 0xc6, 0xd1, 0x2f, 0x29, 0x06, 0x63, 0x82, 0xc1, 0xb7, 0x4f, 0x32, 0x88, 0x90, - 0xa5, 0x28, 0xcc, 0x00, 0x12, 0x0c, 0x8e, 0x88, 0x4f, 0x9a, 0x71, 0x83, 0xf4, 0x13, 0x98, 0x4e, - 0xdd, 0x4a, 0x4a, 0x3b, 0x90, 0xf5, 0xc4, 0x8d, 0xec, 0xd9, 0xf2, 0x60, 0x32, 0x32, 0x5a, 0xc6, - 0xe8, 0x6b, 0xf0, 0x45, 0xaf, 0x59, 0xbf, 0x12, 0x5e, 0x8f, 0xe5, 0x98, 0x81, 0x89, 0x9e, 0xdc, - 0xb9, 0x4a, 0x74, 0x48, 0xbf, 0xa9, 0xc8, 0x5d, 0xc2, 0xe8, 0xf7, 0xa6, 0x4e, 0x60, 0x5e, 0x78, - 0xff, 0xcc, 0x4d, 0x9f, 0xfd, 0xf5, 0xa3, 0x65, 0xf9, 0x94, 0x77, 0xf5, 0x9e, 0x85, 0x4f, 0x3d, - 0xe6, 0x07, 0x55, 0xc7, 0x92, 0x31, 0xd9, 0xf0, 0x78, 0x68, 0xa1, 0xaf, 0x00, 0xcc, 0x3a, 0x71, - 0x5d, 0xda, 0x08, 0x6d, 0x63, 0xc2, 0x96, 0x93, 0x37, 0x87, 0x96, 0xbe, 0x0f, 0x6a, 0xbf, 0xa4, - 0x12, 0xc6, 0xd7, 0x30, 0x45, 0x85, 0xa1, 0x4a, 0x22, 0x8b, 0x4c, 0x3e, 0x49, 0x93, 0xee, 0x7a, - 0x19, 0x16, 0x45, 0x92, 0x53, 0x16, 0x90, 0x46, 0x94, 0xe9, 0x80, 0xf9, 0x82, 0x55, 0xa2, 0x01, - 0x42, 0xdc, 0xb8, 0x01, 0xe2, 0xa0, 0x9f, 0xc1, 0xd2, 0xe3, 0x81, 0x12, 0x43, 0x19, 0xb2, 0xa4, - 0xc9, 0x5a, 0x6e, 0x20, 0x15, 0x99, 0x4f, 0xbd, 0x81, 0x58, 0xfd, 0x7d, 0xe6, 0xb8, 0x7b, 0xe3, - 0xe1, 0x7b, 0xaa, 0x48, 0xf7, 0xf5, 0xdb, 0xcf, 0x60, 0x42, 0x64, 0x47, 0xcf, 0x14, 0x80, 0xde, - 0xb3, 0x43, 0xa5, 0xc1, 0x9a, 0xf6, 0x1f, 0x73, 0x75, 0x73, 0xc4, 0xa8, 0x08, 0xbe, 0x5e, 0xfa, - 0xfb, 0xe5, 0xbb, 0xab, 0x31, 0x03, 0xad, 0x62, 0xb9, 0x8b, 0xd2, 0x3b, 0x28, 0x39, 0x3f, 0xb8, - 0x13, 0xea, 0xbc, 0x5b, 0x28, 0x5c, 0xa2, 0x7f, 0x15, 0xc8, 0x27, 0x26, 0x0e, 0x8d, 0x56, 0x3c, - 0x7e, 0x15, 0xea, 0xd6, 0xa8, 0x61, 0x12, 0x74, 0x41, 0x80, 0x5e, 0x46, 0xfa, 0xd3, 0xa0, 0xd1, - 0x95, 0x02, 0xd9, 0x68, 0x0c, 0xd0, 0xf7, 0x43, 0x94, 0x4b, 0x4d, 0xa1, 0x5a, 0x1c, 0x21, 0x42, - 0x62, 0x5b, 0x16, 0xd8, 0x34, 0xb4, 0xd0, 0x1f, 0x5b, 0x34, 0x89, 0xe8, 0x7f, 0x05, 0x72, 0xdd, - 0xb1, 0x42, 0x1b, 0xc3, 0xf6, 0x21, 0x31, 0xb3, 0x6a, 0x69, 0xb4, 0x20, 0x09, 0x6f, 0x53, 0xc0, - 0xc3, 0x68, 0x6d, 0x50, 0xeb, 0x42, 0x9d, 0x43, 0xbd, 0x45, 0x0b, 0x85, 0xe0, 0xaf, 0x14, 0x98, - 0x4c, 0xcd, 0x20, 0x2a, 0x0f, 0x51, 0xbe, 0xdf, 0x2a, 0x50, 0xb7, 0x47, 0x0f, 0x94, 0xd8, 0x2b, - 0x02, 0xfb, 0xef, 0xe8, 0xb7, 0xfe, 0xd8, 0xe5, 0xd6, 0xe0, 0xb8, 0xd3, 0xdb, 0x28, 0x97, 0x38, - 0xdc, 0x33, 0x1c, 0x77, 0xe4, 0xf6, 0xb9, 0xc4, 0xe9, 0x85, 0x81, 0x5e, 0x28, 0x30, 0xdd, 0x67, - 0xbc, 0xd1, 0xee, 0x10, 0x28, 0x1f, 0xdf, 0x27, 0xea, 0x0f, 0x1f, 0x1b, 0x2e, 0xa9, 0xee, 0x08, - 0xaa, 0x5b, 0xa8, 0x34, 0x40, 0x26, 0x8e, 0x3b, 0xe2, 0x37, 0x14, 0x08, 0x07, 0x61, 0xb2, 0x6a, - 0x44, 0x6e, 0xef, 0xf8, 0xfa, 0x4e, 0x53, 0x6e, 0xee, 0x34, 0xe5, 0xed, 0x9d, 0xa6, 0xfc, 0x73, - 0xaf, 0x65, 0x6e, 0xee, 0xb5, 0xcc, 0xed, 0xbd, 0x96, 0xf9, 0xa3, 0x6c, 0x3b, 0x41, 0xbd, 0x55, - 0x33, 0x4c, 0xd6, 0xc4, 0xf2, 0x8f, 0x8a, 0x53, 0x33, 0xd7, 0x6c, 0x86, 0xdb, 0xdb, 0xb8, 0xc9, - 0xac, 0x56, 0x83, 0xf2, 0x0f, 0xca, 0x05, 0x17, 0x1e, 0xe5, 0xb5, 0xac, 0xf8, 0x9b, 0xb1, 0xf1, - 0x3e, 0x00, 0x00, 0xff, 0xff, 0x78, 0xf1, 0x3d, 0x9d, 0x5d, 0x09, 0x00, 0x00, + 0xab, 0x41, 0x78, 0x2d, 0xa2, 0xf2, 0xeb, 0x2b, 0xc6, 0x20, 0xa5, 0x8c, 0x44, 0x1a, 0xb0, 0xba, + 0xdf, 0x3a, 0x79, 0x50, 0x85, 0xc7, 0xa0, 0x0e, 0x00, 0x7a, 0x6a, 0xc8, 0x22, 0xdf, 0x18, 0x91, + 0x74, 0x46, 0x28, 0x9d, 0x11, 0xf5, 0x49, 0x4a, 0x67, 0x1c, 0x11, 0x3b, 0x26, 0x54, 0x49, 0x44, + 0xea, 0xcf, 0x15, 0x98, 0x7b, 0x58, 0x43, 0x52, 0x39, 0x83, 0xcf, 0x13, 0x54, 0xf8, 0x9c, 0xb2, + 0xf4, 0xc9, 0x28, 0x5c, 0xf6, 0xa6, 0xae, 0x5f, 0x2f, 0x66, 0xfe, 0x7b, 0xb3, 0x98, 0x95, 0x79, + 0xf3, 0x3d, 0x6e, 0x1c, 0xfd, 0x92, 0x62, 0x30, 0x26, 0x18, 0x7c, 0xfb, 0x24, 0x83, 0x08, 0x59, + 0x8a, 0xc2, 0x0c, 0x20, 0xc1, 0xe0, 0x88, 0xf8, 0xa4, 0x19, 0x0b, 0xa4, 0x9f, 0xc0, 0x74, 0xea, + 0x56, 0x52, 0xda, 0x81, 0xac, 0x27, 0x6e, 0xa4, 0x66, 0xcb, 0x83, 0xc9, 0xc8, 0x68, 0x19, 0xa3, + 0xaf, 0xc1, 0x17, 0x3d, 0xb1, 0x7e, 0x25, 0xbc, 0x1e, 0xb7, 0x63, 0x06, 0x26, 0x7a, 0xed, 0xce, + 0x55, 0xa2, 0x43, 0xfa, 0x4d, 0x45, 0xee, 0x12, 0x46, 0xbf, 0x37, 0x75, 0x02, 0xf3, 0xc2, 0xfb, + 0x67, 0x6e, 0xfa, 0xec, 0xaf, 0x1f, 0x2d, 0xcb, 0xa7, 0xbc, 0xdb, 0xef, 0x59, 0xf8, 0xd4, 0x63, + 0x7e, 0x50, 0x75, 0x2c, 0x19, 0x93, 0x0d, 0x8f, 0x87, 0x16, 0xfa, 0x0a, 0xc0, 0xac, 0x13, 0xd7, + 0xa5, 0x8d, 0xd0, 0x36, 0x26, 0x6c, 0x39, 0x79, 0x73, 0x68, 0xe9, 0xfb, 0xa0, 0xf6, 0x4b, 0x2a, + 0x61, 0x7c, 0x0d, 0x53, 0x54, 0x18, 0xaa, 0x24, 0xb2, 0xc8, 0xe4, 0x93, 0x34, 0xe9, 0xae, 0x97, + 0x61, 0x51, 0x24, 0x39, 0x65, 0x01, 0x69, 0x44, 0x99, 0x0e, 0x98, 0x2f, 0x58, 0x25, 0x04, 0x10, + 0xcd, 0x8d, 0x05, 0x10, 0x07, 0xfd, 0x0c, 0x96, 0x1e, 0x0f, 0x94, 0x18, 0xca, 0x90, 0x25, 0x4d, + 0xd6, 0x72, 0x03, 0xd9, 0x91, 0xf9, 0xd4, 0x1b, 0x88, 0xbb, 0xbf, 0xcf, 0x1c, 0x77, 0x6f, 0x3c, + 0x7c, 0x4f, 0x15, 0xe9, 0xbe, 0x7e, 0xfb, 0x19, 0x4c, 0x88, 0xec, 0xe8, 0x5f, 0x05, 0xf2, 0x89, + 0xf7, 0x8b, 0x36, 0x07, 0x37, 0xf5, 0x91, 0x99, 0x52, 0xb7, 0x46, 0x0d, 0x8b, 0x18, 0xe8, 0x85, + 0xbf, 0x5f, 0xbe, 0xbb, 0x1a, 0x5b, 0x46, 0x3a, 0x96, 0xeb, 0x28, 0xbd, 0x86, 0x92, 0x23, 0x84, + 0x9e, 0x29, 0x00, 0xbd, 0x1c, 0xa8, 0x34, 0x52, 0xc9, 0x18, 0xe8, 0xe6, 0x88, 0x51, 0x12, 0x67, + 0x49, 0xe0, 0x34, 0xd0, 0xea, 0xd3, 0x38, 0x71, 0x27, 0x7c, 0x92, 0xbb, 0x85, 0xc2, 0x25, 0xba, + 0x52, 0x20, 0x1b, 0x8d, 0x01, 0xfa, 0x7e, 0x88, 0xba, 0xa9, 0x29, 0x54, 0x8b, 0x23, 0x44, 0x48, + 0x94, 0xcb, 0x02, 0xa5, 0x86, 0x16, 0xfa, 0xa3, 0x8c, 0x26, 0x11, 0xfd, 0xaf, 0x40, 0xae, 0x3b, + 0x56, 0x68, 0x63, 0x58, 0x41, 0x12, 0x33, 0xab, 0x96, 0x46, 0x0b, 0x92, 0xf0, 0x36, 0x05, 0x3c, + 0x8c, 0xd6, 0x06, 0x89, 0x18, 0x8a, 0x17, 0x8a, 0x28, 0xc4, 0x14, 0x2a, 0xbe, 0x52, 0x60, 0x32, + 0x35, 0x83, 0xa8, 0x3c, 0x44, 0xf9, 0x7e, 0xab, 0x40, 0xdd, 0x1e, 0x3d, 0x50, 0x62, 0xaf, 0x08, + 0xec, 0xbf, 0xa3, 0xdf, 0xfa, 0x63, 0x97, 0x5b, 0x83, 0xe3, 0x4e, 0x6f, 0xa3, 0x5c, 0xe2, 0x70, + 0xcf, 0x70, 0xdc, 0x91, 0xdb, 0xe7, 0x12, 0xa7, 0x17, 0x06, 0x7a, 0xa1, 0xc0, 0x74, 0x9f, 0xf1, + 0x46, 0xbb, 0x43, 0xa0, 0x7c, 0x7c, 0x9f, 0xa8, 0x3f, 0x7c, 0x6c, 0xb8, 0xa4, 0xba, 0x23, 0xa8, + 0x6e, 0xa1, 0xd2, 0x80, 0x36, 0x71, 0xdc, 0x11, 0xbf, 0x61, 0x83, 0x70, 0x10, 0x26, 0xab, 0x46, + 0xe4, 0xf6, 0x8e, 0xaf, 0xef, 0x34, 0xe5, 0xe6, 0x4e, 0x53, 0xde, 0xde, 0x69, 0xca, 0x3f, 0xf7, + 0x5a, 0xe6, 0xe6, 0x5e, 0xcb, 0xdc, 0xde, 0x6b, 0x99, 0x3f, 0xca, 0xb6, 0x13, 0xd4, 0x5b, 0x35, + 0xc3, 0x64, 0x4d, 0x2c, 0xff, 0xa8, 0x38, 0x35, 0x73, 0xcd, 0x66, 0xb8, 0xbd, 0x8d, 0x9b, 0xcc, + 0x6a, 0x35, 0x28, 0xff, 0xa0, 0x5c, 0x70, 0xe1, 0x51, 0x5e, 0xcb, 0x8a, 0xbf, 0x19, 0x1b, 0xef, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x97, 0xb6, 0x42, 0x5d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -683,10 +683,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // DenomTrace queries a denomination trace information. - DenomTrace(ctx context.Context, in *QueryDenomTraceRequest, opts ...grpc.CallOption) (*QueryDenomTraceResponse, error) // DenomTraces queries all denomination traces. DenomTraces(ctx context.Context, in *QueryDenomTracesRequest, opts ...grpc.CallOption) (*QueryDenomTracesResponse, error) + // DenomTrace queries a denomination trace information. + DenomTrace(ctx context.Context, in *QueryDenomTraceRequest, opts ...grpc.CallOption) (*QueryDenomTraceResponse, error) // Params queries all parameters of the ibc-transfer module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // DenomHash queries a denomination hash information. @@ -705,18 +705,18 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) DenomTrace(ctx context.Context, in *QueryDenomTraceRequest, opts ...grpc.CallOption) (*QueryDenomTraceResponse, error) { - out := new(QueryDenomTraceResponse) - err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Query/DenomTrace", in, out, opts...) +func (c *queryClient) DenomTraces(ctx context.Context, in *QueryDenomTracesRequest, opts ...grpc.CallOption) (*QueryDenomTracesResponse, error) { + out := new(QueryDenomTracesResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Query/DenomTraces", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) DenomTraces(ctx context.Context, in *QueryDenomTracesRequest, opts ...grpc.CallOption) (*QueryDenomTracesResponse, error) { - out := new(QueryDenomTracesResponse) - err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Query/DenomTraces", in, out, opts...) +func (c *queryClient) DenomTrace(ctx context.Context, in *QueryDenomTraceRequest, opts ...grpc.CallOption) (*QueryDenomTraceResponse, error) { + out := new(QueryDenomTraceResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Query/DenomTrace", in, out, opts...) if err != nil { return nil, err } @@ -761,10 +761,10 @@ func (c *queryClient) TotalEscrowForDenom(ctx context.Context, in *QueryTotalEsc // QueryServer is the server API for Query service. type QueryServer interface { - // DenomTrace queries a denomination trace information. - DenomTrace(context.Context, *QueryDenomTraceRequest) (*QueryDenomTraceResponse, error) // DenomTraces queries all denomination traces. DenomTraces(context.Context, *QueryDenomTracesRequest) (*QueryDenomTracesResponse, error) + // DenomTrace queries a denomination trace information. + DenomTrace(context.Context, *QueryDenomTraceRequest) (*QueryDenomTraceResponse, error) // Params queries all parameters of the ibc-transfer module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // DenomHash queries a denomination hash information. @@ -779,12 +779,12 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) DenomTrace(ctx context.Context, req *QueryDenomTraceRequest) (*QueryDenomTraceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomTrace not implemented") -} func (*UnimplementedQueryServer) DenomTraces(ctx context.Context, req *QueryDenomTracesRequest) (*QueryDenomTracesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomTraces not implemented") } +func (*UnimplementedQueryServer) DenomTrace(ctx context.Context, req *QueryDenomTraceRequest) (*QueryDenomTraceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomTrace not implemented") +} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } @@ -802,38 +802,38 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_DenomTrace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomTraceRequest) +func _Query_DenomTraces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomTracesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).DenomTrace(ctx, in) + return srv.(QueryServer).DenomTraces(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.applications.transfer.v1.Query/DenomTrace", + FullMethod: "/ibc.applications.transfer.v1.Query/DenomTraces", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomTrace(ctx, req.(*QueryDenomTraceRequest)) + return srv.(QueryServer).DenomTraces(ctx, req.(*QueryDenomTracesRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_DenomTraces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomTracesRequest) +func _Query_DenomTrace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomTraceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).DenomTraces(ctx, in) + return srv.(QueryServer).DenomTrace(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.applications.transfer.v1.Query/DenomTraces", + FullMethod: "/ibc.applications.transfer.v1.Query/DenomTrace", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomTraces(ctx, req.(*QueryDenomTracesRequest)) + return srv.(QueryServer).DenomTrace(ctx, req.(*QueryDenomTraceRequest)) } return interceptor(ctx, in, info, handler) } @@ -914,14 +914,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.applications.transfer.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "DenomTrace", - Handler: _Query_DenomTrace_Handler, - }, { MethodName: "DenomTraces", Handler: _Query_DenomTraces_Handler, }, + { + MethodName: "DenomTrace", + Handler: _Query_DenomTrace_Handler, + }, { MethodName: "Params", Handler: _Query_Params_Handler, diff --git a/modules/apps/transfer/types/query.pb.gw.go b/modules/apps/transfer/types/query.pb.gw.go index e7b727dbd50..0bb5025494e 100644 --- a/modules/apps/transfer/types/query.pb.gw.go +++ b/modules/apps/transfer/types/query.pb.gw.go @@ -33,6 +33,42 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +var ( + filter_Query_DenomTraces_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DenomTraces_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomTracesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomTraces_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomTraces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomTraces_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomTracesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomTraces_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomTraces(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_DenomTrace_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDenomTraceRequest var metadata runtime.ServerMetadata @@ -87,42 +123,6 @@ func local_request_Query_DenomTrace_0(ctx context.Context, marshaler runtime.Mar } -var ( - filter_Query_DenomTraces_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_DenomTraces_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomTracesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomTraces_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DenomTraces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DenomTraces_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomTracesRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomTraces_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DenomTraces(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest var metadata runtime.ServerMetadata @@ -331,7 +331,7 @@ func local_request_Query_TotalEscrowForDenom_0(ctx context.Context, marshaler ru // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_DenomTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomTraces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -342,7 +342,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_DenomTrace_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_DenomTraces_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -350,11 +350,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_DenomTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomTraces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_DenomTraces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -365,7 +365,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_DenomTraces_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_DenomTrace_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -373,7 +373,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_DenomTraces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -510,7 +510,7 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_DenomTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomTraces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -519,18 +519,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_DenomTrace_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_DenomTraces_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_DenomTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomTraces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_DenomTraces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -539,14 +539,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_DenomTraces_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_DenomTrace_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_DenomTraces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -634,10 +634,10 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_DenomTrace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 3, 0, 4, 1, 5, 5}, []string{"ibc", "apps", "transfer", "v1", "denom_traces", "hash"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_DenomTraces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "apps", "transfer", "v1", "denom_traces"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DenomTrace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 3, 0, 4, 1, 5, 5}, []string{"ibc", "apps", "transfer", "v1", "denom_traces", "hash"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "apps", "transfer", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DenomHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 3, 0, 4, 1, 5, 5}, []string{"ibc", "apps", "transfer", "v1", "denom_hashes", "trace"}, "", runtime.AssumeColonVerbOpt(false))) @@ -648,10 +648,10 @@ var ( ) var ( - forward_Query_DenomTrace_0 = runtime.ForwardResponseMessage - forward_Query_DenomTraces_0 = runtime.ForwardResponseMessage + forward_Query_DenomTrace_0 = runtime.ForwardResponseMessage + forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_DenomHash_0 = runtime.ForwardResponseMessage diff --git a/modules/apps/transfer/types/tx.pb.go b/modules/apps/transfer/types/tx.pb.go index 14b4b9815d6..3e86ff234e4 100644 --- a/modules/apps/transfer/types/tx.pb.go +++ b/modules/apps/transfer/types/tx.pb.go @@ -130,7 +130,7 @@ var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo // MsgUpdateParams is the Msg/UpdateParams request type. type MsgUpdateParams struct { - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // params defines the transfer parameters to update. // diff --git a/modules/core/02-client/types/params.go b/modules/core/02-client/types/params.go index 2764e83a4d7..dc9b70b5cbc 100644 --- a/modules/core/02-client/types/params.go +++ b/modules/core/02-client/types/params.go @@ -2,9 +2,9 @@ package types import ( "fmt" + "slices" "strings" - "github.com/cosmos/ibc-go/v8/internal/collections" "github.com/cosmos/ibc-go/v8/modules/core/exported" ) @@ -30,7 +30,7 @@ func (p Params) Validate() error { // IsAllowedClient checks if the given client type is registered on the allowlist. func (p Params) IsAllowedClient(clientType string) bool { - return collections.Contains(clientType, p.AllowedClients) + return slices.Contains(p.AllowedClients, clientType) } // validateClients checks that the given clients are not blank. diff --git a/modules/core/02-client/types/tx.pb.go b/modules/core/02-client/types/tx.pb.go index 41954fe8f29..4ddcfb55201 100644 --- a/modules/core/02-client/types/tx.pb.go +++ b/modules/core/02-client/types/tx.pb.go @@ -373,7 +373,7 @@ type MsgRecoverClient struct { // the substitute client identifier for the client which will replace the subject // client SubstituteClientId string `protobuf:"bytes,2,opt,name=substitute_client_id,json=substituteClientId,proto3" json:"substitute_client_id,omitempty"` - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` } @@ -556,7 +556,7 @@ var xxx_messageInfo_MsgIBCSoftwareUpgradeResponse proto.InternalMessageInfo // MsgUpdateParams defines the sdk.Msg type to update the client parameters. type MsgUpdateParams struct { - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // params defines the client parameters to update. // diff --git a/modules/core/03-connection/types/tx.pb.go b/modules/core/03-connection/types/tx.pb.go index 6995dd78a79..afe87287690 100644 --- a/modules/core/03-connection/types/tx.pb.go +++ b/modules/core/03-connection/types/tx.pb.go @@ -380,7 +380,7 @@ var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo // MsgUpdateParams defines the sdk.Msg type to update the connection parameters. type MsgUpdateParams struct { - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // params defines the connection parameters to update. // diff --git a/modules/core/03-connection/types/version.go b/modules/core/03-connection/types/version.go index 9ece332016d..00aadcb8682 100644 --- a/modules/core/03-connection/types/version.go +++ b/modules/core/03-connection/types/version.go @@ -1,11 +1,10 @@ package types import ( + "slices" "strings" errorsmod "cosmossdk.io/errors" - - "github.com/cosmos/ibc-go/v8/internal/collections" ) var ( @@ -86,7 +85,7 @@ func (version Version) VerifyProposedVersion(proposedVersion *Version) error { } for _, proposedFeature := range proposedVersion.GetFeatures() { - if !collections.Contains(proposedFeature, version.GetFeatures()) { + if !slices.Contains(version.GetFeatures(), proposedFeature) { return errorsmod.Wrapf( ErrVersionNegotiationFailed, "proposed feature (%s) is not a supported feature set (%s)", proposedFeature, version.GetFeatures(), @@ -100,7 +99,7 @@ func (version Version) VerifyProposedVersion(proposedVersion *Version) error { // VerifySupportedFeature takes in a version and feature string and returns // true if the feature is supported by the version and false otherwise. func VerifySupportedFeature(version *Version, feature string) bool { - return collections.Contains(feature, version.GetFeatures()) + return slices.Contains(version.GetFeatures(), feature) } // GetCompatibleVersions returns a descending ordered set of compatible IBC @@ -176,7 +175,7 @@ func PickVersion(supportedVersions, counterpartyVersions []*Version) (*Version, // set for the counterparty version. func GetFeatureSetIntersection(sourceFeatureSet, counterpartyFeatureSet []string) (featureSet []string) { for _, feature := range sourceFeatureSet { - if collections.Contains(feature, counterpartyFeatureSet) { + if slices.Contains(counterpartyFeatureSet, feature) { featureSet = append(featureSet, feature) } } diff --git a/modules/core/04-channel/keeper/grpc_query.go b/modules/core/04-channel/keeper/grpc_query.go index 171c88d435f..1802b2f4a1e 100644 --- a/modules/core/04-channel/keeper/grpc_query.go +++ b/modules/core/04-channel/keeper/grpc_query.go @@ -555,26 +555,13 @@ func (k Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequence ctx := sdk.UnwrapSDKContext(c) - channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) + sequence, found := k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, - errorsmod.Wrapf(types.ErrChannelNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), + errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), ) } - - // Return the next sequence send for ordered channels. Unordered channels - // do not make use of the next sequence send. - var sequence uint64 - if channel.Ordering != types.UNORDERED { - sequence, found = k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) - if !found { - return nil, status.Error( - codes.NotFound, - errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), - ) - } - } selfHeight := clienttypes.GetSelfHeight(ctx) return types.NewQueryNextSequenceSendResponse(sequence, nil, selfHeight), nil } diff --git a/modules/core/04-channel/keeper/grpc_query_test.go b/modules/core/04-channel/keeper/grpc_query_test.go index 725b6d1655a..00937161d97 100644 --- a/modules/core/04-channel/keeper/grpc_query_test.go +++ b/modules/core/04-channel/keeper/grpc_query_test.go @@ -1620,12 +1620,14 @@ func (suite *KeeperTestSuite) TestQueryNextSequenceSend() { false, }, { - "basic success on unordered channel returns zero", + "basic success on unordered channel returns the set send sequence", func() { path := ibctesting.NewPath(suite.chainA, suite.chainB) suite.coordinator.Setup(path) - expSeq = 0 + expSeq = 42 + seq := uint64(42) + suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetNextSequenceSend(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, seq) req = &types.QueryNextSequenceSendRequest{ PortId: path.EndpointA.ChannelConfig.PortID, ChannelId: path.EndpointA.ChannelID, diff --git a/modules/core/05-port/keeper/keeper_test.go b/modules/core/05-port/keeper/keeper_test.go index 48438d6f3c2..df2051644f9 100644 --- a/modules/core/05-port/keeper/keeper_test.go +++ b/modules/core/05-port/keeper/keeper_test.go @@ -29,7 +29,7 @@ func (suite *KeeperTestSuite) SetupTest() { app := simapp.Setup(suite.T(), isCheckTx) suite.ctx = app.BaseApp.NewContext(isCheckTx) - suite.keeper = &app.IBCKeeper.PortKeeper + suite.keeper = app.IBCKeeper.PortKeeper } func TestKeeperTestSuite(t *testing.T) { diff --git a/modules/core/keeper/keeper.go b/modules/core/keeper/keeper.go index ca705d5cd2b..cebfb159f54 100644 --- a/modules/core/keeper/keeper.go +++ b/modules/core/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" "reflect" + "strings" storetypes "cosmossdk.io/store/types" @@ -32,7 +33,7 @@ type Keeper struct { ClientKeeper clientkeeper.Keeper ConnectionKeeper connectionkeeper.Keeper ChannelKeeper channelkeeper.Keeper - PortKeeper portkeeper.Keeper + PortKeeper *portkeeper.Keeper Router *porttypes.Router authority string @@ -64,16 +65,21 @@ func NewKeeper( panic(fmt.Errorf("cannot initialize IBC keeper: empty scoped keeper")) } + if strings.TrimSpace(authority) == "" { + panic(fmt.Errorf("authority must be non-empty")) + } + clientKeeper := clientkeeper.NewKeeper(cdc, key, paramSpace, stakingKeeper, upgradeKeeper) connectionKeeper := connectionkeeper.NewKeeper(cdc, key, paramSpace, clientKeeper) portKeeper := portkeeper.NewKeeper(scopedKeeper) - channelKeeper := channelkeeper.NewKeeper(cdc, key, clientKeeper, connectionKeeper, portKeeper, scopedKeeper) + channelKeeper := channelkeeper.NewKeeper(cdc, key, clientKeeper, connectionKeeper, &portKeeper, scopedKeeper) + return &Keeper{ cdc: cdc, ClientKeeper: clientKeeper, ConnectionKeeper: connectionKeeper, ChannelKeeper: channelKeeper, - PortKeeper: portKeeper, + PortKeeper: &portKeeper, authority: authority, } } diff --git a/modules/core/keeper/keeper_test.go b/modules/core/keeper/keeper_test.go index 58e8167fb1c..0cd6b2a5857 100644 --- a/modules/core/keeper/keeper_test.go +++ b/modules/core/keeper/keeper_test.go @@ -64,17 +64,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { stakingKeeper clienttypes.StakingKeeper upgradeKeeper clienttypes.UpgradeKeeper scopedKeeper capabilitykeeper.ScopedKeeper - newIBCKeeperFn = func() { - ibckeeper.NewKeeper( - suite.chainA.GetSimApp().AppCodec(), - suite.chainA.GetSimApp().GetKey(ibcexported.StoreKey), - suite.chainA.GetSimApp().GetSubspace(ibcexported.ModuleName), - stakingKeeper, - upgradeKeeper, - scopedKeeper, - suite.chainA.App.GetIBCKeeper().GetAuthority(), - ) - } + newIBCKeeperFn func() ) testCases := []struct { @@ -113,6 +103,19 @@ func (suite *KeeperTestSuite) TestNewKeeper() { scopedKeeper = emptyScopedKeeper }, false}, + {"failure: empty authority", func() { + newIBCKeeperFn = func() { + ibckeeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(ibcexported.StoreKey), + suite.chainA.GetSimApp().GetSubspace(ibcexported.ModuleName), + stakingKeeper, + upgradeKeeper, + scopedKeeper, + "", // authority + ) + } + }, false}, {"success: replace stakingKeeper with non-empty MockStakingKeeper", func() { // use a different implementation of clienttypes.StakingKeeper mockStakingKeeper := MockStakingKeeper{"not empty"} @@ -126,6 +129,19 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.SetupTest() suite.Run(tc.name, func() { + // set default behaviour + newIBCKeeperFn = func() { + ibckeeper.NewKeeper( + suite.chainA.GetSimApp().AppCodec(), + suite.chainA.GetSimApp().GetKey(ibcexported.StoreKey), + suite.chainA.GetSimApp().GetSubspace(ibcexported.ModuleName), + stakingKeeper, + upgradeKeeper, + scopedKeeper, + suite.chainA.App.GetIBCKeeper().GetAuthority(), + ) + } + stakingKeeper = suite.chainA.GetSimApp().StakingKeeper upgradeKeeper = suite.chainA.GetSimApp().UpgradeKeeper scopedKeeper = suite.chainA.GetSimApp().ScopedIBCKeeper diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index b53b42d8be7..f1830ec787c 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -67,7 +67,7 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 1; // params defines the 27-interchain-accounts/controller parameters to update. diff --git a/proto/ibc/applications/interchain_accounts/host/v1/tx.proto b/proto/ibc/applications/interchain_accounts/host/v1/tx.proto index c6e15ef8b7e..01f327292e9 100644 --- a/proto/ibc/applications/interchain_accounts/host/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/host/v1/tx.proto @@ -22,7 +22,7 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 1; // params defines the 27-interchain-accounts/host parameters to update. diff --git a/proto/ibc/applications/transfer/v1/query.proto b/proto/ibc/applications/transfer/v1/query.proto index 2323ea171c1..788296718fe 100644 --- a/proto/ibc/applications/transfer/v1/query.proto +++ b/proto/ibc/applications/transfer/v1/query.proto @@ -12,16 +12,16 @@ option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; // Query provides defines the gRPC querier service. service Query { - // DenomTrace queries a denomination trace information. - rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash=**}"; - } - // DenomTraces queries all denomination traces. rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; } + // DenomTrace queries a denomination trace information. + rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash=**}"; + } + // Params queries all parameters of the ibc-transfer module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/params"; diff --git a/proto/ibc/applications/transfer/v1/tx.proto b/proto/ibc/applications/transfer/v1/tx.proto index c2ca39977c8..144b95898c5 100644 --- a/proto/ibc/applications/transfer/v1/tx.proto +++ b/proto/ibc/applications/transfer/v1/tx.proto @@ -65,7 +65,7 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 1; // params defines the transfer parameters to update. diff --git a/proto/ibc/core/client/v1/tx.proto b/proto/ibc/core/client/v1/tx.proto index d7f8e2f97a0..ee32db9158a 100644 --- a/proto/ibc/core/client/v1/tx.proto +++ b/proto/ibc/core/client/v1/tx.proto @@ -129,7 +129,7 @@ message MsgRecoverClient { // client string substitute_client_id = 2; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 3; } @@ -149,7 +149,7 @@ message MsgIBCSoftwareUpgrade { // deprecated in the Cosmos SDK to allow for this logic to exist solely in // the 02-client module. google.protobuf.Any upgraded_client_state = 2; - // signer defaults to the governance account address unless otherwise specified. + // signer address string signer = 3; } @@ -162,7 +162,7 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 1; // params defines the client parameters to update. diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto index d5465d8709a..252153b38b1 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -133,7 +133,7 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; - // signer address (it may be the the address that controls the module, which defaults to x/gov unless overwritten). + // signer address string signer = 1; // params defines the connection parameters to update. diff --git a/testing/events.go b/testing/events.go index 58607080a21..9ccfaea96fa 100644 --- a/testing/events.go +++ b/testing/events.go @@ -2,13 +2,13 @@ package ibctesting import ( "fmt" + "slices" "strconv" testifysuite "github.com/stretchr/testify/suite" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/ibc-go/v8/internal/collections" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" @@ -185,7 +185,7 @@ func AssertEvents( for _, expectedAttr := range expectedEvent.Attributes { // any expected attributes that are not contained in the actual events will cause this event // not to match - attributeMatch = attributeMatch && collections.Contains(expectedAttr, actualEvent.Attributes) + attributeMatch = attributeMatch && slices.Contains(actualEvent.Attributes, expectedAttr) } if attributeMatch { diff --git a/testing/simapp/app.go b/testing/simapp/app.go index f25530e0d4b..6c9d07c5699 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -469,14 +469,14 @@ func NewSimApp( appCodec, keys[ibcfeetypes.StoreKey], app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, - &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, + app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, ) // ICA Controller keeper app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -485,7 +485,7 @@ func NewSimApp( app.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -500,7 +500,7 @@ func NewSimApp( app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -510,7 +510,7 @@ func NewSimApp( // Mock Module setup for testing IBC and also acts as the interchain accounts authentication module // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do // not replicate if you do not need to test core IBC or light clients. - mockModule := ibcmock.NewAppModule(&app.IBCKeeper.PortKeeper) + mockModule := ibcmock.NewAppModule(app.IBCKeeper.PortKeeper) // The mock module is used for testing IBC mockIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewIBCApp(ibcmock.ModuleName, scopedIBCMockKeeper)) @@ -657,7 +657,6 @@ func NewSimApp( // NOTE: staking module is required if HistoricalEntries param > 0 // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) app.ModuleManager.SetOrderBeginBlockers( - upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName,