diff --git a/api/side/btcbridge/params.pulsar.go b/api/side/btcbridge/params.pulsar.go index ebb9320..7ec96e5 100644 --- a/api/side/btcbridge/params.pulsar.go +++ b/api/side/btcbridge/params.pulsar.go @@ -45,7 +45,7 @@ func (x *_Params_6_list) Append(value protoreflect.Value) { } func (x *_Params_6_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Params at list field TrustedNonBtcRelayers as it is not of Message kind")) + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field TrustedBtcRelayers as it is not of Message kind")) } func (x *_Params_6_list) Truncate(n int) { @@ -91,7 +91,7 @@ func (x *_Params_7_list) Append(value protoreflect.Value) { } func (x *_Params_7_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Params at list field TrustedOracles as it is not of Message kind")) + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field TrustedNonBtcRelayers as it is not of Message kind")) } func (x *_Params_7_list) Truncate(n int) { @@ -107,54 +107,100 @@ func (x *_Params_7_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Params_9_list)(nil) +var _ protoreflect.List = (*_Params_8_list)(nil) + +type _Params_8_list struct { + list *[]string +} + +func (x *_Params_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field TrustedOracles as it is not of Message kind")) +} + +func (x *_Params_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_8_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Params_10_list)(nil) -type _Params_9_list struct { +type _Params_10_list struct { list *[]*Vault } -func (x *_Params_9_list) Len() int { +func (x *_Params_10_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_9_list) Get(i int) protoreflect.Value { +func (x *_Params_10_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_Params_9_list) Set(i int, value protoreflect.Value) { +func (x *_Params_10_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*Vault) (*x.list)[i] = concreteValue } -func (x *_Params_9_list) Append(value protoreflect.Value) { +func (x *_Params_10_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*Vault) *x.list = append(*x.list, concreteValue) } -func (x *_Params_9_list) AppendMutable() protoreflect.Value { +func (x *_Params_10_list) AppendMutable() protoreflect.Value { v := new(Vault) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_Params_9_list) Truncate(n int) { +func (x *_Params_10_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_Params_9_list) NewElement() protoreflect.Value { +func (x *_Params_10_list) NewElement() protoreflect.Value { v := new(Vault) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_Params_9_list) IsValid() bool { +func (x *_Params_10_list) IsValid() bool { return x.list != nil } @@ -165,6 +211,7 @@ var ( fd_Params_btc_voucher_denom protoreflect.FieldDescriptor fd_Params_deposit_enabled protoreflect.FieldDescriptor fd_Params_withdraw_enabled protoreflect.FieldDescriptor + fd_Params_trusted_btc_relayers protoreflect.FieldDescriptor fd_Params_trusted_non_btc_relayers protoreflect.FieldDescriptor fd_Params_trusted_oracles protoreflect.FieldDescriptor fd_Params_fee_rate_validity_period protoreflect.FieldDescriptor @@ -183,6 +230,7 @@ func init() { fd_Params_btc_voucher_denom = md_Params.Fields().ByName("btc_voucher_denom") fd_Params_deposit_enabled = md_Params.Fields().ByName("deposit_enabled") fd_Params_withdraw_enabled = md_Params.Fields().ByName("withdraw_enabled") + fd_Params_trusted_btc_relayers = md_Params.Fields().ByName("trusted_btc_relayers") fd_Params_trusted_non_btc_relayers = md_Params.Fields().ByName("trusted_non_btc_relayers") fd_Params_trusted_oracles = md_Params.Fields().ByName("trusted_oracles") fd_Params_fee_rate_validity_period = md_Params.Fields().ByName("fee_rate_validity_period") @@ -288,14 +336,20 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.TrustedBtcRelayers) != 0 { + value := protoreflect.ValueOfList(&_Params_6_list{list: &x.TrustedBtcRelayers}) + if !f(fd_Params_trusted_btc_relayers, value) { + return + } + } if len(x.TrustedNonBtcRelayers) != 0 { - value := protoreflect.ValueOfList(&_Params_6_list{list: &x.TrustedNonBtcRelayers}) + value := protoreflect.ValueOfList(&_Params_7_list{list: &x.TrustedNonBtcRelayers}) if !f(fd_Params_trusted_non_btc_relayers, value) { return } } if len(x.TrustedOracles) != 0 { - value := protoreflect.ValueOfList(&_Params_7_list{list: &x.TrustedOracles}) + value := protoreflect.ValueOfList(&_Params_8_list{list: &x.TrustedOracles}) if !f(fd_Params_trusted_oracles, value) { return } @@ -307,7 +361,7 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto } } if len(x.Vaults) != 0 { - value := protoreflect.ValueOfList(&_Params_9_list{list: &x.Vaults}) + value := protoreflect.ValueOfList(&_Params_10_list{list: &x.Vaults}) if !f(fd_Params_vaults, value) { return } @@ -361,6 +415,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.DepositEnabled != false case "side.btcbridge.Params.withdraw_enabled": return x.WithdrawEnabled != false + case "side.btcbridge.Params.trusted_btc_relayers": + return len(x.TrustedBtcRelayers) != 0 case "side.btcbridge.Params.trusted_non_btc_relayers": return len(x.TrustedNonBtcRelayers) != 0 case "side.btcbridge.Params.trusted_oracles": @@ -403,6 +459,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.DepositEnabled = false case "side.btcbridge.Params.withdraw_enabled": x.WithdrawEnabled = false + case "side.btcbridge.Params.trusted_btc_relayers": + x.TrustedBtcRelayers = nil case "side.btcbridge.Params.trusted_non_btc_relayers": x.TrustedNonBtcRelayers = nil case "side.btcbridge.Params.trusted_oracles": @@ -450,26 +508,32 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "side.btcbridge.Params.withdraw_enabled": value := x.WithdrawEnabled return protoreflect.ValueOfBool(value) + case "side.btcbridge.Params.trusted_btc_relayers": + if len(x.TrustedBtcRelayers) == 0 { + return protoreflect.ValueOfList(&_Params_6_list{}) + } + listValue := &_Params_6_list{list: &x.TrustedBtcRelayers} + return protoreflect.ValueOfList(listValue) case "side.btcbridge.Params.trusted_non_btc_relayers": if len(x.TrustedNonBtcRelayers) == 0 { - return protoreflect.ValueOfList(&_Params_6_list{}) + return protoreflect.ValueOfList(&_Params_7_list{}) } - listValue := &_Params_6_list{list: &x.TrustedNonBtcRelayers} + listValue := &_Params_7_list{list: &x.TrustedNonBtcRelayers} return protoreflect.ValueOfList(listValue) case "side.btcbridge.Params.trusted_oracles": if len(x.TrustedOracles) == 0 { - return protoreflect.ValueOfList(&_Params_7_list{}) + return protoreflect.ValueOfList(&_Params_8_list{}) } - listValue := &_Params_7_list{list: &x.TrustedOracles} + listValue := &_Params_8_list{list: &x.TrustedOracles} return protoreflect.ValueOfList(listValue) case "side.btcbridge.Params.fee_rate_validity_period": value := x.FeeRateValidityPeriod return protoreflect.ValueOfInt64(value) case "side.btcbridge.Params.vaults": if len(x.Vaults) == 0 { - return protoreflect.ValueOfList(&_Params_9_list{}) + return protoreflect.ValueOfList(&_Params_10_list{}) } - listValue := &_Params_9_list{list: &x.Vaults} + listValue := &_Params_10_list{list: &x.Vaults} return protoreflect.ValueOfList(listValue) case "side.btcbridge.Params.withdraw_params": value := x.WithdrawParams @@ -513,19 +577,23 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.DepositEnabled = value.Bool() case "side.btcbridge.Params.withdraw_enabled": x.WithdrawEnabled = value.Bool() - case "side.btcbridge.Params.trusted_non_btc_relayers": + case "side.btcbridge.Params.trusted_btc_relayers": lv := value.List() clv := lv.(*_Params_6_list) + x.TrustedBtcRelayers = *clv.list + case "side.btcbridge.Params.trusted_non_btc_relayers": + lv := value.List() + clv := lv.(*_Params_7_list) x.TrustedNonBtcRelayers = *clv.list case "side.btcbridge.Params.trusted_oracles": lv := value.List() - clv := lv.(*_Params_7_list) + clv := lv.(*_Params_8_list) x.TrustedOracles = *clv.list case "side.btcbridge.Params.fee_rate_validity_period": x.FeeRateValidityPeriod = value.Int() case "side.btcbridge.Params.vaults": lv := value.List() - clv := lv.(*_Params_9_list) + clv := lv.(*_Params_10_list) x.Vaults = *clv.list case "side.btcbridge.Params.withdraw_params": x.WithdrawParams = value.Message().Interface().(*WithdrawParams) @@ -555,23 +623,29 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "side.btcbridge.Params.trusted_btc_relayers": + if x.TrustedBtcRelayers == nil { + x.TrustedBtcRelayers = []string{} + } + value := &_Params_6_list{list: &x.TrustedBtcRelayers} + return protoreflect.ValueOfList(value) case "side.btcbridge.Params.trusted_non_btc_relayers": if x.TrustedNonBtcRelayers == nil { x.TrustedNonBtcRelayers = []string{} } - value := &_Params_6_list{list: &x.TrustedNonBtcRelayers} + value := &_Params_7_list{list: &x.TrustedNonBtcRelayers} return protoreflect.ValueOfList(value) case "side.btcbridge.Params.trusted_oracles": if x.TrustedOracles == nil { x.TrustedOracles = []string{} } - value := &_Params_7_list{list: &x.TrustedOracles} + value := &_Params_8_list{list: &x.TrustedOracles} return protoreflect.ValueOfList(value) case "side.btcbridge.Params.vaults": if x.Vaults == nil { x.Vaults = []*Vault{} } - value := &_Params_9_list{list: &x.Vaults} + value := &_Params_10_list{list: &x.Vaults} return protoreflect.ValueOfList(value) case "side.btcbridge.Params.withdraw_params": if x.WithdrawParams == nil { @@ -628,17 +702,20 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "side.btcbridge.Params.withdraw_enabled": return protoreflect.ValueOfBool(false) - case "side.btcbridge.Params.trusted_non_btc_relayers": + case "side.btcbridge.Params.trusted_btc_relayers": list := []string{} return protoreflect.ValueOfList(&_Params_6_list{list: &list}) - case "side.btcbridge.Params.trusted_oracles": + case "side.btcbridge.Params.trusted_non_btc_relayers": list := []string{} return protoreflect.ValueOfList(&_Params_7_list{list: &list}) + case "side.btcbridge.Params.trusted_oracles": + list := []string{} + return protoreflect.ValueOfList(&_Params_8_list{list: &list}) case "side.btcbridge.Params.fee_rate_validity_period": return protoreflect.ValueOfInt64(int64(0)) case "side.btcbridge.Params.vaults": list := []*Vault{} - return protoreflect.ValueOfList(&_Params_9_list{list: &list}) + return protoreflect.ValueOfList(&_Params_10_list{list: &list}) case "side.btcbridge.Params.withdraw_params": m := new(WithdrawParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -736,6 +813,12 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.WithdrawEnabled { n += 2 } + if len(x.TrustedBtcRelayers) > 0 { + for _, s := range x.TrustedBtcRelayers { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if len(x.TrustedNonBtcRelayers) > 0 { for _, s := range x.TrustedNonBtcRelayers { l = len(s) @@ -814,7 +897,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 } if x.ProtocolFees != nil { encoded, err := options.Marshal(x.ProtocolFees) @@ -828,7 +911,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a } if x.ProtocolLimits != nil { encoded, err := options.Marshal(x.ProtocolLimits) @@ -842,7 +925,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 } if x.WithdrawParams != nil { encoded, err := options.Marshal(x.WithdrawParams) @@ -856,7 +939,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a } if len(x.Vaults) > 0 { for iNdEx := len(x.Vaults) - 1; iNdEx >= 0; iNdEx-- { @@ -871,13 +954,13 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x52 } } if x.FeeRateValidityPeriod != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.FeeRateValidityPeriod)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x48 } if len(x.TrustedOracles) > 0 { for iNdEx := len(x.TrustedOracles) - 1; iNdEx >= 0; iNdEx-- { @@ -885,7 +968,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.TrustedOracles[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TrustedOracles[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } } if len(x.TrustedNonBtcRelayers) > 0 { @@ -894,6 +977,15 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.TrustedNonBtcRelayers[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TrustedNonBtcRelayers[iNdEx]))) i-- + dAtA[i] = 0x3a + } + } + if len(x.TrustedBtcRelayers) > 0 { + for iNdEx := len(x.TrustedBtcRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.TrustedBtcRelayers[iNdEx]) + copy(dAtA[i:], x.TrustedBtcRelayers[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TrustedBtcRelayers[iNdEx]))) + i-- dAtA[i] = 0x32 } } @@ -1094,6 +1186,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.WithdrawEnabled = bool(v != 0) case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TrustedBtcRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.TrustedBtcRelayers = append(x.TrustedBtcRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TrustedNonBtcRelayers", wireType) } @@ -1125,7 +1249,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.TrustedNonBtcRelayers = append(x.TrustedNonBtcRelayers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TrustedOracles", wireType) } @@ -1157,7 +1281,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.TrustedOracles = append(x.TrustedOracles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 8: + case 9: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeRateValidityPeriod", wireType) } @@ -1176,7 +1300,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } - case 9: + case 10: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Vaults", wireType) } @@ -1210,7 +1334,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WithdrawParams", wireType) } @@ -1246,7 +1370,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProtocolLimits", wireType) } @@ -1282,7 +1406,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProtocolFees", wireType) } @@ -1318,7 +1442,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TssParams", wireType) } @@ -4085,22 +4209,24 @@ type Params struct { DepositEnabled bool `protobuf:"varint,4,opt,name=deposit_enabled,json=depositEnabled,proto3" json:"deposit_enabled,omitempty"` // Indicates if withdrawal is enabled WithdrawEnabled bool `protobuf:"varint,5,opt,name=withdraw_enabled,json=withdrawEnabled,proto3" json:"withdraw_enabled,omitempty"` + // Trusted relayers to submit bitcoin block headers + TrustedBtcRelayers []string `protobuf:"bytes,6,rep,name=trusted_btc_relayers,json=trustedBtcRelayers,proto3" json:"trusted_btc_relayers,omitempty"` // Trusted relayers for non-btc asset deposit - TrustedNonBtcRelayers []string `protobuf:"bytes,6,rep,name=trusted_non_btc_relayers,json=trustedNonBtcRelayers,proto3" json:"trusted_non_btc_relayers,omitempty"` + TrustedNonBtcRelayers []string `protobuf:"bytes,7,rep,name=trusted_non_btc_relayers,json=trustedNonBtcRelayers,proto3" json:"trusted_non_btc_relayers,omitempty"` // Trusted oracles for providing offchain data, e.g. bitcoin fee rate - TrustedOracles []string `protobuf:"bytes,7,rep,name=trusted_oracles,json=trustedOracles,proto3" json:"trusted_oracles,omitempty"` + TrustedOracles []string `protobuf:"bytes,8,rep,name=trusted_oracles,json=trustedOracles,proto3" json:"trusted_oracles,omitempty"` // Period of validity for the fee rate - FeeRateValidityPeriod int64 `protobuf:"varint,8,opt,name=fee_rate_validity_period,json=feeRateValidityPeriod,proto3" json:"fee_rate_validity_period,omitempty"` + FeeRateValidityPeriod int64 `protobuf:"varint,9,opt,name=fee_rate_validity_period,json=feeRateValidityPeriod,proto3" json:"fee_rate_validity_period,omitempty"` // Asset vaults - Vaults []*Vault `protobuf:"bytes,9,rep,name=vaults,proto3" json:"vaults,omitempty"` + Vaults []*Vault `protobuf:"bytes,10,rep,name=vaults,proto3" json:"vaults,omitempty"` // Withdrawal params - WithdrawParams *WithdrawParams `protobuf:"bytes,10,opt,name=withdraw_params,json=withdrawParams,proto3" json:"withdraw_params,omitempty"` + WithdrawParams *WithdrawParams `protobuf:"bytes,11,opt,name=withdraw_params,json=withdrawParams,proto3" json:"withdraw_params,omitempty"` // Protocol limitations - ProtocolLimits *ProtocolLimits `protobuf:"bytes,11,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits,omitempty"` + ProtocolLimits *ProtocolLimits `protobuf:"bytes,12,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits,omitempty"` // Protocol fees - ProtocolFees *ProtocolFees `protobuf:"bytes,12,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees,omitempty"` + ProtocolFees *ProtocolFees `protobuf:"bytes,13,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees,omitempty"` // TSS params - TssParams *TSSParams `protobuf:"bytes,13,opt,name=tss_params,json=tssParams,proto3" json:"tss_params,omitempty"` + TssParams *TSSParams `protobuf:"bytes,14,opt,name=tss_params,json=tssParams,proto3" json:"tss_params,omitempty"` } func (x *Params) Reset() { @@ -4158,6 +4284,13 @@ func (x *Params) GetWithdrawEnabled() bool { return false } +func (x *Params) GetTrustedBtcRelayers() []string { + if x != nil { + return x.TrustedBtcRelayers + } + return nil +} + func (x *Params) GetTrustedNonBtcRelayers() []string { if x != nil { return x.TrustedNonBtcRelayers @@ -4499,7 +4632,7 @@ var file_side_btcbridge_params_proto_rawDesc = []byte{ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, + 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x06, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x63, 0x63, 0x65, @@ -4514,104 +4647,107 @@ var file_side_btcbridge_params_proto_rawDesc = []byte{ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x37, 0x0a, 0x18, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, - 0x5f, 0x62, 0x74, 0x63, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x15, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x4e, 0x6f, 0x6e, 0x42, - 0x74, 0x63, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, - 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x4f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2d, 0x0a, 0x06, - 0x76, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, - 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x56, 0x61, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, - 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x77, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x0d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x46, 0x65, 0x65, 0x73, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x46, 0x65, - 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x74, 0x73, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, - 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x54, 0x53, 0x53, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x74, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, - 0x38, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x75, 0x74, - 0x78, 0x6f, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x61, - 0x78, 0x55, 0x74, 0x78, 0x6f, 0x4e, 0x75, 0x6d, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x74, 0x63, 0x5f, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x70, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x62, 0x74, 0x63, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x74, 0x63, 0x5f, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x6e, 0x75, - 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x42, 0x74, 0x63, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4e, 0x75, 0x6d, 0x22, - 0x8c, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x74, 0x63, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x74, 0x63, - 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x74, - 0x63, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x74, 0x63, 0x4d, 0x69, 0x6e, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x74, 0x63, 0x5f, 0x6d, 0x61, 0x78, 0x5f, - 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, - 0x62, 0x74, 0x63, 0x4d, 0x61, 0x78, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x22, 0x70, - 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x46, 0x65, 0x65, 0x73, 0x12, 0x1f, - 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x46, - 0x65, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x22, 0xd4, 0x01, 0x0a, 0x09, 0x54, 0x53, 0x53, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x51, - 0x0a, 0x12, 0x64, 0x6b, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, - 0x10, 0x64, 0x6b, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x12, 0x74, 0x0a, 0x24, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, - 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x21, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, - 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2a, 0x67, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, - 0x54, 0x43, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x42, 0x52, 0x43, 0x32, 0x30, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x53, - 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x45, 0x53, 0x10, 0x03, - 0x42, 0x9b, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, - 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x74, - 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0e, - 0x53, 0x69, 0x64, 0x65, 0x2e, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xca, 0x02, - 0x0e, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xe2, - 0x02, 0x1a, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, - 0x69, 0x64, 0x65, 0x3a, 0x3a, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x74, 0x63, + 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x12, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x42, 0x74, 0x63, 0x52, 0x65, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6e, + 0x6f, 0x6e, 0x5f, 0x62, 0x74, 0x63, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x4e, 0x6f, + 0x6e, 0x42, 0x74, 0x63, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x0f, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x4f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x2d, + 0x0a, 0x06, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, + 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x4d, 0x0a, + 0x0f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, + 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4d, 0x0a, 0x0f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, + 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x0d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x46, 0x65, 0x65, 0x73, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x46, 0x65, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x74, 0x73, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, + 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x54, 0x53, 0x53, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x74, 0x73, 0x73, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8e, 0x01, 0x0a, 0x05, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, + 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, + 0x75, 0x74, 0x78, 0x6f, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, + 0x6d, 0x61, 0x78, 0x55, 0x74, 0x78, 0x6f, 0x4e, 0x75, 0x6d, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x74, + 0x63, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x62, + 0x74, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x50, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x74, 0x63, + 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x6d, 0x61, 0x78, 0x42, 0x74, + 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4e, 0x75, + 0x6d, 0x22, 0x8c, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x74, 0x63, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, + 0x74, 0x63, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, + 0x62, 0x74, 0x63, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x74, 0x63, 0x4d, 0x69, 0x6e, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x74, 0x63, 0x5f, 0x6d, 0x61, + 0x78, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0e, 0x62, 0x74, 0x63, 0x4d, 0x61, 0x78, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x22, 0x70, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x46, 0x65, 0x65, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x46, 0x65, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x66, 0x65, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x46, 0x65, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x22, 0xd4, 0x01, 0x0a, 0x09, 0x54, 0x53, 0x53, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x51, 0x0a, 0x12, 0x64, 0x6b, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, + 0x01, 0x52, 0x10, 0x64, 0x6b, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x12, 0x74, 0x0a, 0x24, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, + 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x21, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2a, 0x67, 0x0a, 0x09, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x42, 0x54, 0x43, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x52, 0x43, 0x32, 0x30, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, + 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x45, 0x53, + 0x10, 0x03, 0x42, 0x9b, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, + 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, + 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, + 0x02, 0x0e, 0x53, 0x69, 0x64, 0x65, 0x2e, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0xca, 0x02, 0x0e, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0xe2, 0x02, 0x1a, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0f, 0x53, 0x69, 0x64, 0x65, 0x3a, 0x3a, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/side/btcbridge/params.proto b/proto/side/btcbridge/params.proto index f38cba0..42274b5 100644 --- a/proto/side/btcbridge/params.proto +++ b/proto/side/btcbridge/params.proto @@ -19,22 +19,24 @@ message Params { bool deposit_enabled = 4; // Indicates if withdrawal is enabled bool withdraw_enabled = 5; + // Trusted relayers to submit bitcoin block headers + repeated string trusted_btc_relayers = 6; // Trusted relayers for non-btc asset deposit - repeated string trusted_non_btc_relayers = 6; + repeated string trusted_non_btc_relayers = 7; // Trusted oracles for providing offchain data, e.g. bitcoin fee rate - repeated string trusted_oracles = 7; + repeated string trusted_oracles = 8; // Period of validity for the fee rate - int64 fee_rate_validity_period = 8; + int64 fee_rate_validity_period = 9; // Asset vaults - repeated Vault vaults = 9; + repeated Vault vaults = 10; // Withdrawal params - WithdrawParams withdraw_params = 10 [(gogoproto.nullable) = false]; + WithdrawParams withdraw_params = 11 [(gogoproto.nullable) = false]; // Protocol limitations - ProtocolLimits protocol_limits = 11 [(gogoproto.nullable) = false]; + ProtocolLimits protocol_limits = 12 [(gogoproto.nullable) = false]; // Protocol fees - ProtocolFees protocol_fees = 12 [(gogoproto.nullable) = false]; + ProtocolFees protocol_fees = 13 [(gogoproto.nullable) = false]; // TSS params - TSSParams tss_params = 13 [(gogoproto.nullable) = false]; + TSSParams tss_params = 14 [(gogoproto.nullable) = false]; } // AssetType defines the type of asset diff --git a/x/btcbridge/keeper/msg_server.go b/x/btcbridge/keeper/msg_server.go index bd723a0..1e0f7a0 100644 --- a/x/btcbridge/keeper/msg_server.go +++ b/x/btcbridge/keeper/msg_server.go @@ -26,6 +26,10 @@ func (m msgServer) SubmitBlockHeaders(goCtx context.Context, msg *types.MsgSubmi return nil, err } + if !m.IsTrustedBtcRelayer(ctx, msg.Sender) { + return nil, types.ErrUntrustedBtcRelayer + } + // insert block headers err := m.InsertBlockHeaders(ctx, msg.BlockHeaders) if err != nil { @@ -64,7 +68,7 @@ func (m msgServer) UpdateTrustedOracles(goCtx context.Context, msg *types.MsgUpd } if !m.IsTrustedOracle(ctx, msg.Sender) { - return nil, types.ErruntrustedOracle + return nil, types.ErrUntrustedOracle } // update oracles @@ -138,7 +142,7 @@ func (m msgServer) SubmitFeeRate(goCtx context.Context, msg *types.MsgSubmitFeeR } if !m.IsTrustedOracle(ctx, msg.Sender) { - return nil, types.ErruntrustedOracle + return nil, types.ErrUntrustedOracle } m.SetFeeRate(ctx, msg.FeeRate) diff --git a/x/btcbridge/keeper/params.go b/x/btcbridge/keeper/params.go index 279a2da..fedae53 100644 --- a/x/btcbridge/keeper/params.go +++ b/x/btcbridge/keeper/params.go @@ -36,6 +36,22 @@ func (k Keeper) BtcDenom(ctx sdk.Context) string { return k.GetParams(ctx).BtcVoucherDenom } +// IsTrustedBtcRelayer returns true if the given address is a trusted btc relayer, false otherwise +func (k Keeper) IsTrustedBtcRelayer(ctx sdk.Context, addr string) bool { + trustedBtcRelayers := k.GetParams(ctx).TrustedNonBtcRelayers + if len(trustedBtcRelayers) == 0 { + return true + } + + for _, relayer := range trustedBtcRelayers { + if relayer == addr { + return true + } + } + + return false +} + // IsTrustedNonBtcRelayer returns true if the given address is a trusted non-btc relayer, false otherwise func (k Keeper) IsTrustedNonBtcRelayer(ctx sdk.Context, addr string) bool { for _, relayer := range k.GetParams(ctx).TrustedNonBtcRelayers { diff --git a/x/btcbridge/types/errors.go b/x/btcbridge/types/errors.go index b2433c9..8b2e04c 100644 --- a/x/btcbridge/types/errors.go +++ b/x/btcbridge/types/errors.go @@ -22,8 +22,9 @@ var ( ErrInvalidDepositTransaction = errorsmod.Register(ModuleName, 2108, "invalid deposit transaction") ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 2109, "invalid deposit amount") ErrDepositNotEnabled = errorsmod.Register(ModuleName, 2110, "deposit not enabled") - ErrUntrustedNonBtcRelayer = errorsmod.Register(ModuleName, 2111, "untrusted non btc relayer") - ErruntrustedOracle = errorsmod.Register(ModuleName, 2112, "untrusted oracle") + ErrUntrustedBtcRelayer = errorsmod.Register(ModuleName, 2111, "untrusted btc relayer") + ErrUntrustedNonBtcRelayer = errorsmod.Register(ModuleName, 2112, "untrusted non btc relayer") + ErrUntrustedOracle = errorsmod.Register(ModuleName, 2113, "untrusted oracle") ErrInvalidWithdrawAmount = errorsmod.Register(ModuleName, 3100, "invalid withdrawal amount") ErrInvalidBtcAddress = errorsmod.Register(ModuleName, 3101, "invalid btc address") diff --git a/x/btcbridge/types/params.go b/x/btcbridge/types/params.go index a137f5c..7c120e8 100644 --- a/x/btcbridge/types/params.go +++ b/x/btcbridge/types/params.go @@ -50,6 +50,7 @@ func NewParams() Params { BtcVoucherDenom: DefaultBtcVoucherDenom, DepositEnabled: true, WithdrawEnabled: true, + TrustedBtcRelayers: []string{}, TrustedNonBtcRelayers: []string{}, TrustedOracles: []string{}, FeeRateValidityPeriod: DefaultFeeRateValidityPeriod, @@ -87,6 +88,10 @@ func (p Params) Validate() error { return err } + if err := validateBtcRelayers(p.TrustedBtcRelayers); err != nil { + return err + } + if err := validateNonBtcRelayers(p.TrustedNonBtcRelayers); err != nil { return err } @@ -174,7 +179,19 @@ func SelectVaultByPkScript(vaults []*Vault, pkScript []byte) *Vault { return nil } -// validateNonBtcRelayers validates the given relayers +// validateBtcRelayers validates the given btc relayers +func validateBtcRelayers(relayers []string) error { + for _, relayer := range relayers { + _, err := sdk.AccAddressFromBech32(relayer) + if err != nil { + return ErrInvalidRelayers + } + } + + return nil +} + +// validateNonBtcRelayers validates the given non btc relayers func validateNonBtcRelayers(relayers []string) error { for _, relayer := range relayers { _, err := sdk.AccAddressFromBech32(relayer) @@ -198,6 +215,7 @@ func validateOracles(oracles []string) error { return nil } +// validateFeeRateValidityPeriod validates the given fee rate validity period func validateFeeRateValidityPeriod(feeRateValidityPeriod int64) error { if feeRateValidityPeriod <= 0 { return errorsmod.Wrapf(ErrInvalidParams, "fee rate validity period must be greater than 0") @@ -242,6 +260,7 @@ func validateVaults(vaults []*Vault) error { return nil } +// validateWithdrawParams validates the given withdrawal params func validateWithdrawParams(withdrawParams *WithdrawParams) error { if withdrawParams.MaxUtxoNum == 0 || withdrawParams.BtcBatchWithdrawPeriod == 0 || withdrawParams.MaxBtcBatchWithdrawNum == 0 { return errorsmod.Wrapf(ErrInvalidParams, "invalid withdrawal params") diff --git a/x/btcbridge/types/params.pb.go b/x/btcbridge/types/params.pb.go index ecb86eb..33ce0ce 100644 --- a/x/btcbridge/types/params.pb.go +++ b/x/btcbridge/types/params.pb.go @@ -76,22 +76,24 @@ type Params struct { DepositEnabled bool `protobuf:"varint,4,opt,name=deposit_enabled,json=depositEnabled,proto3" json:"deposit_enabled,omitempty"` // Indicates if withdrawal is enabled WithdrawEnabled bool `protobuf:"varint,5,opt,name=withdraw_enabled,json=withdrawEnabled,proto3" json:"withdraw_enabled,omitempty"` + // Trusted relayers to submit bitcoin block headers + TrustedBtcRelayers []string `protobuf:"bytes,6,rep,name=trusted_btc_relayers,json=trustedBtcRelayers,proto3" json:"trusted_btc_relayers,omitempty"` // Trusted relayers for non-btc asset deposit - TrustedNonBtcRelayers []string `protobuf:"bytes,6,rep,name=trusted_non_btc_relayers,json=trustedNonBtcRelayers,proto3" json:"trusted_non_btc_relayers,omitempty"` + TrustedNonBtcRelayers []string `protobuf:"bytes,7,rep,name=trusted_non_btc_relayers,json=trustedNonBtcRelayers,proto3" json:"trusted_non_btc_relayers,omitempty"` // Trusted oracles for providing offchain data, e.g. bitcoin fee rate - TrustedOracles []string `protobuf:"bytes,7,rep,name=trusted_oracles,json=trustedOracles,proto3" json:"trusted_oracles,omitempty"` + TrustedOracles []string `protobuf:"bytes,8,rep,name=trusted_oracles,json=trustedOracles,proto3" json:"trusted_oracles,omitempty"` // Period of validity for the fee rate - FeeRateValidityPeriod int64 `protobuf:"varint,8,opt,name=fee_rate_validity_period,json=feeRateValidityPeriod,proto3" json:"fee_rate_validity_period,omitempty"` + FeeRateValidityPeriod int64 `protobuf:"varint,9,opt,name=fee_rate_validity_period,json=feeRateValidityPeriod,proto3" json:"fee_rate_validity_period,omitempty"` // Asset vaults - Vaults []*Vault `protobuf:"bytes,9,rep,name=vaults,proto3" json:"vaults,omitempty"` + Vaults []*Vault `protobuf:"bytes,10,rep,name=vaults,proto3" json:"vaults,omitempty"` // Withdrawal params - WithdrawParams WithdrawParams `protobuf:"bytes,10,opt,name=withdraw_params,json=withdrawParams,proto3" json:"withdraw_params"` + WithdrawParams WithdrawParams `protobuf:"bytes,11,opt,name=withdraw_params,json=withdrawParams,proto3" json:"withdraw_params"` // Protocol limitations - ProtocolLimits ProtocolLimits `protobuf:"bytes,11,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits"` + ProtocolLimits ProtocolLimits `protobuf:"bytes,12,opt,name=protocol_limits,json=protocolLimits,proto3" json:"protocol_limits"` // Protocol fees - ProtocolFees ProtocolFees `protobuf:"bytes,12,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees"` + ProtocolFees ProtocolFees `protobuf:"bytes,13,opt,name=protocol_fees,json=protocolFees,proto3" json:"protocol_fees"` // TSS params - TssParams TSSParams `protobuf:"bytes,13,opt,name=tss_params,json=tssParams,proto3" json:"tss_params"` + TssParams TSSParams `protobuf:"bytes,14,opt,name=tss_params,json=tssParams,proto3" json:"tss_params"` } func (m *Params) Reset() { *m = Params{} } @@ -162,6 +164,13 @@ func (m *Params) GetWithdrawEnabled() bool { return false } +func (m *Params) GetTrustedBtcRelayers() []string { + if m != nil { + return m.TrustedBtcRelayers + } + return nil +} + func (m *Params) GetTrustedNonBtcRelayers() []string { if m != nil { return m.TrustedNonBtcRelayers @@ -550,68 +559,69 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/params.proto", fileDescriptor_f1d33573cda8a6d2) } var fileDescriptor_f1d33573cda8a6d2 = []byte{ - // 969 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdd, 0x6e, 0x23, 0x35, - 0x18, 0xed, 0x34, 0xfd, 0x1b, 0xb7, 0x4d, 0x83, 0xb5, 0xed, 0xce, 0x96, 0x55, 0x9a, 0x8d, 0x56, - 0x10, 0x56, 0x22, 0xc3, 0x96, 0x0b, 0xfe, 0x24, 0xa4, 0xa6, 0x4d, 0x61, 0x05, 0x5b, 0xca, 0x24, - 0x2d, 0x82, 0x1b, 0xcb, 0xe3, 0xf9, 0x92, 0x5a, 0x9d, 0x19, 0x8f, 0xc6, 0x9e, 0x36, 0x79, 0x07, - 0x84, 0xb8, 0xe4, 0x15, 0x78, 0x93, 0xbd, 0xdc, 0x0b, 0x2e, 0xb8, 0x40, 0x80, 0xda, 0x17, 0x41, - 0xf6, 0xfc, 0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xc6, 0x13, 0x1a, 0x2b, - 0x92, 0x25, 0x81, 0x7e, 0x37, 0x54, 0x4a, 0x63, 0xc9, 0xf5, 0xe6, 0xd9, 0x1e, 0xff, 0xcf, 0x22, - 0x4f, 0x66, 0x0c, 0xcf, 0x8c, 0xdf, 0xb0, 0xb2, 0xcb, 0xab, 0x3e, 0x1b, 0x23, 0xbb, 0x4a, 0x2d, - 0xde, 0x45, 0x3b, 0x07, 0x83, 0x41, 0x7f, 0x48, 0x86, 0xdf, 0x9f, 0xf6, 0xc9, 0xd9, 0xc9, 0xe0, - 0xb4, 0x7f, 0xf8, 0xe2, 0xf8, 0x45, 0xff, 0xa8, 0xb1, 0x80, 0x31, 0xaa, 0xcf, 0x70, 0xbd, 0xe1, - 0x61, 0xc3, 0xc2, 0x0f, 0x50, 0x63, 0x16, 0xf3, 0x0e, 0xf7, 0x3f, 0x68, 0x2c, 0xde, 0x43, 0xbd, - 0xb3, 0x93, 0xfe, 0xa0, 0x51, 0xeb, 0x7d, 0xf9, 0xea, 0xa6, 0x69, 0xbd, 0xbe, 0x69, 0x5a, 0x7f, - 0xdf, 0x34, 0xad, 0x9f, 0x6f, 0x9b, 0x0b, 0xaf, 0x6f, 0x9b, 0x0b, 0xbf, 0xdf, 0x36, 0x17, 0x7e, - 0xe8, 0x8e, 0xb9, 0xba, 0xc8, 0xfc, 0x2e, 0x13, 0x91, 0xab, 0x07, 0xaa, 0x1c, 0x7a, 0xb3, 0x70, - 0x27, 0x33, 0xff, 0x89, 0x7a, 0xf6, 0xa4, 0xbf, 0x62, 0x04, 0x1f, 0xfe, 0x13, 0x00, 0x00, 0xff, - 0xff, 0x86, 0x8c, 0xef, 0x11, 0x32, 0x07, 0x00, 0x00, + // 983 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x5d, 0x4f, 0xe3, 0x46, + 0x14, 0xc5, 0x04, 0x02, 0xb9, 0x40, 0x48, 0x47, 0xc0, 0x7a, 0xe9, 0x2a, 0x64, 0xa3, 0x55, 0x37, + 0x5d, 0xa9, 0xf1, 0x2e, 0x7d, 0xe8, 0x97, 0x54, 0x89, 0x40, 0x68, 0x57, 0xed, 0x52, 0xea, 0x04, + 0xaa, 0xf6, 0x65, 0x34, 0xb6, 0x6f, 0x82, 0x85, 0xed, 0xb1, 0x3c, 0x63, 0x48, 0xfe, 0x43, 0xb5, + 0xea, 0x63, 0xff, 0x42, 0xff, 0xc9, 0x3e, 0xee, 0x43, 0x1f, 0xfa, 0xd4, 0x56, 0xf0, 0x47, 0xaa, + 0x19, 0x7f, 0x90, 0xd0, 0xad, 0xd4, 0xb7, 0xcc, 0x39, 0xe7, 0x9e, 0x3b, 0x9e, 0x39, 0x77, 0x02, + 0xef, 0x0b, 0xdf, 0x43, 0xcb, 0x91, 0xae, 0x93, 0xf8, 0xde, 0x18, 0xad, 0x98, 0x25, 0x2c, 0x14, + 0xdd, 0x38, 0xe1, 0x92, 0x93, 0xba, 0x22, 0xbb, 0x25, 0xb9, 0xbb, 0x35, 0xe6, 0x63, 0xae, 0x29, + 0x4b, 0xfd, 0xca, 0x54, 0xbb, 0xcd, 0x31, 0xe7, 0xe3, 0x00, 0x2d, 0xbd, 0x72, 0xd2, 0x91, 0xe5, + 0xa5, 0x09, 0x93, 0x3e, 0x8f, 0x0a, 0xde, 0xe5, 0x22, 0xe4, 0xc2, 0x72, 0x98, 0x40, 0xeb, 0xea, + 0x85, 0x83, 0x92, 0xbd, 0xb0, 0x5c, 0xee, 0xe7, 0x7c, 0xfb, 0x75, 0x15, 0xaa, 0xa7, 0xba, 0x2d, + 0x79, 0x02, 0x1b, 0x2e, 0x8f, 0x46, 0x7e, 0x12, 0x6a, 0x03, 0x61, 0x1a, 0x2d, 0xa3, 0xb3, 0x6c, + 0xcf, 0x83, 0xe4, 0x0b, 0xd8, 0x0d, 0xd9, 0x84, 0x32, 0xd7, 0xc5, 0x58, 0x32, 0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 0x9b, 0x0b, 0x6f, 0x6f, 0x9b, 0x0b, 0x7f, 0xdc, 0x36, 0x17, 0x7e, 0xea, 0x8e, + 0x7d, 0x79, 0x91, 0x3a, 0x5d, 0x97, 0x87, 0x96, 0x1a, 0xa8, 0x62, 0xe8, 0xf5, 0xc2, 0x9a, 0xcc, + 0xfc, 0x8b, 0xaa, 0xd9, 0x13, 0x4e, 0x55, 0x0b, 0x3e, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xb3, + 0xc1, 0x4f, 0x0c, 0x64, 0x07, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -643,7 +653,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 { size, err := m.ProtocolFees.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -653,7 +663,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a { size, err := m.ProtocolLimits.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -663,7 +673,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 { size, err := m.WithdrawParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -673,7 +683,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a if len(m.Vaults) > 0 { for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { { @@ -685,13 +695,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x52 } } if m.FeeRateValidityPeriod != 0 { i = encodeVarintParams(dAtA, i, uint64(m.FeeRateValidityPeriod)) i-- - dAtA[i] = 0x40 + dAtA[i] = 0x48 } if len(m.TrustedOracles) > 0 { for iNdEx := len(m.TrustedOracles) - 1; iNdEx >= 0; iNdEx-- { @@ -699,7 +709,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.TrustedOracles[iNdEx]) i = encodeVarintParams(dAtA, i, uint64(len(m.TrustedOracles[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } } if len(m.TrustedNonBtcRelayers) > 0 { @@ -708,6 +718,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.TrustedNonBtcRelayers[iNdEx]) i = encodeVarintParams(dAtA, i, uint64(len(m.TrustedNonBtcRelayers[iNdEx]))) i-- + dAtA[i] = 0x3a + } + } + if len(m.TrustedBtcRelayers) > 0 { + for iNdEx := len(m.TrustedBtcRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TrustedBtcRelayers[iNdEx]) + copy(dAtA[i:], m.TrustedBtcRelayers[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.TrustedBtcRelayers[iNdEx]))) + i-- dAtA[i] = 0x32 } } @@ -986,6 +1005,12 @@ func (m *Params) Size() (n int) { if m.WithdrawEnabled { n += 2 } + if len(m.TrustedBtcRelayers) > 0 { + for _, s := range m.TrustedBtcRelayers { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } if len(m.TrustedNonBtcRelayers) > 0 { for _, s := range m.TrustedNonBtcRelayers { l = len(s) @@ -1255,6 +1280,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.WithdrawEnabled = bool(v != 0) case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedBtcRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrustedBtcRelayers = append(m.TrustedBtcRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TrustedNonBtcRelayers", wireType) } @@ -1286,7 +1343,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.TrustedNonBtcRelayers = append(m.TrustedNonBtcRelayers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TrustedOracles", wireType) } @@ -1318,7 +1375,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.TrustedOracles = append(m.TrustedOracles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 8: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FeeRateValidityPeriod", wireType) } @@ -1337,7 +1394,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 9: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Vaults", wireType) } @@ -1371,7 +1428,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WithdrawParams", wireType) } @@ -1404,7 +1461,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolLimits", wireType) } @@ -1437,7 +1494,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolFees", wireType) } @@ -1470,7 +1527,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TssParams", wireType) }