diff --git a/app/keepers.go b/app/keepers.go index 2b9803afa..ee465ab03 100644 --- a/app/keepers.go +++ b/app/keepers.go @@ -2,8 +2,6 @@ package app import ( "fmt" - wasmvmtypes "github.com/CosmWasm/wasmvm/types" - "github.com/axelarnetwork/axelar-core/x/ante" "reflect" "strings" @@ -168,8 +166,10 @@ func initWasmKeeper(encodingConfig axelarParams.EncodingConfig, keys map[string] // if we want to allow any custom callbacks wasmOpts = append(wasmOpts, wasmkeeper.WithMessageHandlerDecorator( func(old wasmkeeper.Messenger) wasmkeeper.Messenger { - return withAnteChecks( - wasm.DefaultEncoders(), // todo add custom encoder + encoders := wasm.DefaultEncoders(encodingConfig.Codec, getKeeper[ibctransferkeeper.Keeper](keepers)) + encoders.Custom = nexusKeeper.EncodeRoutingMessage + return withAnteHandlers( + encoders, initMessageAnteDecorators(encodingConfig, keepers), wasmkeeper.NewMessageHandlerChain(old, nexusKeeper.NewMessenger(getKeeper[nexusKeeper.Keeper](keepers)))) })) @@ -200,33 +200,6 @@ func initWasmKeeper(encodingConfig axelarParams.EncodingConfig, keys map[string] return &wasmK } -type Messenger struct { - anteHandle ante.MessageAnteHandler - encoders wasm.MessageEncoders - messenger wasmkeeper.Messenger -} - -func (m Messenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { - sdkMsgs, err := m.encoders.Encode(ctx, contractAddr, contractIBCPortID, msg) - if err != nil { - return nil, nil, err - } - ctx, err = m.anteHandle(ctx, sdkMsgs, false) //todo: how do I get the simulate boolean? - if err != nil { - return nil, nil, err - } - - return m.messenger.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) -} - -func withAnteChecks(encoders wasmkeeper.MessageEncoders, anteHandler ante.MessageAnteHandler, messenger wasmkeeper.Messenger) wasmkeeper.Messenger { - return Messenger{ - encoders: encoders, - anteHandle: anteHandler, - messenger: messenger, - } -} - func initGovernanceKeeper(appCodec codec.Codec, keys map[string]*sdk.KVStoreKey, keepers *keeperCache) *govkeeper.Keeper { // Add governance proposal hooks govRouter := govtypes.NewRouter() diff --git a/app/wasm.go b/app/wasm.go new file mode 100644 index 000000000..aec504cb3 --- /dev/null +++ b/app/wasm.go @@ -0,0 +1,38 @@ +package app + +import ( + "github.com/CosmWasm/wasmd/x/wasm" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + "github.com/axelarnetwork/axelar-core/x/ante" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type AnteHandlerMessenger struct { + anteHandle ante.MessageAnteHandler + encoders wasm.MessageEncoders + messenger wasmkeeper.Messenger +} + +func (m AnteHandlerMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { + sdkMsgs, err := m.encoders.Encode(ctx, contractAddr, contractIBCPortID, msg) + if err != nil { + return nil, nil, err + } + + // we can't know if this is a simulation or not at this stage, so we treat it as a regular execution + ctx, err = m.anteHandle(ctx, sdkMsgs, false) + if err != nil { + return nil, nil, err + } + + return m.messenger.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) +} + +func withAnteHandlers(encoders wasmkeeper.MessageEncoders, anteHandler ante.MessageAnteHandler, messenger wasmkeeper.Messenger) wasmkeeper.Messenger { + return AnteHandlerMessenger{ + encoders: encoders, + anteHandle: anteHandler, + messenger: messenger, + } +} diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 1f7b79e6d..0bf73eefd 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1343,6 +1343,7 @@ TransferFee represents accumulated fees generated by the network | `payload_hash` | [bytes](#bytes) | | | | `source_tx_id` | [bytes](#bytes) | | | | `source_tx_index` | [uint64](#uint64) | | | +| `sender` | [bytes](#bytes) | | | diff --git a/proto/axelar/nexus/exported/v1beta1/types.proto b/proto/axelar/nexus/exported/v1beta1/types.proto index d787f748b..d49a44d13 100644 --- a/proto/axelar/nexus/exported/v1beta1/types.proto +++ b/proto/axelar/nexus/exported/v1beta1/types.proto @@ -118,4 +118,6 @@ message WasmMessage { bytes payload_hash = 5; bytes source_tx_id = 6 [ (gogoproto.customname) = "SourceTxID" ]; uint64 source_tx_index = 7; + bytes sender = 8 [ (gogoproto.casttype) = + "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; } diff --git a/third_party/proto/cosmwasm/wasm/v1/authz.proto b/third_party/proto/cosmwasm/wasm/v1/authz.proto index 96ecbfb38..97a82275d 100644 --- a/third_party/proto/cosmwasm/wasm/v1/authz.proto +++ b/third_party/proto/cosmwasm/wasm/v1/authz.proto @@ -12,7 +12,8 @@ option (gogoproto.goproto_getters_all) = false; // ContractExecutionAuthorization defines authorization for wasm execute. // Since: wasmd 0.30 message ContractExecutionAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = + "cosmos.authz.v1beta1.Authorization"; // Grants for contract executions repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; @@ -21,7 +22,8 @@ message ContractExecutionAuthorization { // ContractMigrationAuthorization defines authorization for wasm contract // migration. Since: wasmd 0.30 message ContractMigrationAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = + "cosmos.authz.v1beta1.Authorization"; // Grants for contract migrations repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; @@ -35,20 +37,22 @@ message ContractGrant { // Limit defines execution limits that are enforced and updated when the grant // is applied. When the limit lapsed the grant is removed. - google.protobuf.Any limit = 2 - [ (cosmos_proto.accepts_interface) = "ContractAuthzLimitX" ]; + google.protobuf.Any limit = 2 [ (cosmos_proto.accepts_interface) = + "cosmwasm.wasm.v1.ContractAuthzLimitX" ]; // Filter define more fine-grained control on the message payload passed // to the contract in the operation. When no filter applies on execution, the // operation is prohibited. google.protobuf.Any filter = 3 - [ (cosmos_proto.accepts_interface) = "ContractAuthzFilterX" ]; + [ (cosmos_proto.accepts_interface) = + "cosmwasm.wasm.v1.ContractAuthzFilterX" ]; } // MaxCallsLimit limited number of calls to the contract. No funds transferable. // Since: wasmd 0.30 message MaxCallsLimit { - option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzLimitX"; // Remaining number that is decremented on each execution uint64 remaining = 1; @@ -57,7 +61,8 @@ message MaxCallsLimit { // MaxFundsLimit defines the maximal amounts that can be sent to the contract. // Since: wasmd 0.30 message MaxFundsLimit { - option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzLimitX"; // Amounts is the maximal amount of tokens transferable to the contract. repeated cosmos.base.v1beta1.Coin amounts = 1 [ @@ -70,7 +75,8 @@ message MaxFundsLimit { // the maximal number of calls executable. Both need to remain >0 to be valid. // Since: wasmd 0.30 message CombinedLimit { - option (cosmos_proto.implements_interface) = "ContractAuthzLimitX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzLimitX"; // Remaining number that is decremented on each execution uint64 calls_remaining = 1; @@ -85,14 +91,16 @@ message CombinedLimit { // message. // Since: wasmd 0.30 message AllowAllMessagesFilter { - option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzFilterX"; } // AcceptedMessageKeysFilter accept only the specific contract message keys in // the json object to be executed. // Since: wasmd 0.30 message AcceptedMessageKeysFilter { - option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzFilterX"; // Messages is the list of unique keys repeated string keys = 1; @@ -102,7 +110,8 @@ message AcceptedMessageKeysFilter { // executed. // Since: wasmd 0.30 message AcceptedMessagesFilter { - option (cosmos_proto.implements_interface) = "ContractAuthzFilterX"; + option (cosmos_proto.implements_interface) = + "cosmwasm.wasm.v1.ContractAuthzFilterX"; // Messages is the list of raw contract messages repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; diff --git a/third_party/proto/cosmwasm/wasm/v1/genesis.proto b/third_party/proto/cosmwasm/wasm/v1/genesis.proto index b7622c206..4e728ff4b 100644 --- a/third_party/proto/cosmwasm/wasm/v1/genesis.proto +++ b/third_party/proto/cosmwasm/wasm/v1/genesis.proto @@ -3,7 +3,6 @@ package cosmwasm.wasm.v1; import "gogoproto/gogo.proto"; import "cosmwasm/wasm/v1/types.proto"; -import "cosmwasm/wasm/v1/tx.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; @@ -20,23 +19,6 @@ message GenesisState { (gogoproto.nullable) = false, (gogoproto.jsontag) = "sequences,omitempty" ]; - repeated GenMsgs gen_msgs = 5 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "gen_msgs,omitempty" - ]; - - // GenMsgs define the messages that can be executed during genesis phase in - // order. The intention is to have more human readable data that is auditable. - message GenMsgs { - // sum is a single message - oneof sum { - MsgStoreCode store_code = 1; - MsgInstantiateContract instantiate_contract = 2; - MsgExecuteContract execute_contract = 3; - // MsgInstantiateContract2 intentionally not supported - // see https://github.com/CosmWasm/wasmd/issues/987 - } - } } // Code struct encompasses CodeInfo and CodeBytes diff --git a/third_party/proto/cosmwasm/wasm/v1/ibc.proto b/third_party/proto/cosmwasm/wasm/v1/ibc.proto index d880a7078..feaad2936 100644 --- a/third_party/proto/cosmwasm/wasm/v1/ibc.proto +++ b/third_party/proto/cosmwasm/wasm/v1/ibc.proto @@ -25,6 +25,12 @@ message MsgIBCSend { bytes data = 6; } +// MsgIBCSendResponse +message MsgIBCSendResponse { + // Sequence number of the IBC packet sent + uint64 sequence = 1; +} + // MsgIBCCloseChannel port and channel need to be owned by the contract message MsgIBCCloseChannel { string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; diff --git a/third_party/proto/cosmwasm/wasm/v1/proposal.proto b/third_party/proto/cosmwasm/wasm/v1/proposal.proto index b8a143b67..b1c484bc9 100644 --- a/third_party/proto/cosmwasm/wasm/v1/proposal.proto +++ b/third_party/proto/cosmwasm/wasm/v1/proposal.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmwasm.wasm.v1; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmwasm/wasm/v1/types.proto"; @@ -12,6 +13,8 @@ option (gogoproto.equal_all) = true; // StoreCodeProposal gov proposal content type to submit WASM code to the system message StoreCodeProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -39,6 +42,8 @@ message StoreCodeProposal { // InstantiateContractProposal gov proposal content type to instantiate a // contract. message InstantiateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -60,8 +65,41 @@ message InstantiateContractProposal { ]; } +// InstantiateContract2Proposal gov proposal content type to instantiate +// contract 2 +message InstantiateContract2Proposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's enviroment as sender + string run_as = 3; + // Admin is an optional address that can execute migrations + string admin = 4; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encode message to be passed to the contract on instantiation + bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 9; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 10; +} + // MigrateContractProposal gov proposal content type to migrate a contract. message MigrateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -78,6 +116,8 @@ message MigrateContractProposal { // SudoContractProposal gov proposal content type to call sudo on a contract. message SudoContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -91,6 +131,8 @@ message SudoContractProposal { // ExecuteContractProposal gov proposal content type to call execute on a // contract. message ExecuteContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -110,6 +152,8 @@ message ExecuteContractProposal { // UpdateAdminProposal gov proposal content type to set an admin for a contract. message UpdateAdminProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -123,6 +167,8 @@ message UpdateAdminProposal { // ClearAdminProposal gov proposal content type to clear the admin of a // contract. message ClearAdminProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text @@ -134,6 +180,8 @@ message ClearAdminProposal { // PinCodesProposal gov proposal content type to pin a set of code ids in the // wasmvm cache. message PinCodesProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; // Description is a human readable text @@ -148,6 +196,8 @@ message PinCodesProposal { // UnpinCodesProposal gov proposal content type to unpin a set of code ids in // the wasmvm cache. message UnpinCodesProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; // Description is a human readable text @@ -171,6 +221,8 @@ message AccessConfigUpdate { // UpdateInstantiateConfigProposal gov proposal content type to update // instantiate config to a set of code ids. message UpdateInstantiateConfigProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; // Description is a human readable text @@ -184,6 +236,8 @@ message UpdateInstantiateConfigProposal { // StoreAndInstantiateContractProposal gov proposal content type to store // and instantiate the contract. message StoreAndInstantiateContractProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // Title is a short summary string title = 1; // Description is a human readable text diff --git a/third_party/proto/cosmwasm/wasm/v1/tx.proto b/third_party/proto/cosmwasm/wasm/v1/tx.proto index 04acc8ef7..741fbc494 100644 --- a/third_party/proto/cosmwasm/wasm/v1/tx.proto +++ b/third_party/proto/cosmwasm/wasm/v1/tx.proto @@ -28,11 +28,14 @@ service Msg { rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); // ClearAdmin removes any admin stored for a smart contract rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); + // UpdateInstantiateConfig updates instantiate config for a smart contract + rpc UpdateInstantiateConfig(MsgUpdateInstantiateConfig) + returns (MsgUpdateInstantiateConfigResponse); } // MsgStoreCode submit Wasm code to the system message MsgStoreCode { - // Sender is the that actor that signed the messages + // Sender is the actor that signed the messages string sender = 1; // WASMByteCode can be raw or gzip compressed bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; @@ -166,7 +169,7 @@ message MsgUpdateAdminResponse {} // MsgClearAdmin removes any admin stored for a smart contract message MsgClearAdmin { - // Sender is the that actor that signed the messages + // Sender is the actor that signed the messages string sender = 1; // Contract is the address of the smart contract string contract = 3; @@ -174,3 +177,16 @@ message MsgClearAdmin { // MsgClearAdminResponse returns empty data message MsgClearAdminResponse {} + +// MsgUpdateInstantiateConfig updates instantiate config for a smart contract +message MsgUpdateInstantiateConfig { + // Sender is the that actor that signed the messages + string sender = 1; + // CodeID references the stored WASM code + uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; + // NewInstantiatePermission is the new access control + AccessConfig new_instantiate_permission = 3; +} + +// MsgUpdateInstantiateConfigResponse returns empty data +message MsgUpdateInstantiateConfigResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmwasm/wasm/v1/types.proto b/third_party/proto/cosmwasm/wasm/v1/types.proto index 216b24e3b..b68179e2e 100644 --- a/third_party/proto/cosmwasm/wasm/v1/types.proto +++ b/third_party/proto/cosmwasm/wasm/v1/types.proto @@ -90,7 +90,8 @@ message ContractInfo { // Extension is an extension point to store custom metadata within the // persistence model. google.protobuf.Any extension = 7 - [ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ]; + [ (cosmos_proto.accepts_interface) = + "cosmwasm.wasm.v1.ContractInfoExtension" ]; } // ContractCodeHistoryOperationType actions that caused a code change diff --git a/x/ante/ante.go b/x/ante/ante.go index fe892651e..e3a3187f3 100644 --- a/x/ante/ante.go +++ b/x/ante/ante.go @@ -32,19 +32,31 @@ func (decorator HandlerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat return next(newCtx, tx, simulate) } +// MessageAnteHandler is analogous to the sdk's AnteHandler, but works on messages instead of the full Tx type MessageAnteHandler func(ctx sdk.Context, msgs []sdk.Msg, simulate bool) (sdk.Context, error) + +// ToAnteHandler converts a MessageAnteHandler to an AnteHandler +func (m MessageAnteHandler) ToAnteHandler() sdk.AnteHandler { + return func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { + msgs := tx.GetMsgs() + return m(ctx, msgs, simulate) + } +} + +// MessageAnteDecorator is analogous to the sdk's AnteDecorator, but works on messages instead of the full Tx type MessageAnteDecorator interface { AnteHandle(ctx sdk.Context, msgs []sdk.Msg, simulate bool, next MessageAnteHandler) (sdk.Context, error) } +// ChainMessageAnteDecorators combines multiple MessageAnteDecorators into a single MessageAnteHandler func ChainMessageAnteDecorators(chain ...MessageAnteDecorator) MessageAnteHandler { if len(chain) == 0 { return nil } // handle non-terminated decorators chain - if (chain[len(chain)-1] != Terminator{}) { - chain = append(chain, Terminator{}) + if (chain[len(chain)-1] != terminator{}) { + chain = append(chain, terminator{}) } return func(ctx sdk.Context, msgs []sdk.Msg, simulate bool) (sdk.Context, error) { @@ -52,15 +64,9 @@ func ChainMessageAnteDecorators(chain ...MessageAnteDecorator) MessageAnteHandle } } -type Terminator struct{} +type terminator struct{} -func (Terminator) AnteHandle(ctx sdk.Context, _ []sdk.Msg, _ bool, _ MessageAnteHandler) (sdk.Context, error) { +// AnteHandle implements MessageAnteDecorator +func (terminator) AnteHandle(ctx sdk.Context, _ []sdk.Msg, _ bool, _ MessageAnteHandler) (sdk.Context, error) { return ctx, nil } - -func (m MessageAnteHandler) ToAnteHandler() sdk.AnteHandler { - return func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { - msgs := tx.GetMsgs() - return m(ctx, msgs, simulate) - } -} diff --git a/x/nexus/exported/types.go b/x/nexus/exported/types.go index 95e5b840d..e21e47d2f 100644 --- a/x/nexus/exported/types.go +++ b/x/nexus/exported/types.go @@ -349,3 +349,15 @@ func FromGeneralMessage(msg GeneralMessage) WasmMessage { SourceTxIndex: msg.SourceTxIndex, } } + +var _ sdk.Msg = &WasmMessage{} + +// ValidateBasic implements sdk.Msg +func (m WasmMessage) ValidateBasic() error { + return nil +} + +// GetSigners implements sdk.Msg +func (m WasmMessage) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.Sender} +} diff --git a/x/nexus/exported/types.pb.go b/x/nexus/exported/types.pb.go index 38118cf33..71b37d534 100644 --- a/x/nexus/exported/types.pb.go +++ b/x/nexus/exported/types.pb.go @@ -403,13 +403,14 @@ func (m *GeneralMessage) XXX_DiscardUnknown() { var xxx_messageInfo_GeneralMessage proto.InternalMessageInfo type WasmMessage struct { - SourceChain ChainName `protobuf:"bytes,1,opt,name=source_chain,json=sourceChain,proto3,casttype=ChainName" json:"source_chain,omitempty"` - SourceAddress string `protobuf:"bytes,2,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` - DestinationChain ChainName `protobuf:"bytes,3,opt,name=destination_chain,json=destinationChain,proto3,casttype=ChainName" json:"destination_chain,omitempty"` - DestinationAddress string `protobuf:"bytes,4,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` - PayloadHash []byte `protobuf:"bytes,5,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` - SourceTxID []byte `protobuf:"bytes,6,opt,name=source_tx_id,json=sourceTxId,proto3" json:"source_tx_id,omitempty"` - SourceTxIndex uint64 `protobuf:"varint,7,opt,name=source_tx_index,json=sourceTxIndex,proto3" json:"source_tx_index,omitempty"` + SourceChain ChainName `protobuf:"bytes,1,opt,name=source_chain,json=sourceChain,proto3,casttype=ChainName" json:"source_chain,omitempty"` + SourceAddress string `protobuf:"bytes,2,opt,name=source_address,json=sourceAddress,proto3" json:"source_address,omitempty"` + DestinationChain ChainName `protobuf:"bytes,3,opt,name=destination_chain,json=destinationChain,proto3,casttype=ChainName" json:"destination_chain,omitempty"` + DestinationAddress string `protobuf:"bytes,4,opt,name=destination_address,json=destinationAddress,proto3" json:"destination_address,omitempty"` + PayloadHash []byte `protobuf:"bytes,5,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` + SourceTxID []byte `protobuf:"bytes,6,opt,name=source_tx_id,json=sourceTxId,proto3" json:"source_tx_id,omitempty"` + SourceTxIndex uint64 `protobuf:"varint,7,opt,name=source_tx_index,json=sourceTxIndex,proto3" json:"source_tx_index,omitempty"` + Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,8,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"` } func (m *WasmMessage) Reset() { *m = WasmMessage{} } @@ -464,85 +465,86 @@ func init() { } var fileDescriptor_82a7a8692925fe67 = []byte{ - // 1237 bytes of a gzipped FileDescriptorProto + // 1259 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x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 0x9b, 0x0e, 0x79, 0xb9, 0xa7, + 0xc3, 0x9b, 0xdd, 0xce, 0x56, 0x53, 0x2e, 0x99, 0x80, 0x37, 0xc7, 0xfe, 0x80, 0xba, 0x64, 0x90, + 0x8d, 0xf2, 0x94, 0x37, 0xdb, 0x4f, 0xfe, 0xc9, 0x85, 0x9e, 0x1c, 0xe5, 0xb4, 0xa7, 0x47, 0x39, + 0xed, 0xef, 0xa3, 0x9c, 0xf6, 0xcd, 0xb3, 0x5c, 0xe8, 0xe9, 0xb3, 0x5c, 0xe8, 0x8f, 0x67, 0xb9, + 0xd0, 0x17, 0xf7, 0xe6, 0x66, 0x2a, 0xef, 0x35, 0x02, 0xfe, 0x97, 0xd4, 0xdb, 0x55, 0x6f, 0x1b, + 0x36, 0xf5, 0xa0, 0x3c, 0x59, 0xf8, 0x03, 0xbb, 0x1d, 0x17, 0xff, 0x1a, 0xef, 0xfe, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0xdd, 0xe9, 0x7c, 0x51, 0xe0, 0x0a, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { @@ -940,6 +942,13 @@ func (m *WasmMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x42 + } if m.SourceTxIndex != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.SourceTxIndex)) i-- @@ -1180,6 +1189,10 @@ func (m *WasmMessage) Size() (n int) { if m.SourceTxIndex != 0 { n += 1 + sovTypes(uint64(m.SourceTxIndex)) } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -2544,6 +2557,40 @@ func (m *WasmMessage) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = append(m.Sender[:0], dAtA[iNdEx:postIndex]...) + if m.Sender == nil { + m.Sender = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/x/nexus/keeper/msg_dispatcher.go b/x/nexus/keeper/msg_dispatcher.go index bd07fb369..25731cefe 100644 --- a/x/nexus/keeper/msg_dispatcher.go +++ b/x/nexus/keeper/msg_dispatcher.go @@ -30,9 +30,9 @@ func NewMessenger(nexus types.Nexus) Messenger { // DispatchMsg decodes the messages from the cosmowasm gateway and routes them to the nexus module if possible func (m Messenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { - req := exported.WasmMessage{} - if err := json.Unmarshal(msg.Custom, &req); err != nil { - return nil, nil, sdkerrors.Wrap(wasmtypes.ErrUnknownMsg, err.Error()) + req, err := encodeRoutingMessage(contractAddr, msg.Custom) + if err != nil { + return nil, nil, err } gateway := m.GetParams(ctx).Gateway @@ -77,3 +77,23 @@ func (m Messenger) routeMsg(ctx sdk.Context, msg exported.WasmMessage) error { return nil } + +// EncodeRoutingMessage encodes the message from the wasm contract into a sdk.Msg +func EncodeRoutingMessage(sender sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error) { + req, err := encodeRoutingMessage(sender, msg) + if err != nil { + return nil, err + } + + return []sdk.Msg{&req}, nil +} + +func encodeRoutingMessage(sender sdk.AccAddress, msg json.RawMessage) (exported.WasmMessage, error) { + req := exported.WasmMessage{} + if err := json.Unmarshal(msg, &req); err != nil { + return exported.WasmMessage{}, sdkerrors.Wrap(wasmtypes.ErrUnknownMsg, err.Error()) + } + + req.Sender = sender + return req, nil +}