diff --git a/proto/cosmos/accesscontrol/accesscontrol.proto b/proto/cosmos/accesscontrol/accesscontrol.proto index 99a83abec..6cfbc6467 100644 --- a/proto/cosmos/accesscontrol/accesscontrol.proto +++ b/proto/cosmos/accesscontrol/accesscontrol.proto @@ -18,6 +18,18 @@ message WasmAccessOperation { string selector = 3; } +message WasmContractReference { + string contract_address = 1; + WasmMessageSubtype message_type = 2; + string message_name = 3; + // TODO: add wasm message adapter format here +} + +message WasmContractReferences { + string message_name = 1; + repeated WasmContractReference contract_references = 2; +} + message WasmAccessOperations { string message_name = 1; repeated WasmAccessOperation wasm_operations = 2; @@ -35,6 +47,9 @@ message WasmDependencyMapping { repeated WasmAccessOperation base_access_ops = 1; repeated WasmAccessOperations query_access_ops = 2; repeated WasmAccessOperations execute_access_ops = 3; - string reset_reason = 4; - string contract_address = 5; + repeated WasmContractReference base_contract_references = 4; + repeated WasmContractReferences query_contract_references = 5; + repeated WasmContractReferences execute_contract_references = 6; + string reset_reason = 7; + string contract_address = 8; } diff --git a/snapshots/types/snapshot.pb.go b/snapshots/types/snapshot.pb.go index c7e427343..801a38262 100644 --- a/snapshots/types/snapshot.pb.go +++ b/snapshots/types/snapshot.pb.go @@ -150,6 +150,7 @@ type SnapshotItem struct { // item is the specific type of snapshot item. // // Types that are valid to be assigned to Item: + // // *SnapshotItem_Store // *SnapshotItem_IAVL // *SnapshotItem_Extension diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index eb4abf1ff..0e2da76d8 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -715,6 +715,7 @@ type Customer3 struct { Surcharge float32 `protobuf:"fixed32,4,opt,name=surcharge,proto3" json:"surcharge,omitempty"` Destination string `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"` // Types that are valid to be assigned to Payment: + // // *Customer3_CreditCardNo // *Customer3_ChequeNo Payment isCustomer3_Payment `protobuf_oneof:"payment"` @@ -848,6 +849,7 @@ type TestVersion1 struct { C []*TestVersion1 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []TestVersion1 `protobuf:"bytes,5,rep,name=d,proto3" json:"d"` // Types that are valid to be assigned to Sum: + // // *TestVersion1_E // *TestVersion1_F Sum isTestVersion1_Sum `protobuf_oneof:"sum"` @@ -992,6 +994,7 @@ type TestVersion2 struct { C []*TestVersion2 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion2 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion2_E // *TestVersion2_F Sum isTestVersion2_Sum `protobuf_oneof:"sum"` @@ -1144,6 +1147,7 @@ type TestVersion3 struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3_E // *TestVersion3_F Sum isTestVersion3_Sum `protobuf_oneof:"sum"` @@ -1296,6 +1300,7 @@ type TestVersion3LoneOneOfValue struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3LoneOneOfValue_E Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -1435,6 +1440,7 @@ type TestVersion3LoneNesting struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion3LoneNesting_F Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -1822,6 +1828,7 @@ type TestVersion4LoneNesting struct { C []*TestVersion3 `protobuf:"bytes,4,rep,name=c,proto3" json:"c,omitempty"` D []*TestVersion3 `protobuf:"bytes,5,rep,name=d,proto3" json:"d,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersion4LoneNesting_F Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"` G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` @@ -2206,6 +2213,7 @@ type TestVersionFD1 struct { X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersionFD1_E // *TestVersionFD1_F Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"` @@ -2323,6 +2331,7 @@ type TestVersionFD1WithExtraAny struct { X int64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` A *TestVersion1 `protobuf:"bytes,2,opt,name=a,proto3" json:"a,omitempty"` // Types that are valid to be assigned to Sum: + // // *TestVersionFD1WithExtraAny_E // *TestVersionFD1WithExtraAny_F Sum isTestVersionFD1WithExtraAny_Sum `protobuf_oneof:"sum"` diff --git a/types/accesscontrol/accesscontrol.pb.go b/types/accesscontrol/accesscontrol.pb.go index f03a1fcf9..03a3215a6 100644 --- a/types/accesscontrol/accesscontrol.pb.go +++ b/types/accesscontrol/accesscontrol.pb.go @@ -143,6 +143,118 @@ func (m *WasmAccessOperation) GetSelector() string { return "" } +type WasmContractReference struct { + ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + MessageType WasmMessageSubtype `protobuf:"varint,2,opt,name=message_type,json=messageType,proto3,enum=cosmos.accesscontrol.v1beta1.WasmMessageSubtype" json:"message_type,omitempty"` + MessageName string `protobuf:"bytes,3,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` +} + +func (m *WasmContractReference) Reset() { *m = WasmContractReference{} } +func (m *WasmContractReference) String() string { return proto.CompactTextString(m) } +func (*WasmContractReference) ProtoMessage() {} +func (*WasmContractReference) Descriptor() ([]byte, []int) { + return fileDescriptor_d636a082612ba091, []int{2} +} +func (m *WasmContractReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WasmContractReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WasmContractReference.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WasmContractReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_WasmContractReference.Merge(m, src) +} +func (m *WasmContractReference) XXX_Size() int { + return m.Size() +} +func (m *WasmContractReference) XXX_DiscardUnknown() { + xxx_messageInfo_WasmContractReference.DiscardUnknown(m) +} + +var xxx_messageInfo_WasmContractReference proto.InternalMessageInfo + +func (m *WasmContractReference) GetContractAddress() string { + if m != nil { + return m.ContractAddress + } + return "" +} + +func (m *WasmContractReference) GetMessageType() WasmMessageSubtype { + if m != nil { + return m.MessageType + } + return WasmMessageSubtype_QUERY +} + +func (m *WasmContractReference) GetMessageName() string { + if m != nil { + return m.MessageName + } + return "" +} + +type WasmContractReferences struct { + MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` + ContractReferences []*WasmContractReference `protobuf:"bytes,2,rep,name=contract_references,json=contractReferences,proto3" json:"contract_references,omitempty"` +} + +func (m *WasmContractReferences) Reset() { *m = WasmContractReferences{} } +func (m *WasmContractReferences) String() string { return proto.CompactTextString(m) } +func (*WasmContractReferences) ProtoMessage() {} +func (*WasmContractReferences) Descriptor() ([]byte, []int) { + return fileDescriptor_d636a082612ba091, []int{3} +} +func (m *WasmContractReferences) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WasmContractReferences) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WasmContractReferences.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WasmContractReferences) XXX_Merge(src proto.Message) { + xxx_messageInfo_WasmContractReferences.Merge(m, src) +} +func (m *WasmContractReferences) XXX_Size() int { + return m.Size() +} +func (m *WasmContractReferences) XXX_DiscardUnknown() { + xxx_messageInfo_WasmContractReferences.DiscardUnknown(m) +} + +var xxx_messageInfo_WasmContractReferences proto.InternalMessageInfo + +func (m *WasmContractReferences) GetMessageName() string { + if m != nil { + return m.MessageName + } + return "" +} + +func (m *WasmContractReferences) GetContractReferences() []*WasmContractReference { + if m != nil { + return m.ContractReferences + } + return nil +} + type WasmAccessOperations struct { MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` WasmOperations []*WasmAccessOperation `protobuf:"bytes,2,rep,name=wasm_operations,json=wasmOperations,proto3" json:"wasm_operations,omitempty"` @@ -152,7 +264,7 @@ func (m *WasmAccessOperations) Reset() { *m = WasmAccessOperations{} } func (m *WasmAccessOperations) String() string { return proto.CompactTextString(m) } func (*WasmAccessOperations) ProtoMessage() {} func (*WasmAccessOperations) Descriptor() ([]byte, []int) { - return fileDescriptor_d636a082612ba091, []int{2} + return fileDescriptor_d636a082612ba091, []int{4} } func (m *WasmAccessOperations) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,7 +317,7 @@ func (m *MessageDependencyMapping) Reset() { *m = MessageDependencyMappi func (m *MessageDependencyMapping) String() string { return proto.CompactTextString(m) } func (*MessageDependencyMapping) ProtoMessage() {} func (*MessageDependencyMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_d636a082612ba091, []int{3} + return fileDescriptor_d636a082612ba091, []int{5} } func (m *MessageDependencyMapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -256,18 +368,21 @@ func (m *MessageDependencyMapping) GetDynamicEnabled() bool { } type WasmDependencyMapping struct { - BaseAccessOps []*WasmAccessOperation `protobuf:"bytes,1,rep,name=base_access_ops,json=baseAccessOps,proto3" json:"base_access_ops,omitempty"` - QueryAccessOps []*WasmAccessOperations `protobuf:"bytes,2,rep,name=query_access_ops,json=queryAccessOps,proto3" json:"query_access_ops,omitempty"` - ExecuteAccessOps []*WasmAccessOperations `protobuf:"bytes,3,rep,name=execute_access_ops,json=executeAccessOps,proto3" json:"execute_access_ops,omitempty"` - ResetReason string `protobuf:"bytes,4,opt,name=reset_reason,json=resetReason,proto3" json:"reset_reason,omitempty"` - ContractAddress string `protobuf:"bytes,5,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + BaseAccessOps []*WasmAccessOperation `protobuf:"bytes,1,rep,name=base_access_ops,json=baseAccessOps,proto3" json:"base_access_ops,omitempty"` + QueryAccessOps []*WasmAccessOperations `protobuf:"bytes,2,rep,name=query_access_ops,json=queryAccessOps,proto3" json:"query_access_ops,omitempty"` + ExecuteAccessOps []*WasmAccessOperations `protobuf:"bytes,3,rep,name=execute_access_ops,json=executeAccessOps,proto3" json:"execute_access_ops,omitempty"` + BaseContractReferences []*WasmContractReference `protobuf:"bytes,4,rep,name=base_contract_references,json=baseContractReferences,proto3" json:"base_contract_references,omitempty"` + QueryContractReferences []*WasmContractReferences `protobuf:"bytes,5,rep,name=query_contract_references,json=queryContractReferences,proto3" json:"query_contract_references,omitempty"` + ExecuteContractReferences []*WasmContractReferences `protobuf:"bytes,6,rep,name=execute_contract_references,json=executeContractReferences,proto3" json:"execute_contract_references,omitempty"` + ResetReason string `protobuf:"bytes,7,opt,name=reset_reason,json=resetReason,proto3" json:"reset_reason,omitempty"` + ContractAddress string `protobuf:"bytes,8,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` } func (m *WasmDependencyMapping) Reset() { *m = WasmDependencyMapping{} } func (m *WasmDependencyMapping) String() string { return proto.CompactTextString(m) } func (*WasmDependencyMapping) ProtoMessage() {} func (*WasmDependencyMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_d636a082612ba091, []int{4} + return fileDescriptor_d636a082612ba091, []int{6} } func (m *WasmDependencyMapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,6 +432,27 @@ func (m *WasmDependencyMapping) GetExecuteAccessOps() []*WasmAccessOperations { return nil } +func (m *WasmDependencyMapping) GetBaseContractReferences() []*WasmContractReference { + if m != nil { + return m.BaseContractReferences + } + return nil +} + +func (m *WasmDependencyMapping) GetQueryContractReferences() []*WasmContractReferences { + if m != nil { + return m.QueryContractReferences + } + return nil +} + +func (m *WasmDependencyMapping) GetExecuteContractReferences() []*WasmContractReferences { + if m != nil { + return m.ExecuteContractReferences + } + return nil +} + func (m *WasmDependencyMapping) GetResetReason() string { if m != nil { return m.ResetReason @@ -334,6 +470,8 @@ func (m *WasmDependencyMapping) GetContractAddress() string { func init() { proto.RegisterType((*AccessOperation)(nil), "cosmos.accesscontrol.v1beta1.AccessOperation") proto.RegisterType((*WasmAccessOperation)(nil), "cosmos.accesscontrol.v1beta1.WasmAccessOperation") + proto.RegisterType((*WasmContractReference)(nil), "cosmos.accesscontrol.v1beta1.WasmContractReference") + proto.RegisterType((*WasmContractReferences)(nil), "cosmos.accesscontrol.v1beta1.WasmContractReferences") proto.RegisterType((*WasmAccessOperations)(nil), "cosmos.accesscontrol.v1beta1.WasmAccessOperations") proto.RegisterType((*MessageDependencyMapping)(nil), "cosmos.accesscontrol.v1beta1.MessageDependencyMapping") proto.RegisterType((*WasmDependencyMapping)(nil), "cosmos.accesscontrol.v1beta1.WasmDependencyMapping") @@ -344,44 +482,52 @@ func init() { } var fileDescriptor_d636a082612ba091 = []byte{ - // 581 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xe3, 0x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 0x7d, 0xd4, 0x3d, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x34, 0xad, 0xfd, - 0x0b, 0x70, 0x05, 0x00, 0x00, + // 710 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0xcd, 0x6e, 0x13, 0x3b, + 0x14, 0xc7, 0x33, 0xfd, 0xba, 0x8d, 0xd3, 0x26, 0x95, 0xdb, 0xdb, 0x9b, 0xf6, 0xa2, 0xb4, 0x44, + 0x48, 0x04, 0xa4, 0x26, 0x6d, 0xca, 0x86, 0x65, 0x0b, 0x2c, 0xa0, 0x2a, 0x95, 0xdc, 0x4a, 0x88, + 0x0a, 0x31, 0x38, 0x9e, 0xd3, 0x30, 0x6a, 0x66, 0x3c, 0x8c, 0x1d, 0x60, 0xde, 0x82, 0x0d, 0x0f, + 0xc0, 0x5b, 0x20, 0x9e, 0xa0, 0xcb, 0xee, 0x60, 0x55, 0xa1, 0xf6, 0x45, 0xd0, 0xd8, 0x9e, 0x49, + 0xd2, 0x8c, 0xfa, 0x11, 0x56, 0x33, 0xe7, 0xd8, 0xe7, 0x77, 0xfe, 0xc7, 0x3e, 0xb6, 0x51, 0x8d, + 0x71, 0xe1, 0x71, 0xd1, 0xa0, 0x8c, 0x81, 0x10, 0x8c, 0xfb, 0x32, 0xe4, 0x9d, 0x41, 0xab, 0x1e, + 0x84, 0x5c, 0x72, 0x7c, 0x47, 0xcf, 0xac, 0x0f, 0x8e, 0x7d, 0xdc, 0x68, 0x81, 0xa4, 0x1b, 0xcb, + 0x0b, 0x6d, 0xde, 0xe6, 0x6a, 0x62, 0x23, 0xfe, 0xd3, 0x31, 0xcb, 0xf7, 0x32, 0xe9, 0x8c, 0xfb, + 0x42, 0x52, 0x5f, 0x0a, 0x3d, 0xab, 0x7a, 0x66, 0xa1, 0xd2, 0x96, 0x9a, 0xb1, 0x17, 0x40, 0x48, + 0xa5,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08, 0x00, 0x00, } func (m *AccessOperation) Marshal() (dAtA []byte, err error) { @@ -471,6 +617,92 @@ func (m *WasmAccessOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *WasmContractReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WasmContractReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WasmContractReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MessageName) > 0 { + i -= len(m.MessageName) + copy(dAtA[i:], m.MessageName) + i = encodeVarintAccesscontrol(dAtA, i, uint64(len(m.MessageName))) + i-- + dAtA[i] = 0x1a + } + if m.MessageType != 0 { + i = encodeVarintAccesscontrol(dAtA, i, uint64(m.MessageType)) + i-- + dAtA[i] = 0x10 + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintAccesscontrol(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WasmContractReferences) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WasmContractReferences) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WasmContractReferences) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ContractReferences) > 0 { + for iNdEx := len(m.ContractReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ContractReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccesscontrol(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.MessageName) > 0 { + i -= len(m.MessageName) + copy(dAtA[i:], m.MessageName) + i = encodeVarintAccesscontrol(dAtA, i, uint64(len(m.MessageName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *WasmAccessOperations) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -594,14 +826,56 @@ func (m *WasmDependencyMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ContractAddress) i = encodeVarintAccesscontrol(dAtA, i, uint64(len(m.ContractAddress))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 } if len(m.ResetReason) > 0 { i -= len(m.ResetReason) copy(dAtA[i:], m.ResetReason) i = encodeVarintAccesscontrol(dAtA, i, uint64(len(m.ResetReason))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a + } + if len(m.ExecuteContractReferences) > 0 { + for iNdEx := len(m.ExecuteContractReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExecuteContractReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccesscontrol(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.QueryContractReferences) > 0 { + for iNdEx := len(m.QueryContractReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.QueryContractReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccesscontrol(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.BaseContractReferences) > 0 { + for iNdEx := len(m.BaseContractReferences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BaseContractReferences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccesscontrol(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.ExecuteAccessOps) > 0 { for iNdEx := len(m.ExecuteAccessOps) - 1; iNdEx >= 0; iNdEx-- { @@ -698,6 +972,45 @@ func (m *WasmAccessOperation) Size() (n int) { return n } +func (m *WasmContractReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovAccesscontrol(uint64(l)) + } + if m.MessageType != 0 { + n += 1 + sovAccesscontrol(uint64(m.MessageType)) + } + l = len(m.MessageName) + if l > 0 { + n += 1 + l + sovAccesscontrol(uint64(l)) + } + return n +} + +func (m *WasmContractReferences) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MessageName) + if l > 0 { + n += 1 + l + sovAccesscontrol(uint64(l)) + } + if len(m.ContractReferences) > 0 { + for _, e := range m.ContractReferences { + l = e.Size() + n += 1 + l + sovAccesscontrol(uint64(l)) + } + } + return n +} + func (m *WasmAccessOperations) Size() (n int) { if m == nil { return 0 @@ -763,6 +1076,24 @@ func (m *WasmDependencyMapping) Size() (n int) { n += 1 + l + sovAccesscontrol(uint64(l)) } } + if len(m.BaseContractReferences) > 0 { + for _, e := range m.BaseContractReferences { + l = e.Size() + n += 1 + l + sovAccesscontrol(uint64(l)) + } + } + if len(m.QueryContractReferences) > 0 { + for _, e := range m.QueryContractReferences { + l = e.Size() + n += 1 + l + sovAccesscontrol(uint64(l)) + } + } + if len(m.ExecuteContractReferences) > 0 { + for _, e := range m.ExecuteContractReferences { + l = e.Size() + n += 1 + l + sovAccesscontrol(uint64(l)) + } + } l = len(m.ResetReason) if l > 0 { n += 1 + l + sovAccesscontrol(uint64(l)) @@ -1037,7 +1368,7 @@ func (m *WasmAccessOperation) Unmarshal(dAtA []byte) error { } return nil } -func (m *WasmAccessOperations) Unmarshal(dAtA []byte) error { +func (m *WasmContractReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1060,15 +1391,15 @@ func (m *WasmAccessOperations) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WasmAccessOperations: wiretype end group for non-group") + return fmt.Errorf("proto: WasmContractReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WasmAccessOperations: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WasmContractReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1096,13 +1427,13 @@ func (m *WasmAccessOperations) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MessageName = string(dAtA[iNdEx:postIndex]) + m.ContractAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WasmOperations", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageType", wireType) } - var msglen int + m.MessageType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAccesscontrol @@ -1112,15 +1443,264 @@ func (m *WasmAccessOperations) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.MessageType |= WasmMessageSubtype(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthAccesscontrol - } - postIndex := iNdEx + msglen + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccesscontrol(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccesscontrol + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WasmContractReferences) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WasmContractReferences: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WasmContractReferences: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractReferences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractReferences = append(m.ContractReferences, &WasmContractReference{}) + if err := m.ContractReferences[len(m.ContractReferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccesscontrol(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccesscontrol + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WasmAccessOperations) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WasmAccessOperations: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WasmAccessOperations: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WasmOperations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthAccesscontrol } @@ -1421,6 +2001,108 @@ func (m *WasmDependencyMapping) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseContractReferences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseContractReferences = append(m.BaseContractReferences, &WasmContractReference{}) + if err := m.BaseContractReferences[len(m.BaseContractReferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryContractReferences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueryContractReferences = append(m.QueryContractReferences, &WasmContractReferences{}) + if err := m.QueryContractReferences[len(m.QueryContractReferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecuteContractReferences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccesscontrol + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccesscontrol + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccesscontrol + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecuteContractReferences = append(m.ExecuteContractReferences, &WasmContractReferences{}) + if err := m.ExecuteContractReferences[len(m.ExecuteContractReferences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResetReason", wireType) } @@ -1452,7 +2134,7 @@ func (m *WasmDependencyMapping) Unmarshal(dAtA []byte) error { } m.ResetReason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) } diff --git a/types/query/pagination.pb.go b/types/query/pagination.pb.go index c631ecfb1..742c760fb 100644 --- a/types/query/pagination.pb.go +++ b/types/query/pagination.pb.go @@ -25,10 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PageRequest is to be embedded in gRPC request messages for efficient // pagination. Ex: // -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } type PageRequest struct { // key is a value returned in PageResponse.next_key to begin // querying the next page most efficiently. Only one of offset or key @@ -123,10 +123,10 @@ func (m *PageRequest) GetReverse() bool { // PageResponse is to be embedded in gRPC response messages where the // corresponding request message has used PageRequest. // -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } type PageResponse struct { // next_key is the key to be passed to PageRequest.key to // query the next page most efficiently diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 346198195..4bbdccabd 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -197,6 +197,7 @@ type SignatureDescriptor_Data struct { // sum is the oneof that specifies whether this represents single or multi-signature data // // Types that are valid to be assigned to Sum: + // // *SignatureDescriptor_Data_Single_ // *SignatureDescriptor_Data_Multi_ Sum isSignatureDescriptor_Data_Sum `protobuf_oneof:"sum"` diff --git a/x/accesscontrol/keeper/genesis.go b/x/accesscontrol/keeper/genesis.go index b72678b60..ea021a873 100644 --- a/x/accesscontrol/keeper/genesis.go +++ b/x/accesscontrol/keeper/genesis.go @@ -11,7 +11,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { for _, resourceDependencyMapping := range genState.GetMessageDependencyMapping() { k.SetResourceDependencyMapping(ctx, resourceDependencyMapping) } - for _, wasmDependencyMapping := range genState.GetWasmDependencyAccessOpss() { + for _, wasmDependencyMapping := range genState.GetWasmDependencyMappings() { k.SetWasmDependencyMapping(ctx, wasmDependencyMapping) } } diff --git a/x/accesscontrol/keeper/keeper.go b/x/accesscontrol/keeper/keeper.go index c95616035..455d0fca0 100644 --- a/x/accesscontrol/keeper/keeper.go +++ b/x/accesscontrol/keeper/keeper.go @@ -174,16 +174,77 @@ func (k Keeper) GetWasmDependencyAccessOps(ctx sdk.Context, contractAddress sdk. if err != nil { return nil, err } - return selectedAccessOps, nil + + // imports base contract references + contractRefs := dependencyMapping.BaseContractReferences + // add the specific execute or query contract references based on message type + name + specificContractRefs := []*acltypes.WasmContractReferences{} + if msgInfo.MessageType == acltypes.WasmMessageSubtype_EXECUTE && len(dependencyMapping.ExecuteContractReferences) != 0 { + specificContractRefs = dependencyMapping.ExecuteContractReferences + } else if msgInfo.MessageType == acltypes.WasmMessageSubtype_QUERY && len(dependencyMapping.QueryContractReferences) != 0 { + specificContractRefs = dependencyMapping.QueryContractReferences + } + for _, specificContractRef := range specificContractRefs { + if specificContractRef.MessageName == msgInfo.MessageName { + contractRefs = append(contractRefs, specificContractRef.ContractReferences...) + break + } + } + importedAccessOps, err := k.ImportContractReferences(ctx, contractAddress, contractRefs, senderBech, msgInfo, circularDepLookup) + if err != nil { + return nil, err + } + // combine the access ops to get the definitive list of access ops for the contract + selectedAccessOps.Merge(importedAccessOps) + + return selectedAccessOps.ToSlice(), nil } -func (k Keeper) BuildSelectorOps(ctx sdk.Context, contractAddr sdk.AccAddress, accessOps []*acltypes.WasmAccessOperation, senderBech string, msgInfo *types.WasmMessageInfo, circularDepLookup ContractReferenceLookupMap) ([]acltypes.AccessOperation, error) { +func (k Keeper) ImportContractReferences(ctx sdk.Context, contractAddr sdk.AccAddress, contractReferences []*acltypes.WasmContractReference, senderBech string, msgInfo *types.WasmMessageInfo, circularDepLookup ContractReferenceLookupMap) (*types.AccessOperationSet, error) { + importedAccessOps := types.NewEmptyAccessOperationSet() + + for _, contractReference := range contractReferences { + // We use this to import the dependencies from another contract address + importContractAddress, err := sdk.AccAddressFromBech32(contractReference.ContractAddress) + if err != nil { + return nil, err + } + // TODO: build new msgbody for the new contract execute / query msg in later milestone tasks based on the translation pattern + emptyJSON := []byte(fmt.Sprintf("{\"%s\":{}}", contractReference.MessageName)) + var msgInfo *types.WasmMessageInfo + if contractReference.MessageType == acltypes.WasmMessageSubtype_EXECUTE { + msgInfo, err = types.NewExecuteMessageInfo(emptyJSON) + if err != nil { + return nil, err + } + } else if contractReference.MessageType == acltypes.WasmMessageSubtype_QUERY { + msgInfo, err = types.NewQueryMessageInfo(emptyJSON) + if err != nil { + return nil, err + } + } + wasmDeps, err := k.GetWasmDependencyAccessOps(ctx, importContractAddress, contractAddr.String(), msgInfo, circularDepLookup) + + if err != nil { + // if we have an error fetching the dependency mapping or the mapping is disabled, + // we want to return the error and the fallback behavior can be defined in the caller function + // recommended fallback behavior is to use synchronous wasm access ops + return nil, err + } else { + // if we did get deps properly and they are enabled, now we want to add them to our access operations + importedAccessOps.AddMultiple(wasmDeps) + } + } + // if we imported all relevant contract references properly, we can return the access ops generated + return importedAccessOps, nil +} + +func (k Keeper) BuildSelectorOps(ctx sdk.Context, contractAddr sdk.AccAddress, accessOps []*acltypes.WasmAccessOperation, senderBech string, msgInfo *types.WasmMessageInfo, circularDepLookup ContractReferenceLookupMap) (*types.AccessOperationSet, error) { selectedAccessOps := types.NewEmptyAccessOperationSet() // when we build selector ops here, we want to generate "*" if the proper fields aren't present // if size of circular dep map > 1 then it means we're in a contract reference // as a result, if the selector doesn't match properly, we need to conservatively assume "*" for the identifier withinContractReference := len(circularDepLookup) > 1 -accessOpLoop: for _, opWithSelector := range accessOps { selectorSwitch: switch opWithSelector.SelectorType { @@ -302,35 +363,13 @@ accessOpLoop: hexStr, ) case acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE: - // We use this to import the dependencies from another contract address - interContractAddress, err := sdk.AccAddressFromBech32(opWithSelector.Selector) - if err != nil { - return nil, err - } - // TODO: add a circular dependency check here to ignore if we've already seen this contract/identifier in our reference chain - // for now, we will just pass in the same message body, this needs to be changed later though - // TODO: build new msgbody for the new contract execute / query msg in later milestone tasks - emptyJSON := []byte("{\"\":{}}") - // TODO: add separate enum for query reference vs execute reference and build msgInfo according to whether - // the reference is a query one or an execute one. For now defaulting to execute. - emptyMsgInfo, _ := types.NewExecuteMessageInfo(emptyJSON) - wasmDeps, err := k.GetWasmDependencyAccessOps(ctx, interContractAddress, contractAddr.String(), emptyMsgInfo, circularDepLookup) - - if err != nil { - // if we have an error fetching the dependency mapping or the mapping is disabled, we want to use the synchronous mappings instead - selectedAccessOps = types.SynchronousAccessOpsSet() - break accessOpLoop - } else { - // if we did get deps properly and they are enabled, now we want to add them to our access operations - selectedAccessOps.AddMultiple(wasmDeps) - } - // we want to continue here to skip adding the original OpWithSelector (since that just represents instruction to fetch dependent contract) + // Deprecated for ImportContractReference function continue } selectedAccessOps.Add(*opWithSelector.Operation) } - return selectedAccessOps.ToSlice(), nil + return selectedAccessOps, nil } func (k Keeper) SetWasmDependencyMapping( diff --git a/x/accesscontrol/keeper/keeper_test.go b/x/accesscontrol/keeper/keeper_test.go index 062007f4c..493a484c3 100644 --- a/x/accesscontrol/keeper/keeper_test.go +++ b/x/accesscontrol/keeper/keeper_test.go @@ -613,7 +613,7 @@ func TestWasmDependencyMappingWithConstantSelector(t *testing.T) { require.True(t, types.NewAccessOperationSet(deps).HasIdentifier(fmt.Sprintf("prefix%s", hex.EncodeToString([]byte("constantValue"))))) } -func TestWasmDependencyMappingWithContractReferenceSelector(t *testing.T) { +func TestWasmDependencyMappingWithContractReference(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) @@ -657,15 +657,6 @@ func TestWasmDependencyMappingWithContractReferenceSelector(t *testing.T) { // this mapping creates a reference to the inter-contract dependency wasmMapping := acltypes.WasmDependencyMapping{ BaseAccessOps: []*acltypes.WasmAccessOperation{ - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: interContractAddress.String(), - }, // this one should be appropriately discarded because we are not processing a contract reference { Operation: &acltypes.AccessOperation{ @@ -681,6 +672,13 @@ func TestWasmDependencyMappingWithContractReferenceSelector(t *testing.T) { SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: interContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, ContractAddress: wasmContractAddress.String(), } // set the dependency mapping @@ -703,7 +701,7 @@ func TestWasmDependencyMappingWithContractReferenceSelector(t *testing.T) { make(aclkeeper.ContractReferenceLookupMap), ) require.NoError(t, err) - require.Equal(t, types.NewAccessOperationSet(deps).Size(), 3) + require.Equal(t, 3, types.NewAccessOperationSet(deps).Size()) expectedAccessOps := []acltypes.AccessOperation{ { ResourceType: acltypes.ResourceType_KV_BANK_BALANCES, @@ -742,20 +740,18 @@ func TestWasmDependencyMappingWithContractReferenceSelectorMultipleReferences(t }, SelectorType: acltypes.AccessOperationSelectorType_SENDER_LENGTH_PREFIXED_ADDRESS, }, - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: inter2ContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: inter2ContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "message_b", + }, + }, ContractAddress: interContractAddress.String(), } // set the dependency mapping @@ -787,20 +783,18 @@ func TestWasmDependencyMappingWithContractReferenceSelectorMultipleReferences(t // this mapping creates a reference to the inter-contract dependency wasmMapping := acltypes.WasmDependencyMapping{ BaseAccessOps: []*acltypes.WasmAccessOperation{ - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: interContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: interContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "message_a", + }, + }, ContractAddress: wasmContractAddress.String(), } // set the dependency mapping @@ -823,7 +817,7 @@ func TestWasmDependencyMappingWithContractReferenceSelectorMultipleReferences(t make(aclkeeper.ContractReferenceLookupMap), ) require.NoError(t, err) - require.Equal(t, types.NewAccessOperationSet(deps).Size(), 3) + require.Equal(t, 3, types.NewAccessOperationSet(deps).Size()) expectedAccessOps := []acltypes.AccessOperation{ { ResourceType: acltypes.ResourceType_KV_BANK_BALANCES, @@ -862,20 +856,18 @@ func TestWasmDependencyMappingWithContractReferenceSelectorCircularDependency(t }, SelectorType: acltypes.AccessOperationSelectorType_SENDER_LENGTH_PREFIXED_ADDRESS, }, - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: inter2ContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: inter2ContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "message_b", + }, + }, ContractAddress: interContractAddress.String(), } // set the dependency mapping @@ -893,20 +885,18 @@ func TestWasmDependencyMappingWithContractReferenceSelectorCircularDependency(t IdentifierTemplate: "*", }, }, - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: wasmContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "send", + }, + }, ContractAddress: inter2ContractAddress.String(), } // set the dependency mapping @@ -916,20 +906,18 @@ func TestWasmDependencyMappingWithContractReferenceSelectorCircularDependency(t // this mapping creates a reference to the inter-contract dependency wasmMapping := acltypes.WasmDependencyMapping{ BaseAccessOps: []*acltypes.WasmAccessOperation{ - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: interContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: interContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "message_a", + }, + }, ContractAddress: wasmContractAddress.String(), } // set the dependency mapping @@ -952,7 +940,7 @@ func TestWasmDependencyMappingWithContractReferenceSelectorCircularDependency(t make(aclkeeper.ContractReferenceLookupMap), ) require.NoError(t, err) - require.Equal(t, types.NewAccessOperationSet(deps).Size(), 4) + require.Equal(t, 4, types.NewAccessOperationSet(deps).Size()) expectedAccessOps := []acltypes.AccessOperation{ { ResourceType: acltypes.ResourceType_KV_BANK_BALANCES, @@ -971,7 +959,7 @@ func TestWasmDependencyMappingWithContractReferenceSelectorCircularDependency(t require.Equal(t, types.NewAccessOperationSet(expectedAccessOps), types.NewAccessOperationSet(deps)) } -func TestWasmDependencyMappingWithContractReferenceDisabled(t *testing.T) { +func TestWasmDependencyMappingWithContractReferenceDNE(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) @@ -984,20 +972,18 @@ func TestWasmDependencyMappingWithContractReferenceDisabled(t *testing.T) { // this mapping creates a reference to the inter-contract dependency wasmMapping := acltypes.WasmDependencyMapping{ BaseAccessOps: []*acltypes.WasmAccessOperation{ - { - Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, - IdentifierTemplate: "*", - }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: interContractAddress.String(), - }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: interContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, ContractAddress: wasmContractAddress.String(), } // set the dependency mapping @@ -1020,38 +1006,95 @@ func TestWasmDependencyMappingWithContractReferenceDisabled(t *testing.T) { make(aclkeeper.ContractReferenceLookupMap), ) require.NoError(t, err) - // we should have synchronous access ops as returned from building selectors - require.Equal(t, types.NewAccessOperationSet(deps).Size(), 2) + require.Equal(t, 2, types.NewAccessOperationSet(deps).Size()) require.Equal(t, types.SynchronousAccessOpsSet(), types.NewAccessOperationSet(deps)) } -func TestWasmDependencyMappingWithContractReferenceDNE(t *testing.T) { +func TestWasmDependencyMappingWithContractReferencePartitioned(t *testing.T) { app := simapp.Setup(false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(30000000)) + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 4, sdk.NewInt(30000000)) wasmContractAddress := wasmContractAddresses[0] interContractAddress := wasmContractAddresses[1] - wasmBech32, err := sdk.Bech32ifyAddressBytes("cosmos", wasmContractAddress) + inter2ContractAddress := wasmContractAddresses[2] + otherAddr := wasmContractAddresses[3] + + // create a dummy mapping of a bank balance write for the sender address (eg. performing some action like depositing funds) + // also performs a bank write to an address specified by the JSON body (following same schema as contract A for now) + interContractMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: &acltypes.AccessOperation{ + ResourceType: acltypes.ResourceType_KV_BANK_BALANCES, + AccessType: acltypes.AccessType_WRITE, + IdentifierTemplate: "02%s", + }, + SelectorType: acltypes.AccessOperationSelectorType_SENDER_LENGTH_PREFIXED_ADDRESS, + }, + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + ContractAddress: interContractAddress.String(), + } + // set the dependency mapping + err := app.AccessControlKeeper.SetWasmDependencyMapping(ctx, interContractMapping) require.NoError(t, err) - // this mapping creates a reference to the inter-contract dependency - wasmMapping := acltypes.WasmDependencyMapping{ + // create a dummy mapping of a bank balance write for the sender address (eg. performing some action like depositing funds) + // also performs a bank write to an address specified by the JSON body (following same schema as contract A for now) + inter2ContractMapping := acltypes.WasmDependencyMapping{ BaseAccessOps: []*acltypes.WasmAccessOperation{ { Operation: &acltypes.AccessOperation{ - ResourceType: acltypes.ResourceType_ANY, - AccessType: acltypes.AccessType_UNKNOWN, + ResourceType: acltypes.ResourceType_KV_ORACLE_EXCHANGE_RATE, + AccessType: acltypes.AccessType_READ, IdentifierTemplate: "*", }, - SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, - Selector: interContractAddress.String(), }, { Operation: types.CommitAccessOp(), SelectorType: acltypes.AccessOperationSelectorType_NONE, }, }, + ContractAddress: inter2ContractAddress.String(), + } + // set the dependency mapping + err = app.AccessControlKeeper.SetWasmDependencyMapping(ctx, inter2ContractMapping) + require.NoError(t, err) + + // this mapping creates a reference to the inter-contract dependency + wasmMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + ExecuteContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "send", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: interContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "message_a", + }, + }, + }, + { + MessageName: "other_msg", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: inter2ContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "message_b", + }, + }, + }, + }, ContractAddress: wasmContractAddress.String(), } // set the dependency mapping @@ -1065,17 +1108,47 @@ func TestWasmDependencyMappingWithContractReferenceDNE(t *testing.T) { // test getting a dependency mapping with selector that expands the inter-contract reference into the contract's dependencies require.NoError(t, err) - info, _ := types.NewExecuteMessageInfo([]byte(fmt.Sprintf("{\"send\":{\"address\":\"%s\",\"amount\":10}}", wasmBech32))) + info, _ := types.NewExecuteMessageInfo([]byte(fmt.Sprintf("{\"send\":{\"address\":\"%s\",\"amount\":10}}", otherAddr.String()))) deps, err := app.AccessControlKeeper.GetWasmDependencyAccessOps( ctx, wasmContractAddress, - wasmContractAddresses[2].String(), + otherAddr.String(), info, make(aclkeeper.ContractReferenceLookupMap), ) require.NoError(t, err) - require.Equal(t, types.NewAccessOperationSet(deps).Size(), 2) - require.Equal(t, types.SynchronousAccessOpsSet(), types.NewAccessOperationSet(deps)) + require.Equal(t, 2, types.NewAccessOperationSet(deps).Size()) + expectedAccessOps := []acltypes.AccessOperation{ + { + ResourceType: acltypes.ResourceType_KV_BANK_BALANCES, + AccessType: acltypes.AccessType_WRITE, + IdentifierTemplate: fmt.Sprintf("02%s", hex.EncodeToString(address.MustLengthPrefix(wasmContractAddress))), + }, + *types.CommitAccessOp(), + } + require.Equal(t, types.NewAccessOperationSet(expectedAccessOps), types.NewAccessOperationSet(deps)) + + require.NoError(t, err) + + info2, _ := types.NewExecuteMessageInfo([]byte(fmt.Sprintf("{\"other_msg\":{\"address\":\"%s\",\"amount\":10}}", otherAddr.String()))) + deps2, err := app.AccessControlKeeper.GetWasmDependencyAccessOps( + ctx, + wasmContractAddress, + otherAddr.String(), + info2, + make(aclkeeper.ContractReferenceLookupMap), + ) + require.NoError(t, err) + require.Equal(t, 2, types.NewAccessOperationSet(deps2).Size()) + expectedAccessOps2 := []acltypes.AccessOperation{ + { + ResourceType: acltypes.ResourceType_KV_ORACLE_EXCHANGE_RATE, + AccessType: acltypes.AccessType_READ, + IdentifierTemplate: "*", + }, + *types.CommitAccessOp(), + } + require.Equal(t, types.NewAccessOperationSet(expectedAccessOps2), types.NewAccessOperationSet(deps2)) } func (suite *KeeperTestSuite) TestMessageDependencies() { diff --git a/x/accesscontrol/types/genesis.pb.go b/x/accesscontrol/types/genesis.pb.go index 51d15c665..b20927191 100644 --- a/x/accesscontrol/types/genesis.pb.go +++ b/x/accesscontrol/types/genesis.pb.go @@ -78,7 +78,7 @@ func (m *GenesisState) GetMessageDependencyMapping() []accesscontrol.MessageDepe return nil } -func (m *GenesisState) GetWasmDependencyAccessOpss() []accesscontrol.WasmDependencyMapping { +func (m *GenesisState) GetWasmDependencyMappings() []accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMappings } diff --git a/x/accesscontrol/types/gov.pb.go b/x/accesscontrol/types/gov.pb.go index cbd528bdd..d7b4d54c1 100644 --- a/x/accesscontrol/types/gov.pb.go +++ b/x/accesscontrol/types/gov.pb.go @@ -290,7 +290,7 @@ func (m *MsgUpdateWasmDependencyMappingProposalJsonFile) GetContractAddress() st return "" } -func (m *MsgUpdateWasmDependencyMappingProposalJsonFile) GetWasmDependencyAccessOps() accesscontrol.WasmDependencyMapping { +func (m *MsgUpdateWasmDependencyMappingProposalJsonFile) GetWasmDependencyMapping() accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMapping } diff --git a/x/accesscontrol/types/message_dependency_mapping.go b/x/accesscontrol/types/message_dependency_mapping.go index 469587f1b..75debe357 100644 --- a/x/accesscontrol/types/message_dependency_mapping.go +++ b/x/accesscontrol/types/message_dependency_mapping.go @@ -12,7 +12,9 @@ var ( ErrNoCommitAccessOp = fmt.Errorf("MessageDependencyMapping doesn't terminate with AccessType_COMMIT") ErrEmptyIdentifierString = fmt.Errorf("IdentifierTemplate cannot be an empty string") ErrNonLeafResourceTypeWithIdentifier = fmt.Errorf("IdentifierTemplate must be '*' for non leaf resource types") - ErrDuplicateWasmMethodName = fmt.Errorf("A method name is defined multiple times in specific access operation list") + ErrDuplicateWasmMethodName = fmt.Errorf("a method name is defined multiple times in specific access operation list") + ErrQueryRefNonQueryMessageType = fmt.Errorf("query contract references can only have query message types") + ErrSelectorDeprecated = fmt.Errorf("this selector type is deprecated") ) type MessageKey string @@ -132,12 +134,84 @@ func ValidateWasmDependencyMapping(mapping acltypes.WasmDependencyMapping) error if lastAccessOp.Operation.AccessType != acltypes.AccessType_COMMIT { return ErrNoCommitAccessOp } + + // ensure uniqueness for partitioned message names across access ops and contract references seenMessageNames := map[string]struct{}{} - for _, ops := range append(mapping.ExecuteAccessOps, mapping.QueryAccessOps...) { + for _, ops := range mapping.ExecuteAccessOps { + if _, ok := seenMessageNames[ops.MessageName]; ok { + return ErrDuplicateWasmMethodName + } + seenMessageNames[ops.MessageName] = struct{}{} + } + seenMessageNames = map[string]struct{}{} + for _, ops := range mapping.QueryAccessOps { + if _, ok := seenMessageNames[ops.MessageName]; ok { + return ErrDuplicateWasmMethodName + } + seenMessageNames[ops.MessageName] = struct{}{} + } + seenMessageNames = map[string]struct{}{} + for _, ops := range mapping.ExecuteContractReferences { + if _, ok := seenMessageNames[ops.MessageName]; ok { + return ErrDuplicateWasmMethodName + } + seenMessageNames[ops.MessageName] = struct{}{} + } + seenMessageNames = map[string]struct{}{} + for _, ops := range mapping.QueryContractReferences { if _, ok := seenMessageNames[ops.MessageName]; ok { return ErrDuplicateWasmMethodName } seenMessageNames[ops.MessageName] = struct{}{} } + + // ensure deprecation for CONTRACT_REFERENCE access operation selector due to new contract references + for _, accessOp := range mapping.BaseAccessOps { + if accessOp.SelectorType == acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE { + return ErrSelectorDeprecated + } + } + for _, accessOps := range mapping.ExecuteAccessOps { + for _, accessOp := range accessOps.WasmOperations { + if accessOp.SelectorType == acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE { + return ErrSelectorDeprecated + } + } + } + for _, accessOps := range mapping.QueryAccessOps { + for _, accessOp := range accessOps.WasmOperations { + if accessOp.SelectorType == acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE { + return ErrSelectorDeprecated + } + } + } + + // verify contract address valid for contract references + for _, contractRef := range mapping.BaseContractReferences { + _, err := sdk.AccAddressFromBech32(contractRef.ContractAddress) + if err != nil { + return err + } + } + for _, msgContractRef := range mapping.ExecuteContractReferences { + for _, contractRef := range msgContractRef.ContractReferences { + _, err := sdk.AccAddressFromBech32(contractRef.ContractAddress) + if err != nil { + return err + } + } + } + for _, msgContractRef := range mapping.QueryContractReferences { + for _, contractRef := range msgContractRef.ContractReferences { + _, err := sdk.AccAddressFromBech32(contractRef.ContractAddress) + if err != nil { + return err + } + // query contract references CANNOT have execute contract message types + if contractRef.MessageType != acltypes.WasmMessageSubtype_QUERY { + return ErrQueryRefNonQueryMessageType + } + } + } return nil } diff --git a/x/accesscontrol/types/message_dependency_mapping_test.go b/x/accesscontrol/types/message_dependency_mapping_test.go new file mode 100644 index 000000000..64ccbdbb9 --- /dev/null +++ b/x/accesscontrol/types/message_dependency_mapping_test.go @@ -0,0 +1,303 @@ +package types_test + +import ( + "testing" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + acltypes "github.com/cosmos/cosmos-sdk/types/accesscontrol" + "github.com/cosmos/cosmos-sdk/x/accesscontrol/types" + "github.com/stretchr/testify/require" +) + +func TestWasmDependencyInvalidBaseContractReference(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(30000000)) + wasmContractAddress := wasmContractAddresses[0] + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + BaseContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + { + ContractAddress: "gibberish", + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} + +func TestWasmDependencyInvalidExecuteContractReference(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(30000000)) + wasmContractAddress := wasmContractAddresses[0] + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + ExecuteContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + { + ContractAddress: "gibberish", + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} + +func TestWasmDependencyInvalidQueryContractReference(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(30000000)) + wasmContractAddress := wasmContractAddresses[0] + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + QueryContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + { + ContractAddress: "gibberish", + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} + +func TestWasmDependencyQueryContractReferenceIncorrectMessageType(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(30000000)) + wasmContractAddress := wasmContractAddresses[0] + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + QueryContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} + +func TestWasmDependencyDeprecatedSelectors(t *testing.T) { + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, + }, + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) + + wasmDependencyMapping = acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + ExecuteAccessOps: []*acltypes.WasmAccessOperations{ + { + MessageName: "message_name", + WasmOperations: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) + + wasmDependencyMapping = acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + QueryAccessOps: []*acltypes.WasmAccessOperations{ + { + MessageName: "message_name", + WasmOperations: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_CONTRACT_REFERENCE, + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} + +func TestWasmDependencyDuplicateMessageNameInContractReference(t *testing.T) { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + wasmContractAddresses := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(30000000)) + wasmContractAddress := wasmContractAddresses[0] + wasmDependencyMapping := acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + ExecuteContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, + }, + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_EXECUTE, + MessageName: "some_message", + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) + + wasmDependencyMapping = acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + QueryContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + }, + }, + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + }, + }, + }, + } + require.Error(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) + + // duplicate message names in different section (query and execute partitions) shouldnt error + wasmDependencyMapping = acltypes.WasmDependencyMapping{ + BaseAccessOps: []*acltypes.WasmAccessOperation{ + { + Operation: types.CommitAccessOp(), + SelectorType: acltypes.AccessOperationSelectorType_NONE, + }, + }, + QueryContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + }, + }, + }, + ExecuteContractReferences: []*acltypes.WasmContractReferences{ + { + MessageName: "some_message", + ContractReferences: []*acltypes.WasmContractReference{ + { + ContractAddress: wasmContractAddress.String(), + MessageType: acltypes.WasmMessageSubtype_QUERY, + MessageName: "some_message", + }, + }, + }, + }, + } + require.NoError(t, types.ValidateWasmDependencyMapping(wasmDependencyMapping)) +} diff --git a/x/accesscontrol/types/query.pb.go b/x/accesscontrol/types/query.pb.go index c011b26cd..9e90ab1c6 100644 --- a/x/accesscontrol/types/query.pb.go +++ b/x/accesscontrol/types/query.pb.go @@ -289,7 +289,7 @@ func (m *WasmDependencyMappingResponse) XXX_DiscardUnknown() { var xxx_messageInfo_WasmDependencyMappingResponse proto.InternalMessageInfo -func (m *WasmDependencyMappingResponse) GetWasmDependencyAccessOps() accesscontrol.WasmDependencyMapping { +func (m *WasmDependencyMappingResponse) GetWasmDependencyMapping() accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMapping } @@ -449,7 +449,7 @@ func (m *ListWasmDependencyMappingResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ListWasmDependencyMappingResponse proto.InternalMessageInfo -func (m *ListWasmDependencyMappingResponse) GetWasmDependencyAccessOpsList() []accesscontrol.WasmDependencyMapping { +func (m *ListWasmDependencyMappingResponse) GetWasmDependencyMappingList() []accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMappingList } diff --git a/x/accesscontrol/types/tx.pb.go b/x/accesscontrol/types/tx.pb.go index 60fbc3d41..07ed86fd6 100644 --- a/x/accesscontrol/types/tx.pb.go +++ b/x/accesscontrol/types/tx.pb.go @@ -68,7 +68,7 @@ func (m *RegisterWasmDependencyJSONFile) XXX_DiscardUnknown() { var xxx_messageInfo_RegisterWasmDependencyJSONFile proto.InternalMessageInfo -func (m *RegisterWasmDependencyJSONFile) GetWasmDependencyAccessOps() accesscontrol.WasmDependencyMapping { +func (m *RegisterWasmDependencyJSONFile) GetWasmDependencyMapping() accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMapping } @@ -120,7 +120,7 @@ func (m *MsgRegisterWasmDependency) GetFromAddress() string { return "" } -func (m *MsgRegisterWasmDependency) GetWasmDependencyAccessOps() accesscontrol.WasmDependencyMapping { +func (m *MsgRegisterWasmDependency) GetWasmDependencyMapping() accesscontrol.WasmDependencyMapping { if m != nil { return m.WasmDependencyMapping } diff --git a/x/distribution/types/distribution.pb.go b/x/distribution/types/distribution.pb.go index 2657160a6..0e4513d6c 100644 --- a/x/distribution/types/distribution.pb.go +++ b/x/distribution/types/distribution.pb.go @@ -79,11 +79,12 @@ func (m *Params) GetWithdrawAddrEnabled() bool { // The reference count indicates the number of objects // which might need to reference this historical entry at any point. // ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization +// +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization type ValidatorHistoricalRewards struct { CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio" yaml:"cumulative_reward_ratio"` ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty" yaml:"reference_count"`