diff --git a/api/feemarket/feemarket/v1/genesis.pulsar.go b/api/feemarket/feemarket/v1/genesis.pulsar.go index f4295da..1ffff91 100644 --- a/api/feemarket/feemarket/v1/genesis.pulsar.go +++ b/api/feemarket/feemarket/v1/genesis.pulsar.go @@ -575,17 +575,17 @@ func (x *_State_3_list) IsValid() bool { } var ( - md_State protoreflect.MessageDescriptor - fd_State_base_fee protoreflect.FieldDescriptor - fd_State_learning_rate protoreflect.FieldDescriptor - fd_State_window protoreflect.FieldDescriptor - fd_State_index protoreflect.FieldDescriptor + md_State protoreflect.MessageDescriptor + fd_State_base_gas_price protoreflect.FieldDescriptor + fd_State_learning_rate protoreflect.FieldDescriptor + fd_State_window protoreflect.FieldDescriptor + fd_State_index protoreflect.FieldDescriptor ) func init() { file_feemarket_feemarket_v1_genesis_proto_init() md_State = File_feemarket_feemarket_v1_genesis_proto.Messages().ByName("State") - fd_State_base_fee = md_State.Fields().ByName("base_fee") + fd_State_base_gas_price = md_State.Fields().ByName("base_gas_price") fd_State_learning_rate = md_State.Fields().ByName("learning_rate") fd_State_window = md_State.Fields().ByName("window") fd_State_index = md_State.Fields().ByName("index") @@ -656,9 +656,9 @@ func (x *fastReflection_State) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_State) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.BaseFee != "" { - value := protoreflect.ValueOfString(x.BaseFee) - if !f(fd_State_base_fee, value) { + if x.BaseGasPrice != "" { + value := protoreflect.ValueOfString(x.BaseGasPrice) + if !f(fd_State_base_gas_price, value) { return } } @@ -695,8 +695,8 @@ func (x *fastReflection_State) Range(f func(protoreflect.FieldDescriptor, protor // a repeated field is populated if it is non-empty. func (x *fastReflection_State) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "feemarket.feemarket.v1.State.base_fee": - return x.BaseFee != "" + case "feemarket.feemarket.v1.State.base_gas_price": + return x.BaseGasPrice != "" case "feemarket.feemarket.v1.State.learning_rate": return x.LearningRate != "" case "feemarket.feemarket.v1.State.window": @@ -719,8 +719,8 @@ func (x *fastReflection_State) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_State) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "feemarket.feemarket.v1.State.base_fee": - x.BaseFee = "" + case "feemarket.feemarket.v1.State.base_gas_price": + x.BaseGasPrice = "" case "feemarket.feemarket.v1.State.learning_rate": x.LearningRate = "" case "feemarket.feemarket.v1.State.window": @@ -743,8 +743,8 @@ func (x *fastReflection_State) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_State) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "feemarket.feemarket.v1.State.base_fee": - value := x.BaseFee + case "feemarket.feemarket.v1.State.base_gas_price": + value := x.BaseGasPrice return protoreflect.ValueOfString(value) case "feemarket.feemarket.v1.State.learning_rate": value := x.LearningRate @@ -778,8 +778,8 @@ func (x *fastReflection_State) Get(descriptor protoreflect.FieldDescriptor) prot // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_State) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "feemarket.feemarket.v1.State.base_fee": - x.BaseFee = value.Interface().(string) + case "feemarket.feemarket.v1.State.base_gas_price": + x.BaseGasPrice = value.Interface().(string) case "feemarket.feemarket.v1.State.learning_rate": x.LearningRate = value.Interface().(string) case "feemarket.feemarket.v1.State.window": @@ -814,8 +814,8 @@ func (x *fastReflection_State) Mutable(fd protoreflect.FieldDescriptor) protoref } value := &_State_3_list{list: &x.Window} return protoreflect.ValueOfList(value) - case "feemarket.feemarket.v1.State.base_fee": - panic(fmt.Errorf("field base_fee of message feemarket.feemarket.v1.State is not mutable")) + case "feemarket.feemarket.v1.State.base_gas_price": + panic(fmt.Errorf("field base_gas_price of message feemarket.feemarket.v1.State is not mutable")) case "feemarket.feemarket.v1.State.learning_rate": panic(fmt.Errorf("field learning_rate of message feemarket.feemarket.v1.State is not mutable")) case "feemarket.feemarket.v1.State.index": @@ -833,7 +833,7 @@ func (x *fastReflection_State) Mutable(fd protoreflect.FieldDescriptor) protoref // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_State) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "feemarket.feemarket.v1.State.base_fee": + case "feemarket.feemarket.v1.State.base_gas_price": return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.State.learning_rate": return protoreflect.ValueOfString("") @@ -911,7 +911,7 @@ func (x *fastReflection_State) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.BaseFee) + l = len(x.BaseGasPrice) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -990,10 +990,10 @@ func (x *fastReflection_State) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.BaseFee) > 0 { - i -= len(x.BaseFee) - copy(dAtA[i:], x.BaseFee) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseFee))) + if len(x.BaseGasPrice) > 0 { + i -= len(x.BaseGasPrice) + copy(dAtA[i:], x.BaseGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseGasPrice))) i-- dAtA[i] = 0xa } @@ -1076,7 +1076,7 @@ func (x *fastReflection_State) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.BaseFee = string(dAtA[iNdEx:postIndex]) + x.BaseGasPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1309,9 +1309,9 @@ type State struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // BaseFee is the current base fee. This is denominated in the fee per gas - // unit. - BaseFee string `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3" json:"base_fee,omitempty"` + // BaseGasPrice is the current base fee. This is denominated in the fee per + // gas unit. + BaseGasPrice string `protobuf:"bytes,1,opt,name=base_gas_price,json=baseGasPrice,proto3" json:"base_gas_price,omitempty"` // LearningRate is the current learning rate. LearningRate string `protobuf:"bytes,2,opt,name=learning_rate,json=learningRate,proto3" json:"learning_rate,omitempty"` // Window contains a list of the last blocks' utilization values. This is used @@ -1342,9 +1342,9 @@ func (*State) Descriptor() ([]byte, []int) { return file_feemarket_feemarket_v1_genesis_proto_rawDescGZIP(), []int{1} } -func (x *State) GetBaseFee() string { +func (x *State) GetBaseGasPrice() string { if x != nil { - return x.BaseFee + return x.BaseGasPrice } return "" } @@ -1390,35 +1390,36 @@ var file_feemarket_feemarket_v1_genesis_proto_rawDesc = []byte{ 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xd8, - 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, - 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, - 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, - 0x12, 0x59, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0d, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x52, 0x0c, 0x6c, - 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, - 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x77, 0x69, 0x6e, - 0x64, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0xd9, 0x01, 0x0a, 0x1a, 0x63, 0x6f, - 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, - 0x31, 0x3b, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x46, 0x46, 0x58, 0xaa, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, - 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xe6, + 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x44, 0x65, 0x63, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x12, 0x56, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0c, 0x6c, 0x65, 0x61, + 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x42, 0xd9, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, + 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, + 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, + 0x58, 0xaa, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, + 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/feemarket/feemarket/v1/params.pulsar.go b/api/feemarket/feemarket/v1/params.pulsar.go index 8910064..c288cb5 100644 --- a/api/feemarket/feemarket/v1/params.pulsar.go +++ b/api/feemarket/feemarket/v1/params.pulsar.go @@ -15,19 +15,19 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_alpha protoreflect.FieldDescriptor - fd_Params_beta protoreflect.FieldDescriptor - fd_Params_theta protoreflect.FieldDescriptor - fd_Params_delta protoreflect.FieldDescriptor - fd_Params_min_base_fee protoreflect.FieldDescriptor - fd_Params_min_learning_rate protoreflect.FieldDescriptor - fd_Params_max_learning_rate protoreflect.FieldDescriptor - fd_Params_target_block_utilization protoreflect.FieldDescriptor - fd_Params_max_block_utilization protoreflect.FieldDescriptor - fd_Params_window protoreflect.FieldDescriptor - fd_Params_fee_denom protoreflect.FieldDescriptor - fd_Params_enabled protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_alpha protoreflect.FieldDescriptor + fd_Params_beta protoreflect.FieldDescriptor + fd_Params_gamma protoreflect.FieldDescriptor + fd_Params_delta protoreflect.FieldDescriptor + fd_Params_min_base_gas_price protoreflect.FieldDescriptor + fd_Params_min_learning_rate protoreflect.FieldDescriptor + fd_Params_max_learning_rate protoreflect.FieldDescriptor + fd_Params_max_block_utilization protoreflect.FieldDescriptor + fd_Params_window protoreflect.FieldDescriptor + fd_Params_fee_denom protoreflect.FieldDescriptor + fd_Params_enabled protoreflect.FieldDescriptor + fd_Params_distribute_fees protoreflect.FieldDescriptor ) func init() { @@ -35,16 +35,16 @@ func init() { md_Params = File_feemarket_feemarket_v1_params_proto.Messages().ByName("Params") fd_Params_alpha = md_Params.Fields().ByName("alpha") fd_Params_beta = md_Params.Fields().ByName("beta") - fd_Params_theta = md_Params.Fields().ByName("theta") + fd_Params_gamma = md_Params.Fields().ByName("gamma") fd_Params_delta = md_Params.Fields().ByName("delta") - fd_Params_min_base_fee = md_Params.Fields().ByName("min_base_fee") + fd_Params_min_base_gas_price = md_Params.Fields().ByName("min_base_gas_price") fd_Params_min_learning_rate = md_Params.Fields().ByName("min_learning_rate") fd_Params_max_learning_rate = md_Params.Fields().ByName("max_learning_rate") - fd_Params_target_block_utilization = md_Params.Fields().ByName("target_block_utilization") fd_Params_max_block_utilization = md_Params.Fields().ByName("max_block_utilization") fd_Params_window = md_Params.Fields().ByName("window") fd_Params_fee_denom = md_Params.Fields().ByName("fee_denom") fd_Params_enabled = md_Params.Fields().ByName("enabled") + fd_Params_distribute_fees = md_Params.Fields().ByName("distribute_fees") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -124,9 +124,9 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.Theta != "" { - value := protoreflect.ValueOfString(x.Theta) - if !f(fd_Params_theta, value) { + if x.Gamma != "" { + value := protoreflect.ValueOfString(x.Gamma) + if !f(fd_Params_gamma, value) { return } } @@ -136,9 +136,9 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.MinBaseFee != "" { - value := protoreflect.ValueOfString(x.MinBaseFee) - if !f(fd_Params_min_base_fee, value) { + if x.MinBaseGasPrice != "" { + value := protoreflect.ValueOfString(x.MinBaseGasPrice) + if !f(fd_Params_min_base_gas_price, value) { return } } @@ -154,12 +154,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.TargetBlockUtilization != uint64(0) { - value := protoreflect.ValueOfUint64(x.TargetBlockUtilization) - if !f(fd_Params_target_block_utilization, value) { - return - } - } if x.MaxBlockUtilization != uint64(0) { value := protoreflect.ValueOfUint64(x.MaxBlockUtilization) if !f(fd_Params_max_block_utilization, value) { @@ -184,6 +178,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.DistributeFees != false { + value := protoreflect.ValueOfBool(x.DistributeFees) + if !f(fd_Params_distribute_fees, value) { + return + } + } } // Has reports whether a field is populated. @@ -203,18 +203,16 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.Alpha != "" case "feemarket.feemarket.v1.Params.beta": return x.Beta != "" - case "feemarket.feemarket.v1.Params.theta": - return x.Theta != "" + case "feemarket.feemarket.v1.Params.gamma": + return x.Gamma != "" case "feemarket.feemarket.v1.Params.delta": return x.Delta != "" - case "feemarket.feemarket.v1.Params.min_base_fee": - return x.MinBaseFee != "" + case "feemarket.feemarket.v1.Params.min_base_gas_price": + return x.MinBaseGasPrice != "" case "feemarket.feemarket.v1.Params.min_learning_rate": return x.MinLearningRate != "" case "feemarket.feemarket.v1.Params.max_learning_rate": return x.MaxLearningRate != "" - case "feemarket.feemarket.v1.Params.target_block_utilization": - return x.TargetBlockUtilization != uint64(0) case "feemarket.feemarket.v1.Params.max_block_utilization": return x.MaxBlockUtilization != uint64(0) case "feemarket.feemarket.v1.Params.window": @@ -223,6 +221,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.FeeDenom != "" case "feemarket.feemarket.v1.Params.enabled": return x.Enabled != false + case "feemarket.feemarket.v1.Params.distribute_fees": + return x.DistributeFees != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -243,18 +243,16 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.Alpha = "" case "feemarket.feemarket.v1.Params.beta": x.Beta = "" - case "feemarket.feemarket.v1.Params.theta": - x.Theta = "" + case "feemarket.feemarket.v1.Params.gamma": + x.Gamma = "" case "feemarket.feemarket.v1.Params.delta": x.Delta = "" - case "feemarket.feemarket.v1.Params.min_base_fee": - x.MinBaseFee = "" + case "feemarket.feemarket.v1.Params.min_base_gas_price": + x.MinBaseGasPrice = "" case "feemarket.feemarket.v1.Params.min_learning_rate": x.MinLearningRate = "" case "feemarket.feemarket.v1.Params.max_learning_rate": x.MaxLearningRate = "" - case "feemarket.feemarket.v1.Params.target_block_utilization": - x.TargetBlockUtilization = uint64(0) case "feemarket.feemarket.v1.Params.max_block_utilization": x.MaxBlockUtilization = uint64(0) case "feemarket.feemarket.v1.Params.window": @@ -263,6 +261,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.FeeDenom = "" case "feemarket.feemarket.v1.Params.enabled": x.Enabled = false + case "feemarket.feemarket.v1.Params.distribute_fees": + x.DistributeFees = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -285,14 +285,14 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.v1.Params.beta": value := x.Beta return protoreflect.ValueOfString(value) - case "feemarket.feemarket.v1.Params.theta": - value := x.Theta + case "feemarket.feemarket.v1.Params.gamma": + value := x.Gamma return protoreflect.ValueOfString(value) case "feemarket.feemarket.v1.Params.delta": value := x.Delta return protoreflect.ValueOfString(value) - case "feemarket.feemarket.v1.Params.min_base_fee": - value := x.MinBaseFee + case "feemarket.feemarket.v1.Params.min_base_gas_price": + value := x.MinBaseGasPrice return protoreflect.ValueOfString(value) case "feemarket.feemarket.v1.Params.min_learning_rate": value := x.MinLearningRate @@ -300,9 +300,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.v1.Params.max_learning_rate": value := x.MaxLearningRate return protoreflect.ValueOfString(value) - case "feemarket.feemarket.v1.Params.target_block_utilization": - value := x.TargetBlockUtilization - return protoreflect.ValueOfUint64(value) case "feemarket.feemarket.v1.Params.max_block_utilization": value := x.MaxBlockUtilization return protoreflect.ValueOfUint64(value) @@ -315,6 +312,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.v1.Params.enabled": value := x.Enabled return protoreflect.ValueOfBool(value) + case "feemarket.feemarket.v1.Params.distribute_fees": + value := x.DistributeFees + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -339,18 +339,16 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.Alpha = value.Interface().(string) case "feemarket.feemarket.v1.Params.beta": x.Beta = value.Interface().(string) - case "feemarket.feemarket.v1.Params.theta": - x.Theta = value.Interface().(string) + case "feemarket.feemarket.v1.Params.gamma": + x.Gamma = value.Interface().(string) case "feemarket.feemarket.v1.Params.delta": x.Delta = value.Interface().(string) - case "feemarket.feemarket.v1.Params.min_base_fee": - x.MinBaseFee = value.Interface().(string) + case "feemarket.feemarket.v1.Params.min_base_gas_price": + x.MinBaseGasPrice = value.Interface().(string) case "feemarket.feemarket.v1.Params.min_learning_rate": x.MinLearningRate = value.Interface().(string) case "feemarket.feemarket.v1.Params.max_learning_rate": x.MaxLearningRate = value.Interface().(string) - case "feemarket.feemarket.v1.Params.target_block_utilization": - x.TargetBlockUtilization = value.Uint() case "feemarket.feemarket.v1.Params.max_block_utilization": x.MaxBlockUtilization = value.Uint() case "feemarket.feemarket.v1.Params.window": @@ -359,6 +357,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.FeeDenom = value.Interface().(string) case "feemarket.feemarket.v1.Params.enabled": x.Enabled = value.Bool() + case "feemarket.feemarket.v1.Params.distribute_fees": + x.DistributeFees = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -383,18 +383,16 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field alpha of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.beta": panic(fmt.Errorf("field beta of message feemarket.feemarket.v1.Params is not mutable")) - case "feemarket.feemarket.v1.Params.theta": - panic(fmt.Errorf("field theta of message feemarket.feemarket.v1.Params is not mutable")) + case "feemarket.feemarket.v1.Params.gamma": + panic(fmt.Errorf("field gamma of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.delta": panic(fmt.Errorf("field delta of message feemarket.feemarket.v1.Params is not mutable")) - case "feemarket.feemarket.v1.Params.min_base_fee": - panic(fmt.Errorf("field min_base_fee of message feemarket.feemarket.v1.Params is not mutable")) + case "feemarket.feemarket.v1.Params.min_base_gas_price": + panic(fmt.Errorf("field min_base_gas_price of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.min_learning_rate": panic(fmt.Errorf("field min_learning_rate of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.max_learning_rate": panic(fmt.Errorf("field max_learning_rate of message feemarket.feemarket.v1.Params is not mutable")) - case "feemarket.feemarket.v1.Params.target_block_utilization": - panic(fmt.Errorf("field target_block_utilization of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.max_block_utilization": panic(fmt.Errorf("field max_block_utilization of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.window": @@ -403,6 +401,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field fee_denom of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.enabled": panic(fmt.Errorf("field enabled of message feemarket.feemarket.v1.Params is not mutable")) + case "feemarket.feemarket.v1.Params.distribute_fees": + panic(fmt.Errorf("field distribute_fees of message feemarket.feemarket.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -420,18 +420,16 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.Params.beta": return protoreflect.ValueOfString("") - case "feemarket.feemarket.v1.Params.theta": + case "feemarket.feemarket.v1.Params.gamma": return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.Params.delta": return protoreflect.ValueOfString("") - case "feemarket.feemarket.v1.Params.min_base_fee": + case "feemarket.feemarket.v1.Params.min_base_gas_price": return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.Params.min_learning_rate": return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.Params.max_learning_rate": return protoreflect.ValueOfString("") - case "feemarket.feemarket.v1.Params.target_block_utilization": - return protoreflect.ValueOfUint64(uint64(0)) case "feemarket.feemarket.v1.Params.max_block_utilization": return protoreflect.ValueOfUint64(uint64(0)) case "feemarket.feemarket.v1.Params.window": @@ -440,6 +438,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "feemarket.feemarket.v1.Params.enabled": return protoreflect.ValueOfBool(false) + case "feemarket.feemarket.v1.Params.distribute_fees": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -517,7 +517,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Theta) + l = len(x.Gamma) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -525,7 +525,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.MinBaseFee) + l = len(x.MinBaseGasPrice) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -537,9 +537,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.TargetBlockUtilization != 0 { - n += 1 + runtime.Sov(uint64(x.TargetBlockUtilization)) - } if x.MaxBlockUtilization != 0 { n += 1 + runtime.Sov(uint64(x.MaxBlockUtilization)) } @@ -553,6 +550,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.Enabled { n += 2 } + if x.DistributeFees { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -582,6 +582,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.DistributeFees { + i-- + if x.DistributeFees { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } if x.Enabled { i-- if x.Enabled { @@ -590,28 +600,23 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x60 + dAtA[i] = 0x58 } if len(x.FeeDenom) > 0 { i -= len(x.FeeDenom) copy(dAtA[i:], x.FeeDenom) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeDenom))) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x52 } if x.Window != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Window)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x48 } if x.MaxBlockUtilization != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxBlockUtilization)) i-- - dAtA[i] = 0x48 - } - if x.TargetBlockUtilization != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.TargetBlockUtilization)) - i-- dAtA[i] = 0x40 } if len(x.MaxLearningRate) > 0 { @@ -628,10 +633,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x32 } - if len(x.MinBaseFee) > 0 { - i -= len(x.MinBaseFee) - copy(dAtA[i:], x.MinBaseFee) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinBaseFee))) + if len(x.MinBaseGasPrice) > 0 { + i -= len(x.MinBaseGasPrice) + copy(dAtA[i:], x.MinBaseGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinBaseGasPrice))) i-- dAtA[i] = 0x2a } @@ -642,10 +647,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if len(x.Theta) > 0 { - i -= len(x.Theta) - copy(dAtA[i:], x.Theta) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Theta))) + if len(x.Gamma) > 0 { + i -= len(x.Gamma) + copy(dAtA[i:], x.Gamma) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Gamma))) i-- dAtA[i] = 0x1a } @@ -778,7 +783,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Theta", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Gamma", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -806,7 +811,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Theta = string(dAtA[iNdEx:postIndex]) + x.Gamma = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -870,7 +875,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.MinBaseFee = string(dAtA[iNdEx:postIndex]) + x.MinBaseGasPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { @@ -937,25 +942,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { x.MaxLearningRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TargetBlockUtilization", wireType) - } - x.TargetBlockUtilization = 0 - 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++ - x.TargetBlockUtilization |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBlockUtilization", wireType) } @@ -974,7 +960,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } - case 10: + case 9: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) } @@ -993,7 +979,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } - case 11: + case 10: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeDenom", wireType) } @@ -1025,7 +1011,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.FeeDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 12: + case 11: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } @@ -1045,6 +1031,26 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.Enabled = bool(v != 0) + case 12: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DistributeFees", wireType) + } + var v int + 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.DistributeFees = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1100,41 +1106,47 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Alpha is the amount we additively increase the learninig rate + // Alpha is the amount we additively increase the learning rate // when it is above or below the target +/- threshold. + // + // Must be > 0. Alpha string `protobuf:"bytes,1,opt,name=alpha,proto3" json:"alpha,omitempty"` // Beta is the amount we multiplicatively decrease the learning rate // when it is within the target +/- threshold. + // + // Must be [0, 1]. Beta string `protobuf:"bytes,2,opt,name=beta,proto3" json:"beta,omitempty"` - // Theta is the threshold for the learning rate. If the learning rate is + // Gamma is the threshold for the learning rate. If the learning rate is // above or below the target +/- threshold, we additively increase the // learning rate by Alpha. Otherwise, we multiplicatively decrease the // learning rate by Beta. - Theta string `protobuf:"bytes,3,opt,name=theta,proto3" json:"theta,omitempty"` - // Delta is the amount we additively increase/decrease the base fee when the + // + // Must be [0, 0.5]. + Gamma string `protobuf:"bytes,3,opt,name=gamma,proto3" json:"gamma,omitempty"` + // Delta is the amount we additively increase/decrease the gas price when the // net block utilization difference in the window is above/below the target // utilization. Delta string `protobuf:"bytes,4,opt,name=delta,proto3" json:"delta,omitempty"` - // MinBaseFee determines the initial base fee of the module and the global - // minimum - // for the network. This is denominated in fee per gas unit. - MinBaseFee string `protobuf:"bytes,5,opt,name=min_base_fee,json=minBaseFee,proto3" json:"min_base_fee,omitempty"` + // MinBaseGasPrice determines the initial gas price of the module and the + // global minimum for the network. + MinBaseGasPrice string `protobuf:"bytes,5,opt,name=min_base_gas_price,json=minBaseGasPrice,proto3" json:"min_base_gas_price,omitempty"` // MinLearningRate is the lower bound for the learning rate. MinLearningRate string `protobuf:"bytes,6,opt,name=min_learning_rate,json=minLearningRate,proto3" json:"min_learning_rate,omitempty"` // MaxLearningRate is the upper bound for the learning rate. MaxLearningRate string `protobuf:"bytes,7,opt,name=max_learning_rate,json=maxLearningRate,proto3" json:"max_learning_rate,omitempty"` - // TargetBlockUtilization is the target block utilization. - TargetBlockUtilization uint64 `protobuf:"varint,8,opt,name=target_block_utilization,json=targetBlockUtilization,proto3" json:"target_block_utilization,omitempty"` // MaxBlockUtilization is the maximum block utilization. - MaxBlockUtilization uint64 `protobuf:"varint,9,opt,name=max_block_utilization,json=maxBlockUtilization,proto3" json:"max_block_utilization,omitempty"` + MaxBlockUtilization uint64 `protobuf:"varint,8,opt,name=max_block_utilization,json=maxBlockUtilization,proto3" json:"max_block_utilization,omitempty"` // Window defines the window size for calculating an adaptive learning rate // over a moving window of blocks. - Window uint64 `protobuf:"varint,10,opt,name=window,proto3" json:"window,omitempty"` + Window uint64 `protobuf:"varint,9,opt,name=window,proto3" json:"window,omitempty"` // FeeDenom is the denom that will be used for all fee payments. - FeeDenom string `protobuf:"bytes,11,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` + FeeDenom string `protobuf:"bytes,10,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` // Enabled is a boolean that determines whether the EIP1559 fee market is // enabled. - Enabled bool `protobuf:"varint,12,opt,name=enabled,proto3" json:"enabled,omitempty"` + Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled,omitempty"` + // DistributeFees is a boolean that determines whether the fees are burned or + // distributed to all stakers. + DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` } func (x *Params) Reset() { @@ -1171,9 +1183,9 @@ func (x *Params) GetBeta() string { return "" } -func (x *Params) GetTheta() string { +func (x *Params) GetGamma() string { if x != nil { - return x.Theta + return x.Gamma } return "" } @@ -1185,9 +1197,9 @@ func (x *Params) GetDelta() string { return "" } -func (x *Params) GetMinBaseFee() string { +func (x *Params) GetMinBaseGasPrice() string { if x != nil { - return x.MinBaseFee + return x.MinBaseGasPrice } return "" } @@ -1206,13 +1218,6 @@ func (x *Params) GetMaxLearningRate() string { return "" } -func (x *Params) GetTargetBlockUtilization() uint64 { - if x != nil { - return x.TargetBlockUtilization - } - return 0 -} - func (x *Params) GetMaxBlockUtilization() uint64 { if x != nil { return x.MaxBlockUtilization @@ -1241,6 +1246,13 @@ func (x *Params) GetEnabled() bool { return false } +func (x *Params) GetDistributeFees() bool { + if x != nil { + return x.DistributeFees + } + return false +} + var File_feemarket_feemarket_v1_params_proto protoreflect.FileDescriptor var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ @@ -1260,45 +1272,45 @@ var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x04, 0x62, 0x65, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x74, 0x68, 0x65, - 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x44, 0x65, 0x63, 0x52, 0x04, 0x62, 0x65, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x67, 0x61, 0x6d, + 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x74, 0x68, 0x65, - 0x74, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x67, 0x61, 0x6d, + 0x6d, 0x61, 0x12, 0x47, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x0c, 0x6d, - 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0a, - 0x6d, 0x69, 0x6e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x6d, 0x69, - 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x5e, 0x0a, 0x12, 0x6d, + 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, + 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, + 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x42, + 0x61, 0x73, 0x65, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x6d, + 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x4c, 0x65, + 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x6d, 0x61, + 0x78, 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x61, - 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x6d, 0x61, 0x78, - 0x5f, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x61, 0x72, - 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, - 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x74, 0x69, 0x6c, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x1b, - 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x61, + 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x61, 0x78, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x55, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, + 0x06, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x46, 0x65, 0x65, 0x73, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, diff --git a/api/feemarket/feemarket/v1/query.pulsar.go b/api/feemarket/feemarket/v1/query.pulsar.go index 39ddc0c..a43122e 100644 --- a/api/feemarket/feemarket/v1/query.pulsar.go +++ b/api/feemarket/feemarket/v1/query.pulsar.go @@ -1599,23 +1599,25 @@ func (x *fastReflection_StateResponse) ProtoMethods() *protoiface.Methods { } var ( - md_BaseFeeRequest protoreflect.MessageDescriptor + md_GasPriceRequest protoreflect.MessageDescriptor + fd_GasPriceRequest_denom protoreflect.FieldDescriptor ) func init() { file_feemarket_feemarket_v1_query_proto_init() - md_BaseFeeRequest = File_feemarket_feemarket_v1_query_proto.Messages().ByName("BaseFeeRequest") + md_GasPriceRequest = File_feemarket_feemarket_v1_query_proto.Messages().ByName("GasPriceRequest") + fd_GasPriceRequest_denom = md_GasPriceRequest.Fields().ByName("denom") } -var _ protoreflect.Message = (*fastReflection_BaseFeeRequest)(nil) +var _ protoreflect.Message = (*fastReflection_GasPriceRequest)(nil) -type fastReflection_BaseFeeRequest BaseFeeRequest +type fastReflection_GasPriceRequest GasPriceRequest -func (x *BaseFeeRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_BaseFeeRequest)(x) +func (x *GasPriceRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_GasPriceRequest)(x) } -func (x *BaseFeeRequest) slowProtoReflect() protoreflect.Message { +func (x *GasPriceRequest) slowProtoReflect() protoreflect.Message { mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1627,43 +1629,43 @@ func (x *BaseFeeRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BaseFeeRequest_messageType fastReflection_BaseFeeRequest_messageType -var _ protoreflect.MessageType = fastReflection_BaseFeeRequest_messageType{} +var _fastReflection_GasPriceRequest_messageType fastReflection_GasPriceRequest_messageType +var _ protoreflect.MessageType = fastReflection_GasPriceRequest_messageType{} -type fastReflection_BaseFeeRequest_messageType struct{} +type fastReflection_GasPriceRequest_messageType struct{} -func (x fastReflection_BaseFeeRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_BaseFeeRequest)(nil) +func (x fastReflection_GasPriceRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_GasPriceRequest)(nil) } -func (x fastReflection_BaseFeeRequest_messageType) New() protoreflect.Message { - return new(fastReflection_BaseFeeRequest) +func (x fastReflection_GasPriceRequest_messageType) New() protoreflect.Message { + return new(fastReflection_GasPriceRequest) } -func (x fastReflection_BaseFeeRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BaseFeeRequest +func (x fastReflection_GasPriceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GasPriceRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BaseFeeRequest) Descriptor() protoreflect.MessageDescriptor { - return md_BaseFeeRequest +func (x *fastReflection_GasPriceRequest) Descriptor() protoreflect.MessageDescriptor { + return md_GasPriceRequest } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_BaseFeeRequest) Type() protoreflect.MessageType { - return _fastReflection_BaseFeeRequest_messageType +func (x *fastReflection_GasPriceRequest) Type() protoreflect.MessageType { + return _fastReflection_GasPriceRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BaseFeeRequest) New() protoreflect.Message { - return new(fastReflection_BaseFeeRequest) +func (x *fastReflection_GasPriceRequest) New() protoreflect.Message { + return new(fastReflection_GasPriceRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BaseFeeRequest) Interface() protoreflect.ProtoMessage { - return (*BaseFeeRequest)(x) +func (x *fastReflection_GasPriceRequest) Interface() protoreflect.ProtoMessage { + return (*GasPriceRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -1671,7 +1673,860 @@ func (x *fastReflection_BaseFeeRequest) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_BaseFeeRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_GasPriceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_GasPriceRequest_denom, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GasPriceRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + return x.Denom != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + x.Denom = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GasPriceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + x.Denom = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + panic(fmt.Errorf("field denom of message feemarket.feemarket.v1.GasPriceRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GasPriceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceRequest.denom": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceRequest")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GasPriceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.GasPriceRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GasPriceRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GasPriceRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GasPriceRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GasPriceRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GasPriceRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GasPriceRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPriceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GasPriceResponse protoreflect.MessageDescriptor + fd_GasPriceResponse_price protoreflect.FieldDescriptor +) + +func init() { + file_feemarket_feemarket_v1_query_proto_init() + md_GasPriceResponse = File_feemarket_feemarket_v1_query_proto.Messages().ByName("GasPriceResponse") + fd_GasPriceResponse_price = md_GasPriceResponse.Fields().ByName("price") +} + +var _ protoreflect.Message = (*fastReflection_GasPriceResponse)(nil) + +type fastReflection_GasPriceResponse GasPriceResponse + +func (x *GasPriceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_GasPriceResponse)(x) +} + +func (x *GasPriceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GasPriceResponse_messageType fastReflection_GasPriceResponse_messageType +var _ protoreflect.MessageType = fastReflection_GasPriceResponse_messageType{} + +type fastReflection_GasPriceResponse_messageType struct{} + +func (x fastReflection_GasPriceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_GasPriceResponse)(nil) +} +func (x fastReflection_GasPriceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_GasPriceResponse) +} +func (x fastReflection_GasPriceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GasPriceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GasPriceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_GasPriceResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GasPriceResponse) Type() protoreflect.MessageType { + return _fastReflection_GasPriceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GasPriceResponse) New() protoreflect.Message { + return new(fastReflection_GasPriceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GasPriceResponse) Interface() protoreflect.ProtoMessage { + return (*GasPriceResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GasPriceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Price != nil { + value := protoreflect.ValueOfMessage(x.Price.ProtoReflect()) + if !f(fd_GasPriceResponse_price, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GasPriceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + return x.Price != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + x.Price = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GasPriceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + value := x.Price + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + x.Price = value.Message().Interface().(*v1beta1.DecCoin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + if x.Price == nil { + x.Price = new(v1beta1.DecCoin) + } + return protoreflect.ValueOfMessage(x.Price.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GasPriceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "feemarket.feemarket.v1.GasPriceResponse.price": + m := new(v1beta1.DecCoin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPriceResponse")) + } + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPriceResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GasPriceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.GasPriceResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GasPriceResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GasPriceResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GasPriceResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GasPriceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GasPriceResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Price != nil { + l = options.Size(x.Price) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GasPriceResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Price != nil { + encoded, err := options.Marshal(x.Price) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GasPriceResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + 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 + } + if x.Price == nil { + x.Price = &v1beta1.DecCoin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Price); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GasPricesRequest protoreflect.MessageDescriptor +) + +func init() { + file_feemarket_feemarket_v1_query_proto_init() + md_GasPricesRequest = File_feemarket_feemarket_v1_query_proto.Messages().ByName("GasPricesRequest") +} + +var _ protoreflect.Message = (*fastReflection_GasPricesRequest)(nil) + +type fastReflection_GasPricesRequest GasPricesRequest + +func (x *GasPricesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_GasPricesRequest)(x) +} + +func (x *GasPricesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GasPricesRequest_messageType fastReflection_GasPricesRequest_messageType +var _ protoreflect.MessageType = fastReflection_GasPricesRequest_messageType{} + +type fastReflection_GasPricesRequest_messageType struct{} + +func (x fastReflection_GasPricesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_GasPricesRequest)(nil) +} +func (x fastReflection_GasPricesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_GasPricesRequest) +} +func (x fastReflection_GasPricesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GasPricesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GasPricesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_GasPricesRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GasPricesRequest) Type() protoreflect.MessageType { + return _fastReflection_GasPricesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GasPricesRequest) New() protoreflect.Message { + return new(fastReflection_GasPricesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GasPricesRequest) Interface() protoreflect.ProtoMessage { + return (*GasPricesRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GasPricesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -1685,13 +2540,13 @@ func (x *fastReflection_BaseFeeRequest) Range(f func(protoreflect.FieldDescripto // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_BaseFeeRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_GasPricesRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", fd.FullName())) } } @@ -1701,13 +2556,13 @@ func (x *fastReflection_BaseFeeRequest) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_GasPricesRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", fd.FullName())) } } @@ -1717,13 +2572,13 @@ func (x *fastReflection_BaseFeeRequest) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_BaseFeeRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", descriptor.FullName())) } } @@ -1737,13 +2592,13 @@ func (x *fastReflection_BaseFeeRequest) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_GasPricesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", fd.FullName())) } } @@ -1757,36 +2612,36 @@ func (x *fastReflection_BaseFeeRequest) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_BaseFeeRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesRequest")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesRequest does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_BaseFeeRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_GasPricesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.BaseFeeRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.GasPricesRequest", d.FullName())) } panic("unreachable") } @@ -1794,7 +2649,7 @@ func (x *fastReflection_BaseFeeRequest) WhichOneof(d protoreflect.OneofDescripto // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_BaseFeeRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_GasPricesRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1805,7 +2660,7 @@ func (x *fastReflection_BaseFeeRequest) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_GasPricesRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1817,7 +2672,7 @@ func (x *fastReflection_BaseFeeRequest) SetUnknown(fields protoreflect.RawFields // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_BaseFeeRequest) IsValid() bool { +func (x *fastReflection_GasPricesRequest) IsValid() bool { return x != nil } @@ -1827,9 +2682,9 @@ func (x *fastReflection_BaseFeeRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_BaseFeeRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_GasPricesRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BaseFeeRequest) + x := input.Message.Interface().(*GasPricesRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1851,7 +2706,7 @@ func (x *fastReflection_BaseFeeRequest) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BaseFeeRequest) + x := input.Message.Interface().(*GasPricesRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1881,7 +2736,7 @@ func (x *fastReflection_BaseFeeRequest) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BaseFeeRequest) + x := input.Message.Interface().(*GasPricesRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1913,10 +2768,10 @@ func (x *fastReflection_BaseFeeRequest) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseFeeRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPricesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPricesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1954,78 +2809,78 @@ func (x *fastReflection_BaseFeeRequest) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_BaseFeeResponse_1_list)(nil) +var _ protoreflect.List = (*_GasPricesResponse_1_list)(nil) -type _BaseFeeResponse_1_list struct { - list *[]*v1beta1.Coin +type _GasPricesResponse_1_list struct { + list *[]*v1beta1.DecCoin } -func (x *_BaseFeeResponse_1_list) Len() int { +func (x *_GasPricesResponse_1_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_BaseFeeResponse_1_list) Get(i int) protoreflect.Value { +func (x *_GasPricesResponse_1_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_BaseFeeResponse_1_list) Set(i int, value protoreflect.Value) { +func (x *_GasPricesResponse_1_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + concreteValue := valueUnwrapped.Interface().(*v1beta1.DecCoin) (*x.list)[i] = concreteValue } -func (x *_BaseFeeResponse_1_list) Append(value protoreflect.Value) { +func (x *_GasPricesResponse_1_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + concreteValue := valueUnwrapped.Interface().(*v1beta1.DecCoin) *x.list = append(*x.list, concreteValue) } -func (x *_BaseFeeResponse_1_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) +func (x *_GasPricesResponse_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.DecCoin) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_BaseFeeResponse_1_list) Truncate(n int) { +func (x *_GasPricesResponse_1_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_BaseFeeResponse_1_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) +func (x *_GasPricesResponse_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.DecCoin) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_BaseFeeResponse_1_list) IsValid() bool { +func (x *_GasPricesResponse_1_list) IsValid() bool { return x.list != nil } var ( - md_BaseFeeResponse protoreflect.MessageDescriptor - fd_BaseFeeResponse_fee protoreflect.FieldDescriptor + md_GasPricesResponse protoreflect.MessageDescriptor + fd_GasPricesResponse_prices protoreflect.FieldDescriptor ) func init() { file_feemarket_feemarket_v1_query_proto_init() - md_BaseFeeResponse = File_feemarket_feemarket_v1_query_proto.Messages().ByName("BaseFeeResponse") - fd_BaseFeeResponse_fee = md_BaseFeeResponse.Fields().ByName("fee") + md_GasPricesResponse = File_feemarket_feemarket_v1_query_proto.Messages().ByName("GasPricesResponse") + fd_GasPricesResponse_prices = md_GasPricesResponse.Fields().ByName("prices") } -var _ protoreflect.Message = (*fastReflection_BaseFeeResponse)(nil) +var _ protoreflect.Message = (*fastReflection_GasPricesResponse)(nil) -type fastReflection_BaseFeeResponse BaseFeeResponse +type fastReflection_GasPricesResponse GasPricesResponse -func (x *BaseFeeResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_BaseFeeResponse)(x) +func (x *GasPricesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_GasPricesResponse)(x) } -func (x *BaseFeeResponse) slowProtoReflect() protoreflect.Message { - mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[5] +func (x *GasPricesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2036,43 +2891,43 @@ func (x *BaseFeeResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BaseFeeResponse_messageType fastReflection_BaseFeeResponse_messageType -var _ protoreflect.MessageType = fastReflection_BaseFeeResponse_messageType{} +var _fastReflection_GasPricesResponse_messageType fastReflection_GasPricesResponse_messageType +var _ protoreflect.MessageType = fastReflection_GasPricesResponse_messageType{} -type fastReflection_BaseFeeResponse_messageType struct{} +type fastReflection_GasPricesResponse_messageType struct{} -func (x fastReflection_BaseFeeResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_BaseFeeResponse)(nil) +func (x fastReflection_GasPricesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_GasPricesResponse)(nil) } -func (x fastReflection_BaseFeeResponse_messageType) New() protoreflect.Message { - return new(fastReflection_BaseFeeResponse) +func (x fastReflection_GasPricesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_GasPricesResponse) } -func (x fastReflection_BaseFeeResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BaseFeeResponse +func (x fastReflection_GasPricesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GasPricesResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BaseFeeResponse) Descriptor() protoreflect.MessageDescriptor { - return md_BaseFeeResponse +func (x *fastReflection_GasPricesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_GasPricesResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_BaseFeeResponse) Type() protoreflect.MessageType { - return _fastReflection_BaseFeeResponse_messageType +func (x *fastReflection_GasPricesResponse) Type() protoreflect.MessageType { + return _fastReflection_GasPricesResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BaseFeeResponse) New() protoreflect.Message { - return new(fastReflection_BaseFeeResponse) +func (x *fastReflection_GasPricesResponse) New() protoreflect.Message { + return new(fastReflection_GasPricesResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BaseFeeResponse) Interface() protoreflect.ProtoMessage { - return (*BaseFeeResponse)(x) +func (x *fastReflection_GasPricesResponse) Interface() protoreflect.ProtoMessage { + return (*GasPricesResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2080,10 +2935,10 @@ func (x *fastReflection_BaseFeeResponse) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_BaseFeeResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Fee) != 0 { - value := protoreflect.ValueOfList(&_BaseFeeResponse_1_list{list: &x.Fee}) - if !f(fd_BaseFeeResponse_fee, value) { +func (x *fastReflection_GasPricesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Prices) != 0 { + value := protoreflect.ValueOfList(&_GasPricesResponse_1_list{list: &x.Prices}) + if !f(fd_GasPricesResponse_prices, value) { return } } @@ -2100,15 +2955,15 @@ func (x *fastReflection_BaseFeeResponse) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_BaseFeeResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_GasPricesResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": - return len(x.Fee) != 0 + case "feemarket.feemarket.v1.GasPricesResponse.prices": + return len(x.Prices) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", fd.FullName())) } } @@ -2118,15 +2973,15 @@ func (x *fastReflection_BaseFeeResponse) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_GasPricesResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": - x.Fee = nil + case "feemarket.feemarket.v1.GasPricesResponse.prices": + x.Prices = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", fd.FullName())) } } @@ -2136,19 +2991,19 @@ func (x *fastReflection_BaseFeeResponse) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_BaseFeeResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": - if len(x.Fee) == 0 { - return protoreflect.ValueOfList(&_BaseFeeResponse_1_list{}) + case "feemarket.feemarket.v1.GasPricesResponse.prices": + if len(x.Prices) == 0 { + return protoreflect.ValueOfList(&_GasPricesResponse_1_list{}) } - listValue := &_BaseFeeResponse_1_list{list: &x.Fee} + listValue := &_GasPricesResponse_1_list{list: &x.Prices} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", descriptor.FullName())) } } @@ -2162,17 +3017,17 @@ func (x *fastReflection_BaseFeeResponse) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_GasPricesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": + case "feemarket.feemarket.v1.GasPricesResponse.prices": lv := value.List() - clv := lv.(*_BaseFeeResponse_1_list) - x.Fee = *clv.list + clv := lv.(*_GasPricesResponse_1_list) + x.Prices = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", fd.FullName())) } } @@ -2186,45 +3041,45 @@ func (x *fastReflection_BaseFeeResponse) Set(fd protoreflect.FieldDescriptor, va // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": - if x.Fee == nil { - x.Fee = []*v1beta1.Coin{} + case "feemarket.feemarket.v1.GasPricesResponse.prices": + if x.Prices == nil { + x.Prices = []*v1beta1.DecCoin{} } - value := &_BaseFeeResponse_1_list{list: &x.Fee} + value := &_GasPricesResponse_1_list{list: &x.Prices} return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_BaseFeeResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_GasPricesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "feemarket.feemarket.v1.BaseFeeResponse.fee": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_BaseFeeResponse_1_list{list: &list}) + case "feemarket.feemarket.v1.GasPricesResponse.prices": + list := []*v1beta1.DecCoin{} + return protoreflect.ValueOfList(&_GasPricesResponse_1_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.BaseFeeResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.GasPricesResponse")) } - panic(fmt.Errorf("message feemarket.feemarket.v1.BaseFeeResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message feemarket.feemarket.v1.GasPricesResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_BaseFeeResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_GasPricesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.BaseFeeResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in feemarket.feemarket.v1.GasPricesResponse", d.FullName())) } panic("unreachable") } @@ -2232,7 +3087,7 @@ func (x *fastReflection_BaseFeeResponse) WhichOneof(d protoreflect.OneofDescript // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_BaseFeeResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_GasPricesResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2243,7 +3098,7 @@ func (x *fastReflection_BaseFeeResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BaseFeeResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_GasPricesResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2255,7 +3110,7 @@ func (x *fastReflection_BaseFeeResponse) SetUnknown(fields protoreflect.RawField // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_BaseFeeResponse) IsValid() bool { +func (x *fastReflection_GasPricesResponse) IsValid() bool { return x != nil } @@ -2265,9 +3120,9 @@ func (x *fastReflection_BaseFeeResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_GasPricesResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BaseFeeResponse) + x := input.Message.Interface().(*GasPricesResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2279,8 +3134,8 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Fee) > 0 { - for _, e := range x.Fee { + if len(x.Prices) > 0 { + for _, e := range x.Prices { l = options.Size(e) n += 1 + l + runtime.Sov(uint64(l)) } @@ -2295,7 +3150,7 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BaseFeeResponse) + x := input.Message.Interface().(*GasPricesResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2314,9 +3169,9 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Fee) > 0 { - for iNdEx := len(x.Fee) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Fee[iNdEx]) + if len(x.Prices) > 0 { + for iNdEx := len(x.Prices) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Prices[iNdEx]) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2341,7 +3196,7 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BaseFeeResponse) + x := input.Message.Interface().(*GasPricesResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2373,15 +3228,15 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseFeeResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPricesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GasPricesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Prices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2408,8 +3263,8 @@ func (x *fastReflection_BaseFeeResponse) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Fee = append(x.Fee, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Fee[len(x.Fee)-1]); err != nil { + x.Prices = append(x.Prices, &v1beta1.DecCoin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Prices[len(x.Prices)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -2587,15 +3442,18 @@ func (x *StateResponse) GetState() *State { return nil } -// BaseFeeRequest is the request type for the Query/BaseGasPrice RPC method. -type BaseFeeRequest struct { +// GasPriceRequest is the request type for the Query/GasPrice RPC method. +type GasPriceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + // denom we are querying gas price in + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } -func (x *BaseFeeRequest) Reset() { - *x = BaseFeeRequest{} +func (x *GasPriceRequest) Reset() { + *x = GasPriceRequest{} if protoimpl.UnsafeEnabled { mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2603,28 +3461,36 @@ func (x *BaseFeeRequest) Reset() { } } -func (x *BaseFeeRequest) String() string { +func (x *GasPriceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BaseFeeRequest) ProtoMessage() {} +func (*GasPriceRequest) ProtoMessage() {} -// Deprecated: Use BaseFeeRequest.ProtoReflect.Descriptor instead. -func (*BaseFeeRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GasPriceRequest.ProtoReflect.Descriptor instead. +func (*GasPriceRequest) Descriptor() ([]byte, []int) { return file_feemarket_feemarket_v1_query_proto_rawDescGZIP(), []int{4} } -// StateResponse is the response type for the Query/BaseGasPrice RPC method. -type BaseFeeResponse struct { +func (x *GasPriceRequest) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +// GasPriceResponse is the response type for the Query/GasPrice RPC method. +// Returns a gas price in specified denom. +type GasPriceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Fee []*v1beta1.Coin `protobuf:"bytes,1,rep,name=fee,proto3" json:"fee,omitempty"` + Price *v1beta1.DecCoin `protobuf:"bytes,1,opt,name=price,proto3" json:"price,omitempty"` } -func (x *BaseFeeResponse) Reset() { - *x = BaseFeeResponse{} +func (x *GasPriceResponse) Reset() { + *x = GasPriceResponse{} if protoimpl.UnsafeEnabled { mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2632,20 +3498,84 @@ func (x *BaseFeeResponse) Reset() { } } -func (x *BaseFeeResponse) String() string { +func (x *GasPriceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BaseFeeResponse) ProtoMessage() {} +func (*GasPriceResponse) ProtoMessage() {} -// Deprecated: Use BaseFeeResponse.ProtoReflect.Descriptor instead. -func (*BaseFeeResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GasPriceResponse.ProtoReflect.Descriptor instead. +func (*GasPriceResponse) Descriptor() ([]byte, []int) { return file_feemarket_feemarket_v1_query_proto_rawDescGZIP(), []int{5} } -func (x *BaseFeeResponse) GetFee() []*v1beta1.Coin { +func (x *GasPriceResponse) GetPrice() *v1beta1.DecCoin { + if x != nil { + return x.Price + } + return nil +} + +// GasPriceRequest is the request type for the Query/GasPrices RPC method. +type GasPricesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GasPricesRequest) Reset() { + *x = GasPricesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GasPricesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GasPricesRequest) ProtoMessage() {} + +// Deprecated: Use GasPricesRequest.ProtoReflect.Descriptor instead. +func (*GasPricesRequest) Descriptor() ([]byte, []int) { + return file_feemarket_feemarket_v1_query_proto_rawDescGZIP(), []int{6} +} + +// GasPricesResponse is the response type for the Query/GasPrices RPC method. +// Returns a gas price in all available denoms. +type GasPricesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prices []*v1beta1.DecCoin `protobuf:"bytes,1,rep,name=prices,proto3" json:"prices,omitempty"` +} + +func (x *GasPricesResponse) Reset() { + *x = GasPricesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_feemarket_feemarket_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GasPricesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GasPricesResponse) ProtoMessage() {} + +// Deprecated: Use GasPricesResponse.ProtoReflect.Descriptor instead. +func (*GasPricesResponse) Descriptor() ([]byte, []int) { + return file_feemarket_feemarket_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *GasPricesResponse) GetPrices() []*v1beta1.DecCoin { if x != nil { - return x.Fee + return x.Prices } return nil } @@ -2679,54 +3609,71 @@ var file_feemarket_feemarket_v1_query_proto_rawDesc = []byte{ 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x42, - 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x86, 0x01, - 0x0a, 0x0f, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x73, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, - 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x32, 0xed, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x75, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x66, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x16, 0x12, 0x14, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x71, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x24, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x7a, 0x0a, 0x07, 0x42, 0x61, - 0x73, 0x65, 0x46, 0x65, 0x65, 0x12, 0x26, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, - 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x27, 0x0a, 0x0f, 0x47, + 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x51, 0x0a, 0x10, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, + 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x61, 0x73, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x11, + 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x6e, 0x0a, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x38, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, + 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x73, 0x32, 0xff, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x75, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x71, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, + 0x12, 0x13, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x08, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x12, 0x27, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, + 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x61, 0x73, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x82, + 0x01, 0x0a, 0x09, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, - 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x66, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x73, 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, + 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, 0x16, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, + 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, + 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2741,33 +3688,38 @@ func file_feemarket_feemarket_v1_query_proto_rawDescGZIP() []byte { return file_feemarket_feemarket_v1_query_proto_rawDescData } -var file_feemarket_feemarket_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_feemarket_feemarket_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_feemarket_feemarket_v1_query_proto_goTypes = []interface{}{ - (*ParamsRequest)(nil), // 0: feemarket.feemarket.v1.ParamsRequest - (*ParamsResponse)(nil), // 1: feemarket.feemarket.v1.ParamsResponse - (*StateRequest)(nil), // 2: feemarket.feemarket.v1.StateRequest - (*StateResponse)(nil), // 3: feemarket.feemarket.v1.StateResponse - (*BaseFeeRequest)(nil), // 4: feemarket.feemarket.v1.BaseFeeRequest - (*BaseFeeResponse)(nil), // 5: feemarket.feemarket.v1.BaseFeeResponse - (*Params)(nil), // 6: feemarket.feemarket.v1.Params - (*State)(nil), // 7: feemarket.feemarket.v1.State - (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*ParamsRequest)(nil), // 0: feemarket.feemarket.v1.ParamsRequest + (*ParamsResponse)(nil), // 1: feemarket.feemarket.v1.ParamsResponse + (*StateRequest)(nil), // 2: feemarket.feemarket.v1.StateRequest + (*StateResponse)(nil), // 3: feemarket.feemarket.v1.StateResponse + (*GasPriceRequest)(nil), // 4: feemarket.feemarket.v1.GasPriceRequest + (*GasPriceResponse)(nil), // 5: feemarket.feemarket.v1.GasPriceResponse + (*GasPricesRequest)(nil), // 6: feemarket.feemarket.v1.GasPricesRequest + (*GasPricesResponse)(nil), // 7: feemarket.feemarket.v1.GasPricesResponse + (*Params)(nil), // 8: feemarket.feemarket.v1.Params + (*State)(nil), // 9: feemarket.feemarket.v1.State + (*v1beta1.DecCoin)(nil), // 10: cosmos.base.v1beta1.DecCoin } var file_feemarket_feemarket_v1_query_proto_depIdxs = []int32{ - 6, // 0: feemarket.feemarket.v1.ParamsResponse.params:type_name -> feemarket.feemarket.v1.Params - 7, // 1: feemarket.feemarket.v1.StateResponse.state:type_name -> feemarket.feemarket.v1.State - 8, // 2: feemarket.feemarket.v1.BaseFeeResponse.fee:type_name -> cosmos.base.v1beta1.Coin - 0, // 3: feemarket.feemarket.v1.Query.Params:input_type -> feemarket.feemarket.v1.ParamsRequest - 2, // 4: feemarket.feemarket.v1.Query.State:input_type -> feemarket.feemarket.v1.StateRequest - 4, // 5: feemarket.feemarket.v1.Query.BaseGasPrice:input_type -> feemarket.feemarket.v1.BaseFeeRequest - 1, // 6: feemarket.feemarket.v1.Query.Params:output_type -> feemarket.feemarket.v1.ParamsResponse - 3, // 7: feemarket.feemarket.v1.Query.State:output_type -> feemarket.feemarket.v1.StateResponse - 5, // 8: feemarket.feemarket.v1.Query.BaseGasPrice:output_type -> feemarket.feemarket.v1.BaseFeeResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 8, // 0: feemarket.feemarket.v1.ParamsResponse.params:type_name -> feemarket.feemarket.v1.Params + 9, // 1: feemarket.feemarket.v1.StateResponse.state:type_name -> feemarket.feemarket.v1.State + 10, // 2: feemarket.feemarket.v1.GasPriceResponse.price:type_name -> cosmos.base.v1beta1.DecCoin + 10, // 3: feemarket.feemarket.v1.GasPricesResponse.prices:type_name -> cosmos.base.v1beta1.DecCoin + 0, // 4: feemarket.feemarket.v1.Query.Params:input_type -> feemarket.feemarket.v1.ParamsRequest + 2, // 5: feemarket.feemarket.v1.Query.State:input_type -> feemarket.feemarket.v1.StateRequest + 4, // 6: feemarket.feemarket.v1.Query.GasPrice:input_type -> feemarket.feemarket.v1.GasPriceRequest + 6, // 7: feemarket.feemarket.v1.Query.GasPrices:input_type -> feemarket.feemarket.v1.GasPricesRequest + 1, // 8: feemarket.feemarket.v1.Query.Params:output_type -> feemarket.feemarket.v1.ParamsResponse + 3, // 9: feemarket.feemarket.v1.Query.State:output_type -> feemarket.feemarket.v1.StateResponse + 5, // 10: feemarket.feemarket.v1.Query.GasPrice:output_type -> feemarket.feemarket.v1.GasPriceResponse + 7, // 11: feemarket.feemarket.v1.Query.GasPrices:output_type -> feemarket.feemarket.v1.GasPricesResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_feemarket_feemarket_v1_query_proto_init() } @@ -2827,7 +3779,7 @@ func file_feemarket_feemarket_v1_query_proto_init() { } } file_feemarket_feemarket_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseFeeRequest); i { + switch v := v.(*GasPriceRequest); i { case 0: return &v.state case 1: @@ -2839,7 +3791,31 @@ func file_feemarket_feemarket_v1_query_proto_init() { } } file_feemarket_feemarket_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseFeeResponse); i { + switch v := v.(*GasPriceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_feemarket_feemarket_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GasPricesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_feemarket_feemarket_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GasPricesResponse); i { case 0: return &v.state case 1: @@ -2857,7 +3833,7 @@ func file_feemarket_feemarket_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_feemarket_feemarket_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/feemarket/feemarket/v1/query_grpc.pb.go b/api/feemarket/feemarket/v1/query_grpc.pb.go index c18d6da..804edad 100644 --- a/api/feemarket/feemarket/v1/query_grpc.pb.go +++ b/api/feemarket/feemarket/v1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: feemarket/feemarket/v1/query.proto @@ -15,25 +15,32 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( - Query_Params_FullMethodName = "/feemarket.feemarket.v1.Query/Params" - Query_State_FullMethodName = "/feemarket.feemarket.v1.Query/State" - Query_BaseFee_FullMethodName = "/feemarket.feemarket.v1.Query/BaseGasPrice" + Query_Params_FullMethodName = "/feemarket.feemarket.v1.Query/Params" + Query_State_FullMethodName = "/feemarket.feemarket.v1.Query/State" + Query_GasPrice_FullMethodName = "/feemarket.feemarket.v1.Query/GasPrice" + Query_GasPrices_FullMethodName = "/feemarket.feemarket.v1.Query/GasPrices" ) // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query Service for the feemarket module. type QueryClient interface { // Params returns the current feemarket module parameters. Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) // State returns the current feemarket module state. State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) - // BaseFee returns the current feemarket module base fee. - BaseFee(ctx context.Context, in *BaseFeeRequest, opts ...grpc.CallOption) (*BaseFeeResponse, error) + // GasPrice returns the current feemarket module gas price + // for specified denom. + GasPrice(ctx context.Context, in *GasPriceRequest, opts ...grpc.CallOption) (*GasPriceResponse, error) + // GasPrices returns the current feemarket module list of gas prices + // in all available denoms. + GasPrices(ctx context.Context, in *GasPricesRequest, opts ...grpc.CallOption) (*GasPricesResponse, error) } type queryClient struct { @@ -45,8 +52,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -54,17 +62,29 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp } func (c *queryClient) State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StateResponse) - err := c.cc.Invoke(ctx, Query_State_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_State_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GasPrice(ctx context.Context, in *GasPriceRequest, opts ...grpc.CallOption) (*GasPriceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GasPriceResponse) + err := c.cc.Invoke(ctx, Query_GasPrice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) BaseFee(ctx context.Context, in *BaseFeeRequest, opts ...grpc.CallOption) (*BaseFeeResponse, error) { - out := new(BaseFeeResponse) - err := c.cc.Invoke(ctx, Query_BaseFee_FullMethodName, in, out, opts...) +func (c *queryClient) GasPrices(ctx context.Context, in *GasPricesRequest, opts ...grpc.CallOption) (*GasPricesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GasPricesResponse) + err := c.cc.Invoke(ctx, Query_GasPrices_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -74,13 +94,19 @@ func (c *queryClient) BaseFee(ctx context.Context, in *BaseFeeRequest, opts ...g // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility +// +// Query Service for the feemarket module. type QueryServer interface { // Params returns the current feemarket module parameters. Params(context.Context, *ParamsRequest) (*ParamsResponse, error) // State returns the current feemarket module state. State(context.Context, *StateRequest) (*StateResponse, error) - // BaseFee returns the current feemarket module base fee. - BaseFee(context.Context, *BaseFeeRequest) (*BaseFeeResponse, error) + // GasPrice returns the current feemarket module gas price + // for specified denom. + GasPrice(context.Context, *GasPriceRequest) (*GasPriceResponse, error) + // GasPrices returns the current feemarket module list of gas prices + // in all available denoms. + GasPrices(context.Context, *GasPricesRequest) (*GasPricesResponse, error) mustEmbedUnimplementedQueryServer() } @@ -94,8 +120,11 @@ func (UnimplementedQueryServer) Params(context.Context, *ParamsRequest) (*Params func (UnimplementedQueryServer) State(context.Context, *StateRequest) (*StateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method State not implemented") } -func (UnimplementedQueryServer) BaseFee(context.Context, *BaseFeeRequest) (*BaseFeeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BaseGasPrice not implemented") +func (UnimplementedQueryServer) GasPrice(context.Context, *GasPriceRequest) (*GasPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GasPrice not implemented") +} +func (UnimplementedQueryServer) GasPrices(context.Context, *GasPricesRequest) (*GasPricesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GasPrices not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} @@ -146,20 +175,38 @@ func _Query_State_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } -func _Query_BaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BaseFeeRequest) +func _Query_GasPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GasPriceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GasPrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GasPrice_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GasPrice(ctx, req.(*GasPriceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GasPrices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GasPricesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).BaseFee(ctx, in) + return srv.(QueryServer).GasPrices(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_BaseFee_FullMethodName, + FullMethod: Query_GasPrices_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).BaseFee(ctx, req.(*BaseFeeRequest)) + return srv.(QueryServer).GasPrices(ctx, req.(*GasPricesRequest)) } return interceptor(ctx, in, info, handler) } @@ -180,8 +227,12 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_State_Handler, }, { - MethodName: "BaseGasPrice", - Handler: _Query_BaseFee_Handler, + MethodName: "GasPrice", + Handler: _Query_GasPrice_Handler, + }, + { + MethodName: "GasPrices", + Handler: _Query_GasPrices_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/feemarket/feemarket/v1/tx_grpc.pb.go b/api/feemarket/feemarket/v1/tx_grpc.pb.go index c576b92..f21094d 100644 --- a/api/feemarket/feemarket/v1/tx_grpc.pb.go +++ b/api/feemarket/feemarket/v1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: feemarket/feemarket/v1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( Msg_Params_FullMethodName = "/feemarket.feemarket.v1.Msg/Params" @@ -25,6 +25,9 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Message service defines the types of messages supported by the feemarket +// module. type MsgClient interface { // Params defines a method for updating the feemarket module parameters. Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) @@ -39,8 +42,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgParamsResponse) - err := c.cc.Invoke(ctx, Msg_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -50,6 +54,9 @@ func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.Call // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility +// +// Message service defines the types of messages supported by the feemarket +// module. type MsgServer interface { // Params defines a method for updating the feemarket module parameters. Params(context.Context, *MsgParams) (*MsgParamsResponse, error) diff --git a/docs/SPEC.md b/docs/SPEC.md index aa1261a..aaa18db 100644 --- a/docs/SPEC.md +++ b/docs/SPEC.md @@ -20,7 +20,6 @@ * [MinBaseFee](#minbasefee) * [MinLearningRate](#minlearningrate) * [MaxLearningRate](#maxlearningrate) - * [TargetBlockUtilization](#targetblockutilization) * [MaxBlockUtilization](#maxblockutilization) * [Window](#window) * [FeeDenom](#feedenom) @@ -234,9 +233,6 @@ MinLearningRate is the lower bound for the learning rate. MaxLearningRate is the upper bound for the learning rate. -### TargetBlockUtilization - -TargetBlockUtilization is the target block utilization for the current block. ### MaxBlockUtilization @@ -263,8 +259,10 @@ through governance at a later time. // Params contains the required set of parameters for the EIP1559 fee market // plugin implementation. message Params { - // Alpha is the amount we additively increase the learninig rate + // Alpha is the amount we additively increase the learning rate // when it is above or below the target +/- threshold. + // + // Must be > 0. string alpha = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", @@ -273,17 +271,21 @@ message Params { // Beta is the amount we multiplicatively decrease the learning rate // when it is within the target +/- threshold. + // + // Must be [0, 1]. string beta = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - // Theta is the threshold for the learning rate. If the learning rate is + // Gamma is the threshold for the learning rate. If the learning rate is // above or below the target +/- threshold, we additively increase the // learning rate by Alpha. Otherwise, we multiplicatively decrease the // learning rate by Beta. - string theta = 3 [ + // + // Must be [0, 0.5]. + string gamma = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false @@ -298,10 +300,9 @@ message Params { (gogoproto.nullable) = false ]; - // MinBaseGasPrice determines the initial gas price of the module and the global - // minimum - // for the network. This is denominated in fee per gas unit. - string MinBaseGasPrice = 5 [ + // MinBaseGasPrice determines the initial gas price of the module and the + // global minimum for the network. + string min_base_gas_price = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false @@ -321,22 +322,23 @@ message Params { (gogoproto.nullable) = false ]; - // TargetBlockUtilization is the target block utilization. - uint64 target_block_utilization = 8; - // MaxBlockUtilization is the maximum block utilization. - uint64 max_block_utilization = 9; + uint64 max_block_utilization = 8; // Window defines the window size for calculating an adaptive learning rate // over a moving window of blocks. - uint64 window = 10; + uint64 window = 9; // FeeDenom is the denom that will be used for all fee payments. - string fee_denom = 11; + string fee_denom = 10; // Enabled is a boolean that determines whether the EIP1559 fee market is // enabled. - bool enabled = 12; + bool enabled = 11; + + // DistributeFees is a boolean that determines whether the fees are burned or + // distributed to all stakers. + bool distribute_fees = 12; } ``` @@ -380,7 +382,6 @@ max_block_utilization: "30000000" max_learning_rate: "0.125000000000000000" min_base_fee: "1.000000000000000000" min_learning_rate: "0.125000000000000000" -target_block_utilization: "15000000" theta: "0.000000000000000000" window: "1" ``` @@ -481,7 +482,6 @@ Example Output: "minBaseFee": "1000000", "minLearningRate": "125000000000000000", "maxLearningRate": "125000000000000000", - "targetBlockUtilization": "15000000", "maxBlockUtilization": "30000000", "window": "1", "feeDenom": "skip", diff --git a/proto/feemarket/feemarket/v1/genesis.proto b/proto/feemarket/feemarket/v1/genesis.proto index 6133558..e1a7933 100644 --- a/proto/feemarket/feemarket/v1/genesis.proto +++ b/proto/feemarket/feemarket/v1/genesis.proto @@ -22,8 +22,8 @@ message GenesisState { // the current base fee, learning rate, and block utilization within the // specified AIMD window. message State { - // BaseGasPrice is the current base fee. This is denominated in the fee per gas - // unit. + // BaseGasPrice is the current base fee. This is denominated in the fee per + // gas unit. string base_gas_price = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", diff --git a/proto/feemarket/feemarket/v1/params.proto b/proto/feemarket/feemarket/v1/params.proto index 4796a3a..3038ada 100644 --- a/proto/feemarket/feemarket/v1/params.proto +++ b/proto/feemarket/feemarket/v1/params.proto @@ -11,6 +11,8 @@ import "gogoproto/gogo.proto"; message Params { // Alpha is the amount we additively increase the learning rate // when it is above or below the target +/- threshold. + // + // Must be > 0. string alpha = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", @@ -19,17 +21,21 @@ message Params { // Beta is the amount we multiplicatively decrease the learning rate // when it is within the target +/- threshold. + // + // Must be [0, 1]. string beta = 2 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - // Theta is the threshold for the learning rate. If the learning rate is + // Gamma is the threshold for the learning rate. If the learning rate is // above or below the target +/- threshold, we additively increase the // learning rate by Alpha. Otherwise, we multiplicatively decrease the // learning rate by Beta. - string theta = 3 [ + // + // Must be [0, 0.5]. + string gamma = 3 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false @@ -44,8 +50,8 @@ message Params { (gogoproto.nullable) = false ]; - // MinBaseGasPrice determines the initial gas price of the module and the global - // minimum for the network. + // MinBaseGasPrice determines the initial gas price of the module and the + // global minimum for the network. string min_base_gas_price = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", @@ -66,24 +72,21 @@ message Params { (gogoproto.nullable) = false ]; - // TargetBlockUtilization is the target block utilization. - uint64 target_block_utilization = 8; - // MaxBlockUtilization is the maximum block utilization. - uint64 max_block_utilization = 9; + uint64 max_block_utilization = 8; // Window defines the window size for calculating an adaptive learning rate // over a moving window of blocks. - uint64 window = 10; + uint64 window = 9; // FeeDenom is the denom that will be used for all fee payments. - string fee_denom = 11; + string fee_denom = 10; // Enabled is a boolean that determines whether the EIP1559 fee market is // enabled. - bool enabled = 12; + bool enabled = 11; // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. - bool distribute_fees = 13; + bool distribute_fees = 12; } diff --git a/proto/feemarket/feemarket/v1/query.proto b/proto/feemarket/feemarket/v1/query.proto index aefa5ad..d9a1d10 100644 --- a/proto/feemarket/feemarket/v1/query.proto +++ b/proto/feemarket/feemarket/v1/query.proto @@ -64,15 +64,12 @@ message GasPriceRequest { // GasPriceResponse is the response type for the Query/GasPrice RPC method. // Returns a gas price in specified denom. message GasPriceResponse { - cosmos.base.v1beta1.DecCoin price = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + cosmos.base.v1beta1.DecCoin price = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // GasPriceRequest is the request type for the Query/GasPrices RPC method. -message GasPricesRequest { -} +message GasPricesRequest {} // GasPricesResponse is the response type for the Query/GasPrices RPC method. // Returns a gas price in all available denoms. diff --git a/tests/e2e/consumer.go b/tests/e2e/consumer.go index 3559290..ebe95fa 100644 --- a/tests/e2e/consumer.go +++ b/tests/e2e/consumer.go @@ -16,8 +16,8 @@ import ( var ( providerChainID = "provider-1" - providerNumValidators = int(4) - providerVersion = "v5.0.0-rc0" + providerNumValidators = 4 + providerVersion = "v5.0.0" ) // CCVChainConstructor is a constructor for the CCV chain @@ -76,7 +76,7 @@ func CCVInterchainConstructor(ctx context.Context, t *testing.T, chains []*cosmo // create a relayer client, network := interchaintest.DockerSetup(t) r := interchaintest.NewBuiltinRelayerFactory( - ibc.CosmosRly, + ibc.Hermes, zaptest.NewLogger(t), ).Build(t, client, network) diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 7e65ffa..b54a870 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -22,8 +22,8 @@ import ( ) var ( - minBaseGasPrice = sdkmath.LegacyNewDec(10) - baseGasPrice = sdkmath.LegacyNewDec(1000000) + minBaseGasPrice = sdkmath.LegacyMustNewDecFromStr("0.001") + baseGasPrice = sdkmath.LegacyMustNewDecFromStr("0.1") // config params numValidators = 4 @@ -53,19 +53,18 @@ var ( { Key: "app_state.feemarket.params", Value: feemarkettypes.Params{ - Alpha: feemarkettypes.DefaultAlpha, - Beta: feemarkettypes.DefaultBeta, - Theta: feemarkettypes.DefaultTheta, - Delta: feemarkettypes.DefaultDelta, - MinBaseGasPrice: minBaseGasPrice, - MinLearningRate: feemarkettypes.DefaultMinLearningRate, - MaxLearningRate: feemarkettypes.DefaultMaxLearningRate, - TargetBlockUtilization: feemarkettypes.DefaultTargetBlockUtilization / 4, - MaxBlockUtilization: feemarkettypes.DefaultMaxBlockUtilization, - Window: feemarkettypes.DefaultWindow, - FeeDenom: feemarkettypes.DefaultFeeDenom, - Enabled: true, - DistributeFees: false, + Alpha: feemarkettypes.DefaultAlpha, + Beta: feemarkettypes.DefaultBeta, + Gamma: feemarkettypes.DefaultAIMDGamma, + Delta: feemarkettypes.DefaultDelta, + MinBaseGasPrice: minBaseGasPrice, + MinLearningRate: feemarkettypes.DefaultMinLearningRate, + MaxLearningRate: feemarkettypes.DefaultMaxLearningRate, + MaxBlockUtilization: feemarkettypes.DefaultMaxBlockUtilization, + Window: feemarkettypes.DefaultWindow, + FeeDenom: feemarkettypes.DefaultFeeDenom, + Enabled: true, + DistributeFees: false, }, }, { diff --git a/tests/e2e/go.mod b/tests/e2e/go.mod index 84de46c..0ef3671 100644 --- a/tests/e2e/go.mod +++ b/tests/e2e/go.mod @@ -21,7 +21,7 @@ require ( github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 github.com/skip-mev/feemarket v0.0.1-alpha.2.0.20240529211541-57d7094237da github.com/skip-mev/slinky v0.4.6 - github.com/strangelove-ventures/interchaintest/v8 v8.3.1-0.20240510203915-0559b76de4fa + github.com/strangelove-ventures/interchaintest/v8 v8.4.0 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 google.golang.org/grpc v1.64.0 @@ -82,7 +82,7 @@ require ( github.com/cosmos/gogoproto v1.4.12 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect - github.com/cosmos/ibc-go/v8 v8.2.0 // indirect + github.com/cosmos/ibc-go/v8 v8.2.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/interchain-security/v5 v5.0.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect @@ -160,7 +160,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.8 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.9 // indirect @@ -258,10 +258,10 @@ require ( gotest.tools/v3 v3.5.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect - modernc.org/libc v1.41.0 // indirect + modernc.org/libc v1.49.3 // indirect modernc.org/mathutil v1.6.0 // indirect - modernc.org/memory v1.7.2 // indirect - modernc.org/sqlite v1.29.5 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/sqlite v1.29.9 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect nhooyr.io/websocket v1.8.7 // indirect diff --git a/tests/e2e/go.sum b/tests/e2e/go.sum index 56b3126..baf43ca 100644 --- a/tests/e2e/go.sum +++ b/tests/e2e/go.sum @@ -383,8 +383,8 @@ github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.0 h1:7oCzyy1sZCcgpeQLnHxC56brsSz3KWwQGKXalXwXFzE= -github.com/cosmos/ibc-go/v8 v8.2.0/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= +github.com/cosmos/ibc-go/v8 v8.2.1/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= @@ -632,8 +632,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b h1:h9U78+dx9a4BKdQkBBos92HalKpaGKHrp+3Uo6yTodo= -github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -790,8 +790,8 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -836,8 +836,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -1078,8 +1076,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= -github.com/strangelove-ventures/interchaintest/v8 v8.3.1-0.20240510203915-0559b76de4fa h1:4C802Vg9ADUXiw8Nb6iEDoXAmUw0XYvf3rPoSLslfqA= -github.com/strangelove-ventures/interchaintest/v8 v8.3.1-0.20240510203915-0559b76de4fa/go.mod h1:5goHQtgWO9khoUO/SfR//w3uaw/uYVriDR1OY6PyydM= +github.com/strangelove-ventures/interchaintest/v8 v8.4.0 h1:UHLmJfmkFXuJHfSE8qmOuEy4FWZWuRw4G6XZHm9hC6w= +github.com/strangelove-ventures/interchaintest/v8 v8.4.0/go.mod h1:nfPgRi1yjnzi+qF+0Fs9qN9kkS1Fk0oqgpKvqg5a200= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1831,18 +1829,28 @@ launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbc launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +modernc.org/cc/v4 v4.20.0 h1:45Or8mQfbUqJOG9WaxvlFYOAQO0lQ5RvqBcFCXngjxk= +modernc.org/cc/v4 v4.20.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.16.0 h1:ofwORa6vx2FMm0916/CkZjpFPSR70VwTjUCe2Eg5BnA= +modernc.org/ccgo/v4 v4.16.0/go.mod h1:dkNyWIjFrVIZ68DTo36vHK+6/ShBn4ysU61So6PIqCI= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= -modernc.org/libc v1.41.0/go.mod h1:w0eszPsiXoOnoMJgrXjglgLuDy/bt5RR4y3QzUUeodY= +modernc.org/libc v1.49.3 h1:j2MRCRdwJI2ls/sGbeSk0t2bypOG/uvPZUsGQFDulqg= +modernc.org/libc v1.49.3/go.mod h1:yMZuGkn7pXbKfoT/M35gFJOAEdSKdxL0q64sF7KqCDo= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= -modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= -modernc.org/sqlite v1.29.5 h1:8l/SQKAjDtZFo9lkJLdk8g9JEOeYRG4/ghStDCCTiTE= -modernc.org/sqlite v1.29.5/go.mod h1:S02dvcmm7TnTRvGhv8IGYyLnIt7AS2KPaB1F/71p75U= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow= +modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/tests/e2e/setup.go b/tests/e2e/setup.go index 4784df5..721b08f 100644 --- a/tests/e2e/setup.go +++ b/tests/e2e/setup.go @@ -12,7 +12,6 @@ import ( "path" "strconv" "strings" - "testing" "time" "cosmossdk.io/math" @@ -35,8 +34,6 @@ import ( "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" "github.com/strangelove-ventures/interchaintest/v8/testutil" - "github.com/stretchr/testify/require" - "go.uber.org/zap/zaptest" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -53,49 +50,6 @@ type KeyringOverride struct { cdc codec.Codec } -// ChainBuilderFromChainSpec creates an interchaintest chain builder factory given a ChainSpec -// and returns the associated chain -func ChainBuilderFromChainSpec(t *testing.T, spec *interchaintest.ChainSpec) ibc.Chain { - // require that NumFullNodes == NumValidators == 3 - require.Equal(t, *spec.NumValidators, 3) - - cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{spec}) - - chains, err := cf.Chains(t.Name()) - require.NoError(t, err) - - require.Len(t, chains, 1) - chain := chains[0] - - _, ok := chain.(*cosmos.CosmosChain) - require.True(t, ok) - - return chain -} - -// BuildInterchain creates a new Interchain testing env with the configured Block SDK CosmosChain -func BuildInterchain(t *testing.T, ctx context.Context, chain ibc.Chain) *interchaintest.Interchain { - ic := interchaintest.NewInterchain() - ic.AddChain(chain) - - // create docker network - dockerClient, networkID := interchaintest.DockerSetup(t) - - ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) - defer cancel() - - // build the interchain - err := ic.Build(ctx, nil, interchaintest.InterchainBuildOptions{ - SkipPathCreation: true, - Client: dockerClient, - NetworkID: networkID, - TestName: t.Name(), - }) - require.NoError(t, err) - - return ic -} - // SimulateTx simulates the provided messages, and checks whether the provided failure condition is met func (s *TestSuite) SimulateTx(ctx context.Context, user cosmos.User, height uint64, expectFail bool, msgs ...sdk.Msg) { // create tx factory + Client Context @@ -377,7 +331,6 @@ func (s *TestSuite) keyringDirFromNode() string { } func (s *TestSuite) SendCoinsMultiBroadcast(ctx context.Context, sender, receiver ibc.Wallet, amt, fees sdk.Coins, gas int64, numMsg int) (*coretypes.ResultBroadcastTxCommit, error) { - msgs := make([]sdk.Msg, numMsg) for i := 0; i < numMsg; i++ { msgs[i] = &banktypes.MsgSend{ diff --git a/tests/e2e/suite.go b/tests/e2e/suite.go index 5ad0fde..55d9c46 100644 --- a/tests/e2e/suite.go +++ b/tests/e2e/suite.go @@ -26,15 +26,9 @@ import ( ) const ( - envKeepAlive = "FEEMARKET_INTEGRATION_KEEPALIVE" - initBalance = 30000000000000 - genesisAmount = 1000000000 - defaultDenom = "stake" - validatorKey = "validator" - yes = "yes" - deposit = 1000000 - userMnemonic = "foster poverty abstract scorpion short shrimp tilt edge romance adapt only benefit moral another where host egg echo ability wisdom lizard lazy pool roast" - userAccountAddressHex = "877E307618AB73E009A978AC32E0264791F6D40A" + envKeepAlive = "FEEMARKET_INTEGRATION_KEEPALIVE" + initBalance = 30000000000000 + defaultDenom = "stake" ) var r *rand.Rand @@ -486,7 +480,7 @@ func (s *TestSuite) TestSendTxIncrease() { baseGasPrice = s.QueryDefaultGasPrice() s.T().Log("gas price", baseGasPrice.String()) - if baseGasPrice.Amount.GT(math.LegacyNewDec(1000000)) { + if baseGasPrice.Amount.GT(math.LegacyNewDec(10)) { break } } diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index b7edd80..16358c5 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -3,6 +3,7 @@ package integration_test import ( "testing" + "cosmossdk.io/math" txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -10,12 +11,10 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/std" + sdk "github.com/cosmos/cosmos-sdk/types" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/gogoproto/proto" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" testkeeper "github.com/skip-mev/feemarket/testutils/keeper" @@ -82,17 +81,16 @@ func (s *IntegrationTestSuite) TestParams() { s.Run("set and get custom params", func() { params := types.Params{ - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - MinBaseGasPrice: math.LegacyNewDec(10), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 5, - MaxBlockUtilization: 10, - Window: 1, - Enabled: true, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MinBaseGasPrice: math.LegacyNewDec(10), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 10, + Window: 1, + Enabled: true, } err := s.TestKeepers.FeeMarketKeeper.SetParams(s.ctx, params) diff --git a/x/feemarket/ante/expected_keepers.go b/x/feemarket/ante/expected_keepers.go index c1c1d9f..360d831 100644 --- a/x/feemarket/ante/expected_keepers.go +++ b/x/feemarket/ante/expected_keepers.go @@ -4,7 +4,6 @@ import ( "context" "cosmossdk.io/core/address" - sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/feemarket/ante/fee.go b/x/feemarket/ante/fee.go index cd84452..752b2bf 100644 --- a/x/feemarket/ante/fee.go +++ b/x/feemarket/ante/fee.go @@ -80,11 +80,11 @@ func (dfd FeeMarketCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula ctx = ctx.WithMinGasPrices(sdk.NewDecCoins(minGasPrice)) if !simulate { - fee, _, err := CheckTxFee(ctx, minGasPrice, feeCoin, feeGas, true) + _, tip, err := CheckTxFee(ctx, minGasPrice, feeCoin, feeGas, true) if err != nil { return ctx, errorsmod.Wrapf(err, "error checking fee") } - ctx = ctx.WithPriority(getTxPriority(fee, int64(gas))) + ctx = ctx.WithPriority(getTxPriority(tip, int64(gas))) return next(ctx, tx, simulate) } return next(ctx, tx, simulate) @@ -92,7 +92,7 @@ func (dfd FeeMarketCheckDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula // CheckTxFee implements the logic for the fee market to check if a Tx has provided sufficient // fees given the current state of the fee market. Returns an error if insufficient fees. -func CheckTxFee(ctx sdk.Context, minGasPrice sdk.DecCoin, feeCoin sdk.Coin, feeGas int64, isCheck bool) (payCoin sdk.Coin, tip sdk.Coin, err error) { +func CheckTxFee(ctx sdk.Context, minGasPrice sdk.DecCoin, feeCoin sdk.Coin, feeGas int64, isAnte bool) (payCoin sdk.Coin, tip sdk.Coin, err error) { payCoin = feeCoin // Ensure that the provided fees meet the minimum @@ -123,7 +123,8 @@ func CheckTxFee(ctx sdk.Context, minGasPrice sdk.DecCoin, feeCoin sdk.Coin, feeG ) } - if isCheck { + if isAnte { + tip = payCoin.Sub(requiredFee) // set fee coins to be required amount if checking payCoin = requiredFee } else { @@ -148,7 +149,7 @@ func getTxPriority(fee sdk.Coin, gas int64) int64 { if gasPrice.IsInt64() { p = gasPrice.Int64() } - if priority == 0 || p < priority { + if p < priority { priority = p } diff --git a/x/feemarket/ante/suite/suite.go b/x/feemarket/ante/suite/suite.go index 565a437..9aa013c 100644 --- a/x/feemarket/ante/suite/suite.go +++ b/x/feemarket/ante/suite/suite.go @@ -23,12 +23,11 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" - testkeeper "github.com/skip-mev/feemarket/testutils/keeper" feemarketante "github.com/skip-mev/feemarket/x/feemarket/ante" "github.com/skip-mev/feemarket/x/feemarket/ante/mocks" feemarketpost "github.com/skip-mev/feemarket/x/feemarket/post" + feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" ) type TestSuite struct { diff --git a/x/feemarket/fuzz/aimd_eip1559_test.go b/x/feemarket/fuzz/aimd_eip1559_test.go index 02015b2..46df28d 100644 --- a/x/feemarket/fuzz/aimd_eip1559_test.go +++ b/x/feemarket/fuzz/aimd_eip1559_test.go @@ -49,7 +49,7 @@ func TestAIMDLearningRate(t *testing.T) { require.True(t, lr.GTE(params.MinLearningRate)) require.True(t, lr.LTE(params.MaxLearningRate)) - if utilization.LTE(params.Theta) || utilization.GTE(math.LegacyOneDec().Sub(params.Theta)) { + if utilization.LTE(params.Gamma) || utilization.GTE(math.LegacyOneDec().Sub(params.Gamma)) { require.True(t, lr.GTE(prevLearningRate)) } else { require.True(t, lr.LTE(prevLearningRate)) @@ -61,11 +61,11 @@ func TestAIMDLearningRate(t *testing.T) { }) } -// TestAIMDBaseFee ensures that the additive increase multiplicative -// decrease base fee adjustment algorithm correctly adjusts the base -// fee. In particular, the base fee should function the same as the +// TestAIMDGasPrice ensures that the additive increase multiplicative +// decrease gas price adjustment algorithm correctly adjusts the base +// fee. In particular, the gas price should function the same as the // default EIP-1559 base fee adjustment algorithm. -func TestAIMDBaseFee(t *testing.T) { +func TestAIMDGasPrice(t *testing.T) { rapid.Check(t, func(t *rapid.T) { state := types.DefaultAIMDState() window := rapid.Int64Range(1, 50).Draw(t, "window") @@ -105,7 +105,7 @@ func TestAIMDBaseFee(t *testing.T) { // Calculate the new base gasPrice with the learning rate adjustment. currentBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(state.Window[state.Index])) - targetBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(params.TargetBlockUtilization)) + targetBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(params.TargetBlockUtilization())) utilization := (currentBlockSize.Sub(targetBlockSize)).Quo(targetBlockSize) // Truncate the learning rate adjustment to an integer. @@ -147,8 +147,8 @@ func CreateRandomAIMDParams(t *rapid.T) types.Params { b := rapid.Uint64Range(50, 99).Draw(t, "beta") beta := math.LegacyNewDec(int64(b)).Quo(math.LegacyNewDec(100)) - th := rapid.Uint64Range(10, 90).Draw(t, "theta") - theta := math.LegacyNewDec(int64(th)).Quo(math.LegacyNewDec(100)) + g := rapid.Uint64Range(10, 50).Draw(t, "gamma") + gamma := math.LegacyNewDec(int64(g)).Quo(math.LegacyNewDec(100)) d := rapid.Uint64Range(1, 1000).Draw(t, "delta") delta := math.LegacyNewDec(int64(d)).Quo(math.LegacyNewDec(1000)) @@ -161,10 +161,9 @@ func CreateRandomAIMDParams(t *rapid.T) types.Params { params := types.DefaultAIMDParams() params.Alpha = alpha params.Beta = beta - params.Theta = theta + params.Gamma = gamma params.Delta = delta params.MaxBlockUtilization = maxBlockUtilization - params.TargetBlockUtilization = targetBlockUtilization params.DistributeFees = distributeFees return params diff --git a/x/feemarket/fuzz/eip1559_test.go b/x/feemarket/fuzz/eip1559_test.go index e886629..c17b142 100644 --- a/x/feemarket/fuzz/eip1559_test.go +++ b/x/feemarket/fuzz/eip1559_test.go @@ -10,7 +10,7 @@ import ( "github.com/skip-mev/feemarket/x/feemarket/types" ) -// TestLearningRate ensure's that the learning rate is always +// TestLearningRate ensures that the learning rate is always // constant for the default EIP-1559 implementation. func TestLearningRate(t *testing.T) { rapid.Check(t, func(t *rapid.T) { @@ -35,9 +35,9 @@ func TestLearningRate(t *testing.T) { }) } -// TestBaseFee ensure's that the base fee moves in the correct +// TestGasPrice ensures that the gas price moves in the correct // direction for the default EIP-1559 implementation. -func TestBaseFee(t *testing.T) { +func TestGasPrice(t *testing.T) { rapid.Check(t, func(t *rapid.T) { state := types.DefaultState() params := CreateRandomParams(t) @@ -63,9 +63,9 @@ func TestBaseFee(t *testing.T) { require.True(t, params.MinBaseGasPrice.LTE(state.BaseGasPrice)) switch { - case blockUtilization > params.TargetBlockUtilization: + case blockUtilization > params.TargetBlockUtilization(): require.True(t, state.BaseGasPrice.GTE(prevBaseFee)) - case blockUtilization < params.TargetBlockUtilization: + case blockUtilization < params.TargetBlockUtilization(): require.True(t, state.BaseGasPrice.LTE(prevBaseFee)) default: require.Equal(t, state.BaseGasPrice, prevBaseFee) @@ -82,18 +82,16 @@ func CreateRandomParams(t *rapid.T) types.Params { b := rapid.Uint64Range(50, 99).Draw(t, "beta") beta := math.LegacyNewDec(int64(b)).Quo(math.LegacyNewDec(100)) - th := rapid.Uint64Range(10, 90).Draw(t, "theta") - theta := math.LegacyNewDec(int64(th)).Quo(math.LegacyNewDec(100)) + g := rapid.Uint64Range(10, 50).Draw(t, "gamma") + gamma := math.LegacyNewDec(int64(g)).Quo(math.LegacyNewDec(100)) - targetBlockUtilization := rapid.Uint64Range(1, 30_000_000).Draw(t, "target_block_utilization") - maxBlockUtilization := rapid.Uint64Range(targetBlockUtilization, targetBlockUtilization*5).Draw(t, "max_block_utilization") + maxBlockUtilization := rapid.Uint64Range(2, 30_000_000).Draw(t, "max_block_utilization") params := types.DefaultParams() params.Alpha = alpha params.Beta = beta - params.Theta = theta + params.Gamma = gamma params.MaxBlockUtilization = maxBlockUtilization - params.TargetBlockUtilization = targetBlockUtilization return params } diff --git a/x/feemarket/keeper/feemarket_test.go b/x/feemarket/keeper/feemarket_test.go index 1cc366a..e532e20 100644 --- a/x/feemarket/keeper/feemarket_test.go +++ b/x/feemarket/keeper/feemarket_test.go @@ -96,7 +96,7 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { // Reaching the target block size means that we expect this to not // increase. - err := state.Update(params.TargetBlockUtilization, params) + err := state.Update(params.TargetBlockUtilization(), params) s.Require().NoError(err) s.setGenesisState(params, state) @@ -120,7 +120,7 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { state.BaseGasPrice = state.BaseGasPrice.Mul(math.LegacyNewDec(2)) // Reaching the target block size means that we expect this to not // increase. - err := state.Update(params.TargetBlockUtilization, params) + err := state.Update(params.TargetBlockUtilization(), params) s.Require().NoError(err) s.setGenesisState(params, state) @@ -194,7 +194,6 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { state := types.DefaultState() params := types.DefaultParams() params.MaxBlockUtilization = 100 - params.TargetBlockUtilization = 50 err := state.Update(25, params) s.Require().NoError(err) @@ -219,7 +218,6 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { params := types.DefaultParams() params.MaxBlockUtilization = 100 - params.TargetBlockUtilization = 50 err := state.Update(25, params) s.Require().NoError(err) @@ -245,7 +243,6 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { state := types.DefaultState() params := types.DefaultParams() params.MaxBlockUtilization = 100 - params.TargetBlockUtilization = 50 err := state.Update(75, params) s.Require().NoError(err) @@ -272,7 +269,6 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { state.BaseGasPrice = state.BaseGasPrice.Mul(math.LegacyNewDec(2)) params := types.DefaultParams() params.MaxBlockUtilization = 100 - params.TargetBlockUtilization = 50 err := state.Update(75, params) s.Require().NoError(err) @@ -366,7 +362,7 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { // Reaching the target block size means that we expect this to not // increase. for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } s.setGenesisState(params, state) @@ -393,7 +389,7 @@ func (s *KeeperTestSuite) TestUpdateFeeMarket() { // Reaching the target block size means that we expect this to not // increase. for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } s.setGenesisState(params, state) diff --git a/x/feemarket/keeper/keeper_test.go b/x/feemarket/keeper/keeper_test.go index 00f6b25..d351e55 100644 --- a/x/feemarket/keeper/keeper_test.go +++ b/x/feemarket/keeper/keeper_test.go @@ -98,17 +98,16 @@ func (s *KeeperTestSuite) TestParams() { s.Run("set and get custom params", func() { params := types.Params{ - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - MinBaseGasPrice: math.LegacyNewDec(10), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 5, - MaxBlockUtilization: 10, - Window: 1, - Enabled: true, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MinBaseGasPrice: math.LegacyNewDec(10), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 10, + Window: 1, + Enabled: true, } err := s.feeMarketKeeper.SetParams(s.ctx, params) diff --git a/x/feemarket/keeper/query_server_test.go b/x/feemarket/keeper/query_server_test.go index 1e66157..e6dfb9e 100644 --- a/x/feemarket/keeper/query_server_test.go +++ b/x/feemarket/keeper/query_server_test.go @@ -23,17 +23,16 @@ func (s *KeeperTestSuite) TestParamsRequest() { s.Run("can get updated params", func() { params := types.Params{ - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - MinBaseGasPrice: math.LegacyNewDec(10), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 5, - MaxBlockUtilization: 10, - Window: 1, - Enabled: true, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MinBaseGasPrice: math.LegacyNewDec(10), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 10, + Window: 1, + Enabled: true, } err := s.feeMarketKeeper.SetParams(s.ctx, params) s.Require().NoError(err) diff --git a/x/feemarket/types/eip1559.go b/x/feemarket/types/eip1559.go index b72bf57..b42757c 100644 --- a/x/feemarket/types/eip1559.go +++ b/x/feemarket/types/eip1559.go @@ -21,16 +21,12 @@ var ( // DefaultBeta is not used in the base EIP-1559 implementation. DefaultBeta = math.LegacyMustNewDecFromStr("1.0") - // DefaultTheta is not used in the base EIP-1559 implementation. - DefaultTheta = math.LegacyMustNewDecFromStr("0.0") + // DefaultGamma is not used in the base EIP-1559 implementation. + DefaultGamma = math.LegacyMustNewDecFromStr("0.0") // DefaultDelta is not used in the base EIP-1559 implementation. DefaultDelta = math.LegacyMustNewDecFromStr("0.0") - // DefaultTargetBlockUtilization is the default target block utilization. This is the default - // on Ethereum. This denominated in units of gas consumed in a block. - DefaultTargetBlockUtilization uint64 = 15_000_000 - // DefaultMaxBlockUtilization is the default maximum block utilization. This is the default // on Ethereum. This denominated in units of gas consumed in a block. DefaultMaxBlockUtilization uint64 = 30_000_000 @@ -56,9 +52,8 @@ func DefaultParams() Params { DefaultWindow, DefaultAlpha, DefaultBeta, - DefaultTheta, + DefaultGamma, DefaultDelta, - DefaultTargetBlockUtilization, DefaultMaxBlockUtilization, DefaultMinBaseGasPrice, DefaultMinLearningRate, diff --git a/x/feemarket/types/eip1559_aimd.go b/x/feemarket/types/eip1559_aimd.go index 3aefc00..ac07474 100644 --- a/x/feemarket/types/eip1559_aimd.go +++ b/x/feemarket/types/eip1559_aimd.go @@ -21,23 +21,18 @@ var ( // decrease the learning rate when the target utilization is not met. DefaultAIMDBeta = math.LegacyMustNewDecFromStr("0.95") - // DefaultAIMDTheta is the default threshold for determining whether + // DefaultAIMDGamma is the default threshold for determining whether // to increase or decrease the learning rate. In this case, we increase // the learning rate if the block utilization within the window is greater // than 0.75 or less than 0.25. Otherwise, we multiplicatively decrease // the learning rate. - DefaultAIMDTheta = math.LegacyMustNewDecFromStr("0.25") + DefaultAIMDGamma = math.LegacyMustNewDecFromStr("0.25") // DefaultAIMDDelta is the default delta value for how much we additively // increase or decrease the base fee when the net block utilization within // the window is not equal to the target utilization. DefaultAIMDDelta = math.LegacyMustNewDecFromStr("0.0") - // DefaultAIMDTargetBlockSize is the default target block utilization. This - // is the default on Ethereum. This denominated in units of gas consumed in - // a block. - DefaultAIMDTargetBlockSize uint64 = 15_000_000 - // DefaultAIMDMaxBlockSize is the default maximum block utilization. // This is the default on Ethereum. This denominated in units of gas // consumed in a block. @@ -65,9 +60,8 @@ func DefaultAIMDParams() Params { DefaultAIMDWindow, DefaultAIMDAlpha, DefaultAIMDBeta, - DefaultAIMDTheta, + DefaultAIMDGamma, DefaultAIMDDelta, - DefaultAIMDTargetBlockSize, DefaultAIMDMaxBlockSize, DefaultAIMDMinBaseFee, DefaultAIMDMinLearningRate, diff --git a/x/feemarket/types/genesis.pb.go b/x/feemarket/types/genesis.pb.go index a16420f..cc47e5d 100644 --- a/x/feemarket/types/genesis.pb.go +++ b/x/feemarket/types/genesis.pb.go @@ -86,8 +86,8 @@ func (m *GenesisState) GetState() State { // the current base fee, learning rate, and block utilization within the // specified AIMD window. type State struct { - // BaseGasPrice is the current base fee. This is denominated in the fee per gas - // unit. + // BaseGasPrice is the current base fee. This is denominated in the fee per + // gas unit. BaseGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=base_gas_price,json=baseGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_gas_price"` // LearningRate is the current learning rate. LearningRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=learning_rate,json=learningRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"learning_rate"` diff --git a/x/feemarket/types/params.go b/x/feemarket/types/params.go index ee3f5fb..267f2b0 100644 --- a/x/feemarket/types/params.go +++ b/x/feemarket/types/params.go @@ -6,20 +6,14 @@ import ( "cosmossdk.io/math" ) -// MaxBlockUtilizationRatio is the maximum ratio of the max block size to the target block size. This -// can be trivially understood to be the maximum base fee increase that can occur in between -// blocks. This is a constant that is used to prevent the base fee from increasing too quickly. -const MaxBlockUtilizationRatio = 10 - // NewParams instantiates a new EIP-1559 Params object. This params object is utilized // to implement both the base EIP-1559 fee and AIMD EIP-1559 fee market implementations. func NewParams( window uint64, alpha math.LegacyDec, beta math.LegacyDec, - theta math.LegacyDec, + gamma math.LegacyDec, delta math.LegacyDec, - targetBlockSize uint64, maxBlockSize uint64, minBaseGasPrice math.LegacyDec, minLearingRate math.LegacyDec, @@ -28,18 +22,17 @@ func NewParams( enabled bool, ) Params { return Params{ - Alpha: alpha, - Beta: beta, - Theta: theta, - Delta: delta, - MinBaseGasPrice: minBaseGasPrice, - MinLearningRate: minLearingRate, - MaxLearningRate: maxLearningRate, - TargetBlockUtilization: targetBlockSize, - MaxBlockUtilization: maxBlockSize, - Window: window, - FeeDenom: feeDenom, - Enabled: enabled, + Alpha: alpha, + Beta: beta, + Gamma: gamma, + Delta: delta, + MinBaseGasPrice: minBaseGasPrice, + MinLearningRate: minLearingRate, + MaxLearningRate: maxLearningRate, + MaxBlockUtilization: maxBlockSize, + Window: window, + FeeDenom: feeDenom, + Enabled: enabled, } } @@ -57,26 +50,14 @@ func (p *Params) ValidateBasic() error { return fmt.Errorf("beta cannot be nil and must be between [0, 1]") } - if p.Theta.IsNil() || p.Theta.IsNegative() || p.Theta.GT(math.LegacyOneDec()) { - return fmt.Errorf("theta cannot be nil and must be between [0, 1]") + if p.Gamma.IsNil() || p.Gamma.IsNegative() || p.Gamma.GT(math.LegacyMustNewDecFromStr("0.5")) { + return fmt.Errorf("theta cannot be nil and must be between [0, 0.5]") } if p.Delta.IsNil() || p.Delta.IsNegative() { return fmt.Errorf("delta cannot be nil and must be between [0, inf)") } - if p.TargetBlockUtilization == 0 { - return fmt.Errorf("target block size cannot be zero") - } - - if p.TargetBlockUtilization > p.MaxBlockUtilization { - return fmt.Errorf("target block size cannot be greater than max block size") - } - - if p.MaxBlockUtilization/p.TargetBlockUtilization > MaxBlockUtilizationRatio { - return fmt.Errorf("max block size cannot be greater than target block size times %d", MaxBlockUtilizationRatio) - } - if p.MinBaseGasPrice.IsNil() || !p.MinBaseGasPrice.GTE(math.LegacyZeroDec()) { return fmt.Errorf("min base gas price cannot be nil and must be greater than or equal to zero") } @@ -85,6 +66,10 @@ func (p *Params) ValidateBasic() error { return fmt.Errorf("min learning rate cannot be negative or nil") } + if p.MaxBlockUtilization < 2 { + return fmt.Errorf("max block utilization cannot be less than 2") + } + if p.MaxLearningRate.IsNil() || p.MaxLearningRate.IsNegative() { return fmt.Errorf("max learning rate cannot be negative or nil") } @@ -99,3 +84,8 @@ func (p *Params) ValidateBasic() error { return nil } + +// TargetBlockUtilization returns 0.5 * MaxBlockUtilization. +func (p *Params) TargetBlockUtilization() uint64 { + return p.MaxBlockUtilization / 2 +} diff --git a/x/feemarket/types/params.pb.go b/x/feemarket/types/params.pb.go index e199601..ac312b3 100644 --- a/x/feemarket/types/params.pb.go +++ b/x/feemarket/types/params.pb.go @@ -30,41 +30,45 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Params struct { // Alpha is the amount we additively increase the learning rate // when it is above or below the target +/- threshold. + // + // Must be > 0. Alpha cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=alpha,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"alpha"` // Beta is the amount we multiplicatively decrease the learning rate // when it is within the target +/- threshold. + // + // Must be [0, 1]. Beta cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=beta,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"beta"` - // Theta is the threshold for the learning rate. If the learning rate is + // Gamma is the threshold for the learning rate. If the learning rate is // above or below the target +/- threshold, we additively increase the // learning rate by Alpha. Otherwise, we multiplicatively decrease the // learning rate by Beta. - Theta cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=theta,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"theta"` + // + // Must be [0, 0.5]. + Gamma cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=gamma,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"gamma"` // Delta is the amount we additively increase/decrease the base fee when the // net block utilization difference in the window is above/below the target // utilization. Delta cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=delta,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"delta"` - // MinBaseGasPrice determines the initial gas price of the module and the global - // minimum for the network. + // MinBaseGasPrice determines the initial gas price of the module and the + // global minimum for the network. MinBaseGasPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=min_base_gas_price,json=minBaseGasPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_base_gas_price"` // MinLearningRate is the lower bound for the learning rate. MinLearningRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=min_learning_rate,json=minLearningRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_learning_rate"` // MaxLearningRate is the upper bound for the learning rate. MaxLearningRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=max_learning_rate,json=maxLearningRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_learning_rate"` - // TargetBlockUtilization is the target block utilization. - TargetBlockUtilization uint64 `protobuf:"varint,8,opt,name=target_block_utilization,json=targetBlockUtilization,proto3" json:"target_block_utilization,omitempty"` // MaxBlockUtilization is the maximum block utilization. - MaxBlockUtilization uint64 `protobuf:"varint,9,opt,name=max_block_utilization,json=maxBlockUtilization,proto3" json:"max_block_utilization,omitempty"` + MaxBlockUtilization uint64 `protobuf:"varint,8,opt,name=max_block_utilization,json=maxBlockUtilization,proto3" json:"max_block_utilization,omitempty"` // Window defines the window size for calculating an adaptive learning rate // over a moving window of blocks. - Window uint64 `protobuf:"varint,10,opt,name=window,proto3" json:"window,omitempty"` + Window uint64 `protobuf:"varint,9,opt,name=window,proto3" json:"window,omitempty"` // FeeDenom is the denom that will be used for all fee payments. - FeeDenom string `protobuf:"bytes,11,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` + FeeDenom string `protobuf:"bytes,10,opt,name=fee_denom,json=feeDenom,proto3" json:"fee_denom,omitempty"` // Enabled is a boolean that determines whether the EIP1559 fee market is // enabled. - Enabled bool `protobuf:"varint,12,opt,name=enabled,proto3" json:"enabled,omitempty"` + Enabled bool `protobuf:"varint,11,opt,name=enabled,proto3" json:"enabled,omitempty"` // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. - DistributeFees bool `protobuf:"varint,13,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` + DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -100,13 +104,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetTargetBlockUtilization() uint64 { - if m != nil { - return m.TargetBlockUtilization - } - return 0 -} - func (m *Params) GetMaxBlockUtilization() uint64 { if m != nil { return m.MaxBlockUtilization @@ -151,36 +148,35 @@ func init() { } var fileDescriptor_3907de4df2e1c66e = []byte{ - // 462 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x80, 0x63, 0x48, 0xdd, 0x64, 0xf9, 0xa9, 0x58, 0x20, 0x5a, 0x5a, 0xc9, 0x8d, 0xe0, 0x40, - 0x2e, 0xb5, 0x15, 0xb8, 0x70, 0x8e, 0x02, 0x15, 0x52, 0x0f, 0x95, 0x25, 0x2e, 0x48, 0x60, 0x8d, - 0xed, 0x89, 0xb3, 0x8a, 0xd7, 0x6b, 0x79, 0x37, 0x69, 0xca, 0x53, 0xf0, 0x24, 0x9c, 0x78, 0x88, - 0x1e, 0x2b, 0x4e, 0x88, 0x43, 0x85, 0x92, 0x17, 0x41, 0xbb, 0x0e, 0xa4, 0xd0, 0x9b, 0xb9, 0xcd, - 0xdf, 0xf7, 0x79, 0xbc, 0xd2, 0x90, 0x67, 0x13, 0x44, 0x01, 0xd5, 0x0c, 0x75, 0xb0, 0x8d, 0x16, - 0xc3, 0xa0, 0x84, 0x0a, 0x84, 0xf2, 0xcb, 0x4a, 0x6a, 0x49, 0x7b, 0x7f, 0x5a, 0xfe, 0x36, 0x5a, - 0x0c, 0xf7, 0x9f, 0x24, 0x52, 0x09, 0xa9, 0x22, 0x3b, 0x15, 0xd4, 0x49, 0x8d, 0xec, 0x3f, 0xca, - 0x64, 0x26, 0xeb, 0xba, 0x89, 0xea, 0xea, 0xd3, 0x2f, 0x2e, 0x71, 0x4f, 0xad, 0x99, 0x1e, 0x93, - 0x1d, 0xc8, 0xcb, 0x29, 0x30, 0xa7, 0xef, 0x0c, 0xba, 0xa3, 0xe1, 0xc5, 0xd5, 0x61, 0xeb, 0xc7, - 0xd5, 0xe1, 0x41, 0x6d, 0x51, 0xe9, 0xcc, 0xe7, 0x32, 0x10, 0xa0, 0xa7, 0xfe, 0x09, 0x66, 0x90, - 0x9c, 0x8f, 0x31, 0xf9, 0xf6, 0xf5, 0x88, 0x6c, 0x3e, 0x32, 0xc6, 0x24, 0xac, 0x79, 0xfa, 0x9a, - 0xb4, 0x63, 0xd4, 0xc0, 0x6e, 0x35, 0xf5, 0x58, 0xdc, 0xec, 0xa3, 0xa7, 0xc6, 0x73, 0xbb, 0xf1, - 0x3e, 0x96, 0x37, 0xa2, 0x14, 0x73, 0x0d, 0xac, 0xdd, 0x58, 0x64, 0x79, 0xfa, 0x91, 0x50, 0xc1, - 0x8b, 0x28, 0x06, 0x85, 0x51, 0x06, 0xe6, 0x95, 0x79, 0x82, 0x6c, 0xa7, 0xa9, 0x75, 0x4f, 0xf0, - 0x62, 0x04, 0x0a, 0x8f, 0x41, 0x9d, 0x1a, 0x13, 0xfd, 0x40, 0x1e, 0x18, 0x7f, 0x8e, 0x50, 0x15, - 0xbc, 0xc8, 0xa2, 0x0a, 0x34, 0x32, 0xf7, 0x7f, 0xf4, 0x27, 0x1b, 0x55, 0x08, 0xba, 0xd6, 0xc3, - 0xf2, 0x1f, 0xfd, 0x6e, 0x73, 0x3d, 0x2c, 0xff, 0xd2, 0xbf, 0x22, 0x4c, 0x43, 0x95, 0xa1, 0x8e, - 0xe2, 0x5c, 0x26, 0xb3, 0x68, 0xae, 0x79, 0xce, 0x3f, 0x81, 0xe6, 0xb2, 0x60, 0x9d, 0xbe, 0x33, - 0x68, 0x87, 0xbd, 0xba, 0x3f, 0x32, 0xed, 0x77, 0xdb, 0x2e, 0x7d, 0x41, 0x1e, 0x9b, 0xc5, 0x6e, - 0x62, 0x5d, 0x8b, 0x3d, 0x14, 0xb0, 0xbc, 0xc1, 0xf4, 0x88, 0x7b, 0xc6, 0x8b, 0x54, 0x9e, 0x31, - 0x62, 0x87, 0x36, 0x19, 0x3d, 0x20, 0xdd, 0x09, 0x62, 0x94, 0x62, 0x21, 0x05, 0xbb, 0x63, 0x7e, - 0x2e, 0xec, 0x4c, 0x10, 0xc7, 0x26, 0xa7, 0x8c, 0xec, 0x62, 0x01, 0x71, 0x8e, 0x29, 0xbb, 0xdb, - 0x77, 0x06, 0x9d, 0xf0, 0x77, 0x4a, 0x9f, 0x93, 0xbd, 0x94, 0x2b, 0x5d, 0xf1, 0x78, 0xae, 0x31, - 0x9a, 0x20, 0x2a, 0x76, 0xcf, 0x4e, 0xdc, 0xdf, 0x96, 0xdf, 0x20, 0xaa, 0xd1, 0xdb, 0x8b, 0x95, - 0xe7, 0x5c, 0xae, 0x3c, 0xe7, 0xe7, 0xca, 0x73, 0x3e, 0xaf, 0xbd, 0xd6, 0xe5, 0xda, 0x6b, 0x7d, - 0x5f, 0x7b, 0xad, 0xf7, 0x41, 0xc6, 0xf5, 0x74, 0x1e, 0xfb, 0x89, 0x14, 0x81, 0x9a, 0xf1, 0xf2, - 0x48, 0xe0, 0xe2, 0xda, 0x09, 0x2f, 0xaf, 0xc5, 0xfa, 0xbc, 0x44, 0x15, 0xbb, 0xf6, 0x04, 0x5f, - 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x71, 0xd9, 0x7a, 0x84, 0xf2, 0x03, 0x00, 0x00, + // 447 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x63, 0x48, 0xd2, 0x64, 0x41, 0x54, 0x2c, 0x50, 0x2d, 0xad, 0xe4, 0x46, 0x70, 0x20, + 0x97, 0xda, 0x0a, 0xbc, 0x41, 0x14, 0xa8, 0x90, 0x7a, 0xa8, 0x2c, 0x71, 0x41, 0x02, 0x6b, 0x6c, + 0x4f, 0x9c, 0x55, 0xbc, 0xbb, 0x96, 0x77, 0x93, 0xa6, 0x3c, 0x05, 0x0f, 0xc3, 0x43, 0xf4, 0x58, + 0x71, 0x42, 0x1c, 0x2a, 0x94, 0xbc, 0x02, 0x0f, 0x80, 0x76, 0x1d, 0x48, 0xe1, 0x68, 0x6e, 0xff, + 0x3f, 0x33, 0xff, 0xb7, 0xa3, 0x95, 0x86, 0x3c, 0x9f, 0x22, 0x0a, 0xa8, 0xe6, 0x68, 0xc2, 0x9d, + 0x5a, 0x8e, 0xc2, 0x12, 0x2a, 0x10, 0x3a, 0x28, 0x2b, 0x65, 0x14, 0x3d, 0xf8, 0xd3, 0x0a, 0x76, + 0x6a, 0x39, 0x3a, 0x7c, 0x9a, 0x2a, 0x2d, 0x94, 0x8e, 0xdd, 0x54, 0x58, 0x9b, 0x3a, 0x72, 0xf8, + 0x38, 0x57, 0xb9, 0xaa, 0xeb, 0x56, 0xd5, 0xd5, 0x67, 0x3f, 0x3b, 0xa4, 0x7b, 0xee, 0xc8, 0xf4, + 0x94, 0x74, 0xa0, 0x28, 0x67, 0xc0, 0xbc, 0x81, 0x37, 0xec, 0x8f, 0x47, 0x57, 0x37, 0xc7, 0xad, + 0xef, 0x37, 0xc7, 0x47, 0x35, 0x45, 0x67, 0xf3, 0x80, 0xab, 0x50, 0x80, 0x99, 0x05, 0x67, 0x98, + 0x43, 0x7a, 0x39, 0xc1, 0xf4, 0xeb, 0x97, 0x13, 0xb2, 0x7d, 0x64, 0x82, 0x69, 0x54, 0xe7, 0xe9, + 0x6b, 0xd2, 0x4e, 0xd0, 0x00, 0xbb, 0xd3, 0x94, 0xe3, 0xe2, 0x76, 0x9f, 0x1c, 0x84, 0x00, 0x76, + 0xb7, 0xf1, 0x3e, 0x2e, 0x6f, 0x41, 0x19, 0x16, 0x06, 0x58, 0xbb, 0x31, 0xc8, 0xe5, 0xe9, 0x47, + 0x42, 0x05, 0x97, 0x71, 0x02, 0x1a, 0xe3, 0x1c, 0xec, 0x2f, 0xf3, 0x14, 0x59, 0xa7, 0x29, 0x75, + 0x5f, 0x70, 0x39, 0x06, 0x8d, 0xa7, 0xa0, 0xcf, 0x2d, 0x89, 0x7e, 0x20, 0x0f, 0x2d, 0xbf, 0x40, + 0xa8, 0x24, 0x97, 0x79, 0x5c, 0x81, 0x41, 0xd6, 0xfd, 0x1f, 0xfc, 0xd9, 0x16, 0x15, 0x81, 0xa9, + 0xf1, 0xb0, 0xfa, 0x07, 0xbf, 0xd7, 0x1c, 0x0f, 0xab, 0xbf, 0xf0, 0x2f, 0xc9, 0x13, 0x8b, 0x4f, + 0x0a, 0x95, 0xce, 0xe3, 0x85, 0xe1, 0x05, 0xff, 0x04, 0x86, 0x2b, 0xc9, 0x7a, 0x03, 0x6f, 0xd8, + 0x8e, 0x1e, 0x09, 0x58, 0x8d, 0x6d, 0xef, 0xdd, 0xae, 0x45, 0x0f, 0x48, 0xf7, 0x82, 0xcb, 0x4c, + 0x5d, 0xb0, 0xbe, 0x1b, 0xda, 0x3a, 0x7a, 0x44, 0xfa, 0x53, 0xc4, 0x38, 0x43, 0xa9, 0x04, 0x23, + 0x76, 0xc5, 0xa8, 0x37, 0x45, 0x9c, 0x58, 0x4f, 0x19, 0xd9, 0x43, 0x09, 0x49, 0x81, 0x19, 0xbb, + 0x37, 0xf0, 0x86, 0xbd, 0xe8, 0xb7, 0xa5, 0x2f, 0xc8, 0x7e, 0xc6, 0xb5, 0xa9, 0x78, 0xb2, 0x30, + 0x18, 0x4f, 0x11, 0x35, 0xbb, 0xef, 0x26, 0x1e, 0xec, 0xca, 0x6f, 0x10, 0xf5, 0xf8, 0xed, 0xd5, + 0xda, 0xf7, 0xae, 0xd7, 0xbe, 0xf7, 0x63, 0xed, 0x7b, 0x9f, 0x37, 0x7e, 0xeb, 0x7a, 0xe3, 0xb7, + 0xbe, 0x6d, 0xfc, 0xd6, 0xfb, 0x30, 0xe7, 0x66, 0xb6, 0x48, 0x82, 0x54, 0x89, 0x50, 0xcf, 0x79, + 0x79, 0x22, 0x70, 0x79, 0xeb, 0x10, 0x57, 0xb7, 0xb4, 0xb9, 0x2c, 0x51, 0x27, 0x5d, 0x77, 0x48, + 0xaf, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x33, 0xa4, 0xbf, 0xc2, 0xb8, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -211,7 +207,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x68 + dAtA[i] = 0x60 } if m.Enabled { i-- @@ -221,28 +217,23 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x60 + dAtA[i] = 0x58 } if len(m.FeeDenom) > 0 { i -= len(m.FeeDenom) copy(dAtA[i:], m.FeeDenom) i = encodeVarintParams(dAtA, i, uint64(len(m.FeeDenom))) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x52 } if m.Window != 0 { i = encodeVarintParams(dAtA, i, uint64(m.Window)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x48 } if m.MaxBlockUtilization != 0 { i = encodeVarintParams(dAtA, i, uint64(m.MaxBlockUtilization)) i-- - dAtA[i] = 0x48 - } - if m.TargetBlockUtilization != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.TargetBlockUtilization)) - i-- dAtA[i] = 0x40 } { @@ -286,9 +277,9 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 { - size := m.Theta.Size() + size := m.Gamma.Size() i -= size - if _, err := m.Theta.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.Gamma.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintParams(dAtA, i, uint64(size)) @@ -339,7 +330,7 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) l = m.Beta.Size() n += 1 + l + sovParams(uint64(l)) - l = m.Theta.Size() + l = m.Gamma.Size() n += 1 + l + sovParams(uint64(l)) l = m.Delta.Size() n += 1 + l + sovParams(uint64(l)) @@ -349,9 +340,6 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) l = m.MaxLearningRate.Size() n += 1 + l + sovParams(uint64(l)) - if m.TargetBlockUtilization != 0 { - n += 1 + sovParams(uint64(m.TargetBlockUtilization)) - } if m.MaxBlockUtilization != 0 { n += 1 + sovParams(uint64(m.MaxBlockUtilization)) } @@ -476,7 +464,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Theta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Gamma", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -504,7 +492,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Theta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Gamma.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -645,25 +633,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetBlockUtilization", wireType) - } - m.TargetBlockUtilization = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetBlockUtilization |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MaxBlockUtilization", wireType) } @@ -682,7 +651,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 10: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Window", wireType) } @@ -701,7 +670,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 11: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FeeDenom", wireType) } @@ -733,7 +702,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.FeeDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 12: + case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) } @@ -753,7 +722,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.Enabled = bool(v != 0) - case 13: + case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DistributeFees", wireType) } diff --git a/x/feemarket/types/params_test.go b/x/feemarket/types/params_test.go index 111a9ab..721bfa8 100644 --- a/x/feemarket/types/params_test.go +++ b/x/feemarket/types/params_test.go @@ -92,7 +92,7 @@ func TestParams(t *testing.T) { Window: 1, Alpha: math.LegacyMustNewDecFromStr("0.1"), Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("-0.1"), + Gamma: math.LegacyMustNewDecFromStr("-0.1"), FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, @@ -103,7 +103,7 @@ func TestParams(t *testing.T) { Window: 1, Alpha: math.LegacyMustNewDecFromStr("0.1"), Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("1.1"), + Gamma: math.LegacyMustNewDecFromStr("1.1"), FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, @@ -114,7 +114,7 @@ func TestParams(t *testing.T) { Window: 1, Alpha: math.LegacyMustNewDecFromStr("0.1"), Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, @@ -125,7 +125,7 @@ func TestParams(t *testing.T) { Window: 1, Alpha: math.LegacyMustNewDecFromStr("0.1"), Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), Delta: math.LegacyMustNewDecFromStr("-0.1"), FeeDenom: types.DefaultFeeDenom, }, @@ -137,7 +137,7 @@ func TestParams(t *testing.T) { Window: 1, Alpha: math.LegacyMustNewDecFromStr("0.1"), Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), Delta: math.LegacyMustNewDecFromStr("0.1"), FeeDenom: types.DefaultFeeDenom, }, @@ -146,167 +146,130 @@ func TestParams(t *testing.T) { { name: "max block size is zero", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 1, - FeeDenom: types.DefaultFeeDenom, - }, - expectedErr: true, - }, - { - name: "target block size is greater than max block size", - p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 1, - FeeDenom: types.DefaultFeeDenom, - }, - expectedErr: true, - }, - { - name: "max to target block size ratio is too large", - p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 200, - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "min base gas price is nil", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "min base has price is negative", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("-1.0"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("-1.0"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "min learning rate is nil", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "min learning rate is negative", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("-0.1"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + MinLearningRate: math.LegacyMustNewDecFromStr("-0.1"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "max learning rate is nil", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "max learning rate is negative", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - MaxLearningRate: math.LegacyMustNewDecFromStr("-0.1"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxLearningRate: math.LegacyMustNewDecFromStr("-0.1"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "min learning rate is greater than max learning rate", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.05"), - FeeDenom: types.DefaultFeeDenom, + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + MinLearningRate: math.LegacyMustNewDecFromStr("0.1"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.05"), + FeeDenom: types.DefaultFeeDenom, }, expectedErr: true, }, { name: "fee denom is empty", p: types.Params{ - Window: 1, - Alpha: math.LegacyMustNewDecFromStr("0.1"), - Beta: math.LegacyMustNewDecFromStr("0.1"), - Theta: math.LegacyMustNewDecFromStr("0.1"), - Delta: math.LegacyMustNewDecFromStr("0.1"), - TargetBlockUtilization: 2, - MaxBlockUtilization: 3, - MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), - MinLearningRate: math.LegacyMustNewDecFromStr("0.01"), - MaxLearningRate: math.LegacyMustNewDecFromStr("0.05"), + Window: 1, + Alpha: math.LegacyMustNewDecFromStr("0.1"), + Beta: math.LegacyMustNewDecFromStr("0.1"), + Gamma: math.LegacyMustNewDecFromStr("0.1"), + Delta: math.LegacyMustNewDecFromStr("0.1"), + MaxBlockUtilization: 3, + MinBaseGasPrice: math.LegacyMustNewDecFromStr("1.0"), + MinLearningRate: math.LegacyMustNewDecFromStr("0.01"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.05"), }, expectedErr: true, }, diff --git a/x/feemarket/types/state.go b/x/feemarket/types/state.go index 99cca18..d76ff20 100644 --- a/x/feemarket/types/state.go +++ b/x/feemarket/types/state.go @@ -57,7 +57,7 @@ func (s *State) UpdateBaseGasPrice(params Params) (gasPrice math.LegacyDec) { // Calculate the new base gasPrice with the learning rate adjustment. currentBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(s.Window[s.Index])) - targetBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(params.TargetBlockUtilization)) + targetBlockSize := math.LegacyNewDecFromInt(math.NewIntFromUint64(params.TargetBlockUtilization())) utilization := (currentBlockSize.Sub(targetBlockSize)).Quo(targetBlockSize) // Truncate the learning rate adjustment to an integer. @@ -108,7 +108,7 @@ func (s *State) UpdateLearningRate(params Params) (lr math.LegacyDec) { // Determine if the average utilization is above or below the target // threshold and adjust the learning rate accordingly. - if avg.LTE(params.Theta) || avg.GTE(math.LegacyOneDec().Sub(params.Theta)) { + if avg.LTE(params.Gamma) || avg.GTE(math.LegacyOneDec().Sub(params.Gamma)) { lr = params.Alpha.Add(s.LearningRate) if lr.GT(params.MaxLearningRate) { lr = params.MaxLearningRate @@ -129,7 +129,7 @@ func (s *State) UpdateLearningRate(params Params) (lr math.LegacyDec) { func (s *State) GetNetUtilization(params Params) math.Int { net := math.NewInt(0) - targetUtilization := math.NewIntFromUint64(params.TargetBlockUtilization) + targetUtilization := math.NewIntFromUint64(params.TargetBlockUtilization()) for _, utilization := range s.Window { diff := math.NewIntFromUint64(utilization).Sub(targetUtilization) net = net.Add(diff) diff --git a/x/feemarket/types/state_fuzz_test.go b/x/feemarket/types/state_fuzz_test.go index c9cb6af..6a32c05 100644 --- a/x/feemarket/types/state_fuzz_test.go +++ b/x/feemarket/types/state_fuzz_test.go @@ -52,7 +52,7 @@ func FuzzDefaultFeeMarket(f *testing.F) { oldFee := state.BaseGasPrice newFee := state.UpdateBaseGasPrice(params) - if blockGasUsed > params.TargetBlockUtilization { + if blockGasUsed > params.TargetBlockUtilization() { require.True(t, newFee.GT(oldFee)) } else { require.True(t, newFee.LT(oldFee)) @@ -95,7 +95,7 @@ func FuzzAIMDFeeMarket(f *testing.F) { oldFee := state.BaseGasPrice newFee := state.UpdateBaseGasPrice(params) - if blockGasUsed > params.TargetBlockUtilization { + if blockGasUsed > params.TargetBlockUtilization() { require.True(t, newFee.GT(oldFee)) } else { require.True(t, newFee.LT(oldFee)) diff --git a/x/feemarket/types/state_test.go b/x/feemarket/types/state_test.go index bbf1d65..0083f36 100644 --- a/x/feemarket/types/state_test.go +++ b/x/feemarket/types/state_test.go @@ -141,7 +141,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { state.BaseGasPrice = math.LegacyMustNewDecFromStr("1000") params.MinBaseGasPrice = math.LegacyMustNewDecFromStr("125") - state.Window[0] = params.TargetBlockUtilization + state.Window[0] = params.TargetBlockUtilization() newBaseGasPrice := state.UpdateBaseGasPrice(params) expectedBaseGasPrice := math.LegacyMustNewDecFromStr("1000") @@ -186,7 +186,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { state.LearningRate = math.LegacyMustNewDecFromStr("0.125") for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } state.UpdateLearningRate(params) @@ -307,7 +307,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { state := types.DefaultAIMDState() state.BaseGasPrice = state.BaseGasPrice.Mul(math.LegacyMustNewDecFromStr("10")) for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } lr := state.UpdateLearningRate(params) @@ -316,7 +316,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { state = types.DefaultAIMDState() state.BaseGasPrice = state.BaseGasPrice.Mul(math.LegacyMustNewDecFromStr("10")) for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } lrWithDelta := state.UpdateLearningRate(paramsWithDelta) @@ -341,7 +341,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { params.Delta = math.LegacyNewDec(10) // 1/4th of the window is full. - state.Window[0] = params.TargetBlockUtilization / 2 + state.Window[0] = params.TargetBlockUtilization() / 2 prevLR := state.LearningRate lr := state.UpdateLearningRate(params) @@ -351,7 +351,7 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { expectedLR := prevLR.Add(params.Alpha) expectedLRAdjustment := (expectedLR.Mul(expectedUtilization)).Add(math.LegacyOneDec()) - expectedNetUtilization := math.LegacyNewDec(-1 * int64(params.TargetBlockUtilization) / 2) + expectedNetUtilization := math.LegacyNewDec(-1 * int64(params.TargetBlockUtilization()) / 2) deltaDiff := expectedNetUtilization.Mul(params.Delta) expectedGasPrice := prevBF.Mul(expectedLRAdjustment).Add(deltaDiff) @@ -387,35 +387,6 @@ func TestState_UpdateBaseGasPrice(t *testing.T) { require.Equal(t, expectedLR, lr) require.Equal(t, expectedGasPrice, bgs) }) - - t.Run("recovers from overflow with large max block utilization ratio", func(t *testing.T) { - state := types.DefaultAIMDState() - state.Window = make([]uint64, 50) - state.BaseGasPrice = state.BaseGasPrice.Mul(math.LegacyMustNewDecFromStr("10")) - - params := types.DefaultAIMDParams() - params.Window = 50 - // This should overflow the base gas price after a few iterations. - params.TargetBlockUtilization = 1 - params.MaxBlockUtilization = 9_999_999_999_999_999_999 - - for { - var baseGasPrice math.LegacyDec - require.NotPanics(t, func() { - state.Update(params.MaxBlockUtilization, params) - state.UpdateLearningRate(params) - baseGasPrice = state.UpdateBaseGasPrice(params) - }) - - // An overflow should have occurred. - if baseGasPrice.Equal(params.MinBaseGasPrice) { - return - } - - // Update the height and try again. - state.IncrementHeight() - } - }) } func TestState_UpdateLearningRate(t *testing.T) { @@ -432,7 +403,7 @@ func TestState_UpdateLearningRate(t *testing.T) { state := types.DefaultState() params := types.DefaultParams() - state.Window[0] = params.TargetBlockUtilization + state.Window[0] = params.TargetBlockUtilization() state.UpdateLearningRate(params) expectedLearningRate := math.LegacyMustNewDecFromStr("0.125") @@ -465,7 +436,7 @@ func TestState_UpdateLearningRate(t *testing.T) { state := types.DefaultState() params := types.DefaultParams() - state.Window[0] = params.TargetBlockUtilization + 50000 + state.Window[0] = params.TargetBlockUtilization() + 50000 state.UpdateLearningRate(params) expectedLearningRate := math.LegacyMustNewDecFromStr("0.125") @@ -501,7 +472,7 @@ func TestState_UpdateLearningRate(t *testing.T) { params := types.DefaultAIMDParams() for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } state.UpdateLearningRate(params) @@ -556,7 +527,7 @@ func TestState_UpdateLearningRate(t *testing.T) { if i%2 == 0 { state.Window[i] = params.MaxBlockUtilization } else { - state.Window[i] = params.TargetBlockUtilization + 1 + state.Window[i] = params.TargetBlockUtilization() + 1 } } @@ -572,7 +543,7 @@ func TestState_GetNetUtilization(t *testing.T) { params := types.DefaultParams() netUtilization := state.GetNetUtilization(params) - expectedUtilization := math.NewInt(0).Sub(math.NewIntFromUint64(params.TargetBlockUtilization)) + expectedUtilization := math.NewInt(0).Sub(math.NewIntFromUint64(params.TargetBlockUtilization())) require.True(t, expectedUtilization.Equal(netUtilization)) }) @@ -580,7 +551,7 @@ func TestState_GetNetUtilization(t *testing.T) { state := types.DefaultState() params := types.DefaultParams() - state.Window[0] = params.TargetBlockUtilization + state.Window[0] = params.TargetBlockUtilization() netUtilization := state.GetNetUtilization(params) expectedUtilization := math.NewInt(0) @@ -594,7 +565,7 @@ func TestState_GetNetUtilization(t *testing.T) { state.Window[0] = params.MaxBlockUtilization netUtilization := state.GetNetUtilization(params) - expectedUtilization := math.NewIntFromUint64(params.MaxBlockUtilization - params.TargetBlockUtilization) + expectedUtilization := math.NewIntFromUint64(params.MaxBlockUtilization - params.TargetBlockUtilization()) require.True(t, expectedUtilization.Equal(netUtilization)) }) @@ -605,7 +576,7 @@ func TestState_GetNetUtilization(t *testing.T) { netUtilization := state.GetNetUtilization(params) multiple := math.NewIntFromUint64(uint64(len(state.Window))) - expectedUtilization := math.NewInt(0).Sub(math.NewIntFromUint64(params.TargetBlockUtilization)).Mul(multiple) + expectedUtilization := math.NewInt(0).Sub(math.NewIntFromUint64(params.TargetBlockUtilization())).Mul(multiple) require.True(t, expectedUtilization.Equal(netUtilization)) }) @@ -620,7 +591,7 @@ func TestState_GetNetUtilization(t *testing.T) { netUtilization := state.GetNetUtilization(params) multiple := math.NewIntFromUint64(uint64(len(state.Window))) - expectedUtilization := math.NewIntFromUint64(params.MaxBlockUtilization).Sub(math.NewIntFromUint64(params.TargetBlockUtilization)).Mul(multiple) + expectedUtilization := math.NewIntFromUint64(params.MaxBlockUtilization).Sub(math.NewIntFromUint64(params.TargetBlockUtilization())).Mul(multiple) require.True(t, expectedUtilization.Equal(netUtilization)) }) @@ -649,14 +620,14 @@ func TestState_GetNetUtilization(t *testing.T) { if i%2 == 0 { state.Window[i] = params.MaxBlockUtilization } else { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } } netUtilization := state.GetNetUtilization(params) first := math.NewIntFromUint64(params.MaxBlockUtilization).Mul(math.NewIntFromUint64(params.Window / 2)) - second := math.NewIntFromUint64(params.TargetBlockUtilization).Mul(math.NewIntFromUint64(params.Window / 2)) - expectedUtilization := first.Add(second).Sub(math.NewIntFromUint64(params.TargetBlockUtilization).Mul(math.NewIntFromUint64(params.Window))) + second := math.NewIntFromUint64(params.TargetBlockUtilization()).Mul(math.NewIntFromUint64(params.Window / 2)) + expectedUtilization := first.Add(second).Sub(math.NewIntFromUint64(params.TargetBlockUtilization()).Mul(math.NewIntFromUint64(params.Window))) require.True(t, expectedUtilization.Equal(netUtilization)) }) @@ -665,7 +636,6 @@ func TestState_GetNetUtilization(t *testing.T) { state.Window = make([]uint64, 4) params := types.DefaultAIMDParams() - params.TargetBlockUtilization = 100 params.MaxBlockUtilization = 200 state.Window[0] = 100 @@ -683,7 +653,6 @@ func TestState_GetNetUtilization(t *testing.T) { state.Window = make([]uint64, 4) params := types.DefaultAIMDParams() - params.TargetBlockUtilization = 100 params.MaxBlockUtilization = 200 state.Window[0] = 0 @@ -711,7 +680,7 @@ func TestState_GetAverageUtilization(t *testing.T) { state := types.DefaultState() params := types.DefaultParams() - state.Window[0] = params.TargetBlockUtilization + state.Window[0] = params.TargetBlockUtilization() avgUtilization := state.GetAverageUtilization(params) expectedUtilization := math.LegacyMustNewDecFromStr("0.5") @@ -743,7 +712,7 @@ func TestState_GetAverageUtilization(t *testing.T) { params := types.DefaultAIMDParams() for i := 0; i < len(state.Window); i++ { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } avgUtilization := state.GetAverageUtilization(params) @@ -789,7 +758,7 @@ func TestState_GetAverageUtilization(t *testing.T) { if i%2 == 0 { state.Window[i] = params.MaxBlockUtilization } else { - state.Window[i] = params.TargetBlockUtilization + state.Window[i] = params.TargetBlockUtilization() } } @@ -803,7 +772,6 @@ func TestState_GetAverageUtilization(t *testing.T) { state.Window = make([]uint64, 4) params := types.DefaultAIMDParams() - params.TargetBlockUtilization = 100 params.MaxBlockUtilization = 200 state.Window[0] = 100 @@ -822,7 +790,6 @@ func TestState_GetAverageUtilization(t *testing.T) { params := types.DefaultAIMDParams() params.Window = 4 - params.TargetBlockUtilization = 100 params.MaxBlockUtilization = 200 state.Window[0] = 0