diff --git a/api/opinit/opchild/v1/query_grpc.pb.go b/api/opinit/opchild/v1/query_grpc.pb.go index 56e54547..6832d329 100644 --- a/api/opinit/opchild/v1/query_grpc.pb.go +++ b/api/opinit/opchild/v1/query_grpc.pb.go @@ -36,6 +36,7 @@ type QueryClient interface { Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) // Validator queries validator info for given validator address. Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) + // BridgeInfo queries the bridge information. BridgeInfo(ctx context.Context, in *QueryBridgeInfoRequest, opts ...grpc.CallOption) (*QueryBridgeInfoResponse, error) // Parameters queries the rollup parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -96,6 +97,7 @@ type QueryServer interface { Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) // Validator queries validator info for given validator address. Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) + // BridgeInfo queries the bridge information. BridgeInfo(context.Context, *QueryBridgeInfoRequest) (*QueryBridgeInfoResponse, error) // Parameters queries the rollup parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) diff --git a/api/opinit/opchild/v1/types.pulsar.go b/api/opinit/opchild/v1/types.pulsar.go index 4bae8727..1416c4c5 100644 --- a/api/opinit/opchild/v1/types.pulsar.go +++ b/api/opinit/opchild/v1/types.pulsar.go @@ -70,49 +70,49 @@ func (x *_Params_3_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Params_7_list)(nil) +var _ protoreflect.List = (*_Params_6_list)(nil) -type _Params_7_list struct { +type _Params_6_list struct { list *[]string } -func (x *_Params_7_list) Len() int { +func (x *_Params_6_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_7_list) Get(i int) protoreflect.Value { +func (x *_Params_6_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_7_list) Set(i int, value protoreflect.Value) { +func (x *_Params_6_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_7_list) Append(value protoreflect.Value) { +func (x *_Params_6_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_7_list) AppendMutable() protoreflect.Value { +func (x *_Params_6_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message Params at list field FeeWhitelist as it is not of Message kind")) } -func (x *_Params_7_list) Truncate(n int) { +func (x *_Params_6_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_7_list) NewElement() protoreflect.Value { +func (x *_Params_6_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Params_7_list) IsValid() bool { +func (x *_Params_6_list) IsValid() bool { return x.list != nil } @@ -122,7 +122,6 @@ var ( fd_Params_historical_entries protoreflect.FieldDescriptor fd_Params_min_gas_prices protoreflect.FieldDescriptor fd_Params_bridge_executor protoreflect.FieldDescriptor - fd_Params_host_chain_id protoreflect.FieldDescriptor fd_Params_admin protoreflect.FieldDescriptor fd_Params_fee_whitelist protoreflect.FieldDescriptor ) @@ -134,7 +133,6 @@ func init() { fd_Params_historical_entries = md_Params.Fields().ByName("historical_entries") fd_Params_min_gas_prices = md_Params.Fields().ByName("min_gas_prices") fd_Params_bridge_executor = md_Params.Fields().ByName("bridge_executor") - fd_Params_host_chain_id = md_Params.Fields().ByName("host_chain_id") fd_Params_admin = md_Params.Fields().ByName("admin") fd_Params_fee_whitelist = md_Params.Fields().ByName("fee_whitelist") } @@ -228,12 +226,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.HostChainId != "" { - value := protoreflect.ValueOfString(x.HostChainId) - if !f(fd_Params_host_chain_id, value) { - return - } - } if x.Admin != "" { value := protoreflect.ValueOfString(x.Admin) if !f(fd_Params_admin, value) { @@ -241,7 +233,7 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto } } if len(x.FeeWhitelist) != 0 { - value := protoreflect.ValueOfList(&_Params_7_list{list: &x.FeeWhitelist}) + value := protoreflect.ValueOfList(&_Params_6_list{list: &x.FeeWhitelist}) if !f(fd_Params_fee_whitelist, value) { return } @@ -269,8 +261,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return len(x.MinGasPrices) != 0 case "opinit.opchild.v1.Params.bridge_executor": return x.BridgeExecutor != "" - case "opinit.opchild.v1.Params.host_chain_id": - return x.HostChainId != "" case "opinit.opchild.v1.Params.admin": return x.Admin != "" case "opinit.opchild.v1.Params.fee_whitelist": @@ -299,8 +289,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.MinGasPrices = nil case "opinit.opchild.v1.Params.bridge_executor": x.BridgeExecutor = "" - case "opinit.opchild.v1.Params.host_chain_id": - x.HostChainId = "" case "opinit.opchild.v1.Params.admin": x.Admin = "" case "opinit.opchild.v1.Params.fee_whitelist": @@ -336,17 +324,14 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "opinit.opchild.v1.Params.bridge_executor": value := x.BridgeExecutor return protoreflect.ValueOfString(value) - case "opinit.opchild.v1.Params.host_chain_id": - value := x.HostChainId - return protoreflect.ValueOfString(value) case "opinit.opchild.v1.Params.admin": value := x.Admin return protoreflect.ValueOfString(value) case "opinit.opchild.v1.Params.fee_whitelist": if len(x.FeeWhitelist) == 0 { - return protoreflect.ValueOfList(&_Params_7_list{}) + return protoreflect.ValueOfList(&_Params_6_list{}) } - listValue := &_Params_7_list{list: &x.FeeWhitelist} + listValue := &_Params_6_list{list: &x.FeeWhitelist} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -378,13 +363,11 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.MinGasPrices = *clv.list case "opinit.opchild.v1.Params.bridge_executor": x.BridgeExecutor = value.Interface().(string) - case "opinit.opchild.v1.Params.host_chain_id": - x.HostChainId = value.Interface().(string) case "opinit.opchild.v1.Params.admin": x.Admin = value.Interface().(string) case "opinit.opchild.v1.Params.fee_whitelist": lv := value.List() - clv := lv.(*_Params_7_list) + clv := lv.(*_Params_6_list) x.FeeWhitelist = *clv.list default: if fd.IsExtension() { @@ -416,7 +399,7 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore if x.FeeWhitelist == nil { x.FeeWhitelist = []string{} } - value := &_Params_7_list{list: &x.FeeWhitelist} + value := &_Params_6_list{list: &x.FeeWhitelist} return protoreflect.ValueOfList(value) case "opinit.opchild.v1.Params.max_validators": panic(fmt.Errorf("field max_validators of message opinit.opchild.v1.Params is not mutable")) @@ -424,8 +407,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field historical_entries of message opinit.opchild.v1.Params is not mutable")) case "opinit.opchild.v1.Params.bridge_executor": panic(fmt.Errorf("field bridge_executor of message opinit.opchild.v1.Params is not mutable")) - case "opinit.opchild.v1.Params.host_chain_id": - panic(fmt.Errorf("field host_chain_id of message opinit.opchild.v1.Params is not mutable")) case "opinit.opchild.v1.Params.admin": panic(fmt.Errorf("field admin of message opinit.opchild.v1.Params is not mutable")) default: @@ -450,13 +431,11 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Params_3_list{list: &list}) case "opinit.opchild.v1.Params.bridge_executor": return protoreflect.ValueOfString("") - case "opinit.opchild.v1.Params.host_chain_id": - return protoreflect.ValueOfString("") case "opinit.opchild.v1.Params.admin": return protoreflect.ValueOfString("") case "opinit.opchild.v1.Params.fee_whitelist": list := []string{} - return protoreflect.ValueOfList(&_Params_7_list{list: &list}) + return protoreflect.ValueOfList(&_Params_6_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.Params")) @@ -542,10 +521,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.HostChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } l = len(x.Admin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -591,7 +566,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.FeeWhitelist[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeWhitelist[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 } } if len(x.Admin) > 0 { @@ -599,13 +574,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Admin) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) i-- - dAtA[i] = 0x32 - } - if len(x.HostChainId) > 0 { - i -= len(x.HostChainId) - copy(dAtA[i:], x.HostChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.HostChainId))) - i-- dAtA[i] = 0x2a } if len(x.BridgeExecutor) > 0 { @@ -795,38 +763,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { x.BridgeExecutor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HostChainId", 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.HostChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } @@ -858,7 +794,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeWhitelist", wireType) } @@ -2034,6 +1970,8 @@ var ( md_BridgeInfo protoreflect.MessageDescriptor fd_BridgeInfo_bridge_id protoreflect.FieldDescriptor fd_BridgeInfo_bridge_addr protoreflect.FieldDescriptor + fd_BridgeInfo_l1_chain_id protoreflect.FieldDescriptor + fd_BridgeInfo_l1_client_id protoreflect.FieldDescriptor fd_BridgeInfo_bridge_config protoreflect.FieldDescriptor ) @@ -2042,6 +1980,8 @@ func init() { md_BridgeInfo = File_opinit_opchild_v1_types_proto.Messages().ByName("BridgeInfo") fd_BridgeInfo_bridge_id = md_BridgeInfo.Fields().ByName("bridge_id") fd_BridgeInfo_bridge_addr = md_BridgeInfo.Fields().ByName("bridge_addr") + fd_BridgeInfo_l1_chain_id = md_BridgeInfo.Fields().ByName("l1_chain_id") + fd_BridgeInfo_l1_client_id = md_BridgeInfo.Fields().ByName("l1_client_id") fd_BridgeInfo_bridge_config = md_BridgeInfo.Fields().ByName("bridge_config") } @@ -2122,6 +2062,18 @@ func (x *fastReflection_BridgeInfo) Range(f func(protoreflect.FieldDescriptor, p return } } + if x.L1ChainId != "" { + value := protoreflect.ValueOfString(x.L1ChainId) + if !f(fd_BridgeInfo_l1_chain_id, value) { + return + } + } + if x.L1ClientId != "" { + value := protoreflect.ValueOfString(x.L1ClientId) + if !f(fd_BridgeInfo_l1_client_id, value) { + return + } + } if x.BridgeConfig != nil { value := protoreflect.ValueOfMessage(x.BridgeConfig.ProtoReflect()) if !f(fd_BridgeInfo_bridge_config, value) { @@ -2147,6 +2099,10 @@ func (x *fastReflection_BridgeInfo) Has(fd protoreflect.FieldDescriptor) bool { return x.BridgeId != uint64(0) case "opinit.opchild.v1.BridgeInfo.bridge_addr": return x.BridgeAddr != "" + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + return x.L1ChainId != "" + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + return x.L1ClientId != "" case "opinit.opchild.v1.BridgeInfo.bridge_config": return x.BridgeConfig != nil default: @@ -2169,6 +2125,10 @@ func (x *fastReflection_BridgeInfo) Clear(fd protoreflect.FieldDescriptor) { x.BridgeId = uint64(0) case "opinit.opchild.v1.BridgeInfo.bridge_addr": x.BridgeAddr = "" + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + x.L1ChainId = "" + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + x.L1ClientId = "" case "opinit.opchild.v1.BridgeInfo.bridge_config": x.BridgeConfig = nil default: @@ -2193,6 +2153,12 @@ func (x *fastReflection_BridgeInfo) Get(descriptor protoreflect.FieldDescriptor) case "opinit.opchild.v1.BridgeInfo.bridge_addr": value := x.BridgeAddr return protoreflect.ValueOfString(value) + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + value := x.L1ChainId + return protoreflect.ValueOfString(value) + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + value := x.L1ClientId + return protoreflect.ValueOfString(value) case "opinit.opchild.v1.BridgeInfo.bridge_config": value := x.BridgeConfig return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -2220,6 +2186,10 @@ func (x *fastReflection_BridgeInfo) Set(fd protoreflect.FieldDescriptor, value p x.BridgeId = value.Uint() case "opinit.opchild.v1.BridgeInfo.bridge_addr": x.BridgeAddr = value.Interface().(string) + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + x.L1ChainId = value.Interface().(string) + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + x.L1ClientId = value.Interface().(string) case "opinit.opchild.v1.BridgeInfo.bridge_config": x.BridgeConfig = value.Message().Interface().(*v1.BridgeConfig) default: @@ -2251,6 +2221,10 @@ func (x *fastReflection_BridgeInfo) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field bridge_id of message opinit.opchild.v1.BridgeInfo is not mutable")) case "opinit.opchild.v1.BridgeInfo.bridge_addr": panic(fmt.Errorf("field bridge_addr of message opinit.opchild.v1.BridgeInfo is not mutable")) + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + panic(fmt.Errorf("field l1_chain_id of message opinit.opchild.v1.BridgeInfo is not mutable")) + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + panic(fmt.Errorf("field l1_client_id of message opinit.opchild.v1.BridgeInfo is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: opinit.opchild.v1.BridgeInfo")) @@ -2268,6 +2242,10 @@ func (x *fastReflection_BridgeInfo) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfUint64(uint64(0)) case "opinit.opchild.v1.BridgeInfo.bridge_addr": return protoreflect.ValueOfString("") + case "opinit.opchild.v1.BridgeInfo.l1_chain_id": + return protoreflect.ValueOfString("") + case "opinit.opchild.v1.BridgeInfo.l1_client_id": + return protoreflect.ValueOfString("") case "opinit.opchild.v1.BridgeInfo.bridge_config": m := new(v1.BridgeConfig) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -2347,6 +2325,14 @@ func (x *fastReflection_BridgeInfo) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.L1ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.L1ClientId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.BridgeConfig != nil { l = options.Size(x.BridgeConfig) n += 1 + l + runtime.Sov(uint64(l)) @@ -2392,6 +2378,20 @@ func (x *fastReflection_BridgeInfo) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- + dAtA[i] = 0x2a + } + if len(x.L1ClientId) > 0 { + i -= len(x.L1ClientId) + copy(dAtA[i:], x.L1ClientId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.L1ClientId))) + i-- + dAtA[i] = 0x22 + } + if len(x.L1ChainId) > 0 { + i -= len(x.L1ChainId) + copy(dAtA[i:], x.L1ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.L1ChainId))) + i-- dAtA[i] = 0x1a } if len(x.BridgeAddr) > 0 { @@ -2507,6 +2507,70 @@ func (x *fastReflection_BridgeInfo) ProtoMethods() *protoiface.Methods { x.BridgeAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field L1ChainId", 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.L1ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field L1ClientId", 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.L1ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BridgeConfig", wireType) } @@ -2604,12 +2668,10 @@ type Params struct { // the account address of bridge executor who can execute permissioned bridge // messages. BridgeExecutor string `protobuf:"bytes,4,opt,name=bridge_executor,json=bridgeExecutor,proto3" json:"bridge_executor,omitempty"` - // the host(l1) chain id. - HostChainId string `protobuf:"bytes,5,opt,name=host_chain_id,json=hostChainId,proto3" json:"host_chain_id,omitempty"` // the account address of admin who can execute permissioned cosmos messages. - Admin string `protobuf:"bytes,6,opt,name=admin,proto3" json:"admin,omitempty"` + Admin string `protobuf:"bytes,5,opt,name=admin,proto3" json:"admin,omitempty"` // the list of addresses that are allowed to pay zero fee. - FeeWhitelist []string `protobuf:"bytes,7,rep,name=fee_whitelist,json=feeWhitelist,proto3" json:"fee_whitelist,omitempty"` + FeeWhitelist []string `protobuf:"bytes,6,rep,name=fee_whitelist,json=feeWhitelist,proto3" json:"fee_whitelist,omitempty"` } func (x *Params) Reset() { @@ -2660,13 +2722,6 @@ func (x *Params) GetBridgeExecutor() string { return "" } -func (x *Params) GetHostChainId() string { - if x != nil { - return x.HostChainId - } - return "" -} - func (x *Params) GetAdmin() string { if x != nil { return x.Admin @@ -2800,8 +2855,13 @@ type BridgeInfo struct { BridgeId uint64 `protobuf:"varint,1,opt,name=bridge_id,json=bridgeId,proto3" json:"bridge_id,omitempty"` // bridge_addr is the address of the bridge on l1. BridgeAddr string `protobuf:"bytes,2,opt,name=bridge_addr,json=bridgeAddr,proto3" json:"bridge_addr,omitempty"` + // l1_chain_id is the chain id of the l1 chain. + L1ChainId string `protobuf:"bytes,3,opt,name=l1_chain_id,json=l1ChainId,proto3" json:"l1_chain_id,omitempty"` + // l1_client_id is the IBC client ID, which is allocated for l1 chain, in l2 chain state. + // This is used to verify the validator set in oracle update messages. + L1ClientId string `protobuf:"bytes,4,opt,name=l1_client_id,json=l1ClientId,proto3" json:"l1_client_id,omitempty"` // bridge_config is the configuration of the bridge. - BridgeConfig *v1.BridgeConfig `protobuf:"bytes,3,opt,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config,omitempty"` + BridgeConfig *v1.BridgeConfig `protobuf:"bytes,5,opt,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config,omitempty"` } func (x *BridgeInfo) Reset() { @@ -2838,6 +2898,20 @@ func (x *BridgeInfo) GetBridgeAddr() string { return "" } +func (x *BridgeInfo) GetL1ChainId() string { + if x != nil { + return x.L1ChainId + } + return "" +} + +func (x *BridgeInfo) GetL1ClientId() string { + if x != nil { + return x.L1ClientId + } + return "" +} + func (x *BridgeInfo) GetBridgeConfig() *v1.BridgeConfig { if x != nil { return x.BridgeConfig @@ -2862,7 +2936,7 @@ var file_opinit_opchild_v1_types_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1b, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x68, 0x6f, 0x73, 0x74, 0x2f, 0x76, 0x31, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x04, 0x0a, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x76, @@ -2887,72 +2961,74 @@ var file_opinit_opchild_v1_types_proto_rawDesc = []byte{ 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x22, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x62, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x68, - 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x68, 0x6f, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, - 0x43, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, - 0xf2, 0xde, 0x1f, 0x0c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x5a, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x77, 0x68, 0x69, 0x74, - 0x65, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x42, 0x35, 0xf2, 0xde, 0x1f, - 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x66, 0x65, 0x65, 0x5f, 0x77, 0x68, 0x69, 0x74, 0x65, - 0x6c, 0x69, 0x73, 0x74, 0x22, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, - 0x3a, 0x1b, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x6f, - 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xbb, 0x02, - 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x6d, - 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xf2, 0xde, - 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x22, - 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x10, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, - 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x74, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x42, 0x33, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xca, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x5f, - 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xf2, 0xde, 0x1f, - 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x6f, 0x77, 0x65, - 0x72, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x0c, 0x88, - 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x5f, 0x0a, 0x10, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x45, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xb4, 0x01, 0x0a, - 0x0a, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x62, - 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, - 0x67, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x69, - 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x68, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x42, 0xd0, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x15, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x4f, 0x50, 0x69, 0x6e, - 0x69, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x4f, 0x58, 0xaa, 0x02, 0x11, 0x4f, 0x70, 0x69, 0x6e, 0x69, - 0x74, 0x2e, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x4f, - 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x1d, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, - 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x13, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x3a, 0x3a, 0x4f, 0x70, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x67, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x43, 0x0a, 0x05, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xf2, 0xde, 0x1f, 0x0c, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x12, 0x5a, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x35, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x66, 0x65, 0x65, 0x5f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, + 0x22, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, + 0x66, 0x65, 0x65, 0x57, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x1b, 0x98, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x6f, 0x70, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xbb, 0x02, 0x0a, 0x09, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x12, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x22, 0x52, 0x07, 0x6d, 0x6f, + 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x74, 0x0a, + 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x33, 0xf2, + 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x6f, 0x77, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x73, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x5f, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x07, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0xf6, 0x01, 0x0a, 0x0a, 0x42, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, + 0x1e, 0x0a, 0x0b, 0x6c, 0x31, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x31, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x20, 0x0a, 0x0c, 0x6c, 0x31, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x31, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x4e, 0x0a, 0x0d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, + 0x74, 0x2e, 0x6f, 0x70, 0x68, 0x6f, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x69, 0x64, + 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x42, 0xd0, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xa8, 0xe2, 0x1e, 0x01, 0x0a, 0x15, 0x63, 0x6f, + 0x6d, 0x2e, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x4f, 0x50, 0x69, 0x6e, 0x69, 0x74, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2f, 0x6f, 0x70, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4f, 0x4f, 0x58, 0xaa, 0x02, 0x11, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x2e, + 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x4f, 0x70, 0x69, + 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1d, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x5c, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x4f, 0x70, 0x69, 0x6e, 0x69, 0x74, 0x3a, 0x3a, 0x4f, 0x70, 0x63, 0x68, 0x69, 0x6c, 0x64, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/opinit/opchild/v1/query.proto b/proto/opinit/opchild/v1/query.proto index 34597f7a..da342386 100644 --- a/proto/opinit/opchild/v1/query.proto +++ b/proto/opinit/opchild/v1/query.proto @@ -28,6 +28,7 @@ service Query { option (google.api.http).get = "/opinit/opchild/v1/validator/{validator_addr}"; } + // BridgeInfo queries the bridge information. rpc BridgeInfo(QueryBridgeInfoRequest) returns (QueryBridgeInfoResponse) { option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/opinit/opchild/v1/bridge_info"; diff --git a/proto/opinit/opchild/v1/types.proto b/proto/opinit/opchild/v1/types.proto index 63beb9bf..4a3492f0 100644 --- a/proto/opinit/opchild/v1/types.proto +++ b/proto/opinit/opchild/v1/types.proto @@ -35,16 +35,14 @@ message Params { (amino.dont_omitempty) = true, (gogoproto.moretags) = "yaml:\"bridge_executor\"" ]; - //the host(l1) chain id. - string host_chain_id = 5; // the account address of admin who can execute permissioned cosmos messages. - string admin = 6 [ + string admin = 5 [ (cosmos_proto.scalar) = "cosmos.AddressString", (amino.dont_omitempty) = true, (gogoproto.moretags) = "yaml:\"admin\"" ]; // the list of addresses that are allowed to pay zero fee. - repeated string fee_whitelist = 7 [ + repeated string fee_whitelist = 6 [ (cosmos_proto.scalar) = "cosmos.AddressString", (amino.dont_omitempty) = true, (gogoproto.moretags) = "yaml:\"fee_whitelist\"" @@ -92,6 +90,13 @@ message BridgeInfo { // bridge_addr is the address of the bridge on l1. string bridge_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // l1_chain_id is the chain id of the l1 chain. + string l1_chain_id = 3; + + // l1_client_id is the IBC client ID, which is allocated for l1 chain, in l2 chain state. + // This is used to verify the validator set in oracle update messages. + string l1_client_id = 4; + // bridge_config is the configuration of the bridge. - opinit.ophost.v1.BridgeConfig bridge_config = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + opinit.ophost.v1.BridgeConfig bridge_config = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/x/opchild/client/cli/tx.go b/x/opchild/client/cli/tx.go index 4e6813a0..651949f7 100644 --- a/x/opchild/client/cli/tx.go +++ b/x/opchild/client/cli/tx.go @@ -38,6 +38,7 @@ func GetTxCmd(ac address.Codec) *cobra.Command { NewDepositCmd(ac), NewWithdrawCmd(ac), NewSetBridgeInfoCmd(ac), + NewUpdateOracleCmd(ac), ) return opchildTxCmd @@ -254,13 +255,13 @@ Where proposal.json contains: // NewSetBridgeInfoCmd returns a CLI command handler for transaction to setting a bridge info. func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ - Use: "set-bridge-info [bridge-id] [bridge-addr] [path/to/bridge-config.json]", + Use: "set-bridge-info [bridge-id] [bridge-addr] [l1-chain-id] [l1-client-id] [path/to/bridge-config.json]", Short: "send a bridge creating tx", Long: strings.TrimSpace( fmt.Sprintf( `send a tx to set a bridge info with a config file as a json. Example: - $ %s tx ophost set-bridge-info 1 init10d07y265gmmuvt4z0w9aw880jnsr700j55nka3 path/to/bridge-config.json + $ %s tx ophost set-bridge-info 1 init10d07y265gmmuvt4z0w9aw880jnsr700j55nka3 mahalo-2 07-tendermint-0 path/to/bridge-config.json Where bridge-config.json contains: { @@ -274,7 +275,7 @@ func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { }`, version.AppName, ), ), - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -287,8 +288,10 @@ func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { } bridgeAddr := args[1] + l1ChainId := args[2] + l1ClientId := args[3] - configBytes, err := os.ReadFile(args[2]) + configBytes, err := os.ReadFile(args[4]) if err != nil { return err } @@ -335,6 +338,8 @@ func NewSetBridgeInfoCmd(ac address.Codec) *cobra.Command { msg := types.NewMsgSetBridgeInfo(fromAddr, types.BridgeInfo{ BridgeId: bridgeId, BridgeAddr: bridgeAddr, + L1ChainId: l1ChainId, + L1ClientId: l1ClientId, BridgeConfig: bridgeConfig, }) if err = msg.Validate(ac); err != nil { diff --git a/x/opchild/client/cli/tx_test.go b/x/opchild/client/cli/tx_test.go index ae48a71b..94ebb511 100644 --- a/x/opchild/client/cli/tx_test.go +++ b/x/opchild/client/cli/tx_test.go @@ -445,6 +445,8 @@ func (s *CLITestSuite) TestNewSetBridgeInfo() { []string{ "1", "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", + "l1-chain-id", + "l1-client-id", invalidConfig.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, addr0), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -458,6 +460,8 @@ func (s *CLITestSuite) TestNewSetBridgeInfo() { []string{ "1", "init1q6jhwnarkw2j5qqgx3qlu20k8nrdglft5ksr0g", + "l1-chain-id", + "l1-client-id", validConfig.Name(), fmt.Sprintf("--%s=%s", flags.FlagFrom, addr0), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), diff --git a/x/opchild/keeper/keeper.go b/x/opchild/keeper/keeper.go index 2e65a7a9..94f1cf39 100644 --- a/x/opchild/keeper/keeper.go +++ b/x/opchild/keeper/keeper.go @@ -158,15 +158,15 @@ func (k Keeper) setDenomMetadata(ctx context.Context, baseDenom, denom string) { } // UpdateHostValidatorSet updates the host validator set. -func (k Keeper) UpdateHostValidatorSet(ctx context.Context, chainID string, height int64, validatorSet *cmtproto.ValidatorSet) error { - if chainID == "" { +func (k Keeper) UpdateHostValidatorSet(ctx context.Context, clientID string, height int64, validatorSet *cmtproto.ValidatorSet) error { + if clientID == "" { return nil } // ignore if the chain ID is not the host chain ID - if hostChainID, err := k.HostChainId(ctx); err != nil { + if l1ClientId, err := k.L1ClientId(ctx); err != nil { return err - } else if hostChainID != chainID { + } else if l1ClientId != clientID { return nil } @@ -177,3 +177,21 @@ func (k Keeper) UpdateHostValidatorSet(ctx context.Context, chainID string, heig func (k Keeper) ApplyOracleUpdate(ctx context.Context, height uint64, extCommitBz []byte) error { return k.l2OracleHandler.UpdateOracle(ctx, height, extCommitBz) } + +func (k Keeper) L1ClientId(ctx context.Context) (string, error) { + info, err := k.BridgeInfo.Get(ctx) + if err != nil { + return "", err + } + + return info.L1ClientId, nil +} + +func (k Keeper) L1ChainId(ctx context.Context) (string, error) { + info, err := k.BridgeInfo.Get(ctx) + if err != nil { + return "", err + } + + return info.L1ChainId, nil +} diff --git a/x/opchild/keeper/msg_server.go b/x/opchild/keeper/msg_server.go index 4b9673e8..61afbabf 100644 --- a/x/opchild/keeper/msg_server.go +++ b/x/opchild/keeper/msg_server.go @@ -313,6 +313,14 @@ func (ms MsgServer) SetBridgeInfo(ctx context.Context, req *types.MsgSetBridgeIn if info.BridgeAddr != req.BridgeInfo.BridgeAddr { return nil, types.ErrInvalidBridgeInfo.Wrapf("expected bridge addr %s, got %s", info.BridgeAddr, req.BridgeInfo.BridgeAddr) } + + if info.L1ChainId != req.BridgeInfo.L1ChainId { + return nil, types.ErrInvalidBridgeInfo.Wrapf("expected l1 chain id %s, got %s", info.L1ChainId, req.BridgeInfo.L1ChainId) + } + + if info.L1ClientId != req.BridgeInfo.L1ClientId { + return nil, types.ErrInvalidBridgeInfo.Wrapf("expected l1 client id %s, got %s", info.L1ClientId, req.BridgeInfo.L1ClientId) + } } // set bridge info @@ -327,6 +335,8 @@ func (ms MsgServer) SetBridgeInfo(ctx context.Context, req *types.MsgSetBridgeIn types.EventTypeSetBridgeInfo, sdk.NewAttribute(types.AttributeKeyBridgeId, strconv.FormatUint(req.BridgeInfo.BridgeId, 10)), sdk.NewAttribute(types.AttributeKeyBridgeAddr, req.BridgeInfo.BridgeAddr), + sdk.NewAttribute(types.AttributeKeyL1ChainId, req.BridgeInfo.L1ChainId), + sdk.NewAttribute(types.AttributeKeyL1ClientId, req.BridgeInfo.L1ClientId), ), ) diff --git a/x/opchild/keeper/msg_server_test.go b/x/opchild/keeper/msg_server_test.go index a0ae6caf..1d751704 100644 --- a/x/opchild/keeper/msg_server_test.go +++ b/x/opchild/keeper/msg_server_test.go @@ -278,6 +278,8 @@ func Test_MsgServer_SetBridgeInfo(t *testing.T) { info := types.BridgeInfo{ BridgeId: 1, BridgeAddr: addrsStr[1], + L1ChainId: "test-chain-id", + L1ClientId: "test-client-id", BridgeConfig: ophosttypes.BridgeConfig{ Challenger: addrsStr[2], Proposer: addrsStr[3], @@ -299,6 +301,19 @@ func Test_MsgServer_SetBridgeInfo(t *testing.T) { _, err = ms.SetBridgeInfo(ctx, types.NewMsgSetBridgeInfo(addrsStr[0], info)) require.NoError(t, err) + // cannot change chain id + info.L1ChainId = "test-chain-id-2" + _, err = ms.SetBridgeInfo(ctx, types.NewMsgSetBridgeInfo(addrsStr[0], info)) + require.Error(t, err) + + // cannot change client id + info.L1ChainId = "test-chain-id" + info.L1ClientId = "test-client-id-2" + _, err = ms.SetBridgeInfo(ctx, types.NewMsgSetBridgeInfo(addrsStr[0], info)) + require.Error(t, err) + + info.L1ClientId = "test-client-id" + // invalid bridge id info.BridgeId = 0 @@ -408,12 +423,13 @@ func Test_MsgServer_UpdateOracle(t *testing.T) { opchildKeeper := input.OPChildKeeper oracleKeeper := input.OracleKeeper - params, err := opchildKeeper.GetParams(ctx) - require.NoError(t, err) - defaultHostChainId := "test-host-1" - params.HostChainId = defaultHostChainId - err = opchildKeeper.SetParams(ctx, params) + defaultClientId := "test-client-id" + bridgeInfo := types.BridgeInfo{ + L1ChainId: defaultHostChainId, + L1ClientId: defaultClientId, + } + err := opchildKeeper.BridgeInfo.Set(ctx, bridgeInfo) require.NoError(t, err) oracleKeeper.InitGenesis(sdk.UnwrapSDKContext(ctx), oracletypes.GenesisState{ @@ -439,7 +455,7 @@ func Test_MsgServer_UpdateOracle(t *testing.T) { cpStrategy, extendedCommitCodec, voteExtensionCodec := getSlinky(oracleKeeper) valPrivKeys, _, validatorSet := createCmtValidatorSet(t, numVals) - err = opchildKeeper.UpdateHostValidatorSet(ctx, defaultHostChainId, 1, validatorSet) + err = opchildKeeper.UpdateHostValidatorSet(ctx, defaultClientId, 1, validatorSet) require.NoError(t, err) eci := cometabci.ExtendedCommitInfo{ diff --git a/x/opchild/keeper/oracle.go b/x/opchild/keeper/oracle.go index f2d8fff4..02f380e7 100644 --- a/x/opchild/keeper/oracle.go +++ b/x/opchild/keeper/oracle.go @@ -69,7 +69,8 @@ func (k L2OracleHandler) UpdateOracle(ctx context.Context, height uint64, extCom } sdkCtx := sdk.UnwrapSDKContext(ctx) - hostChainID, err := k.HostChainId(ctx) + + hostChainID, err := k.L1ChainId(ctx) if err != nil { return err } diff --git a/x/opchild/keeper/oracle_test.go b/x/opchild/keeper/oracle_test.go index d23502df..9c2308e9 100644 --- a/x/opchild/keeper/oracle_test.go +++ b/x/opchild/keeper/oracle_test.go @@ -5,6 +5,7 @@ import ( "math/big" "testing" + "github.com/initia-labs/OPinit/x/opchild/types" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -65,42 +66,42 @@ func getSlinky(oracleKeeper *oraclekeeper.Keeper) (currencypair.CurrencyPairStra } func Test_UpdateHostValidatorSet(t *testing.T) { - defaultHostChainId := "test-host-1" + defaultClientId := "test-client-id" testCases := []struct { - name string - hostChainId string - hostHeight int64 - numVals int - expectError bool + name string + hostClientId string + hostHeight int64 + numVals int + expectError bool }{ { - name: "empty chain id", - hostChainId: "", - hostHeight: 100, - numVals: 10, - expectError: true, + name: "empty chain id", + hostClientId: "", + hostHeight: 100, + numVals: 10, + expectError: true, }, { - name: "different chain id", - hostChainId: "test-host-12", - hostHeight: 100, - numVals: 10, - expectError: true, + name: "different chain id", + hostClientId: "test-host-12", + hostHeight: 100, + numVals: 10, + expectError: true, }, { - name: "zero height", - hostChainId: defaultHostChainId, - hostHeight: 0, - numVals: 10, - expectError: true, + name: "zero height", + hostClientId: defaultClientId, + hostHeight: 0, + numVals: 10, + expectError: true, }, { - name: "good host chain id, height, validators", - hostChainId: defaultHostChainId, - hostHeight: 100, - numVals: 10, - expectError: false, + name: "good host chain id, height, validators", + hostClientId: defaultClientId, + hostHeight: 100, + numVals: 10, + expectError: false, }, } @@ -110,14 +111,14 @@ func Test_UpdateHostValidatorSet(t *testing.T) { opchildKeeper := input.OPChildKeeper hostValidatorStore := opchildKeeper.HostValidatorStore - params, err := opchildKeeper.GetParams(ctx) - require.NoError(t, err) - params.HostChainId = defaultHostChainId - err = opchildKeeper.SetParams(ctx, params) + bridgeInfo := types.BridgeInfo{ + L1ClientId: defaultClientId, + } + err := opchildKeeper.BridgeInfo.Set(ctx, bridgeInfo) require.NoError(t, err) _, valPubKeys, validatorSet := createCmtValidatorSet(t, tc.numVals) - err = opchildKeeper.UpdateHostValidatorSet(ctx, tc.hostChainId, tc.hostHeight, validatorSet) + err = opchildKeeper.UpdateHostValidatorSet(ctx, tc.hostClientId, tc.hostHeight, validatorSet) if tc.expectError { // no error but no validator update require.NoError(t, err) @@ -144,6 +145,7 @@ func Test_UpdateHostValidatorSet(t *testing.T) { } func Test_UpdateOracle(t *testing.T) { + defaultClientId := "test-client-id" defaultHostChainId := "test-host-1" testCases := []struct { @@ -241,10 +243,11 @@ func Test_UpdateOracle(t *testing.T) { opchildKeeper := input.OPChildKeeper oracleKeeper := input.OracleKeeper - params, err := opchildKeeper.GetParams(ctx) - require.NoError(t, err) - params.HostChainId = defaultHostChainId - err = opchildKeeper.SetParams(ctx, params) + bridgeInfo := types.BridgeInfo{ + L1ChainId: defaultHostChainId, + L1ClientId: defaultClientId, + } + err := opchildKeeper.BridgeInfo.Set(ctx, bridgeInfo) require.NoError(t, err) oracleKeeper.InitGenesis(sdk.UnwrapSDKContext(ctx), oracletypes.GenesisState{ @@ -259,7 +262,7 @@ func Test_UpdateOracle(t *testing.T) { cpStrategy, extendedCommitCodec, voteExtensionCodec := getSlinky(oracleKeeper) valPrivKeys, _, validatorSet := createCmtValidatorSet(t, tc.numVals) - err = opchildKeeper.UpdateHostValidatorSet(ctx, defaultHostChainId, 1, validatorSet) + err = opchildKeeper.UpdateHostValidatorSet(ctx, defaultClientId, 1, validatorSet) require.NoError(t, err) eci := cometabci.ExtendedCommitInfo{ diff --git a/x/opchild/keeper/params.go b/x/opchild/keeper/params.go index ff29fc16..8948c6ee 100644 --- a/x/opchild/keeper/params.go +++ b/x/opchild/keeper/params.go @@ -49,11 +49,3 @@ func (k Keeper) MinGasPrices(ctx context.Context) (sdk.DecCoins, error) { return params.MinGasPrices, nil } - -func (k Keeper) HostChainId(ctx context.Context) (string, error) { - params, err := k.GetParams(ctx) - if err != nil { - return "", err - } - return params.HostChainId, nil -} diff --git a/x/opchild/types/events.go b/x/opchild/types/events.go index e660c9aa..6f9515ab 100644 --- a/x/opchild/types/events.go +++ b/x/opchild/types/events.go @@ -15,6 +15,8 @@ const ( AttributeKeySender = "sender" AttributeKeyBridgeId = "bridge_id" AttributeKeyBridgeAddr = "bridge_addr" + AttributeKeyL1ChainId = "l1_chain_id" + AttributeKeyL1ClientId = "l1_client_id" AttributeKeyRecipient = "recipient" AttributeKeyAmount = "amount" AttributeKeyDenom = "denom" diff --git a/x/opchild/types/params.go b/x/opchild/types/params.go index c94ed035..96458828 100644 --- a/x/opchild/types/params.go +++ b/x/opchild/types/params.go @@ -10,7 +10,6 @@ import ( var ( DefaultMinGasPrices = sdk.NewDecCoins(sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyNewDecWithPrec(15, 2))) // 0.15 - DefaultHostChainId = "mahalo-2" ) // DefaultParams returns default move parameters @@ -21,20 +20,18 @@ func DefaultParams() Params { DefaultMaxValidators, DefaultHistoricalEntries, DefaultMinGasPrices, - DefaultHostChainId, []string{}, ) } // NewParams creates a new Params instance -func NewParams(admin, bridgeExecutor string, maxValidators, historicalEntries uint32, minGasPrice sdk.DecCoins, hostChainId string, feeWhitelist []string) Params { +func NewParams(admin, bridgeExecutor string, maxValidators, historicalEntries uint32, minGasPrice sdk.DecCoins, feeWhitelist []string) Params { return Params{ Admin: admin, BridgeExecutor: bridgeExecutor, MaxValidators: maxValidators, HistoricalEntries: historicalEntries, MinGasPrices: minGasPrice, - HostChainId: hostChainId, FeeWhitelist: feeWhitelist, } diff --git a/x/opchild/types/query.pb.go b/x/opchild/types/query.pb.go index c4cbe831..a9799c44 100644 --- a/x/opchild/types/query.pb.go +++ b/x/opchild/types/query.pb.go @@ -467,6 +467,7 @@ type QueryClient interface { Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) // Validator queries validator info for given validator address. Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) + // BridgeInfo queries the bridge information. BridgeInfo(ctx context.Context, in *QueryBridgeInfoRequest, opts ...grpc.CallOption) (*QueryBridgeInfoResponse, error) // Parameters queries the rollup parameters. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) @@ -525,6 +526,7 @@ type QueryServer interface { Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) // Validator queries validator info for given validator address. Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) + // BridgeInfo queries the bridge information. BridgeInfo(context.Context, *QueryBridgeInfoRequest) (*QueryBridgeInfoResponse, error) // Parameters queries the rollup parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) diff --git a/x/opchild/types/types.pb.go b/x/opchild/types/types.pb.go index 329ac3e5..f95ee014 100644 --- a/x/opchild/types/types.pb.go +++ b/x/opchild/types/types.pb.go @@ -40,12 +40,10 @@ type Params struct { // the account address of bridge executor who can execute permissioned bridge // messages. BridgeExecutor string `protobuf:"bytes,4,opt,name=bridge_executor,json=bridgeExecutor,proto3" json:"bridge_executor,omitempty" yaml:"bridge_executor"` - //the host(l1) chain id. - HostChainId string `protobuf:"bytes,5,opt,name=host_chain_id,json=hostChainId,proto3" json:"host_chain_id,omitempty"` // the account address of admin who can execute permissioned cosmos messages. - Admin string `protobuf:"bytes,6,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"` + Admin string `protobuf:"bytes,5,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"` // the list of addresses that are allowed to pay zero fee. - FeeWhitelist []string `protobuf:"bytes,7,rep,name=fee_whitelist,json=feeWhitelist,proto3" json:"fee_whitelist,omitempty" yaml:"fee_whitelist"` + FeeWhitelist []string `protobuf:"bytes,6,rep,name=fee_whitelist,json=feeWhitelist,proto3" json:"fee_whitelist,omitempty" yaml:"fee_whitelist"` } func (m *Params) Reset() { *m = Params{} } @@ -177,8 +175,13 @@ type BridgeInfo struct { BridgeId uint64 `protobuf:"varint,1,opt,name=bridge_id,json=bridgeId,proto3" json:"bridge_id,omitempty"` // bridge_addr is the address of the bridge on l1. BridgeAddr string `protobuf:"bytes,2,opt,name=bridge_addr,json=bridgeAddr,proto3" json:"bridge_addr,omitempty"` + // l1_chain_id is the chain id of the l1 chain. + L1ChainId string `protobuf:"bytes,3,opt,name=l1_chain_id,json=l1ChainId,proto3" json:"l1_chain_id,omitempty"` + // l1_client_id is the IBC client ID, which is allocated for l1 chain, in l2 chain state. + // This is used to verify the validator set in oracle update messages. + L1ClientId string `protobuf:"bytes,4,opt,name=l1_client_id,json=l1ClientId,proto3" json:"l1_client_id,omitempty"` // bridge_config is the configuration of the bridge. - BridgeConfig types3.BridgeConfig `protobuf:"bytes,3,opt,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config"` + BridgeConfig types3.BridgeConfig `protobuf:"bytes,5,opt,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config"` } func (m *BridgeInfo) Reset() { *m = BridgeInfo{} } @@ -224,62 +227,63 @@ func init() { func init() { proto.RegisterFile("opinit/opchild/v1/types.proto", fileDescriptor_2cc6df244b706d68) } var fileDescriptor_2cc6df244b706d68 = []byte{ - // 869 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xd6, 0x69, 0x83, 0x27, 0xb6, 0x93, 0x8c, 0x52, 0xd8, 0x24, 0xed, 0xae, 0xb5, 0x27, - 0xab, 0xe0, 0x5d, 0xb9, 0x05, 0x21, 0x72, 0xa2, 0x1b, 0x02, 0x8a, 0x8a, 0xa8, 0xb5, 0x08, 0x90, - 0x7a, 0x59, 0x66, 0x77, 0xc7, 0xf6, 0x28, 0xde, 0x99, 0xd5, 0xce, 0xd8, 0x8d, 0xbf, 0x01, 0xe2, - 0x02, 0x47, 0x8e, 0x39, 0x56, 0x9c, 0x7a, 0xe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 0x76, 0x65, 0x19, 0x97, 0x57, 0x96, 0xf1, 0xf2, 0xca, 0x32, 0xfe, 0xbc, 0xb2, 0x8c, - 0x1f, 0xaf, 0xad, 0xca, 0xcb, 0x6b, 0xab, 0xf2, 0xfb, 0xb5, 0x55, 0x79, 0xd2, 0x59, 0x19, 0xfb, - 0x32, 0x05, 0x41, 0x9d, 0x11, 0x8a, 0xb8, 0xf7, 0xb8, 0x27, 0xb7, 0xe3, 0xf9, 0x62, 0xdb, 0xcb, - 0x0d, 0x10, 0xdd, 0x92, 0x0d, 0xf0, 0xe0, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0x0b, 0x85, - 0xd7, 0x0c, 0x06, 0x00, 0x00, + // 889 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xd6, 0x69, 0xca, 0x8e, 0x1d, 0x27, 0x19, 0xa5, 0xe0, 0x24, 0xed, 0xae, 0xb5, 0x27, + 0xab, 0xe0, 0x5d, 0x39, 0x05, 0x21, 0x72, 0xa2, 0x6b, 0x02, 0x8a, 0x8a, 0xa8, 0xb5, 0x08, 0x90, + 0x7a, 0x59, 0x66, 0x77, 0xc7, 0xf6, 0x28, 0xbb, 0x33, 0xd6, 0xce, 0xd8, 0x8d, 0xff, 0x03, 0xc4, + 0x05, 0x8e, 0x1c, 0x73, 0xac, 0x38, 0xf5, 0xc0, 0x8d, 0x7f, 0x20, 0xea, 0xa9, 0xe2, 0xc4, 0xc9, + 0x40, 0x72, 0x28, 0x67, 0x1f, 0x38, 0xa3, 0x9d, 0x19, 0xff, 0xa8, 0x11, 0xca, 0xc5, 0x9e, 0x79, + 0xdf, 0xf7, 0xde, 0xcc, 0x7c, 0xf3, 0xbd, 0x59, 0x70, 0x9f, 0x0d, 0x09, 0x25, 0xc2, 0x63, 0xc3, + 0x78, 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, 0xbf, 0xb6, 0x4a, 0x4f, + 0x5b, 0x2b, 0x8f, 0x42, 0xb1, 0x04, 0x41, 0xad, 0x14, 0x45, 0xdc, 0x7b, 0xd2, 0x95, 0x6f, 0xe7, + 0xf9, 0xe2, 0x5b, 0x20, 0xdf, 0x87, 0x68, 0x53, 0x5a, 0xe8, 0xe1, 0xbf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xfc, 0x5c, 0x31, 0xd3, 0x2a, 0x06, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -318,9 +322,6 @@ func (this *Params) Equal(that interface{}) bool { if this.BridgeExecutor != that1.BridgeExecutor { return false } - if this.HostChainId != that1.HostChainId { - return false - } if this.Admin != that1.Admin { return false } @@ -359,6 +360,12 @@ func (this *BridgeInfo) Equal(that interface{}) bool { if this.BridgeAddr != that1.BridgeAddr { return false } + if this.L1ChainId != that1.L1ChainId { + return false + } + if this.L1ClientId != that1.L1ClientId { + return false + } if !this.BridgeConfig.Equal(&that1.BridgeConfig) { return false } @@ -390,7 +397,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.FeeWhitelist[iNdEx]) i = encodeVarintTypes(dAtA, i, uint64(len(m.FeeWhitelist[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 } } if len(m.Admin) > 0 { @@ -398,13 +405,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Admin) i = encodeVarintTypes(dAtA, i, uint64(len(m.Admin))) i-- - dAtA[i] = 0x32 - } - if len(m.HostChainId) > 0 { - i -= len(m.HostChainId) - copy(dAtA[i:], m.HostChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.HostChainId))) - i-- dAtA[i] = 0x2a } if len(m.BridgeExecutor) > 0 { @@ -561,7 +561,21 @@ func (m *BridgeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a + if len(m.L1ClientId) > 0 { + i -= len(m.L1ClientId) + copy(dAtA[i:], m.L1ClientId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.L1ClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.L1ChainId) > 0 { + i -= len(m.L1ChainId) + copy(dAtA[i:], m.L1ChainId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.L1ChainId))) + i-- + dAtA[i] = 0x1a + } if len(m.BridgeAddr) > 0 { i -= len(m.BridgeAddr) copy(dAtA[i:], m.BridgeAddr) @@ -610,10 +624,6 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - l = len(m.HostChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } l = len(m.Admin) if l > 0 { n += 1 + l + sovTypes(uint64(l)) @@ -679,6 +689,14 @@ func (m *BridgeInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = len(m.L1ChainId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.L1ClientId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } l = m.BridgeConfig.Size() n += 1 + l + sovTypes(uint64(l)) return n @@ -824,38 +842,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { m.BridgeExecutor = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } @@ -887,7 +873,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FeeWhitelist", wireType) } @@ -1274,6 +1260,70 @@ func (m *BridgeInfo) Unmarshal(dAtA []byte) error { m.BridgeAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field L1ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.L1ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field L1ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.L1ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BridgeConfig", wireType) }