From f4834defe9d7d20aef8090f1c5ce9bb2b96ea683 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 4 Dec 2024 12:03:17 -0600 Subject: [PATCH 01/27] initial x/benchmark --- .../benchmark/module/v1/module.pulsar.go | 1608 +++++++++++++++++ api/cosmos/benchmark/v1/benchmark.pulsar.go | 928 ++++++++++ api/cosmos/benchmark/v1/tx.pulsar.go | 1256 +++++++++++++ api/cosmos/benchmark/v1/tx_grpc.pb.go | 127 ++ simapp/v2/app_config.go | 19 +- x/benchmark/benchmark.pb.go | 545 ++++++ x/benchmark/client/cli/tx.go | 183 ++ x/benchmark/generator/gen.go | 348 ++++ x/benchmark/generator/gen_test.go | 138 ++ x/benchmark/go.mod | 154 ++ x/benchmark/go.sum | 622 +++++++ x/benchmark/module/depinject.go | 79 + x/benchmark/module/keeper.go | 137 ++ x/benchmark/module/module.go | 113 ++ x/benchmark/proto/buf.gen.gogo.yaml | 8 + x/benchmark/proto/buf.gen.pulsar.yaml | 19 + x/benchmark/proto/buf.lock | 38 + x/benchmark/proto/buf.yaml | 19 + .../cosmos/benchmark/module/v1/module.proto | 32 + .../proto/cosmos/benchmark/v1/benchmark.proto | 17 + .../proto/cosmos/benchmark/v1/tx.proto | 33 + x/benchmark/tx.pb.go | 669 +++++++ 22 files changed, 7091 insertions(+), 1 deletion(-) create mode 100644 api/cosmos/benchmark/module/v1/module.pulsar.go create mode 100644 api/cosmos/benchmark/v1/benchmark.pulsar.go create mode 100644 api/cosmos/benchmark/v1/tx.pulsar.go create mode 100644 api/cosmos/benchmark/v1/tx_grpc.pb.go create mode 100644 x/benchmark/benchmark.pb.go create mode 100644 x/benchmark/client/cli/tx.go create mode 100644 x/benchmark/generator/gen.go create mode 100644 x/benchmark/generator/gen_test.go create mode 100644 x/benchmark/go.mod create mode 100644 x/benchmark/go.sum create mode 100644 x/benchmark/module/depinject.go create mode 100644 x/benchmark/module/keeper.go create mode 100644 x/benchmark/module/module.go create mode 100644 x/benchmark/proto/buf.gen.gogo.yaml create mode 100644 x/benchmark/proto/buf.gen.pulsar.yaml create mode 100644 x/benchmark/proto/buf.lock create mode 100644 x/benchmark/proto/buf.yaml create mode 100644 x/benchmark/proto/cosmos/benchmark/module/v1/module.proto create mode 100644 x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto create mode 100644 x/benchmark/proto/cosmos/benchmark/v1/tx.proto create mode 100644 x/benchmark/tx.pb.go diff --git a/api/cosmos/benchmark/module/v1/module.pulsar.go b/api/cosmos/benchmark/module/v1/module.pulsar.go new file mode 100644 index 000000000000..d081bba66b64 --- /dev/null +++ b/api/cosmos/benchmark/module/v1/module.pulsar.go @@ -0,0 +1,1608 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + binary "encoding/binary" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + math "math" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_genesis_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_benchmark_module_v1_module_proto_init() + md_Module = File_cosmos_benchmark_module_v1_module_proto.Messages().ByName("Module") + fd_Module_genesis_params = md_Module.Fields().ByName("genesis_params") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_benchmark_module_v1_module_proto_msgTypes[0] + 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_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.GenesisParams != nil { + value := protoreflect.ValueOfMessage(x.GenesisParams.ProtoReflect()) + if !f(fd_Module_genesis_params, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + return x.GenesisParams != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + x.GenesisParams = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + value := x.GenesisParams + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + x.GenesisParams = value.Message().Interface().(*GeneratorParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + if x.GenesisParams == nil { + x.GenesisParams = new(GeneratorParams) + } + return protoreflect.ValueOfMessage(x.GenesisParams.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.Module.genesis_params": + m := new(GeneratorParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.benchmark.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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.GenesisParams != nil { + l = options.Size(x.GenesisParams) + 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().(*Module) + 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.GenesisParams != nil { + encoded, err := options.Marshal(x.GenesisParams) + 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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 GenesisParams", 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.GenesisParams == nil { + x.GenesisParams = &GeneratorParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GenesisParams); 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_GeneratorParams protoreflect.MessageDescriptor + fd_GeneratorParams_seed protoreflect.FieldDescriptor + fd_GeneratorParams_bucket_count protoreflect.FieldDescriptor + fd_GeneratorParams_key_mean protoreflect.FieldDescriptor + fd_GeneratorParams_key_std_dev protoreflect.FieldDescriptor + fd_GeneratorParams_value_mean protoreflect.FieldDescriptor + fd_GeneratorParams_value_std_dev protoreflect.FieldDescriptor + fd_GeneratorParams_genesis_count protoreflect.FieldDescriptor + fd_GeneratorParams_insert_weight protoreflect.FieldDescriptor + fd_GeneratorParams_update_weight protoreflect.FieldDescriptor + fd_GeneratorParams_get_weight protoreflect.FieldDescriptor + fd_GeneratorParams_delete_weight protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_benchmark_module_v1_module_proto_init() + md_GeneratorParams = File_cosmos_benchmark_module_v1_module_proto.Messages().ByName("GeneratorParams") + fd_GeneratorParams_seed = md_GeneratorParams.Fields().ByName("seed") + fd_GeneratorParams_bucket_count = md_GeneratorParams.Fields().ByName("bucket_count") + fd_GeneratorParams_key_mean = md_GeneratorParams.Fields().ByName("key_mean") + fd_GeneratorParams_key_std_dev = md_GeneratorParams.Fields().ByName("key_std_dev") + fd_GeneratorParams_value_mean = md_GeneratorParams.Fields().ByName("value_mean") + fd_GeneratorParams_value_std_dev = md_GeneratorParams.Fields().ByName("value_std_dev") + fd_GeneratorParams_genesis_count = md_GeneratorParams.Fields().ByName("genesis_count") + fd_GeneratorParams_insert_weight = md_GeneratorParams.Fields().ByName("insert_weight") + fd_GeneratorParams_update_weight = md_GeneratorParams.Fields().ByName("update_weight") + fd_GeneratorParams_get_weight = md_GeneratorParams.Fields().ByName("get_weight") + fd_GeneratorParams_delete_weight = md_GeneratorParams.Fields().ByName("delete_weight") +} + +var _ protoreflect.Message = (*fastReflection_GeneratorParams)(nil) + +type fastReflection_GeneratorParams GeneratorParams + +func (x *GeneratorParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_GeneratorParams)(x) +} + +func (x *GeneratorParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_benchmark_module_v1_module_proto_msgTypes[1] + 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_GeneratorParams_messageType fastReflection_GeneratorParams_messageType +var _ protoreflect.MessageType = fastReflection_GeneratorParams_messageType{} + +type fastReflection_GeneratorParams_messageType struct{} + +func (x fastReflection_GeneratorParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_GeneratorParams)(nil) +} +func (x fastReflection_GeneratorParams_messageType) New() protoreflect.Message { + return new(fastReflection_GeneratorParams) +} +func (x fastReflection_GeneratorParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GeneratorParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GeneratorParams) Descriptor() protoreflect.MessageDescriptor { + return md_GeneratorParams +} + +// 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_GeneratorParams) Type() protoreflect.MessageType { + return _fastReflection_GeneratorParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GeneratorParams) New() protoreflect.Message { + return new(fastReflection_GeneratorParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GeneratorParams) Interface() protoreflect.ProtoMessage { + return (*GeneratorParams)(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_GeneratorParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Seed != uint64(0) { + value := protoreflect.ValueOfUint64(x.Seed) + if !f(fd_GeneratorParams_seed, value) { + return + } + } + if x.BucketCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.BucketCount) + if !f(fd_GeneratorParams_bucket_count, value) { + return + } + } + if x.KeyMean != uint64(0) { + value := protoreflect.ValueOfUint64(x.KeyMean) + if !f(fd_GeneratorParams_key_mean, value) { + return + } + } + if x.KeyStdDev != uint64(0) { + value := protoreflect.ValueOfUint64(x.KeyStdDev) + if !f(fd_GeneratorParams_key_std_dev, value) { + return + } + } + if x.ValueMean != uint64(0) { + value := protoreflect.ValueOfUint64(x.ValueMean) + if !f(fd_GeneratorParams_value_mean, value) { + return + } + } + if x.ValueStdDev != uint64(0) { + value := protoreflect.ValueOfUint64(x.ValueStdDev) + if !f(fd_GeneratorParams_value_std_dev, value) { + return + } + } + if x.GenesisCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.GenesisCount) + if !f(fd_GeneratorParams_genesis_count, value) { + return + } + } + if x.InsertWeight != float32(0) || math.Signbit(float64(x.InsertWeight)) { + value := protoreflect.ValueOfFloat32(x.InsertWeight) + if !f(fd_GeneratorParams_insert_weight, value) { + return + } + } + if x.UpdateWeight != float32(0) || math.Signbit(float64(x.UpdateWeight)) { + value := protoreflect.ValueOfFloat32(x.UpdateWeight) + if !f(fd_GeneratorParams_update_weight, value) { + return + } + } + if x.GetWeight != float32(0) || math.Signbit(float64(x.GetWeight)) { + value := protoreflect.ValueOfFloat32(x.GetWeight) + if !f(fd_GeneratorParams_get_weight, value) { + return + } + } + if x.DeleteWeight != float32(0) || math.Signbit(float64(x.DeleteWeight)) { + value := protoreflect.ValueOfFloat32(x.DeleteWeight) + if !f(fd_GeneratorParams_delete_weight, 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_GeneratorParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + return x.Seed != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + return x.BucketCount != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + return x.KeyMean != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + return x.KeyStdDev != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + return x.ValueMean != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + return x.ValueStdDev != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + return x.GenesisCount != uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + return x.InsertWeight != float32(0) || math.Signbit(float64(x.InsertWeight)) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + return x.UpdateWeight != float32(0) || math.Signbit(float64(x.UpdateWeight)) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + return x.GetWeight != float32(0) || math.Signbit(float64(x.GetWeight)) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + return x.DeleteWeight != float32(0) || math.Signbit(float64(x.DeleteWeight)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + x.Seed = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + x.BucketCount = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + x.KeyMean = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + x.KeyStdDev = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + x.ValueMean = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + x.ValueStdDev = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + x.GenesisCount = uint64(0) + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + x.InsertWeight = float32(0) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + x.UpdateWeight = float32(0) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + x.GetWeight = float32(0) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + x.DeleteWeight = float32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + value := x.Seed + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + value := x.BucketCount + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + value := x.KeyMean + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + value := x.KeyStdDev + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + value := x.ValueMean + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + value := x.ValueStdDev + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + value := x.GenesisCount + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + value := x.InsertWeight + return protoreflect.ValueOfFloat32(value) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + value := x.UpdateWeight + return protoreflect.ValueOfFloat32(value) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + value := x.GetWeight + return protoreflect.ValueOfFloat32(value) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + value := x.DeleteWeight + return protoreflect.ValueOfFloat32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + x.Seed = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + x.BucketCount = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + x.KeyMean = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + x.KeyStdDev = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + x.ValueMean = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + x.ValueStdDev = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + x.GenesisCount = value.Uint() + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + x.InsertWeight = float32(value.Float()) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + x.UpdateWeight = float32(value.Float()) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + x.GetWeight = float32(value.Float()) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + x.DeleteWeight = float32(value.Float()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + panic(fmt.Errorf("field seed of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + panic(fmt.Errorf("field bucket_count of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + panic(fmt.Errorf("field key_mean of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + panic(fmt.Errorf("field key_std_dev of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + panic(fmt.Errorf("field value_mean of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + panic(fmt.Errorf("field value_std_dev of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + panic(fmt.Errorf("field genesis_count of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + panic(fmt.Errorf("field insert_weight of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + panic(fmt.Errorf("field update_weight of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + panic(fmt.Errorf("field get_weight of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + panic(fmt.Errorf("field delete_weight of message cosmos.benchmark.module.v1.GeneratorParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.module.v1.GeneratorParams.seed": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.bucket_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.key_mean": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.key_std_dev": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.value_mean": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.value_std_dev": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.genesis_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.insert_weight": + return protoreflect.ValueOfFloat32(float32(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.update_weight": + return protoreflect.ValueOfFloat32(float32(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.get_weight": + return protoreflect.ValueOfFloat32(float32(0)) + case "cosmos.benchmark.module.v1.GeneratorParams.delete_weight": + return protoreflect.ValueOfFloat32(float32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.module.v1.GeneratorParams")) + } + panic(fmt.Errorf("message cosmos.benchmark.module.v1.GeneratorParams 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_GeneratorParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.benchmark.module.v1.GeneratorParams", 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_GeneratorParams) 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_GeneratorParams) 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_GeneratorParams) 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_GeneratorParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GeneratorParams) + 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.Seed != 0 { + n += 1 + runtime.Sov(uint64(x.Seed)) + } + if x.BucketCount != 0 { + n += 1 + runtime.Sov(uint64(x.BucketCount)) + } + if x.KeyMean != 0 { + n += 1 + runtime.Sov(uint64(x.KeyMean)) + } + if x.KeyStdDev != 0 { + n += 1 + runtime.Sov(uint64(x.KeyStdDev)) + } + if x.ValueMean != 0 { + n += 1 + runtime.Sov(uint64(x.ValueMean)) + } + if x.ValueStdDev != 0 { + n += 1 + runtime.Sov(uint64(x.ValueStdDev)) + } + if x.GenesisCount != 0 { + n += 1 + runtime.Sov(uint64(x.GenesisCount)) + } + if x.InsertWeight != 0 || math.Signbit(float64(x.InsertWeight)) { + n += 5 + } + if x.UpdateWeight != 0 || math.Signbit(float64(x.UpdateWeight)) { + n += 5 + } + if x.GetWeight != 0 || math.Signbit(float64(x.GetWeight)) { + n += 5 + } + if x.DeleteWeight != 0 || math.Signbit(float64(x.DeleteWeight)) { + n += 5 + } + 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().(*GeneratorParams) + 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.GetWeight != 0 || math.Signbit(float64(x.GetWeight)) { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(x.GetWeight)))) + i-- + dAtA[i] = 0x65 + } + if x.DeleteWeight != 0 || math.Signbit(float64(x.DeleteWeight)) { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(x.DeleteWeight)))) + i-- + dAtA[i] = 0x5d + } + if x.UpdateWeight != 0 || math.Signbit(float64(x.UpdateWeight)) { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(x.UpdateWeight)))) + i-- + dAtA[i] = 0x55 + } + if x.InsertWeight != 0 || math.Signbit(float64(x.InsertWeight)) { + i -= 4 + binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(x.InsertWeight)))) + i-- + dAtA[i] = 0x4d + } + if x.GenesisCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.GenesisCount)) + i-- + dAtA[i] = 0x40 + } + if x.ValueStdDev != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ValueStdDev)) + i-- + dAtA[i] = 0x38 + } + if x.ValueMean != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ValueMean)) + i-- + dAtA[i] = 0x30 + } + if x.KeyStdDev != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.KeyStdDev)) + i-- + dAtA[i] = 0x20 + } + if x.KeyMean != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.KeyMean)) + i-- + dAtA[i] = 0x18 + } + if x.BucketCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BucketCount)) + i-- + dAtA[i] = 0x10 + } + if x.Seed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Seed)) + i-- + dAtA[i] = 0x8 + } + 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().(*GeneratorParams) + 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: GeneratorParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GeneratorParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + x.Seed = 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.Seed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BucketCount", wireType) + } + x.BucketCount = 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.BucketCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyMean", wireType) + } + x.KeyMean = 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.KeyMean |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyStdDev", wireType) + } + x.KeyStdDev = 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.KeyStdDev |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValueMean", wireType) + } + x.ValueMean = 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.ValueMean |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValueStdDev", wireType) + } + x.ValueStdDev = 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.ValueStdDev |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GenesisCount", wireType) + } + x.GenesisCount = 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.GenesisCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InsertWeight", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + x.InsertWeight = float32(math.Float32frombits(v)) + case 10: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateWeight", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + x.UpdateWeight = float32(math.Float32frombits(v)) + case 12: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GetWeight", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + x.GetWeight = float32(math.Float32frombits(v)) + case 11: + if wireType != 5 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DeleteWeight", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint32(binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + x.DeleteWeight = float32(math.Float32frombits(v)) + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/benchmark/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object of the benchmark module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GenesisParams *GeneratorParams `protobuf:"bytes,1,opt,name=genesis_params,json=genesisParams,proto3" json:"genesis_params,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_benchmark_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_benchmark_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetGenesisParams() *GeneratorParams { + if x != nil { + return x.GenesisParams + } + return nil +} + +// GenesisParams defines the genesis parameters for the benchmark module. +type GeneratorParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seed uint64 `protobuf:"varint,1,opt,name=seed,proto3" json:"seed,omitempty"` + BucketCount uint64 `protobuf:"varint,2,opt,name=bucket_count,json=bucketCount,proto3" json:"bucket_count,omitempty"` + KeyMean uint64 `protobuf:"varint,3,opt,name=key_mean,json=keyMean,proto3" json:"key_mean,omitempty"` + KeyStdDev uint64 `protobuf:"varint,4,opt,name=key_std_dev,json=keyStdDev,proto3" json:"key_std_dev,omitempty"` + ValueMean uint64 `protobuf:"varint,6,opt,name=value_mean,json=valueMean,proto3" json:"value_mean,omitempty"` + ValueStdDev uint64 `protobuf:"varint,7,opt,name=value_std_dev,json=valueStdDev,proto3" json:"value_std_dev,omitempty"` + GenesisCount uint64 `protobuf:"varint,8,opt,name=genesis_count,json=genesisCount,proto3" json:"genesis_count,omitempty"` + InsertWeight float32 `protobuf:"fixed32,9,opt,name=insert_weight,json=insertWeight,proto3" json:"insert_weight,omitempty"` + UpdateWeight float32 `protobuf:"fixed32,10,opt,name=update_weight,json=updateWeight,proto3" json:"update_weight,omitempty"` + GetWeight float32 `protobuf:"fixed32,12,opt,name=get_weight,json=getWeight,proto3" json:"get_weight,omitempty"` + DeleteWeight float32 `protobuf:"fixed32,11,opt,name=delete_weight,json=deleteWeight,proto3" json:"delete_weight,omitempty"` +} + +func (x *GeneratorParams) Reset() { + *x = GeneratorParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_benchmark_module_v1_module_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GeneratorParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GeneratorParams) ProtoMessage() {} + +// Deprecated: Use GeneratorParams.ProtoReflect.Descriptor instead. +func (*GeneratorParams) Descriptor() ([]byte, []int) { + return file_cosmos_benchmark_module_v1_module_proto_rawDescGZIP(), []int{1} +} + +func (x *GeneratorParams) GetSeed() uint64 { + if x != nil { + return x.Seed + } + return 0 +} + +func (x *GeneratorParams) GetBucketCount() uint64 { + if x != nil { + return x.BucketCount + } + return 0 +} + +func (x *GeneratorParams) GetKeyMean() uint64 { + if x != nil { + return x.KeyMean + } + return 0 +} + +func (x *GeneratorParams) GetKeyStdDev() uint64 { + if x != nil { + return x.KeyStdDev + } + return 0 +} + +func (x *GeneratorParams) GetValueMean() uint64 { + if x != nil { + return x.ValueMean + } + return 0 +} + +func (x *GeneratorParams) GetValueStdDev() uint64 { + if x != nil { + return x.ValueStdDev + } + return 0 +} + +func (x *GeneratorParams) GetGenesisCount() uint64 { + if x != nil { + return x.GenesisCount + } + return 0 +} + +func (x *GeneratorParams) GetInsertWeight() float32 { + if x != nil { + return x.InsertWeight + } + return 0 +} + +func (x *GeneratorParams) GetUpdateWeight() float32 { + if x != nil { + return x.UpdateWeight + } + return 0 +} + +func (x *GeneratorParams) GetGetWeight() float32 { + if x != nil { + return x.GetWeight + } + return 0 +} + +func (x *GeneratorParams) GetDeleteWeight() float32 { + if x != nil { + return x.DeleteWeight + } + return 0 +} + +var File_cosmos_benchmark_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_benchmark_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x20, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x1a, 0x0a, 0x18, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x62, 0x65, + 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xf9, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x65, 0x61, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4d, 0x65, 0x61, 0x6e, 0x12, 0x1e, 0x0a, + 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, 0x12, 0x1d, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x65, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x65, 0x61, 0x6e, 0x12, 0x22, 0x0a, 0x0d, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, + 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x69, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x67, 0x65, 0x74, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x09, 0x67, 0x65, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x42, 0xee, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, + 0x4d, 0xaa, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, + 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, + 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, + 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_benchmark_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_benchmark_module_v1_module_proto_rawDescData = file_cosmos_benchmark_module_v1_module_proto_rawDesc +) + +func file_cosmos_benchmark_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_benchmark_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_benchmark_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_benchmark_module_v1_module_proto_rawDescData) + }) + return file_cosmos_benchmark_module_v1_module_proto_rawDescData +} + +var file_cosmos_benchmark_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_benchmark_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.benchmark.module.v1.Module + (*GeneratorParams)(nil), // 1: cosmos.benchmark.module.v1.GeneratorParams +} +var file_cosmos_benchmark_module_v1_module_proto_depIdxs = []int32{ + 1, // 0: cosmos.benchmark.module.v1.Module.genesis_params:type_name -> cosmos.benchmark.module.v1.GeneratorParams + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_benchmark_module_v1_module_proto_init() } +func file_cosmos_benchmark_module_v1_module_proto_init() { + if File_cosmos_benchmark_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_benchmark_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_benchmark_module_v1_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GeneratorParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_benchmark_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_benchmark_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_benchmark_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_benchmark_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_benchmark_module_v1_module_proto = out.File + file_cosmos_benchmark_module_v1_module_proto_rawDesc = nil + file_cosmos_benchmark_module_v1_module_proto_goTypes = nil + file_cosmos_benchmark_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/benchmark/v1/benchmark.pulsar.go b/api/cosmos/benchmark/v1/benchmark.pulsar.go new file mode 100644 index 000000000000..f834bf313216 --- /dev/null +++ b/api/cosmos/benchmark/v1/benchmark.pulsar.go @@ -0,0 +1,928 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package benchmarkv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Op protoreflect.MessageDescriptor + fd_Op_seed protoreflect.FieldDescriptor + fd_Op_actor protoreflect.FieldDescriptor + fd_Op_key_length protoreflect.FieldDescriptor + fd_Op_value_length protoreflect.FieldDescriptor + fd_Op_iterations protoreflect.FieldDescriptor + fd_Op_delete protoreflect.FieldDescriptor + fd_Op_exists protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_benchmark_v1_benchmark_proto_init() + md_Op = File_cosmos_benchmark_v1_benchmark_proto.Messages().ByName("Op") + fd_Op_seed = md_Op.Fields().ByName("seed") + fd_Op_actor = md_Op.Fields().ByName("actor") + fd_Op_key_length = md_Op.Fields().ByName("key_length") + fd_Op_value_length = md_Op.Fields().ByName("value_length") + fd_Op_iterations = md_Op.Fields().ByName("iterations") + fd_Op_delete = md_Op.Fields().ByName("delete") + fd_Op_exists = md_Op.Fields().ByName("exists") +} + +var _ protoreflect.Message = (*fastReflection_Op)(nil) + +type fastReflection_Op Op + +func (x *Op) ProtoReflect() protoreflect.Message { + return (*fastReflection_Op)(x) +} + +func (x *Op) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_benchmark_v1_benchmark_proto_msgTypes[0] + 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_Op_messageType fastReflection_Op_messageType +var _ protoreflect.MessageType = fastReflection_Op_messageType{} + +type fastReflection_Op_messageType struct{} + +func (x fastReflection_Op_messageType) Zero() protoreflect.Message { + return (*fastReflection_Op)(nil) +} +func (x fastReflection_Op_messageType) New() protoreflect.Message { + return new(fastReflection_Op) +} +func (x fastReflection_Op_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Op +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Op) Descriptor() protoreflect.MessageDescriptor { + return md_Op +} + +// 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_Op) Type() protoreflect.MessageType { + return _fastReflection_Op_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Op) New() protoreflect.Message { + return new(fastReflection_Op) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Op) Interface() protoreflect.ProtoMessage { + return (*Op)(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_Op) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Seed != uint64(0) { + value := protoreflect.ValueOfUint64(x.Seed) + if !f(fd_Op_seed, value) { + return + } + } + if x.Actor != "" { + value := protoreflect.ValueOfString(x.Actor) + if !f(fd_Op_actor, value) { + return + } + } + if x.KeyLength != uint64(0) { + value := protoreflect.ValueOfUint64(x.KeyLength) + if !f(fd_Op_key_length, value) { + return + } + } + if x.ValueLength != uint64(0) { + value := protoreflect.ValueOfUint64(x.ValueLength) + if !f(fd_Op_value_length, value) { + return + } + } + if x.Iterations != uint32(0) { + value := protoreflect.ValueOfUint32(x.Iterations) + if !f(fd_Op_iterations, value) { + return + } + } + if x.Delete != false { + value := protoreflect.ValueOfBool(x.Delete) + if !f(fd_Op_delete, value) { + return + } + } + if x.Exists != false { + value := protoreflect.ValueOfBool(x.Exists) + if !f(fd_Op_exists, 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_Op) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.benchmark.v1.Op.seed": + return x.Seed != uint64(0) + case "cosmos.benchmark.v1.Op.actor": + return x.Actor != "" + case "cosmos.benchmark.v1.Op.key_length": + return x.KeyLength != uint64(0) + case "cosmos.benchmark.v1.Op.value_length": + return x.ValueLength != uint64(0) + case "cosmos.benchmark.v1.Op.iterations": + return x.Iterations != uint32(0) + case "cosmos.benchmark.v1.Op.delete": + return x.Delete != false + case "cosmos.benchmark.v1.Op.exists": + return x.Exists != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.benchmark.v1.Op.seed": + x.Seed = uint64(0) + case "cosmos.benchmark.v1.Op.actor": + x.Actor = "" + case "cosmos.benchmark.v1.Op.key_length": + x.KeyLength = uint64(0) + case "cosmos.benchmark.v1.Op.value_length": + x.ValueLength = uint64(0) + case "cosmos.benchmark.v1.Op.iterations": + x.Iterations = uint32(0) + case "cosmos.benchmark.v1.Op.delete": + x.Delete = false + case "cosmos.benchmark.v1.Op.exists": + x.Exists = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.benchmark.v1.Op.seed": + value := x.Seed + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.v1.Op.actor": + value := x.Actor + return protoreflect.ValueOfString(value) + case "cosmos.benchmark.v1.Op.key_length": + value := x.KeyLength + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.v1.Op.value_length": + value := x.ValueLength + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.v1.Op.iterations": + value := x.Iterations + return protoreflect.ValueOfUint32(value) + case "cosmos.benchmark.v1.Op.delete": + value := x.Delete + return protoreflect.ValueOfBool(value) + case "cosmos.benchmark.v1.Op.exists": + value := x.Exists + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.benchmark.v1.Op.seed": + x.Seed = value.Uint() + case "cosmos.benchmark.v1.Op.actor": + x.Actor = value.Interface().(string) + case "cosmos.benchmark.v1.Op.key_length": + x.KeyLength = value.Uint() + case "cosmos.benchmark.v1.Op.value_length": + x.ValueLength = value.Uint() + case "cosmos.benchmark.v1.Op.iterations": + x.Iterations = uint32(value.Uint()) + case "cosmos.benchmark.v1.Op.delete": + x.Delete = value.Bool() + case "cosmos.benchmark.v1.Op.exists": + x.Exists = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.Op.seed": + panic(fmt.Errorf("field seed of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.actor": + panic(fmt.Errorf("field actor of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.key_length": + panic(fmt.Errorf("field key_length of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.value_length": + panic(fmt.Errorf("field value_length of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.iterations": + panic(fmt.Errorf("field iterations of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.delete": + panic(fmt.Errorf("field delete of message cosmos.benchmark.v1.Op is not mutable")) + case "cosmos.benchmark.v1.Op.exists": + panic(fmt.Errorf("field exists of message cosmos.benchmark.v1.Op is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.Op.seed": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.v1.Op.actor": + return protoreflect.ValueOfString("") + case "cosmos.benchmark.v1.Op.key_length": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.v1.Op.value_length": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.v1.Op.iterations": + return protoreflect.ValueOfUint32(uint32(0)) + case "cosmos.benchmark.v1.Op.delete": + return protoreflect.ValueOfBool(false) + case "cosmos.benchmark.v1.Op.exists": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.Op")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.Op 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_Op) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.benchmark.v1.Op", 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_Op) 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_Op) 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_Op) 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_Op) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Op) + 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.Seed != 0 { + n += 1 + runtime.Sov(uint64(x.Seed)) + } + l = len(x.Actor) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.KeyLength != 0 { + n += 1 + runtime.Sov(uint64(x.KeyLength)) + } + if x.ValueLength != 0 { + n += 1 + runtime.Sov(uint64(x.ValueLength)) + } + if x.Iterations != 0 { + n += 1 + runtime.Sov(uint64(x.Iterations)) + } + if x.Delete { + n += 2 + } + if x.Exists { + n += 2 + } + 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().(*Op) + 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.Exists { + i-- + if x.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if x.Delete { + i-- + if x.Delete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.Iterations != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Iterations)) + i-- + dAtA[i] = 0x28 + } + if x.ValueLength != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ValueLength)) + i-- + dAtA[i] = 0x20 + } + if x.KeyLength != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.KeyLength)) + i-- + dAtA[i] = 0x18 + } + if len(x.Actor) > 0 { + i -= len(x.Actor) + copy(dAtA[i:], x.Actor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Actor))) + i-- + dAtA[i] = 0x12 + } + if x.Seed != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Seed)) + i-- + dAtA[i] = 0x8 + } + 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().(*Op) + 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: Op: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Op: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + x.Seed = 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.Seed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Actor", 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.Actor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyLength", wireType) + } + x.KeyLength = 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.KeyLength |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValueLength", wireType) + } + x.ValueLength = 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.ValueLength |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Iterations", wireType) + } + x.Iterations = 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.Iterations |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Delete", 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.Delete = bool(v != 0) + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exists", 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.Exists = bool(v != 0) + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/benchmark/v1/benchmark.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Op is a message describing a benchmark operation. +type Op struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Seed uint64 `protobuf:"varint,1,opt,name=seed,proto3" json:"seed,omitempty"` + Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"` + KeyLength uint64 `protobuf:"varint,3,opt,name=key_length,json=keyLength,proto3" json:"key_length,omitempty"` + ValueLength uint64 `protobuf:"varint,4,opt,name=value_length,json=valueLength,proto3" json:"value_length,omitempty"` + Iterations uint32 `protobuf:"varint,5,opt,name=iterations,proto3" json:"iterations,omitempty"` + Delete bool `protobuf:"varint,6,opt,name=delete,proto3" json:"delete,omitempty"` + Exists bool `protobuf:"varint,7,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (x *Op) Reset() { + *x = Op{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_benchmark_v1_benchmark_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Op) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Op) ProtoMessage() {} + +// Deprecated: Use Op.ProtoReflect.Descriptor instead. +func (*Op) Descriptor() ([]byte, []int) { + return file_cosmos_benchmark_v1_benchmark_proto_rawDescGZIP(), []int{0} +} + +func (x *Op) GetSeed() uint64 { + if x != nil { + return x.Seed + } + return 0 +} + +func (x *Op) GetActor() string { + if x != nil { + return x.Actor + } + return "" +} + +func (x *Op) GetKeyLength() uint64 { + if x != nil { + return x.KeyLength + } + return 0 +} + +func (x *Op) GetValueLength() uint64 { + if x != nil { + return x.ValueLength + } + return 0 +} + +func (x *Op) GetIterations() uint32 { + if x != nil { + return x.Iterations + } + return 0 +} + +func (x *Op) GetDelete() bool { + if x != nil { + return x.Delete + } + return false +} + +func (x *Op) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +var File_cosmos_benchmark_v1_benchmark_proto protoreflect.FileDescriptor + +var file_cosmos_benchmark_v1_benchmark_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, + 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x22, 0xc0, 0x01, 0x0a, 0x02, 0x4f, + 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, + 0x65, 0x79, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x6b, 0x65, 0x79, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0a, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x42, 0xc9, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, + 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x42, 0x65, 0x6e, 0x63, 0x68, + 0x6d, 0x61, 0x72, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x76, + 0x31, 0x3b, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, + 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x65, 0x6e, 0x63, + 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_benchmark_v1_benchmark_proto_rawDescOnce sync.Once + file_cosmos_benchmark_v1_benchmark_proto_rawDescData = file_cosmos_benchmark_v1_benchmark_proto_rawDesc +) + +func file_cosmos_benchmark_v1_benchmark_proto_rawDescGZIP() []byte { + file_cosmos_benchmark_v1_benchmark_proto_rawDescOnce.Do(func() { + file_cosmos_benchmark_v1_benchmark_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_benchmark_v1_benchmark_proto_rawDescData) + }) + return file_cosmos_benchmark_v1_benchmark_proto_rawDescData +} + +var file_cosmos_benchmark_v1_benchmark_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_benchmark_v1_benchmark_proto_goTypes = []interface{}{ + (*Op)(nil), // 0: cosmos.benchmark.v1.Op +} +var file_cosmos_benchmark_v1_benchmark_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_benchmark_v1_benchmark_proto_init() } +func file_cosmos_benchmark_v1_benchmark_proto_init() { + if File_cosmos_benchmark_v1_benchmark_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_benchmark_v1_benchmark_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Op); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_benchmark_v1_benchmark_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_benchmark_v1_benchmark_proto_goTypes, + DependencyIndexes: file_cosmos_benchmark_v1_benchmark_proto_depIdxs, + MessageInfos: file_cosmos_benchmark_v1_benchmark_proto_msgTypes, + }.Build() + File_cosmos_benchmark_v1_benchmark_proto = out.File + file_cosmos_benchmark_v1_benchmark_proto_rawDesc = nil + file_cosmos_benchmark_v1_benchmark_proto_goTypes = nil + file_cosmos_benchmark_v1_benchmark_proto_depIdxs = nil +} diff --git a/api/cosmos/benchmark/v1/tx.pulsar.go b/api/cosmos/benchmark/v1/tx.pulsar.go new file mode 100644 index 000000000000..290c280def98 --- /dev/null +++ b/api/cosmos/benchmark/v1/tx.pulsar.go @@ -0,0 +1,1256 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package benchmarkv1 + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_MsgLoadTest_2_list)(nil) + +type _MsgLoadTest_2_list struct { + list *[]*Op +} + +func (x *_MsgLoadTest_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgLoadTest_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgLoadTest_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Op) + (*x.list)[i] = concreteValue +} + +func (x *_MsgLoadTest_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Op) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgLoadTest_2_list) AppendMutable() protoreflect.Value { + v := new(Op) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgLoadTest_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgLoadTest_2_list) NewElement() protoreflect.Value { + v := new(Op) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgLoadTest_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgLoadTest protoreflect.MessageDescriptor + fd_MsgLoadTest_caller protoreflect.FieldDescriptor + fd_MsgLoadTest_ops protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_benchmark_v1_tx_proto_init() + md_MsgLoadTest = File_cosmos_benchmark_v1_tx_proto.Messages().ByName("MsgLoadTest") + fd_MsgLoadTest_caller = md_MsgLoadTest.Fields().ByName("caller") + fd_MsgLoadTest_ops = md_MsgLoadTest.Fields().ByName("ops") +} + +var _ protoreflect.Message = (*fastReflection_MsgLoadTest)(nil) + +type fastReflection_MsgLoadTest MsgLoadTest + +func (x *MsgLoadTest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgLoadTest)(x) +} + +func (x *MsgLoadTest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_benchmark_v1_tx_proto_msgTypes[0] + 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_MsgLoadTest_messageType fastReflection_MsgLoadTest_messageType +var _ protoreflect.MessageType = fastReflection_MsgLoadTest_messageType{} + +type fastReflection_MsgLoadTest_messageType struct{} + +func (x fastReflection_MsgLoadTest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgLoadTest)(nil) +} +func (x fastReflection_MsgLoadTest_messageType) New() protoreflect.Message { + return new(fastReflection_MsgLoadTest) +} +func (x fastReflection_MsgLoadTest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgLoadTest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgLoadTest) Descriptor() protoreflect.MessageDescriptor { + return md_MsgLoadTest +} + +// 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_MsgLoadTest) Type() protoreflect.MessageType { + return _fastReflection_MsgLoadTest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgLoadTest) New() protoreflect.Message { + return new(fastReflection_MsgLoadTest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgLoadTest) Interface() protoreflect.ProtoMessage { + return (*MsgLoadTest)(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_MsgLoadTest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Caller) != 0 { + value := protoreflect.ValueOfBytes(x.Caller) + if !f(fd_MsgLoadTest_caller, value) { + return + } + } + if len(x.Ops) != 0 { + value := protoreflect.ValueOfList(&_MsgLoadTest_2_list{list: &x.Ops}) + if !f(fd_MsgLoadTest_ops, 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_MsgLoadTest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.caller": + return len(x.Caller) != 0 + case "cosmos.benchmark.v1.MsgLoadTest.ops": + return len(x.Ops) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.caller": + x.Caller = nil + case "cosmos.benchmark.v1.MsgLoadTest.ops": + x.Ops = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.caller": + value := x.Caller + return protoreflect.ValueOfBytes(value) + case "cosmos.benchmark.v1.MsgLoadTest.ops": + if len(x.Ops) == 0 { + return protoreflect.ValueOfList(&_MsgLoadTest_2_list{}) + } + listValue := &_MsgLoadTest_2_list{list: &x.Ops} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.caller": + x.Caller = value.Bytes() + case "cosmos.benchmark.v1.MsgLoadTest.ops": + lv := value.List() + clv := lv.(*_MsgLoadTest_2_list) + x.Ops = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.ops": + if x.Ops == nil { + x.Ops = []*Op{} + } + value := &_MsgLoadTest_2_list{list: &x.Ops} + return protoreflect.ValueOfList(value) + case "cosmos.benchmark.v1.MsgLoadTest.caller": + panic(fmt.Errorf("field caller of message cosmos.benchmark.v1.MsgLoadTest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTest.caller": + return protoreflect.ValueOfBytes(nil) + case "cosmos.benchmark.v1.MsgLoadTest.ops": + list := []*Op{} + return protoreflect.ValueOfList(&_MsgLoadTest_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTest")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTest 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_MsgLoadTest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.benchmark.v1.MsgLoadTest", 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_MsgLoadTest) 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_MsgLoadTest) 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_MsgLoadTest) 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_MsgLoadTest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgLoadTest) + 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.Caller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Ops) > 0 { + for _, e := range x.Ops { + l = options.Size(e) + 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().(*MsgLoadTest) + 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.Ops) > 0 { + for iNdEx := len(x.Ops) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Ops[iNdEx]) + 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] = 0x12 + } + } + if len(x.Caller) > 0 { + i -= len(x.Caller) + copy(dAtA[i:], x.Caller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Caller))) + 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().(*MsgLoadTest) + 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: MsgLoadTest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgLoadTest: 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 Caller", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.Caller = append(x.Caller[:0], dAtA[iNdEx:postIndex]...) + if x.Caller == nil { + x.Caller = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ops", 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 + } + x.Ops = append(x.Ops, &Op{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Ops[len(x.Ops)-1]); 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_MsgLoadTestResponse protoreflect.MessageDescriptor + fd_MsgLoadTestResponse_total_time protoreflect.FieldDescriptor + fd_MsgLoadTestResponse_total_errors protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_benchmark_v1_tx_proto_init() + md_MsgLoadTestResponse = File_cosmos_benchmark_v1_tx_proto.Messages().ByName("MsgLoadTestResponse") + fd_MsgLoadTestResponse_total_time = md_MsgLoadTestResponse.Fields().ByName("total_time") + fd_MsgLoadTestResponse_total_errors = md_MsgLoadTestResponse.Fields().ByName("total_errors") +} + +var _ protoreflect.Message = (*fastReflection_MsgLoadTestResponse)(nil) + +type fastReflection_MsgLoadTestResponse MsgLoadTestResponse + +func (x *MsgLoadTestResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgLoadTestResponse)(x) +} + +func (x *MsgLoadTestResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_benchmark_v1_tx_proto_msgTypes[1] + 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_MsgLoadTestResponse_messageType fastReflection_MsgLoadTestResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgLoadTestResponse_messageType{} + +type fastReflection_MsgLoadTestResponse_messageType struct{} + +func (x fastReflection_MsgLoadTestResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgLoadTestResponse)(nil) +} +func (x fastReflection_MsgLoadTestResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgLoadTestResponse) +} +func (x fastReflection_MsgLoadTestResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgLoadTestResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgLoadTestResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgLoadTestResponse +} + +// 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_MsgLoadTestResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgLoadTestResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgLoadTestResponse) New() protoreflect.Message { + return new(fastReflection_MsgLoadTestResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgLoadTestResponse) Interface() protoreflect.ProtoMessage { + return (*MsgLoadTestResponse)(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_MsgLoadTestResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TotalTime != uint64(0) { + value := protoreflect.ValueOfUint64(x.TotalTime) + if !f(fd_MsgLoadTestResponse_total_time, value) { + return + } + } + if x.TotalErrors != uint64(0) { + value := protoreflect.ValueOfUint64(x.TotalErrors) + if !f(fd_MsgLoadTestResponse_total_errors, 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_MsgLoadTestResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + return x.TotalTime != uint64(0) + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + return x.TotalErrors != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + x.TotalTime = uint64(0) + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + x.TotalErrors = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + value := x.TotalTime + return protoreflect.ValueOfUint64(value) + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + value := x.TotalErrors + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + x.TotalTime = value.Uint() + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + x.TotalErrors = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + panic(fmt.Errorf("field total_time of message cosmos.benchmark.v1.MsgLoadTestResponse is not mutable")) + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + panic(fmt.Errorf("field total_errors of message cosmos.benchmark.v1.MsgLoadTestResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_time": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.benchmark.v1.MsgLoadTestResponse.total_errors": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.benchmark.v1.MsgLoadTestResponse")) + } + panic(fmt.Errorf("message cosmos.benchmark.v1.MsgLoadTestResponse 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_MsgLoadTestResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.benchmark.v1.MsgLoadTestResponse", 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_MsgLoadTestResponse) 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_MsgLoadTestResponse) 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_MsgLoadTestResponse) 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_MsgLoadTestResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgLoadTestResponse) + 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.TotalTime != 0 { + n += 1 + runtime.Sov(uint64(x.TotalTime)) + } + if x.TotalErrors != 0 { + n += 1 + runtime.Sov(uint64(x.TotalErrors)) + } + 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().(*MsgLoadTestResponse) + 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.TotalErrors != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalErrors)) + i-- + dAtA[i] = 0x10 + } + if x.TotalTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalTime)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgLoadTestResponse) + 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: MsgLoadTestResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgLoadTestResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalTime", wireType) + } + x.TotalTime = 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.TotalTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalErrors", wireType) + } + x.TotalErrors = 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.TotalErrors |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/benchmark/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgLoadTestOps defines a message containing a sequence of load test operations. +type MsgLoadTest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Caller []byte `protobuf:"bytes,1,opt,name=caller,proto3" json:"caller,omitempty"` + Ops []*Op `protobuf:"bytes,2,rep,name=ops,proto3" json:"ops,omitempty"` +} + +func (x *MsgLoadTest) Reset() { + *x = MsgLoadTest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_benchmark_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgLoadTest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgLoadTest) ProtoMessage() {} + +// Deprecated: Use MsgLoadTest.ProtoReflect.Descriptor instead. +func (*MsgLoadTest) Descriptor() ([]byte, []int) { + return file_cosmos_benchmark_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgLoadTest) GetCaller() []byte { + if x != nil { + return x.Caller + } + return nil +} + +func (x *MsgLoadTest) GetOps() []*Op { + if x != nil { + return x.Ops + } + return nil +} + +// MsgLoadTestResponse defines a message containing the results of a load test operation. +type MsgLoadTestResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalTime uint64 `protobuf:"varint,1,opt,name=total_time,json=totalTime,proto3" json:"total_time,omitempty"` + TotalErrors uint64 `protobuf:"varint,2,opt,name=total_errors,json=totalErrors,proto3" json:"total_errors,omitempty"` +} + +func (x *MsgLoadTestResponse) Reset() { + *x = MsgLoadTestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_benchmark_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgLoadTestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgLoadTestResponse) ProtoMessage() {} + +// Deprecated: Use MsgLoadTestResponse.ProtoReflect.Descriptor instead. +func (*MsgLoadTestResponse) Descriptor() ([]byte, []int) { + return file_cosmos_benchmark_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgLoadTestResponse) GetTotalTime() uint64 { + if x != nil { + return x.TotalTime + } + return 0 +} + +func (x *MsgLoadTestResponse) GetTotalErrors() uint64 { + if x != nil { + return x.TotalErrors + } + return 0 +} + +var File_cosmos_benchmark_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_benchmark_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, + 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, + 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, + 0x54, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x03, + 0x6f, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x70, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x63, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, + 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x22, 0x57, + 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x32, 0x64, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x56, + 0x0a, 0x08, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, + 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, + 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x65, 0x6e, 0x63, 0x68, + 0x6d, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, + 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_benchmark_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_benchmark_v1_tx_proto_rawDescData = file_cosmos_benchmark_v1_tx_proto_rawDesc +) + +func file_cosmos_benchmark_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_benchmark_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_benchmark_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_benchmark_v1_tx_proto_rawDescData) + }) + return file_cosmos_benchmark_v1_tx_proto_rawDescData +} + +var file_cosmos_benchmark_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_benchmark_v1_tx_proto_goTypes = []interface{}{ + (*MsgLoadTest)(nil), // 0: cosmos.benchmark.v1.MsgLoadTest + (*MsgLoadTestResponse)(nil), // 1: cosmos.benchmark.v1.MsgLoadTestResponse + (*Op)(nil), // 2: cosmos.benchmark.v1.Op +} +var file_cosmos_benchmark_v1_tx_proto_depIdxs = []int32{ + 2, // 0: cosmos.benchmark.v1.MsgLoadTest.ops:type_name -> cosmos.benchmark.v1.Op + 0, // 1: cosmos.benchmark.v1.Msg.LoadTest:input_type -> cosmos.benchmark.v1.MsgLoadTest + 1, // 2: cosmos.benchmark.v1.Msg.LoadTest:output_type -> cosmos.benchmark.v1.MsgLoadTestResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_benchmark_v1_tx_proto_init() } +func file_cosmos_benchmark_v1_tx_proto_init() { + if File_cosmos_benchmark_v1_tx_proto != nil { + return + } + file_cosmos_benchmark_v1_benchmark_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_benchmark_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgLoadTest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_benchmark_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgLoadTestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_benchmark_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_benchmark_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_benchmark_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_benchmark_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_benchmark_v1_tx_proto = out.File + file_cosmos_benchmark_v1_tx_proto_rawDesc = nil + file_cosmos_benchmark_v1_tx_proto_goTypes = nil + file_cosmos_benchmark_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/benchmark/v1/tx_grpc.pb.go b/api/cosmos/benchmark/v1/tx_grpc.pb.go new file mode 100644 index 000000000000..6cc598845456 --- /dev/null +++ b/api/cosmos/benchmark/v1/tx_grpc.pb.go @@ -0,0 +1,127 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/benchmark/v1/tx.proto + +package benchmarkv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_LoadTest_FullMethodName = "/cosmos.benchmark.v1.Msg/LoadTest" +) + +// 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. +// +// Msg defines the benchmark Msg service. +type MsgClient interface { + // LoadTest defines a method for executing a sequence of load test operations. + LoadTest(ctx context.Context, in *MsgLoadTest, opts ...grpc.CallOption) (*MsgLoadTestResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) LoadTest(ctx context.Context, in *MsgLoadTest, opts ...grpc.CallOption) (*MsgLoadTestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgLoadTestResponse) + err := c.cc.Invoke(ctx, Msg_LoadTest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility. +// +// Msg defines the benchmark Msg service. +type MsgServer interface { + // LoadTest defines a method for executing a sequence of load test operations. + LoadTest(context.Context, *MsgLoadTest) (*MsgLoadTestResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} + +func (UnimplementedMsgServer) LoadTest(context.Context, *MsgLoadTest) (*MsgLoadTestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadTest not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_LoadTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgLoadTest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).LoadTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_LoadTest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).LoadTest(ctx, req.(*MsgLoadTest)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.benchmark.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LoadTest", + Handler: _Msg_LoadTest_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/benchmark/v1/tx.proto", +} diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index 5ade503e6403..6e4b47f66b87 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -12,6 +12,7 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" @@ -39,6 +40,7 @@ import ( _ "cosmossdk.io/x/bank/v2" // import for side-effects bankv2types "cosmossdk.io/x/bank/v2/types" bankmodulev2 "cosmossdk.io/x/bank/v2/types/module" + benchmark "cosmossdk.io/x/benchmark/module" _ "cosmossdk.io/x/circuit" // import for side-effects circuittypes "cosmossdk.io/x/circuit/types" _ "cosmossdk.io/x/consensus" // import for side-effects @@ -173,6 +175,7 @@ var ( circuittypes.ModuleName, pooltypes.ModuleName, epochstypes.ModuleName, + benchmark.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order @@ -181,7 +184,7 @@ var ( // OrderMigrations: []string{}, // TODO GasConfig was added to the config in runtimev2. Where/how was it set in v1? GasConfig: &runtimev2.GasConfig{ - ValidateTxGasLimit: 100_000, + ValidateTxGasLimit: 10_000_000, QueryGasLimit: 100_000, SimulationGasLimit: 100_000, }, @@ -301,6 +304,20 @@ var ( Name: bankv2types.ModuleName, Config: appconfig.WrapAny(&bankmodulev2.Module{}), }, + { + Name: benchmark.ModuleName, + Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ + GenesisParams: &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 5, + GenesisCount: 20_000_000, + KeyMean: 64, + KeyStdDev: 12, + ValueMean: 1024, + ValueStdDev: 256, + }, + }), + }, }, }) ) diff --git a/x/benchmark/benchmark.pb.go b/x/benchmark/benchmark.pb.go new file mode 100644 index 000000000000..3ed322d3beca --- /dev/null +++ b/x/benchmark/benchmark.pb.go @@ -0,0 +1,545 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/benchmark/v1/benchmark.proto + +package benchmark + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Op is a message describing a benchmark operation. +type Op struct { + Seed uint64 `protobuf:"varint,1,opt,name=seed,proto3" json:"seed,omitempty"` + Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"` + KeyLength uint64 `protobuf:"varint,3,opt,name=key_length,json=keyLength,proto3" json:"key_length,omitempty"` + ValueLength uint64 `protobuf:"varint,4,opt,name=value_length,json=valueLength,proto3" json:"value_length,omitempty"` + Iterations uint32 `protobuf:"varint,5,opt,name=iterations,proto3" json:"iterations,omitempty"` + Delete bool `protobuf:"varint,6,opt,name=delete,proto3" json:"delete,omitempty"` + Exists bool `protobuf:"varint,7,opt,name=exists,proto3" json:"exists,omitempty"` +} + +func (m *Op) Reset() { *m = Op{} } +func (m *Op) String() string { return proto.CompactTextString(m) } +func (*Op) ProtoMessage() {} +func (*Op) Descriptor() ([]byte, []int) { + return fileDescriptor_dca1624628907df9, []int{0} +} +func (m *Op) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Op) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Op.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Op) XXX_Merge(src proto.Message) { + xxx_messageInfo_Op.Merge(m, src) +} +func (m *Op) XXX_Size() int { + return m.Size() +} +func (m *Op) XXX_DiscardUnknown() { + xxx_messageInfo_Op.DiscardUnknown(m) +} + +var xxx_messageInfo_Op proto.InternalMessageInfo + +func (m *Op) GetSeed() uint64 { + if m != nil { + return m.Seed + } + return 0 +} + +func (m *Op) GetActor() string { + if m != nil { + return m.Actor + } + return "" +} + +func (m *Op) GetKeyLength() uint64 { + if m != nil { + return m.KeyLength + } + return 0 +} + +func (m *Op) GetValueLength() uint64 { + if m != nil { + return m.ValueLength + } + return 0 +} + +func (m *Op) GetIterations() uint32 { + if m != nil { + return m.Iterations + } + return 0 +} + +func (m *Op) GetDelete() bool { + if m != nil { + return m.Delete + } + return false +} + +func (m *Op) GetExists() bool { + if m != nil { + return m.Exists + } + return false +} + +func init() { + proto.RegisterType((*Op)(nil), "cosmos.benchmark.v1.Op") +} + +func init() { + proto.RegisterFile("cosmos/benchmark/v1/benchmark.proto", fileDescriptor_dca1624628907df9) +} + +var fileDescriptor_dca1624628907df9 = []byte{ + // 245 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0x73, 0x25, 0x0d, 0xf4, 0x80, 0xc5, 0x20, 0xe4, 0x05, 0x2b, 0xc0, 0x92, 0x29, 0x51, + 0xe1, 0x0d, 0x98, 0x91, 0x90, 0x32, 0xb2, 0xa0, 0x34, 0x39, 0xd1, 0xc8, 0x69, 0x5c, 0xd9, 0x26, + 0x6a, 0xdf, 0x82, 0x47, 0x62, 0x64, 0xec, 0xc8, 0x88, 0x92, 0x17, 0x41, 0xd8, 0x45, 0xe9, 0x76, + 0xdf, 0xa7, 0x6f, 0xb9, 0x1f, 0xef, 0x4a, 0x65, 0x56, 0xca, 0x64, 0x0b, 0x6a, 0xcb, 0xe5, 0xaa, + 0xd0, 0x32, 0xeb, 0xe6, 0x23, 0xa4, 0x6b, 0xad, 0xac, 0x62, 0x17, 0x3e, 0x4a, 0x47, 0xdf, 0xcd, + 0x6f, 0x3f, 0x01, 0x27, 0xcf, 0x6b, 0xc6, 0x30, 0x34, 0x44, 0x15, 0x87, 0x18, 0x92, 0x30, 0x77, + 0x37, 0xbb, 0xc4, 0x69, 0x51, 0x5a, 0xa5, 0xf9, 0x24, 0x86, 0x64, 0x96, 0x7b, 0x60, 0xd7, 0x88, + 0x92, 0xb6, 0xaf, 0x0d, 0xb5, 0x6f, 0x76, 0xc9, 0x8f, 0x5c, 0x3f, 0x93, 0xb4, 0x7d, 0x72, 0x82, + 0xdd, 0xe0, 0x59, 0x57, 0x34, 0xef, 0xf4, 0x1f, 0x84, 0x2e, 0x38, 0x75, 0x6e, 0x9f, 0x08, 0xc4, + 0xda, 0x92, 0x2e, 0x6c, 0xad, 0x5a, 0xc3, 0xa7, 0x31, 0x24, 0xe7, 0xf9, 0x81, 0x61, 0x57, 0x18, + 0x55, 0xd4, 0x90, 0x25, 0x1e, 0xc5, 0x90, 0x9c, 0xe4, 0x7b, 0xfa, 0xf3, 0xb4, 0xa9, 0x8d, 0x35, + 0xfc, 0xd8, 0x7b, 0x4f, 0x8f, 0xf7, 0x5f, 0xbd, 0x80, 0x5d, 0x2f, 0xe0, 0xa7, 0x17, 0xf0, 0x31, + 0x88, 0x60, 0x37, 0x88, 0xe0, 0x7b, 0x10, 0xc1, 0x0b, 0xf7, 0x1f, 0x9b, 0x4a, 0xa6, 0xb5, 0xca, + 0x36, 0xe3, 0x22, 0x8b, 0xc8, 0x4d, 0xf2, 0xf0, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x81, 0x0e, 0xb3, + 0x00, 0x39, 0x01, 0x00, 0x00, +} + +func (m *Op) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Op) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Op) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exists { + i-- + if m.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.Delete { + i-- + if m.Delete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Iterations != 0 { + i = encodeVarintBenchmark(dAtA, i, uint64(m.Iterations)) + i-- + dAtA[i] = 0x28 + } + if m.ValueLength != 0 { + i = encodeVarintBenchmark(dAtA, i, uint64(m.ValueLength)) + i-- + dAtA[i] = 0x20 + } + if m.KeyLength != 0 { + i = encodeVarintBenchmark(dAtA, i, uint64(m.KeyLength)) + i-- + dAtA[i] = 0x18 + } + if len(m.Actor) > 0 { + i -= len(m.Actor) + copy(dAtA[i:], m.Actor) + i = encodeVarintBenchmark(dAtA, i, uint64(len(m.Actor))) + i-- + dAtA[i] = 0x12 + } + if m.Seed != 0 { + i = encodeVarintBenchmark(dAtA, i, uint64(m.Seed)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintBenchmark(dAtA []byte, offset int, v uint64) int { + offset -= sovBenchmark(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Op) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Seed != 0 { + n += 1 + sovBenchmark(uint64(m.Seed)) + } + l = len(m.Actor) + if l > 0 { + n += 1 + l + sovBenchmark(uint64(l)) + } + if m.KeyLength != 0 { + n += 1 + sovBenchmark(uint64(m.KeyLength)) + } + if m.ValueLength != 0 { + n += 1 + sovBenchmark(uint64(m.ValueLength)) + } + if m.Iterations != 0 { + n += 1 + sovBenchmark(uint64(m.Iterations)) + } + if m.Delete { + n += 2 + } + if m.Exists { + n += 2 + } + return n +} + +func sovBenchmark(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBenchmark(x uint64) (n int) { + return sovBenchmark(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Op) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Op: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Op: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + m.Seed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Seed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Actor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBenchmark + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBenchmark + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Actor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyLength", wireType) + } + m.KeyLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KeyLength |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueLength", wireType) + } + m.ValueLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValueLength |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Iterations", wireType) + } + m.Iterations = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Iterations |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Delete = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBenchmark + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exists = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipBenchmark(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBenchmark + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBenchmark(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBenchmark + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBenchmark + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBenchmark + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBenchmark + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBenchmark + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBenchmark + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBenchmark = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBenchmark = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBenchmark = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/benchmark/client/cli/tx.go b/x/benchmark/client/cli/tx.go new file mode 100644 index 000000000000..640728473fc0 --- /dev/null +++ b/x/benchmark/client/cli/tx.go @@ -0,0 +1,183 @@ +package cli + +import ( + "context" + "errors" + "os" + "os/signal" + "syscall" + "time" + + modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" + "cosmossdk.io/x/benchmark" + gen "cosmossdk.io/x/benchmark/generator" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + clienttx "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" +) + +func NewTxCmd(params *modulev1.GeneratorParams) *cobra.Command { + txCmd := &cobra.Command{ + Use: "benchmark", + Short: "benchmark transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + NewLoadTestCmd(params), + ) + + return txCmd +} + +func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { + var ( + verbose bool + pause int64 + numOps uint64 + ) + cmd := &cobra.Command{ + Use: "load-test", + RunE: func(cmd *cobra.Command, args []string) (runErr error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + ctx, cancelFn := context.WithCancel(cmd.Context()) + go func() { + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) + select { + case sig := <-sigCh: + cancelFn() + cmd.Printf("caught %s signal\n", sig.String()) + case <-ctx.Done(): + cancelFn() + } + }() + + var ( + successCount uint64 + errCount uint64 + since = time.Now() + last int + ) + defer func() { + cmd.Printf("done! success_tx=%d err_tx=%d\n", successCount, errCount) + }() + accNum, accSeq, err := clientCtx.AccountRetriever.GetAccountNumberSequence(clientCtx, clientCtx.FromAddress) + if err != nil { + return err + } + txf, err := clienttx.NewFactoryCLI(clientCtx, cmd.Flags()) + if err != nil { + return err + } + txf = txf.WithAccountNumber(accNum).WithChainID(clientCtx.ChainID).WithGas(1_000_000_000) + + storeKeys, err := gen.StoreKeys("benchmark", params.Seed, params.BucketCount) + if err != nil { + return err + } + var seed uint64 + for _, c := range clientCtx.FromAddress { + // root the generator seed in the account address + seed += uint64(c) + } + g := gen.NewGenerator(gen.Options{ + HomeDir: clientCtx.HomeDir, + GeneratorParams: params, + InsertWeight: 0.25, + DeleteWeight: 0.05, + UpdateWeight: 0.50, + GetWeight: 0.20, + }, + gen.WithGenesis(), + gen.WithSeed(seed), + ) + if err = g.Load(); err != nil { + return err + } + defer func() { + if err = g.Close(); err != nil { + runErr = errors.Join(runErr, err) + } + }() + + i := 0 + ops := make([]*benchmark.Op, numOps) + for { + select { + case <-ctx.Done(): + return nil + default: + } + if time.Since(since) > 5*time.Second { + cmd.Printf( + "success_tx=%d err_tx=%d seq=%d rate=%.2f/s\n", + successCount, errCount, accSeq, float64(i-last)/time.Since(since).Seconds()) + since = time.Now() + last = i + } + + for j := range numOps { + bucket, op, err := g.Next() + if err != nil { + return err + } + op.Actor = storeKeys[bucket] + ops[j] = op + } + msg := &benchmark.MsgLoadTest{ + Caller: clientCtx.FromAddress, + Ops: ops, + } + txf = txf.WithSequence(accSeq) + tx, err := txf.BuildUnsignedTx(msg) + if err != nil { + return err + } + err = clienttx.Sign(clientCtx, txf, clientCtx.From, tx, true) + if err != nil { + return err + } + txBytes, err := clientCtx.TxConfig.TxEncoder()(tx.GetTx()) + if err != nil { + return err + } + res, err := clientCtx.BroadcastTxSync(txBytes) + if err != nil { + return err + } + if res.Code != 0 { + if verbose { + err = clientCtx.PrintProto(res) + if err != nil { + return err + } + } + errCount++ + } else { + accSeq++ + successCount++ + } + i++ + if pause > 0 { + time.Sleep(time.Duration(pause) * time.Millisecond) + } + } + }, + } + + flags.AddTxFlagsToCmd(cmd) + cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "print the response") + cmd.Flags().Uint64Var(&numOps, "ops", 1, "number of operations per transaction") + cmd.Flags().Int64Var(&pause, "pause", 0, "pause between transactions in milliseconds") + + return cmd +} diff --git a/x/benchmark/generator/gen.go b/x/benchmark/generator/gen.go new file mode 100644 index 000000000000..90fc9855abcb --- /dev/null +++ b/x/benchmark/generator/gen.go @@ -0,0 +1,348 @@ +package gen + +import ( + "encoding" + "encoding/binary" + "errors" + "fmt" + "io" + "iter" + "math/rand/v2" + "os" + + "github.com/cespare/xxhash/v2" + + module "cosmossdk.io/api/cosmos/benchmark/module/v1" + "cosmossdk.io/x/benchmark" +) + +type Options struct { + *module.GeneratorParams + // HomeDir is for reading/writing state + HomeDir string + + InsertWeight float64 + UpdateWeight float64 + GetWeight float64 + DeleteWeight float64 +} + +type State struct { + Src interface { + rand.Source + encoding.BinaryMarshaler + encoding.BinaryUnmarshaler + } + Keys [][]Payload +} + +func (s *State) Marshal(w io.Writer) error { + srcBz, err := s.Src.MarshalBinary() + if err != nil { + return err + } + var n int + n, err = w.Write(srcBz) + if err != nil { + return err + } + if n != 20 { + return fmt.Errorf("expected 20 bytes, got %d", n) + } + if err = binary.Write(w, binary.LittleEndian, uint64(len(s.Keys))); err != nil { + return err + } + for _, bucket := range s.Keys { + if err = binary.Write(w, binary.LittleEndian, uint64(len(bucket))); err != nil { + return err + } + for _, key := range bucket { + if err = binary.Write(w, binary.LittleEndian, key); err != nil { + return err + } + } + } + return nil +} + +func (s *State) Unmarshal(r io.Reader) error { + srcBz := make([]byte, 20) + if _, err := r.Read(srcBz); err != nil { + return err + } + s.Src = rand.NewPCG(0, 0) + if err := s.Src.UnmarshalBinary(srcBz); err != nil { + return err + } + + var n uint64 + if err := binary.Read(r, binary.LittleEndian, &n); err != nil { + return err + } + s.Keys = make([][]Payload, n) + for i := uint64(0); i < n; i++ { + var m uint64 + if err := binary.Read(r, binary.LittleEndian, &m); err != nil { + return err + } + s.Keys[i] = make([]Payload, m) + for j := uint64(0); j < m; j++ { + if err := binary.Read(r, binary.LittleEndian, &s.Keys[i][j]); err != nil { + return err + } + } + } + return nil +} + +type Generator struct { + Options + + rand *rand.Rand + state *State +} + +type opt func(*Generator) + +func NewGenerator(opts Options, f ...opt) *Generator { + g := &Generator{ + Options: opts, + state: &State{ + Src: rand.NewPCG(opts.Seed, opts.Seed>>32), + }, + } + g.rand = rand.New(g.state.Src) + for _, fn := range f { + fn(g) + } + return g +} + +func WithGenesis() func(*Generator) { + return func(g *Generator) { + // sync state to genesis seed + g.state.Keys = make([][]Payload, g.BucketCount) + if g.GeneratorParams != nil { + for kv := range g.GenesisSet() { + g.state.Keys[kv.StoreKey] = append(g.state.Keys[kv.StoreKey], kv.Key) + } + } + } +} + +func WithSeed(seed uint64) func(*Generator) { + return func(g *Generator) { + g.state.Src = rand.NewPCG(seed, seed>>32) + g.rand = rand.New(g.state.Src) + } +} + +func (g *Generator) Load() error { + f := fmt.Sprintf("%s/data/generator_state.bin", g.HomeDir) + r, err := os.Open(f) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + return nil + } + return err + } + return g.state.Unmarshal(r) +} + +type Payload [2]uint64 + +func (p Payload) Seed() uint64 { + return p[0] +} + +func (p Payload) Length() uint64 { + return p[1] +} + +func (p Payload) Bytes() []byte { + return Bytes(p.Seed(), p.Length()) +} + +func (p Payload) String() string { + return fmt.Sprintf("(%d, %d)", p.Seed(), p.Length()) +} + +func NewPayload(seed, length uint64) Payload { + return Payload{seed, length} +} + +type KV struct { + StoreKey uint64 + Key Payload + Value Payload +} + +func (g *Generator) fetchKey(bucket uint64) (idx uint64, key Payload, err error) { + bucketLen := uint64(len(g.state.Keys[bucket])) + if bucketLen == 0 { + return 0, Payload{}, fmt.Errorf("no keys in bucket %d", bucket) + } + idx = g.rand.Uint64N(bucketLen) + return idx, g.state.Keys[bucket][idx], nil +} + +func (g *Generator) deleteKey(bucket, idx uint64) { + g.state.Keys[bucket] = append(g.state.Keys[bucket][:idx], g.state.Keys[bucket][idx+1:]...) +} + +func (g *Generator) setKey(bucket uint64, payload Payload) { + g.state.Keys[bucket] = append(g.state.Keys[bucket], payload) +} + +func (g *Generator) GenesisSet() iter.Seq[*KV] { + return func(yield func(*KV) bool) { + for range g.GenesisCount { + seed := g.rand.Uint64() + if !yield(&KV{ + StoreKey: g.UintN(g.BucketCount), + Key: NewPayload(seed, g.getLength(g.KeyMean, g.KeyStdDev)), + Value: NewPayload(seed, g.getLength(g.ValueMean, g.ValueStdDev)), + }) { + return + } + } + } +} + +func (g *Generator) Next() (uint64, *benchmark.Op, error) { + if g.InsertWeight+g.UpdateWeight+g.GetWeight+g.DeleteWeight != 1 { + return 0, nil, fmt.Errorf("probabilities must sum to 1") + } + + var ( + err error + key Payload + ) + x := g.rand.Float64() + bucket := g.UintN(g.BucketCount) + op := &benchmark.Op{ + Exists: true, + } + + switch { + case x < g.InsertWeight: + // insert + op.Seed = g.rand.Uint64() + op.KeyLength = g.getLength(g.KeyMean, g.KeyStdDev) + op.ValueLength = g.getLength(g.ValueMean, g.ValueStdDev) + op.Exists = false + g.setKey(bucket, NewPayload(op.Seed, op.KeyLength)) + case x < g.InsertWeight+g.UpdateWeight: + // update + _, key, err = g.fetchKey(bucket) + if err != nil { + return 0, nil, err + } + op.Seed = key.Seed() + op.KeyLength = key.Length() + op.ValueLength = g.getLength(g.ValueMean, g.ValueStdDev) + case x < g.InsertWeight+g.UpdateWeight+g.GetWeight: + // get + _, key, err = g.fetchKey(bucket) + if err != nil { + return 0, nil, err + } + op.Seed = key.Seed() + op.KeyLength = key.Length() + default: + // delete + var idx uint64 + idx, key, err = g.fetchKey(bucket) + if err != nil { + return 0, nil, err + } + op.Delete = true + op.Seed = key.Seed() + op.KeyLength = key.Length() + g.deleteKey(bucket, idx) + } + + return bucket, op, nil +} + +func (g *Generator) NormUint64(mean, stdDev uint64) uint64 { + return uint64(g.rand.NormFloat64()*float64(stdDev) + float64(mean)) +} + +func (g *Generator) getLength(mean, stdDev uint64) uint64 { + length := g.NormUint64(mean, stdDev) + if length == 0 { + length = 1 + } + return length +} + +func (g *Generator) UintN(n uint64) uint64 { + return g.rand.Uint64N(n) +} + +func (g *Generator) Close() error { + f := fmt.Sprintf("%s/data/generator_state.bin", g.HomeDir) + w, err := os.Create(f) + if err != nil { + return err + } + return g.state.Marshal(w) +} + +func encodeUint64(x uint64) []byte { + var b [8]byte + b[0] = byte(x) + b[1] = byte(x >> 8) + b[2] = byte(x >> 16) + b[3] = byte(x >> 24) + b[4] = byte(x >> 32) + b[5] = byte(x >> 40) + b[6] = byte(x >> 48) + b[7] = byte(x >> 56) + return b[:] +} + +const maxStoreKeyGenIterations = 100 + +func StoreKeys(prefix string, seed, count uint64) ([]string, error) { + r := rand.New(rand.NewPCG(seed, seed>>32)) + keys := make([]string, count) + seen := make(map[string]struct{}) + + var i, j uint64 + for i < count { + if j > maxStoreKeyGenIterations { + return nil, fmt.Errorf("failed to generate %d unique store keys", count) + } + sk := fmt.Sprintf("%s_%x", prefix, Bytes(r.Uint64(), 8)) + if _, ok := seen[sk]; ok { + j++ + continue + } + keys[i] = sk + seen[sk] = struct{}{} + i++ + } + return keys, nil +} + +func Bytes(seed, length uint64) []byte { + b := make([]byte, length) + rounds := length / 8 + remainder := length % 8 + var h uint64 + for i := uint64(0); i < rounds; i++ { + h = xxhash.Sum64(encodeUint64(seed + i)) + for j := uint64(0); j < 8; j++ { + b[i*8+j] = byte(h >> (8 * j)) + } + } + if remainder > 0 { + h = xxhash.Sum64(encodeUint64(seed + rounds)) + for j := uint64(0); j < remainder; j++ { + b[rounds*8+j] = byte(h >> (8 * j)) + } + } + return b +} diff --git a/x/benchmark/generator/gen_test.go b/x/benchmark/generator/gen_test.go new file mode 100644 index 000000000000..3a0ee8ca1571 --- /dev/null +++ b/x/benchmark/generator/gen_test.go @@ -0,0 +1,138 @@ +package gen + +import ( + "bytes" + "testing" + + "github.com/cespare/xxhash/v2" + "github.com/stretchr/testify/require" + + benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" +) + +func Test_Genesis(t *testing.T) { + params := &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 10, + GenesisCount: 2_000_000, + KeyMean: 64, + KeyStdDev: 8, + ValueMean: 1024, + ValueStdDev: 256, + } + g := NewGenerator(Options{GeneratorParams: params}) + db := make(map[uint64]map[uint64]bool) + for kv := range g.GenesisSet() { + if _, ok := db[kv.StoreKey]; !ok { + db[kv.StoreKey] = make(map[uint64]bool) + } + db[kv.StoreKey][kv.Key[0]] = true + } + + g = NewGenerator(Options{ + GeneratorParams: params, + InsertWeight: 0.25, + DeleteWeight: 0.05, + UpdateWeight: 0.50, + GetWeight: 0.20, + }, WithGenesis()) + for range 100_000 { + sk, op, err := g.Next() + require.NoError(t, err) + switch { + case op.Delete: + require.True(t, db[sk][op.Seed]) + delete(db[sk], op.Seed) + case op.ValueLength > 0: + if op.Exists { + // update + require.True(t, db[sk][op.Seed]) + } else { + // insert + require.False(t, db[sk][op.Seed]) + } + db[sk][op.Seed] = true + case op.ValueLength == 0: + // get + require.True(t, db[sk][op.Seed]) + default: + t.Fatalf("unexpected op: %v", op) + } + } + + // Test state Marshal/Unmarshal + var buf bytes.Buffer + require.NoError(t, g.state.Marshal(&buf)) + s := &State{} + require.NoError(t, s.Unmarshal(bytes.NewReader(buf.Bytes()))) + require.Equal(t, len(g.state.Keys), len(s.Keys)) + for i := range g.state.Keys { + require.Equal(t, len(g.state.Keys[i]), len(s.Keys[i])) + for j := range g.state.Keys[i] { + require.Equal(t, g.state.Keys[i][j], s.Keys[i][j]) + } + } +} + +func Test_Genesis_BytesKey(t *testing.T) { + params := &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 10, + GenesisCount: 2_000_000, + KeyMean: 64, + KeyStdDev: 8, + ValueMean: 1024, + ValueStdDev: 256, + } + g := NewGenerator(Options{GeneratorParams: params}) + db := make(map[uint64]map[uint64]bool) + for kv := range g.GenesisSet() { + if _, ok := db[kv.StoreKey]; !ok { + db[kv.StoreKey] = make(map[uint64]bool) + } + key := xxhash.Sum64(Bytes(kv.Key.Seed(), kv.Key.Length())) + db[kv.StoreKey][key] = true + } + + g = NewGenerator(Options{ + GeneratorParams: params, + InsertWeight: 0.25, + DeleteWeight: 0.05, + UpdateWeight: 0.50, + GetWeight: 0.20, + }, WithGenesis()) + for range 1_000_000 { + sk, op, err := g.Next() + require.NoError(t, err) + key := xxhash.Sum64(Bytes(op.Seed, op.KeyLength)) + switch { + case op.Delete: + require.True(t, db[sk][key]) + delete(db[sk], key) + case op.ValueLength > 0: + if op.Exists { + // update + require.True(t, db[sk][key]) + } else { + // insert + require.False(t, db[sk][key]) + } + db[sk][key] = true + case op.ValueLength == 0: + // get + require.True(t, db[sk][key]) + default: + t.Fatalf("unexpected op: %v", op) + } + } +} + +func Test_Bytes_Deterministic(t *testing.T) { + seed := uint64(12345) + length := uint64(53) + expected := Bytes(seed, length) + for i := 0; i < 100; i++ { + result := Bytes(seed, length) + require.Equal(t, expected, result, "Bytes() should be deterministic") + } +} diff --git a/x/benchmark/go.mod b/x/benchmark/go.mod new file mode 100644 index 000000000000..9d5aa209e00a --- /dev/null +++ b/x/benchmark/go.mod @@ -0,0 +1,154 @@ +module cosmossdk.io/x/benchmark + +go 1.23.2 + +require ( + cosmossdk.io/api v0.7.6 + cosmossdk.io/core v1.0.0-alpha.6 + cosmossdk.io/depinject v1.1.0 + cosmossdk.io/log v1.5.0 + github.com/cespare/xxhash/v2 v2.3.0 + github.com/cosmos/cosmos-sdk v0.53.0 + github.com/cosmos/gogoproto v1.7.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/spf13/cobra v1.8.1 + github.com/stretchr/testify v1.10.0 + google.golang.org/grpc v1.68.0 +) + +require ( + buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1 // indirect + buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1 // indirect + cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b // indirect + cosmossdk.io/errors v1.0.1 // indirect + cosmossdk.io/math v1.4.0 // indirect + cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect + cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect + cosmossdk.io/x/tx v1.0.0-alpha.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/bytedance/sonic v1.12.4 // indirect + github.com/bytedance/sonic/loader v0.2.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v1.0.0-rc2.0.20241127125717-4ce33b646ac9 // indirect + github.com/cometbft/cometbft-db v1.0.1 // indirect + github.com/cometbft/cometbft/api v1.0.0-rc2 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-db v1.1.0 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/iavl v1.3.2 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/danieljoos/wincred v1.2.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/dgraph-io/badger/v4 v4.4.0 // indirect + github.com/dgraph-io/ristretto/v2 v2.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.2 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/flatbuffers v24.3.25+incompatible // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/linxGnu/grocksdb v1.9.3 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.60.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.19.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.13 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect + gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect + go.opencensus.io v0.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/arch v0.12.0 // indirect + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/term v0.26.0 // indirect + golang.org/x/text v0.20.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/protobuf v1.35.2 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) + +replace ( + cosmossdk.io/api => ../../api + cosmossdk.io/core => ../../core + cosmossdk.io/x/bank => ../bank + cosmossdk.io/x/staking => ../staking + github.com/cosmos/cosmos-sdk => ../../ +) diff --git a/x/benchmark/go.sum b/x/benchmark/go.sum new file mode 100644 index 000000000000..d1a90e83d66c --- /dev/null +++ b/x/benchmark/go.sum @@ -0,0 +1,622 @@ +buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1 h1:kAu+bRyXqQWarx/4mAdKFYW6bgvjGKhzvIXJvMHivC4= +buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1/go.mod h1:wqOtclGXqh+7m/L6fn0SatBJ+m9E5muF/41a3LgIPVI= +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1 h1:FYhA+EOS18QBdffLVpisUjBGsCtUljMx4bFOsZT81ZM= +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1/go.mod h1:17Ax38yd8pg56din4ecwSDBRCSX0qLcif5Cdf8ayto4= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b h1:MgU4EDOo/pXgepHCUFQFnIfUCxk/JO0AJGDTUQhhEhg= +cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b/go.mod h1:uf12i1yKvzEIHt2ok7poNqFDQTb71O00RQLitSynmrg= +cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e h1:F+ScucYxwrrDJU8guJXQXpGhdpziYSbxW6HMP2wCNxs= +cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e/go.mod h1:3YvVv9aJayjPhdX0DY1IMrGse4sR63hNBWx2VtDWjGQ= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= +cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b h1:svpFdulZRrYz+RTHu2u9CeKkMKrIHx5354vjiHerovo= +cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc h1:R9O9d75e0qZYUsVV0zzi+D7cNLnX2JrUOQNoIPaF0Bg= +cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc/go.mod h1:amTTatOUV3u1PsKmNb87z6/galCxrRbz9kRdJkL0DyU= +cosmossdk.io/x/tx v1.0.0-alpha.1 h1:5w61etWMQbdCSR7uveWXCnGnD5eQ/64B2vzIhqA80yo= +cosmossdk.io/x/tx v1.0.0-alpha.1/go.mod h1:xlJjZV1wxZBTCP+ygZx9pNT/XxsfHDPf1H0VhHaUp5w= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= +github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= +github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= +github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= +github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= +github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cometbft/cometbft v1.0.0-rc2.0.20241127125717-4ce33b646ac9 h1:moNybQ29M6OzirXBd7DBg1FERRECndXCEnlJSCIaMvo= +github.com/cometbft/cometbft v1.0.0-rc2.0.20241127125717-4ce33b646ac9/go.mod h1:GMmx+Ol327wKu+M/aMIZgOaagm8CC24CqVaC4zTpEok= +github.com/cometbft/cometbft-db v1.0.1 h1:SylKuLseMLQKw3+i8y8KozZyJcQSL98qEe2CGMCGTYE= +github.com/cometbft/cometbft-db v1.0.1/go.mod h1:EBrFs1GDRiTqrWXYi4v90Awf/gcdD5ExzdPbg4X8+mk= +github.com/cometbft/cometbft/api v1.0.0-rc2 h1:ThzvNaJq37htjzfSsohhDoEebW94p0lEjA39CMDJ4xs= +github.com/cometbft/cometbft/api v1.0.0-rc2/go.mod h1:EkQiqVSu/p2ebrZEnB2z6Re7r8XNe//M7ylR0qEwWm0= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.1.0 h1:KLHNVQ73h7vawXTpj9UJ7ZR2IXv51tsEHkQJJ9EBDzI= +github.com/cosmos/cosmos-db v1.1.0/go.mod h1:t7c4A6cfGdpUwwVxrQ0gQLeRQqGUBJu0yvE4F/26REg= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= +github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= +github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/dgraph-io/badger/v4 v4.4.0 h1:rA48XiDynZLyMdlaJl67p9+lqfqwxlgKtCpYLAio7Zk= +github.com/dgraph-io/badger/v4 v4.4.0/go.mod h1:sONMmPPfbnj9FPwS/etCqky/ULth6CQJuAZSuWCmixE= +github.com/dgraph-io/ristretto/v2 v2.0.0 h1:l0yiSOtlJvc0otkqyMaDNysg8E9/F/TYZwMbxscNOAQ= +github.com/dgraph-io/ristretto/v2 v2.0.0/go.mod h1:FVFokF2dRqXyPyeMnK1YDy8Fc6aTe0IKgbcd03CYeEk= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= +github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= +github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= +github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= +github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= +github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= +github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/linxGnu/grocksdb v1.9.3 h1:s1cbPcOd0cU2SKXRG1nEqCOWYAELQjdqg3RVI2MH9ik= +github.com/linxGnu/grocksdb v1.9.3/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= +github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= +github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b h1:CzigHMRySiX3drau9C6Q5CAbNIApmLdat5jPMqChvDA= +gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b/go.mod h1:/y/V339mxv2sZmYYR64O07VuCpdNZqCTwO8ZcouTMI8= +gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 h1:qwDnMxjkyLmAFgcfgTnfJrmYKWhHnci3GjDqcZp1M3Q= +gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02/go.mod h1:JTnUj0mpYiAsuZLmKjTx/ex3AtMowcCgnE7YNyCEP0I= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= +golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= +golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= +google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/x/benchmark/module/depinject.go b/x/benchmark/module/depinject.go new file mode 100644 index 000000000000..fbf824af5833 --- /dev/null +++ b/x/benchmark/module/depinject.go @@ -0,0 +1,79 @@ +package module + +import ( + "unsafe" + + "cosmossdk.io/core/telemetry" + "cosmossdk.io/depinject" + + modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject/appconfig" + "cosmossdk.io/log" + gen "cosmossdk.io/x/benchmark/generator" +) + +const ModuleName = "benchmark" +const maxStoreKeyGenIterations = 100 + +func init() { + // TODO try depinject gogo API + appconfig.RegisterModule( + &modulev1.Module{}, + appconfig.Provide( + ProvideModule, + ), + ) +} + +type StoreKeyRegistrar interface { + RegisterKey(string) +} + +type Input struct { + depinject.In + + Logger log.Logger + Cfg *modulev1.Module + Registrar StoreKeyRegistrar `optional:"true"` + StoreFactory store.KVStoreServiceFactory + Telemetry telemetry.Service +} + +func ProvideModule( + in Input, +) (appmodule.AppModule, error) { + cfg := in.Cfg + kvMap := make(KVServiceMap) + storeKeys, err := gen.StoreKeys(ModuleName, cfg.GenesisParams.Seed, cfg.GenesisParams.BucketCount) + if err != nil { + return nil, err + } + for _, sk := range storeKeys { + // app v2 case + if in.Registrar != nil { + in.Registrar.RegisterKey(sk) + } + kvService := in.StoreFactory(unsafeStrToBytes(sk)) + kvMap[sk] = kvService + } + + return NewAppModule(cfg.GenesisParams, storeKeys, kvMap, in.Logger, in.Telemetry), nil +} + +type KVServiceMap map[string]store.KVStoreService + +// unsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes +// must not be altered after this function is called as it will cause a segmentation fault. +func unsafeStrToBytes(s string) []byte { + return unsafe.Slice(unsafe.StringData(s), len(s)) // ref https://github.com/golang/go/issues/53003#issuecomment-1140276077 +} + +// unsafeBytesToStr is meant to make a zero allocation conversion +// from []byte -> string to speed up operations, it is not meant +// to be used generally, but for a specific pattern to delete keys +// from a map. +func unsafeBytesToStr(b []byte) string { + return unsafe.String(unsafe.SliceData(b), len(b)) +} diff --git a/x/benchmark/module/keeper.go b/x/benchmark/module/keeper.go new file mode 100644 index 000000000000..afefa72f18de --- /dev/null +++ b/x/benchmark/module/keeper.go @@ -0,0 +1,137 @@ +package module + +import ( + "context" + "fmt" + "sync" + "time" + + "cosmossdk.io/core/telemetry" + "cosmossdk.io/x/benchmark" + gen "cosmossdk.io/x/benchmark/generator" +) + +var ( + _ benchmark.MsgServer = &Keeper{} + once sync.Once +) + +type Keeper struct { + kvServiceMap KVServiceMap + telemetryService telemetry.Service + validate bool + errExit bool + + metricOpKey []string + metricTotalKey []string + metricMissKey []string +} + +func NewKeeper(kvMap KVServiceMap, telemetryService telemetry.Service) *Keeper { + k := &Keeper{ + kvServiceMap: kvMap, + telemetryService: telemetryService, + validate: false, + errExit: false, + metricOpKey: []string{"benchmark", "op"}, + metricTotalKey: []string{"benchmark", "total"}, + metricMissKey: []string{"benchmark", "miss"}, + } + once.Do(func() { + telemetryService.RegisterHistogram(k.metricOpKey, telemetry.Buckets.StoreOpsOrder, "op") + telemetryService.RegisterCounter(k.metricMissKey, "op") + telemetryService.RegisterCounter(k.metricTotalKey) + }) + return k +} + +func (k *Keeper) LoadTest(ctx context.Context, msg *benchmark.MsgLoadTest) (*benchmark.MsgLoadTestResponse, error) { + res := &benchmark.MsgLoadTestResponse{} + for _, op := range msg.Ops { + k.telemetryService.IncrCounter(k.metricTotalKey, 1) + err := k.executeOp(ctx, op) + if err != nil { + return res, err + } + } + return res, nil +} + +func (k *Keeper) measureSince(since time.Time, opType string) { + k.telemetryService.MeasureSince(since, k.metricOpKey, telemetry.Label{Name: "op", Value: opType}) +} + +func (k *Keeper) countMiss(opType string) { + k.telemetryService.IncrCounter(k.metricMissKey, 1, telemetry.Label{Name: "op", Value: opType}) +} + +func (k *Keeper) executeOp(ctx context.Context, op *benchmark.Op) error { + svc, ok := k.kvServiceMap[op.Actor] + key := gen.Bytes(op.Seed, op.KeyLength) + if !ok { + return fmt.Errorf("actor %s not found", op.Actor) + } + start := time.Now() + kv := svc.OpenKVStore(ctx) + switch { + case op.Delete: + defer k.measureSince(start, "delete") + if k.validate { + exists, err := kv.Has(key) + if err != nil { + return err + } + if !exists { + k.countMiss("delete") + if k.errExit { + return fmt.Errorf("key %d not found", op.Seed) + } + } + } + return kv.Delete(key) + case op.ValueLength > 0: + opType := "insert" + if op.Exists { + opType = "update" + } + defer k.measureSince(start, opType) + if k.validate { + exists, err := kv.Has(key) + if err != nil { + return err + } + if exists != op.Exists { + k.countMiss(opType) + if k.errExit { + return fmt.Errorf("key %d exists=%t, expected=%t", op.Seed, exists, op.Exists) + } + } + } + value := gen.Bytes(op.Seed, op.ValueLength) + return kv.Set(key, value) + case op.Iterations > 0: + return fmt.Errorf("iterator not implemented") + case op.ValueLength == 0: + defer k.measureSince(start, "get") + v, err := kv.Get(key) + if v == nil { + // always count a miss on GET since it requires no extra I/O + k.countMiss("get") + if k.errExit { + return fmt.Errorf("key %s not found", key) + } + } + return err + default: + return fmt.Errorf("invalid op: %+v", op) + } +} + +func (k *Keeper) set(ctx context.Context, actor string, key, value []byte) error { + svc, ok := k.kvServiceMap[actor] + if !ok { + return fmt.Errorf("actor %s not found", actor) + } + kv := svc.OpenKVStore(ctx) + return kv.Set(key, value) +} diff --git a/x/benchmark/module/module.go b/x/benchmark/module/module.go new file mode 100644 index 000000000000..6a17232db62b --- /dev/null +++ b/x/benchmark/module/module.go @@ -0,0 +1,113 @@ +package module + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/telemetry" + "cosmossdk.io/core/transaction" + + "cosmossdk.io/core/registry" + "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/spf13/cobra" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "google.golang.org/grpc" + + modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" + _ "cosmossdk.io/api/cosmos/benchmark/v1" // for some reason this is required to make msg server registration work + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/x/benchmark" + "cosmossdk.io/x/benchmark/client/cli" + gen "cosmossdk.io/x/benchmark/generator" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.HasGRPCGateway = &AppModule{} + _ appmodule.AppModule = &AppModule{} + _ appmodule.HasGenesis = &AppModule{} +) + +type AppModule struct { + keeper *Keeper + storeKeys []string + genesisParams *modulev1.GeneratorParams + log log.Logger +} + +func NewAppModule( + genesisParams *modulev1.GeneratorParams, + storeKeys []string, + kvMap KVServiceMap, + logger log.Logger, + telemetryService telemetry.Service, +) *AppModule { + return &AppModule{ + genesisParams: genesisParams, + keeper: NewKeeper(kvMap, telemetryService), + storeKeys: storeKeys, + log: logger, + } +} + +// DefaultGenesis implements appmodulev2.HasGenesis. +func (a *AppModule) DefaultGenesis() json.RawMessage { + return nil +} + +// ExportGenesis implements appmodulev2.HasGenesis. +func (a *AppModule) ExportGenesis(context.Context) (json.RawMessage, error) { return nil, nil } + +// InitGenesis implements appmodulev2.HasGenesis. +func (a *AppModule) InitGenesis(ctx context.Context, _ json.RawMessage) error { + a.genesisParams.BucketCount = uint64(len(a.storeKeys)) + g := gen.NewGenerator(gen.Options{GeneratorParams: a.genesisParams}) + i := 0 + for kv := range g.GenesisSet() { + i++ + if i%100_000 == 0 { + fmt.Printf("init genesis: %d/%d\n", i, a.genesisParams.GenesisCount) + a.log.Warn("init genesis", "progress", i, "total", a.genesisParams.GenesisCount) + } + sk := a.storeKeys[kv.StoreKey] + key := gen.Bytes(kv.Key.Seed(), kv.Key.Length()) + value := gen.Bytes(kv.Value.Seed(), kv.Value.Length()) + err := a.keeper.set(ctx, sk, key, value) + if err != nil { + return err + } + } + return nil +} + +// ValidateGenesis implements appmodulev2.HasGenesis. +func (a *AppModule) ValidateGenesis(data json.RawMessage) error { return nil } + +func (a *AppModule) RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) { +} + +// RegisterServices registers module services. +func (a *AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { + benchmark.RegisterMsgServer(registrar, a.keeper) + return nil +} + +func (a *AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { + registrar.RegisterImplementations( + (*transaction.Msg)(nil), + &benchmark.MsgLoadTest{}) + msgservice.RegisterMsgServiceDesc(registrar, &benchmark.Msg_serviceDesc) +} + +func (a *AppModule) GetTxCmd() *cobra.Command { + return cli.NewTxCmd(a.genesisParams) +} + +func (a *AppModule) IsOnePerModuleType() {} + +func (a *AppModule) IsAppModule() {} diff --git a/x/benchmark/proto/buf.gen.gogo.yaml b/x/benchmark/proto/buf.gen.gogo.yaml new file mode 100644 index 000000000000..db36231d0c82 --- /dev/null +++ b/x/benchmark/proto/buf.gen.gogo.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any + - name: grpc-gateway + out: .. + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/benchmark/proto/buf.gen.pulsar.yaml b/x/benchmark/proto/buf.gen.pulsar.yaml new file mode 100644 index 000000000000..cb908f80c9f0 --- /dev/null +++ b/x/benchmark/proto/buf.gen.pulsar.yaml @@ -0,0 +1,19 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: cosmossdk.io/api + except: + - buf.build/googleapis/googleapis + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-proto + override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api + buf.build/cometbft/cometbft: buf.build/gen/go/cometbft/cometbft/protocolbuffers/go +plugins: + - name: go-pulsar + out: .. + opt: paths=source_relative + - name: go-grpc + out: .. + opt: paths=source_relative diff --git a/x/benchmark/proto/buf.lock b/x/benchmark/proto/buf.lock new file mode 100644 index 000000000000..02bbfddc729d --- /dev/null +++ b/x/benchmark/proto/buf.lock @@ -0,0 +1,38 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cometbft + repository: cometbft + commit: c0d3497e35d649538679874acdd86660 + digest: shake256:05d2fb9e6b6bf82385ac26b250afbba281a2ca79f51729291373d24ca676d743183bf70a921daae6feafd5f9917120e2548a7c477d9743f668bca27cc1e12fdf + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: googleapis + repository: googleapis + commit: f52d4f76a8434cc5966798b1d3b4f110 + digest: shake256:71566dd80e39b7d85fdaa9b7f82107385181d5b6d17ea56c0aacce61099b35f9f1bcf7333ad9838ca19d24d7f076b039de7c9c09c55d23bb4c2fddfceff4d2c2 + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/x/benchmark/proto/buf.yaml b/x/benchmark/proto/buf.yaml new file mode 100644 index 000000000000..19fd0b6afb95 --- /dev/null +++ b/x/benchmark/proto/buf.yaml @@ -0,0 +1,19 @@ +version: v1 +name: buf.build/mods/consensus +deps: + - buf.build/cosmos/cosmos-sdk # pin the Cosmos SDK version + - buf.build/cometbft/cometbft:4a62c99d422068a5165429b62a7eb824df46cca9 # CometBFT v0.38 + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME diff --git a/x/benchmark/proto/cosmos/benchmark/module/v1/module.proto b/x/benchmark/proto/cosmos/benchmark/module/v1/module.proto new file mode 100644 index 000000000000..f0d7ddd44792 --- /dev/null +++ b/x/benchmark/proto/cosmos/benchmark/module/v1/module.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package cosmos.benchmark.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the benchmark module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "cosmossdk.io/x/benchmark" + }; + + GeneratorParams genesis_params = 1; +} + +// GenesisParams defines the genesis parameters for the benchmark module. +message GeneratorParams { + uint64 seed = 1; + uint64 bucket_count = 2; + + uint64 key_mean = 3; + uint64 key_std_dev = 4; + uint64 value_mean = 6; + uint64 value_std_dev = 7; + + uint64 genesis_count = 8; + + float insert_weight = 9; + float update_weight = 10; + float get_weight = 12; + float delete_weight = 11; +} \ No newline at end of file diff --git a/x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto b/x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto new file mode 100644 index 000000000000..0bad19a1c1b1 --- /dev/null +++ b/x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package cosmos.benchmark.v1; + +option go_package = "cosmossdk.io/x/benchmark"; + +// Op is a message describing a benchmark operation. +message Op { + uint64 seed = 1; + string actor = 2; + + uint64 key_length = 3; + uint64 value_length = 4; + uint32 iterations = 5; + bool delete = 6; + bool exists = 7; +} \ No newline at end of file diff --git a/x/benchmark/proto/cosmos/benchmark/v1/tx.proto b/x/benchmark/proto/cosmos/benchmark/v1/tx.proto new file mode 100644 index 000000000000..dfedeb64bd72 --- /dev/null +++ b/x/benchmark/proto/cosmos/benchmark/v1/tx.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package cosmos.benchmark.v1; + +import "cosmos/benchmark/v1/benchmark.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "cosmossdk.io/x/benchmark"; + +// MsgLoadTestOps defines a message containing a sequence of load test operations. +message MsgLoadTest { + option (cosmos.msg.v1.signer) = "caller"; + option (amino.name) = "cosmos-sdk/x/benchmark/v1/MsgLoadTest"; + + bytes caller = 1; + + repeated Op ops = 2; +} + +// MsgLoadTestResponse defines a message containing the results of a load test operation. +message MsgLoadTestResponse { + uint64 total_time = 1; + uint64 total_errors = 2; +} + +// Msg defines the benchmark Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // LoadTest defines a method for executing a sequence of load test operations. + rpc LoadTest(MsgLoadTest) returns (MsgLoadTestResponse); +} diff --git a/x/benchmark/tx.pb.go b/x/benchmark/tx.pb.go new file mode 100644 index 000000000000..269fcdfdf9d6 --- /dev/null +++ b/x/benchmark/tx.pb.go @@ -0,0 +1,669 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/benchmark/v1/tx.proto + +package benchmark + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgLoadTestOps defines a message containing a sequence of load test operations. +type MsgLoadTest struct { + Caller []byte `protobuf:"bytes,1,opt,name=caller,proto3" json:"caller,omitempty"` + Ops []*Op `protobuf:"bytes,2,rep,name=ops,proto3" json:"ops,omitempty"` +} + +func (m *MsgLoadTest) Reset() { *m = MsgLoadTest{} } +func (m *MsgLoadTest) String() string { return proto.CompactTextString(m) } +func (*MsgLoadTest) ProtoMessage() {} +func (*MsgLoadTest) Descriptor() ([]byte, []int) { + return fileDescriptor_481e3d7f7138b75b, []int{0} +} +func (m *MsgLoadTest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLoadTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLoadTest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLoadTest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLoadTest.Merge(m, src) +} +func (m *MsgLoadTest) XXX_Size() int { + return m.Size() +} +func (m *MsgLoadTest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLoadTest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLoadTest proto.InternalMessageInfo + +func (m *MsgLoadTest) GetCaller() []byte { + if m != nil { + return m.Caller + } + return nil +} + +func (m *MsgLoadTest) GetOps() []*Op { + if m != nil { + return m.Ops + } + return nil +} + +// MsgLoadTestResponse defines a message containing the results of a load test operation. +type MsgLoadTestResponse struct { + TotalTime uint64 `protobuf:"varint,1,opt,name=total_time,json=totalTime,proto3" json:"total_time,omitempty"` + TotalErrors uint64 `protobuf:"varint,2,opt,name=total_errors,json=totalErrors,proto3" json:"total_errors,omitempty"` +} + +func (m *MsgLoadTestResponse) Reset() { *m = MsgLoadTestResponse{} } +func (m *MsgLoadTestResponse) String() string { return proto.CompactTextString(m) } +func (*MsgLoadTestResponse) ProtoMessage() {} +func (*MsgLoadTestResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_481e3d7f7138b75b, []int{1} +} +func (m *MsgLoadTestResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgLoadTestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgLoadTestResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgLoadTestResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgLoadTestResponse.Merge(m, src) +} +func (m *MsgLoadTestResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgLoadTestResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgLoadTestResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgLoadTestResponse proto.InternalMessageInfo + +func (m *MsgLoadTestResponse) GetTotalTime() uint64 { + if m != nil { + return m.TotalTime + } + return 0 +} + +func (m *MsgLoadTestResponse) GetTotalErrors() uint64 { + if m != nil { + return m.TotalErrors + } + return 0 +} + +func init() { + proto.RegisterType((*MsgLoadTest)(nil), "cosmos.benchmark.v1.MsgLoadTest") + proto.RegisterType((*MsgLoadTestResponse)(nil), "cosmos.benchmark.v1.MsgLoadTestResponse") +} + +func init() { proto.RegisterFile("cosmos/benchmark/v1/tx.proto", fileDescriptor_481e3d7f7138b75b) } + +var fileDescriptor_481e3d7f7138b75b = []byte{ + // 320 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcd, 0x4b, 0xce, 0xc8, 0x4d, 0x2c, 0xca, 0xd6, 0x2f, 0x33, 0xd4, + 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, + 0xca, 0x0c, 0xa5, 0x94, 0xb1, 0x69, 0x41, 0xa8, 0x00, 0xeb, 0x94, 0x12, 0x87, 0x2a, 0xca, 0x2d, + 0x4e, 0x07, 0x49, 0xe7, 0x16, 0xa7, 0x43, 0x25, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, + 0x24, 0x44, 0x48, 0xa9, 0x9d, 0x91, 0x8b, 0xdb, 0xb7, 0x38, 0xdd, 0x27, 0x3f, 0x31, 0x25, 0x24, + 0xb5, 0xb8, 0x44, 0x48, 0x8c, 0x8b, 0x2d, 0x39, 0x31, 0x27, 0x27, 0xb5, 0x48, 0x82, 0x51, 0x81, + 0x51, 0x83, 0x27, 0x08, 0xca, 0x13, 0xd2, 0xe4, 0x62, 0xce, 0x2f, 0x28, 0x96, 0x60, 0x52, 0x60, + 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0xc3, 0xe2, 0x36, 0x3d, 0xff, 0x82, 0x20, 0x90, 0x1a, 0x2b, 0xd3, + 0xa6, 0xe7, 0x1b, 0xb4, 0xa0, 0xfa, 0xba, 0x9e, 0x6f, 0xd0, 0x52, 0x85, 0x28, 0xd6, 0x2d, 0x4e, + 0xc9, 0xd6, 0xaf, 0x40, 0x75, 0x39, 0x92, 0xcd, 0x4a, 0xe1, 0x5c, 0xc2, 0x48, 0xdc, 0xa0, 0xd4, + 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x59, 0x2e, 0xae, 0x92, 0xfc, 0x92, 0xc4, 0x9c, 0xf8, + 0x92, 0xcc, 0xdc, 0x54, 0xb0, 0xa3, 0x58, 0x82, 0x38, 0xc1, 0x22, 0x21, 0x99, 0xb9, 0xa9, 0x42, + 0x8a, 0x5c, 0x3c, 0x10, 0xe9, 0xd4, 0xa2, 0xa2, 0xfc, 0x22, 0x90, 0x03, 0x41, 0x0a, 0xb8, 0xc1, + 0x62, 0xae, 0x60, 0x21, 0xa3, 0x14, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x30, 0x2e, 0x0e, 0xb8, + 0x2f, 0x15, 0xb0, 0x7a, 0x00, 0xc9, 0x7a, 0x29, 0x0d, 0x42, 0x2a, 0x60, 0x0e, 0x94, 0x62, 0x6d, + 0x78, 0xbe, 0x41, 0x8b, 0xd1, 0xc9, 0xe8, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, + 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, + 0xa2, 0x24, 0x20, 0x26, 0x15, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0x23, 0x87, 0x40, 0x12, 0x1b, 0x38, + 0x0e, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x47, 0x7e, 0x92, 0xc2, 0x09, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // LoadTest defines a method for executing a sequence of load test operations. + LoadTest(ctx context.Context, in *MsgLoadTest, opts ...grpc.CallOption) (*MsgLoadTestResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) LoadTest(ctx context.Context, in *MsgLoadTest, opts ...grpc.CallOption) (*MsgLoadTestResponse, error) { + out := new(MsgLoadTestResponse) + err := c.cc.Invoke(ctx, "/cosmos.benchmark.v1.Msg/LoadTest", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // LoadTest defines a method for executing a sequence of load test operations. + LoadTest(context.Context, *MsgLoadTest) (*MsgLoadTestResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) LoadTest(ctx context.Context, req *MsgLoadTest) (*MsgLoadTestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoadTest not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_LoadTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgLoadTest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).LoadTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.benchmark.v1.Msg/LoadTest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).LoadTest(ctx, req.(*MsgLoadTest)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.benchmark.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "LoadTest", + Handler: _Msg_LoadTest_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/benchmark/v1/tx.proto", +} + +func (m *MsgLoadTest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLoadTest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLoadTest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ops) > 0 { + for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ops[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Caller) > 0 { + i -= len(m.Caller) + copy(dAtA[i:], m.Caller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Caller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgLoadTestResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgLoadTestResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgLoadTestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalErrors != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TotalErrors)) + i-- + dAtA[i] = 0x10 + } + if m.TotalTime != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TotalTime)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgLoadTest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Caller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Ops) > 0 { + for _, e := range m.Ops { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgLoadTestResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalTime != 0 { + n += 1 + sovTx(uint64(m.TotalTime)) + } + if m.TotalErrors != 0 { + n += 1 + sovTx(uint64(m.TotalErrors)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgLoadTest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLoadTest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLoadTest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Caller", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Caller = append(m.Caller[:0], dAtA[iNdEx:postIndex]...) + if m.Caller == nil { + m.Caller = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ops = append(m.Ops, &Op{}) + if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgLoadTestResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgLoadTestResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgLoadTestResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalTime", wireType) + } + m.TotalTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalErrors", wireType) + } + m.TotalErrors = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalErrors |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From e4331b5236cf6534fb6aa2c3008e8134322934e1 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 09:43:28 -0600 Subject: [PATCH 02/27] build works --- scripts/init-simapp-v2.sh | 1 + simapp/app_config.go | 17 ++++++++ simapp/go.mod | 2 + simapp/v2/app_config.go | 4 +- simapp/v2/go.mod | 2 + tests/go.mod | 2 + x/benchmark/go.mod | 5 ++- x/benchmark/go.sum | 2 + x/benchmark/module/depinject.go | 12 +----- x/benchmark/module/keeper.go | 70 ++++++++++++--------------------- x/benchmark/module/module.go | 12 ++---- 11 files changed, 63 insertions(+), 66 deletions(-) diff --git a/scripts/init-simapp-v2.sh b/scripts/init-simapp-v2.sh index 7410b2174746..02fb379f8e2c 100755 --- a/scripts/init-simapp-v2.sh +++ b/scripts/init-simapp-v2.sh @@ -10,6 +10,7 @@ $SIMD_BIN config set client chain-id simapp-v2-chain $SIMD_BIN config set client keyring-backend test $SIMD_BIN config set client keyring-default-keyname alice $SIMD_BIN config set app rest.enable true +$SIMD_BIN config set app telemetry.prometheus-retention-time 600 $SIMD_BIN keys add alice --indiscreet $SIMD_BIN keys add bob --indiscreet $SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain diff --git a/simapp/app_config.go b/simapp/app_config.go index 33e11841e795..15a25faeb83a 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -12,6 +12,7 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" + benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" @@ -39,6 +40,7 @@ import ( _ "cosmossdk.io/x/bank/v2" // import for side-effects bankv2types "cosmossdk.io/x/bank/v2/types" bankmodulev2 "cosmossdk.io/x/bank/v2/types/module" + benchmark "cosmossdk.io/x/benchmark/module" _ "cosmossdk.io/x/circuit" // import for side-effects circuittypes "cosmossdk.io/x/circuit/types" _ "cosmossdk.io/x/consensus" // import for side-effects @@ -174,6 +176,7 @@ var ( circuittypes.ModuleName, pooltypes.ModuleName, epochstypes.ModuleName, + benchmark.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order @@ -296,6 +299,20 @@ var ( Name: bankv2types.ModuleName, Config: appconfig.WrapAny(&bankmodulev2.Module{}), }, + { + Name: benchmark.ModuleName, + Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ + GenesisParams: &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 2, + GenesisCount: 500_000, + KeyMean: 64, + KeyStdDev: 12, + ValueMean: 1024, + ValueStdDev: 256, + }, + }), + }, }, }) ) diff --git a/simapp/go.mod b/simapp/go.mod index 1c55eae3a989..e4321730eee6 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -51,6 +51,7 @@ require ( require ( cosmossdk.io/indexer/postgres v0.0.0-20241128094659-bd76b47e1d8b + cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 github.com/jackc/pgx/v5 v5.7.1 ) @@ -260,6 +261,7 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank + cosmossdk.io/x/benchmark => ../x/benchmark cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/consensus => ../x/consensus cosmossdk.io/x/distribution => ../x/distribution diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index 6e4b47f66b87..991ee07665f1 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -309,8 +309,8 @@ var ( Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 5, - GenesisCount: 20_000_000, + BucketCount: 2, + GenesisCount: 5_000_000, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index a42a48e4410f..a7dc2d656dcc 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -46,6 +46,7 @@ require ( cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 ) require ( @@ -259,6 +260,7 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ../../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../../x/authz cosmossdk.io/x/bank => ../../x/bank + cosmossdk.io/x/benchmark => ../../x/benchmark cosmossdk.io/x/circuit => ../../x/circuit cosmossdk.io/x/consensus => ../../x/consensus cosmossdk.io/x/distribution => ../../x/distribution diff --git a/tests/go.mod b/tests/go.mod index ef77ab0e0775..a538efa00f6d 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -74,6 +74,7 @@ require ( cosmossdk.io/indexer/postgres v0.1.0 // indirect cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -264,6 +265,7 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank + cosmossdk.io/x/benchmark => ../x/benchmark cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/consensus => ../x/consensus cosmossdk.io/x/distribution => ../x/distribution diff --git a/x/benchmark/go.mod b/x/benchmark/go.mod index 9d5aa209e00a..a7c9edf5447b 100644 --- a/x/benchmark/go.mod +++ b/x/benchmark/go.mod @@ -28,7 +28,9 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect @@ -129,11 +131,13 @@ require ( golang.org/x/arch v0.12.0 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.31.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.26.0 // indirect golang.org/x/text v0.20.0 // indirect + golang.org/x/tools v0.27.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect @@ -147,7 +151,6 @@ require ( replace ( cosmossdk.io/api => ../../api - cosmossdk.io/core => ../../core cosmossdk.io/x/bank => ../bank cosmossdk.io/x/staking => ../staking github.com/cosmos/cosmos-sdk => ../../ diff --git a/x/benchmark/go.sum b/x/benchmark/go.sum index d1a90e83d66c..2a2f0bf32043 100644 --- a/x/benchmark/go.sum +++ b/x/benchmark/go.sum @@ -6,6 +6,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b h1:MgU4EDOo/pXgepHCUFQFnIfUCxk/JO0AJGDTUQhhEhg= cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b/go.mod h1:uf12i1yKvzEIHt2ok7poNqFDQTb71O00RQLitSynmrg= +cosmossdk.io/core v1.0.0-alpha.6 h1:5ukC4JcQKmemLQXcAgu/QoOvJI50hpBkIIg4ZT2EN8E= +cosmossdk.io/core v1.0.0-alpha.6/go.mod h1:3u9cWq1FAVtiiCrDPpo4LhR+9V6k/ycSG4/Y/tREWCY= cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e h1:F+ScucYxwrrDJU8guJXQXpGhdpziYSbxW6HMP2wCNxs= cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e/go.mod h1:3YvVv9aJayjPhdX0DY1IMrGse4sR63hNBWx2VtDWjGQ= cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= diff --git a/x/benchmark/module/depinject.go b/x/benchmark/module/depinject.go index fbf824af5833..3b90ef4940ff 100644 --- a/x/benchmark/module/depinject.go +++ b/x/benchmark/module/depinject.go @@ -3,7 +3,6 @@ package module import ( "unsafe" - "cosmossdk.io/core/telemetry" "cosmossdk.io/depinject" modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" @@ -38,7 +37,6 @@ type Input struct { Cfg *modulev1.Module Registrar StoreKeyRegistrar `optional:"true"` StoreFactory store.KVStoreServiceFactory - Telemetry telemetry.Service } func ProvideModule( @@ -59,7 +57,7 @@ func ProvideModule( kvMap[sk] = kvService } - return NewAppModule(cfg.GenesisParams, storeKeys, kvMap, in.Logger, in.Telemetry), nil + return NewAppModule(cfg.GenesisParams, storeKeys, kvMap, in.Logger), nil } type KVServiceMap map[string]store.KVStoreService @@ -69,11 +67,3 @@ type KVServiceMap map[string]store.KVStoreService func unsafeStrToBytes(s string) []byte { return unsafe.Slice(unsafe.StringData(s), len(s)) // ref https://github.com/golang/go/issues/53003#issuecomment-1140276077 } - -// unsafeBytesToStr is meant to make a zero allocation conversion -// from []byte -> string to speed up operations, it is not meant -// to be used generally, but for a specific pattern to delete keys -// from a map. -func unsafeBytesToStr(b []byte) string { - return unsafe.String(unsafe.SliceData(b), len(b)) -} diff --git a/x/benchmark/module/keeper.go b/x/benchmark/module/keeper.go index afefa72f18de..27083cadb229 100644 --- a/x/benchmark/module/keeper.go +++ b/x/benchmark/module/keeper.go @@ -3,52 +3,43 @@ package module import ( "context" "fmt" - "sync" - "time" - "cosmossdk.io/core/telemetry" + "github.com/cosmos/cosmos-sdk/telemetry" + "cosmossdk.io/x/benchmark" gen "cosmossdk.io/x/benchmark/generator" ) var ( - _ benchmark.MsgServer = &Keeper{} - once sync.Once + _ benchmark.MsgServer = &Keeper{} + metricOpKey = []string{"benchmark", "op"} + metricGetKey = append(metricOpKey, "get") + metricDelete = append(metricOpKey, "delete") + metricInsertKey = append(metricOpKey, "insert") + metricUpdateKey = append(metricOpKey, "update") + metricTotalKey = []string{"benchmark", "total"} + metricMissKey = []string{"benchmark", "miss"} ) type Keeper struct { - kvServiceMap KVServiceMap - telemetryService telemetry.Service - validate bool - errExit bool - - metricOpKey []string - metricTotalKey []string - metricMissKey []string + kvServiceMap KVServiceMap + validate bool + errExit bool } -func NewKeeper(kvMap KVServiceMap, telemetryService telemetry.Service) *Keeper { +func NewKeeper(kvMap KVServiceMap) *Keeper { k := &Keeper{ - kvServiceMap: kvMap, - telemetryService: telemetryService, - validate: false, - errExit: false, - metricOpKey: []string{"benchmark", "op"}, - metricTotalKey: []string{"benchmark", "total"}, - metricMissKey: []string{"benchmark", "miss"}, + kvServiceMap: kvMap, + validate: false, + errExit: false, } - once.Do(func() { - telemetryService.RegisterHistogram(k.metricOpKey, telemetry.Buckets.StoreOpsOrder, "op") - telemetryService.RegisterCounter(k.metricMissKey, "op") - telemetryService.RegisterCounter(k.metricTotalKey) - }) return k } func (k *Keeper) LoadTest(ctx context.Context, msg *benchmark.MsgLoadTest) (*benchmark.MsgLoadTestResponse, error) { res := &benchmark.MsgLoadTestResponse{} for _, op := range msg.Ops { - k.telemetryService.IncrCounter(k.metricTotalKey, 1) + telemetry.IncrCounter(1, metricTotalKey...) err := k.executeOp(ctx, op) if err != nil { return res, err @@ -57,32 +48,23 @@ func (k *Keeper) LoadTest(ctx context.Context, msg *benchmark.MsgLoadTest) (*ben return res, nil } -func (k *Keeper) measureSince(since time.Time, opType string) { - k.telemetryService.MeasureSince(since, k.metricOpKey, telemetry.Label{Name: "op", Value: opType}) -} - -func (k *Keeper) countMiss(opType string) { - k.telemetryService.IncrCounter(k.metricMissKey, 1, telemetry.Label{Name: "op", Value: opType}) -} - func (k *Keeper) executeOp(ctx context.Context, op *benchmark.Op) error { svc, ok := k.kvServiceMap[op.Actor] key := gen.Bytes(op.Seed, op.KeyLength) if !ok { return fmt.Errorf("actor %s not found", op.Actor) } - start := time.Now() kv := svc.OpenKVStore(ctx) switch { case op.Delete: - defer k.measureSince(start, "delete") + telemetry.IncrCounter(1, metricDelete...) if k.validate { exists, err := kv.Has(key) if err != nil { return err } if !exists { - k.countMiss("delete") + telemetry.IncrCounter(1, metricMissKey...) if k.errExit { return fmt.Errorf("key %d not found", op.Seed) } @@ -90,18 +72,18 @@ func (k *Keeper) executeOp(ctx context.Context, op *benchmark.Op) error { } return kv.Delete(key) case op.ValueLength > 0: - opType := "insert" + metricKey := metricInsertKey if op.Exists { - opType = "update" + metricKey = metricUpdateKey } - defer k.measureSince(start, opType) + telemetry.IncrCounter(1, metricKey...) if k.validate { exists, err := kv.Has(key) if err != nil { return err } if exists != op.Exists { - k.countMiss(opType) + telemetry.IncrCounter(1, metricMissKey...) if k.errExit { return fmt.Errorf("key %d exists=%t, expected=%t", op.Seed, exists, op.Exists) } @@ -112,11 +94,11 @@ func (k *Keeper) executeOp(ctx context.Context, op *benchmark.Op) error { case op.Iterations > 0: return fmt.Errorf("iterator not implemented") case op.ValueLength == 0: - defer k.measureSince(start, "get") + telemetry.IncrCounter(1, metricGetKey...) v, err := kv.Get(key) if v == nil { // always count a miss on GET since it requires no extra I/O - k.countMiss("get") + telemetry.IncrCounter(1, metricMissKey...) if k.errExit { return fmt.Errorf("key %s not found", key) } diff --git a/x/benchmark/module/module.go b/x/benchmark/module/module.go index 6a17232db62b..e07e06ff04ac 100644 --- a/x/benchmark/module/module.go +++ b/x/benchmark/module/module.go @@ -5,19 +5,16 @@ import ( "encoding/json" "fmt" - "cosmossdk.io/core/telemetry" - "cosmossdk.io/core/transaction" - - "cosmossdk.io/core/registry" "github.com/cosmos/cosmos-sdk/types/msgservice" - "github.com/spf13/cobra" - "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "google.golang.org/grpc" modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" _ "cosmossdk.io/api/cosmos/benchmark/v1" // for some reason this is required to make msg server registration work "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/registry" + "cosmossdk.io/core/transaction" "cosmossdk.io/log" "cosmossdk.io/x/benchmark" "cosmossdk.io/x/benchmark/client/cli" @@ -45,11 +42,10 @@ func NewAppModule( storeKeys []string, kvMap KVServiceMap, logger log.Logger, - telemetryService telemetry.Service, ) *AppModule { return &AppModule{ genesisParams: genesisParams, - keeper: NewKeeper(kvMap, telemetryService), + keeper: NewKeeper(kvMap), storeKeys: storeKeys, log: logger, } From 9a846dc01161b45a81895c08ecc6bac0e6d64eb7 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 10:24:22 -0600 Subject: [PATCH 03/27] fix import --- x/benchmark/module/keeper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/benchmark/module/keeper.go b/x/benchmark/module/keeper.go index 27083cadb229..d1349cbb0c66 100644 --- a/x/benchmark/module/keeper.go +++ b/x/benchmark/module/keeper.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/cosmos/cosmos-sdk/telemetry" - "cosmossdk.io/x/benchmark" gen "cosmossdk.io/x/benchmark/generator" + + "github.com/cosmos/cosmos-sdk/telemetry" ) var ( From e6053811e9d4c36ef17a2f0de0e49c73f8dbd3ec Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 10:34:33 -0600 Subject: [PATCH 04/27] add provider --- runtime/module.go | 9 +++++++++ simapp/app_config.go | 4 ++-- simapp/v2/app_config.go | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/runtime/module.go b/runtime/module.go index 3cf7be226421..488bc6c93b8e 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -96,6 +96,7 @@ func init() { codec.ProvideProtoCodec, codec.ProvideAddressCodec, ProvideKVStoreKey, + ProvideKVStoreFactory, ProvideTransientStoreKey, ProvideMemoryStoreKey, ProvideGenesisTxHandler, @@ -296,3 +297,11 @@ func ProvideTransientStoreService( func ProvideCometService() comet.Service { return NewContextAwareCometInfoService() } + +func ProvideKVStoreFactory(app *AppBuilder) store.KVStoreServiceFactory { + return func(key []byte) store.KVStoreService { + sk := storetypes.NewKVStoreKey(string(key)) + registerStoreKey(app, sk) + return kvStoreService{key: sk} + } +} diff --git a/simapp/app_config.go b/simapp/app_config.go index 15a25faeb83a..9e020e1d0a81 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -304,8 +304,8 @@ var ( Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 2, - GenesisCount: 500_000, + BucketCount: 1, + GenesisCount: 100, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index 991ee07665f1..f617f40fae4c 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -309,8 +309,8 @@ var ( Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 2, - GenesisCount: 5_000_000, + BucketCount: 1, + GenesisCount: 100, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, From 747802cadc0f7ab0a45f2b492bc47158bf22604b Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 11:02:51 -0600 Subject: [PATCH 05/27] do not test migrations for x/benchmark --- simapp/app_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simapp/app_test.go b/simapp/app_test.go index 3553b47edf37..e43eebcda965 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -194,6 +194,17 @@ func TestRunMigrations(t *testing.T) { } } + app.ModuleManager.OrderMigrations = module.DefaultMigrationsOrder(app.ModuleManager.ModuleNames()) + // remove benchmark module from migrations list + var benchmarkIdx int + for i, name := range app.ModuleManager.OrderMigrations { + if name == "benchmark" { + benchmarkIdx = i + break + } + } + app.ModuleManager.OrderMigrations = append(app.ModuleManager.OrderMigrations[:benchmarkIdx], app.ModuleManager.OrderMigrations[benchmarkIdx+1:]...) + // Run migrations only for bank. That's why we put the initial // version for bank as 1, and for all other modules, we put as // their latest ConsensusVersion. From c48172163bd0f103d29659c5a191afea8de4adbc Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 11:21:56 -0600 Subject: [PATCH 06/27] cleaner filter --- simapp/app_test.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/simapp/app_test.go b/simapp/app_test.go index e43eebcda965..7add872cbfc6 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -194,16 +194,15 @@ func TestRunMigrations(t *testing.T) { } } - app.ModuleManager.OrderMigrations = module.DefaultMigrationsOrder(app.ModuleManager.ModuleNames()) - // remove benchmark module from migrations list - var benchmarkIdx int - for i, name := range app.ModuleManager.OrderMigrations { - if name == "benchmark" { - benchmarkIdx = i - break + orderMigrations := module.DefaultMigrationsOrder(app.ModuleManager.ModuleNames()) + // Filter out benchmark module from migrations list + filteredMigrations := make([]string, 0, len(app.ModuleManager.OrderMigrations)) + for _, name := range orderMigrations { + if name != "benchmark" { + filteredMigrations = append(filteredMigrations, name) } } - app.ModuleManager.OrderMigrations = append(app.ModuleManager.OrderMigrations[:benchmarkIdx], app.ModuleManager.OrderMigrations[benchmarkIdx+1:]...) + app.ModuleManager.OrderMigrations = filteredMigrations // Run migrations only for bank. That's why we put the initial // version for bank as 1, and for all other modules, we put as From 4b0dbdc6b57f572350e4d710a28cfe2d9821452a Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 13:07:02 -0600 Subject: [PATCH 07/27] Add README and CHANGELOG --- x/benchmark/CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ x/benchmark/README.md | 24 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 x/benchmark/CHANGELOG.md create mode 100644 x/benchmark/README.md diff --git a/x/benchmark/CHANGELOG.md b/x/benchmark/CHANGELOG.md new file mode 100644 index 000000000000..f1417dde2840 --- /dev/null +++ b/x/benchmark/CHANGELOG.md @@ -0,0 +1,30 @@ + + +# Changelog + +## [Unreleased] + +### Features + +* [#22778](https://github.com/cosmos/cosmos-sdk/pull/22778) - Initial commit diff --git a/x/benchmark/README.md b/x/benchmark/README.md new file mode 100644 index 000000000000..465a12d9c580 --- /dev/null +++ b/x/benchmark/README.md @@ -0,0 +1,24 @@ +# x/benchmark + +A benchmark module to test chain and storage performance. It can be used to holistically test +the end to end performance of a node. Given an initial configuration x/benchmark provides: + +* A possibly enormous sequence of key-value sets in InitGenesis distributed across n storekeys, + e.g. 20M keys across 5 store keys +* A client which syncs to genesis state then deterministically generates txs which contain a + configurable sequence of get, insert, update & delete operations +* A keeper which processes the above transactions and emits some telemetry data about them. + +Client invocation looks like: + +```bash +simdv2 tx benchmark load-test --from bob --yes --ops 1000 --pause 10 -v +``` + +On exit it dumps the generator state so that running again should still be in sync. It assumes +that any transaction accepted by the network was processed, which may not be the case, so miss +rate will probably increase over time. This isn't really a problem for tests. + +Obviously this module is built to DOS a node by testing the upper bounds of chain performance; +when testing gas limits should be increased. It should not be included in chains by default but +is enabled in simapp for testing. \ No newline at end of file From ca4740396024f9ab4c8a9252df2674282a3e59bc Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 13:12:44 -0600 Subject: [PATCH 08/27] mv x/benchmark -> tools/ --- simapp/app_config.go | 2 +- simapp/go.mod | 4 +-- simapp/v2/app_config.go | 2 +- simapp/v2/go.mod | 4 +-- {x => tools}/benchmark/CHANGELOG.md | 0 {x => tools}/benchmark/README.md | 0 {x => tools}/benchmark/benchmark.pb.go | 0 {x => tools}/benchmark/client/cli/tx.go | 4 +-- {x => tools}/benchmark/generator/gen.go | 2 +- {x => tools}/benchmark/generator/gen_test.go | 0 {x => tools}/benchmark/go.mod | 24 ++++++------- {x => tools}/benchmark/go.sum | 36 +++++++++---------- {x => tools}/benchmark/module/depinject.go | 2 +- {x => tools}/benchmark/module/keeper.go | 4 +-- {x => tools}/benchmark/module/module.go | 6 ++-- .../benchmark/proto/buf.gen.gogo.yaml | 0 .../benchmark/proto/buf.gen.pulsar.yaml | 0 {x => tools}/benchmark/proto/buf.lock | 0 {x => tools}/benchmark/proto/buf.yaml | 0 .../cosmos/benchmark/module/v1/module.proto | 0 .../proto/cosmos/benchmark/v1/benchmark.proto | 0 .../proto/cosmos/benchmark/v1/tx.proto | 0 {x => tools}/benchmark/tx.pb.go | 0 23 files changed, 45 insertions(+), 45 deletions(-) rename {x => tools}/benchmark/CHANGELOG.md (100%) rename {x => tools}/benchmark/README.md (100%) rename {x => tools}/benchmark/benchmark.pb.go (100%) rename {x => tools}/benchmark/client/cli/tx.go (98%) rename {x => tools}/benchmark/generator/gen.go (99%) rename {x => tools}/benchmark/generator/gen_test.go (100%) rename {x => tools}/benchmark/go.mod (93%) rename {x => tools}/benchmark/go.sum (97%) rename {x => tools}/benchmark/module/depinject.go (97%) rename {x => tools}/benchmark/module/keeper.go (97%) rename {x => tools}/benchmark/module/module.go (96%) rename {x => tools}/benchmark/proto/buf.gen.gogo.yaml (100%) rename {x => tools}/benchmark/proto/buf.gen.pulsar.yaml (100%) rename {x => tools}/benchmark/proto/buf.lock (100%) rename {x => tools}/benchmark/proto/buf.yaml (100%) rename {x => tools}/benchmark/proto/cosmos/benchmark/module/v1/module.proto (100%) rename {x => tools}/benchmark/proto/cosmos/benchmark/v1/benchmark.proto (100%) rename {x => tools}/benchmark/proto/cosmos/benchmark/v1/tx.proto (100%) rename {x => tools}/benchmark/tx.pb.go (100%) diff --git a/simapp/app_config.go b/simapp/app_config.go index 9e020e1d0a81..45846b673aba 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -32,6 +32,7 @@ import ( validatemodulev1 "cosmossdk.io/api/cosmos/validate/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" + benchmark "cosmossdk.io/tools/benchmark/module" "cosmossdk.io/x/accounts" "cosmossdk.io/x/authz" _ "cosmossdk.io/x/authz/module" // import for side-effects @@ -40,7 +41,6 @@ import ( _ "cosmossdk.io/x/bank/v2" // import for side-effects bankv2types "cosmossdk.io/x/bank/v2/types" bankmodulev2 "cosmossdk.io/x/bank/v2/types/module" - benchmark "cosmossdk.io/x/benchmark/module" _ "cosmossdk.io/x/circuit" // import for side-effects circuittypes "cosmossdk.io/x/circuit/types" _ "cosmossdk.io/x/consensus" // import for side-effects diff --git a/simapp/go.mod b/simapp/go.mod index 6aaf00a9f2f3..abc32935902c 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -51,7 +51,7 @@ require ( require ( cosmossdk.io/indexer/postgres v0.0.0-20241128094659-bd76b47e1d8b - cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 github.com/jackc/pgx/v5 v5.7.1 ) @@ -254,6 +254,7 @@ replace ( cosmossdk.io/client/v2 => ../client/v2 cosmossdk.io/collections => ../collections cosmossdk.io/store => ../store + cosmossdk.io/tools/benchmark => ../tools/benchmark cosmossdk.io/tools/confix => ../tools/confix cosmossdk.io/x/accounts => ../x/accounts cosmossdk.io/x/accounts/defaults/base => ../x/accounts/defaults/base @@ -261,7 +262,6 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank - cosmossdk.io/x/benchmark => ../x/benchmark cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/consensus => ../x/consensus cosmossdk.io/x/distribution => ../x/distribution diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index f617f40fae4c..b21565822ee0 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -32,6 +32,7 @@ import ( validatemodulev1 "cosmossdk.io/api/cosmos/validate/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" + benchmark "cosmossdk.io/tools/benchmark/module" "cosmossdk.io/x/accounts" "cosmossdk.io/x/authz" _ "cosmossdk.io/x/authz/module" // import for side-effects @@ -40,7 +41,6 @@ import ( _ "cosmossdk.io/x/bank/v2" // import for side-effects bankv2types "cosmossdk.io/x/bank/v2/types" bankmodulev2 "cosmossdk.io/x/bank/v2/types/module" - benchmark "cosmossdk.io/x/benchmark/module" _ "cosmossdk.io/x/circuit" // import for side-effects circuittypes "cosmossdk.io/x/circuit/types" _ "cosmossdk.io/x/consensus" // import for side-effects diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 7fcaf8fe5a4e..2c3d84a87a0c 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -43,10 +43,10 @@ require ( ) require ( + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 ) require ( @@ -253,6 +253,7 @@ require ( // SimApp on main always tests the latest extracted SDK modules importing the sdk replace ( cosmossdk.io/client/v2 => ../../client/v2 + cosmossdk.io/tools/benchmark => ../../tools/benchmark cosmossdk.io/tools/confix => ../../tools/confix cosmossdk.io/x/accounts => ../../x/accounts cosmossdk.io/x/accounts/defaults/base => ../../x/accounts/defaults/base @@ -260,7 +261,6 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ../../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../../x/authz cosmossdk.io/x/bank => ../../x/bank - cosmossdk.io/x/benchmark => ../../x/benchmark cosmossdk.io/x/circuit => ../../x/circuit cosmossdk.io/x/consensus => ../../x/consensus cosmossdk.io/x/distribution => ../../x/distribution diff --git a/x/benchmark/CHANGELOG.md b/tools/benchmark/CHANGELOG.md similarity index 100% rename from x/benchmark/CHANGELOG.md rename to tools/benchmark/CHANGELOG.md diff --git a/x/benchmark/README.md b/tools/benchmark/README.md similarity index 100% rename from x/benchmark/README.md rename to tools/benchmark/README.md diff --git a/x/benchmark/benchmark.pb.go b/tools/benchmark/benchmark.pb.go similarity index 100% rename from x/benchmark/benchmark.pb.go rename to tools/benchmark/benchmark.pb.go diff --git a/x/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go similarity index 98% rename from x/benchmark/client/cli/tx.go rename to tools/benchmark/client/cli/tx.go index 640728473fc0..b92ca0c7dcd3 100644 --- a/x/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -9,8 +9,8 @@ import ( "time" modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" - "cosmossdk.io/x/benchmark" - gen "cosmossdk.io/x/benchmark/generator" + "cosmossdk.io/tools/benchmark" + gen "cosmossdk.io/tools/benchmark/generator" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/x/benchmark/generator/gen.go b/tools/benchmark/generator/gen.go similarity index 99% rename from x/benchmark/generator/gen.go rename to tools/benchmark/generator/gen.go index 90fc9855abcb..1d473781cbab 100644 --- a/x/benchmark/generator/gen.go +++ b/tools/benchmark/generator/gen.go @@ -13,7 +13,7 @@ import ( "github.com/cespare/xxhash/v2" module "cosmossdk.io/api/cosmos/benchmark/module/v1" - "cosmossdk.io/x/benchmark" + "cosmossdk.io/tools/benchmark" ) type Options struct { diff --git a/x/benchmark/generator/gen_test.go b/tools/benchmark/generator/gen_test.go similarity index 100% rename from x/benchmark/generator/gen_test.go rename to tools/benchmark/generator/gen_test.go diff --git a/x/benchmark/go.mod b/tools/benchmark/go.mod similarity index 93% rename from x/benchmark/go.mod rename to tools/benchmark/go.mod index a7c9edf5447b..8af851297594 100644 --- a/x/benchmark/go.mod +++ b/tools/benchmark/go.mod @@ -1,4 +1,4 @@ -module cosmossdk.io/x/benchmark +module cosmossdk.io/tools/benchmark go 1.23.2 @@ -13,7 +13,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 - google.golang.org/grpc v1.68.0 + google.golang.org/grpc v1.68.1 ) require ( @@ -102,7 +102,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.60.1 // indirect + github.com/prometheus/common v0.61.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -129,18 +129,18 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.12.0 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.30.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.32.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.27.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -151,7 +151,7 @@ require ( replace ( cosmossdk.io/api => ../../api - cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/staking => ../staking + cosmossdk.io/x/bank => ../../x/bank + cosmossdk.io/x/staking => ../../x/staking github.com/cosmos/cosmos-sdk => ../../ ) diff --git a/x/benchmark/go.sum b/tools/benchmark/go.sum similarity index 97% rename from x/benchmark/go.sum rename to tools/benchmark/go.sum index 2a2f0bf32043..91457b7e51b6 100644 --- a/x/benchmark/go.sum +++ b/tools/benchmark/go.sum @@ -368,8 +368,8 @@ github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= -github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= +github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= +github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -463,8 +463,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= +golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= @@ -493,8 +493,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -504,8 +504,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -530,18 +530,18 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -569,16 +569,16 @@ google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUE google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/benchmark/module/depinject.go b/tools/benchmark/module/depinject.go similarity index 97% rename from x/benchmark/module/depinject.go rename to tools/benchmark/module/depinject.go index 3b90ef4940ff..ffb9b653aa28 100644 --- a/x/benchmark/module/depinject.go +++ b/tools/benchmark/module/depinject.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/depinject/appconfig" "cosmossdk.io/log" - gen "cosmossdk.io/x/benchmark/generator" + gen "cosmossdk.io/tools/benchmark/generator" ) const ModuleName = "benchmark" diff --git a/x/benchmark/module/keeper.go b/tools/benchmark/module/keeper.go similarity index 97% rename from x/benchmark/module/keeper.go rename to tools/benchmark/module/keeper.go index d1349cbb0c66..e5c62543e3da 100644 --- a/x/benchmark/module/keeper.go +++ b/tools/benchmark/module/keeper.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "cosmossdk.io/x/benchmark" - gen "cosmossdk.io/x/benchmark/generator" + "cosmossdk.io/tools/benchmark" + gen "cosmossdk.io/tools/benchmark/generator" "github.com/cosmos/cosmos-sdk/telemetry" ) diff --git a/x/benchmark/module/module.go b/tools/benchmark/module/module.go similarity index 96% rename from x/benchmark/module/module.go rename to tools/benchmark/module/module.go index e07e06ff04ac..dfe1423b2d7b 100644 --- a/x/benchmark/module/module.go +++ b/tools/benchmark/module/module.go @@ -16,9 +16,9 @@ import ( "cosmossdk.io/core/registry" "cosmossdk.io/core/transaction" "cosmossdk.io/log" - "cosmossdk.io/x/benchmark" - "cosmossdk.io/x/benchmark/client/cli" - gen "cosmossdk.io/x/benchmark/generator" + "cosmossdk.io/tools/benchmark" + "cosmossdk.io/tools/benchmark/client/cli" + gen "cosmossdk.io/tools/benchmark/generator" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/x/benchmark/proto/buf.gen.gogo.yaml b/tools/benchmark/proto/buf.gen.gogo.yaml similarity index 100% rename from x/benchmark/proto/buf.gen.gogo.yaml rename to tools/benchmark/proto/buf.gen.gogo.yaml diff --git a/x/benchmark/proto/buf.gen.pulsar.yaml b/tools/benchmark/proto/buf.gen.pulsar.yaml similarity index 100% rename from x/benchmark/proto/buf.gen.pulsar.yaml rename to tools/benchmark/proto/buf.gen.pulsar.yaml diff --git a/x/benchmark/proto/buf.lock b/tools/benchmark/proto/buf.lock similarity index 100% rename from x/benchmark/proto/buf.lock rename to tools/benchmark/proto/buf.lock diff --git a/x/benchmark/proto/buf.yaml b/tools/benchmark/proto/buf.yaml similarity index 100% rename from x/benchmark/proto/buf.yaml rename to tools/benchmark/proto/buf.yaml diff --git a/x/benchmark/proto/cosmos/benchmark/module/v1/module.proto b/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto similarity index 100% rename from x/benchmark/proto/cosmos/benchmark/module/v1/module.proto rename to tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto diff --git a/x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto b/tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto similarity index 100% rename from x/benchmark/proto/cosmos/benchmark/v1/benchmark.proto rename to tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto diff --git a/x/benchmark/proto/cosmos/benchmark/v1/tx.proto b/tools/benchmark/proto/cosmos/benchmark/v1/tx.proto similarity index 100% rename from x/benchmark/proto/cosmos/benchmark/v1/tx.proto rename to tools/benchmark/proto/cosmos/benchmark/v1/tx.proto diff --git a/x/benchmark/tx.pb.go b/tools/benchmark/tx.pb.go similarity index 100% rename from x/benchmark/tx.pb.go rename to tools/benchmark/tx.pb.go From 554408d351fa3b984a1879c5a7b14db739ad46e3 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 13:22:39 -0600 Subject: [PATCH 09/27] fix proto gen --- .../benchmark/module/v1/module.pulsar.go | 97 ++++++++++--------- api/cosmos/benchmark/v1/tx.pulsar.go | 60 ++++++------ tools/benchmark/benchmark.pb.go | 34 +++---- .../cosmos/benchmark/module/v1/module.proto | 2 +- .../proto/cosmos/benchmark/v1/benchmark.proto | 2 +- .../proto/cosmos/benchmark/v1/tx.proto | 4 +- tools/benchmark/tx.pb.go | 29 +++--- 7 files changed, 115 insertions(+), 113 deletions(-) diff --git a/api/cosmos/benchmark/module/v1/module.pulsar.go b/api/cosmos/benchmark/module/v1/module.pulsar.go index d081bba66b64..6026b5d30281 100644 --- a/api/cosmos/benchmark/module/v1/module.pulsar.go +++ b/api/cosmos/benchmark/module/v1/module.pulsar.go @@ -1480,54 +1480,55 @@ var file_cosmos_benchmark_module_v1_module_proto_rawDesc = []byte{ 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x20, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x1a, 0x0a, 0x18, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x62, 0x65, - 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xf9, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x12, - 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x65, 0x61, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4d, 0x65, 0x61, 0x6e, 0x12, 0x1e, 0x0a, - 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, 0x12, 0x1d, 0x0a, - 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x65, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x65, 0x61, 0x6e, 0x12, 0x22, 0x0a, 0x0d, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, - 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, - 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x69, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x67, 0x65, 0x74, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x09, 0x67, 0x65, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x23, - 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x42, 0xee, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, - 0x4d, 0xaa, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, - 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, - 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, - 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x52, 0x0a, 0x0e, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x24, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x1e, 0x0a, 0x1c, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x74, 0x6f, 0x6f, + 0x6c, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xf9, 0x02, 0x0a, + 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x73, 0x65, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6d, + 0x65, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4d, 0x65, + 0x61, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, 0x65, + 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x53, 0x74, 0x64, 0x44, + 0x65, 0x76, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x65, 0x61, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x65, 0x61, + 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x74, 0x64, 0x5f, 0x64, + 0x65, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x53, + 0x74, 0x64, 0x44, 0x65, 0x76, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x65, 0x74, 0x5f, 0x77, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x67, 0x65, 0x74, 0x57, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x77, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0xee, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, + 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, + 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, + 0x61, 0x72, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/cosmos/benchmark/v1/tx.pulsar.go b/api/cosmos/benchmark/v1/tx.pulsar.go index 290c280def98..b119e5c8e6d3 100644 --- a/api/cosmos/benchmark/v1/tx.pulsar.go +++ b/api/cosmos/benchmark/v1/tx.pulsar.go @@ -1138,40 +1138,40 @@ var file_cosmos_benchmark_v1_tx_proto_rawDesc = []byte{ 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x70, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, - 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x22, 0x57, - 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x32, 0x64, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x56, - 0x0a, 0x08, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, - 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, - 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x65, - 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x65, 0x6e, 0x63, 0x68, - 0x6d, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, 0xaa, 0x02, 0x13, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, - 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4f, 0x70, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x3a, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x63, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, + 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, + 0x73, 0x74, 0x22, 0x57, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x32, 0x64, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x56, 0x0a, 0x08, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x20, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, + 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x65, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, + 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x62, + 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x58, + 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, + 0x61, 0x72, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, 0x72, 0x6b, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x6d, 0x61, + 0x72, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/tools/benchmark/benchmark.pb.go b/tools/benchmark/benchmark.pb.go index 3ed322d3beca..7405ba9a9723 100644 --- a/tools/benchmark/benchmark.pb.go +++ b/tools/benchmark/benchmark.pb.go @@ -124,23 +124,23 @@ func init() { } var fileDescriptor_dca1624628907df9 = []byte{ - // 245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x73, 0x25, 0x0d, 0xf4, 0x80, 0xc5, 0x20, 0xe4, 0x05, 0x2b, 0xc0, 0x92, 0x29, 0x51, - 0xe1, 0x0d, 0x98, 0x91, 0x90, 0x32, 0xb2, 0xa0, 0x34, 0x39, 0xd1, 0xc8, 0x69, 0x5c, 0xd9, 0x26, - 0x6a, 0xdf, 0x82, 0x47, 0x62, 0x64, 0xec, 0xc8, 0x88, 0x92, 0x17, 0x41, 0xd8, 0x45, 0xe9, 0x76, - 0xdf, 0xa7, 0x6f, 0xb9, 0x1f, 0xef, 0x4a, 0x65, 0x56, 0xca, 0x64, 0x0b, 0x6a, 0xcb, 0xe5, 0xaa, - 0xd0, 0x32, 0xeb, 0xe6, 0x23, 0xa4, 0x6b, 0xad, 0xac, 0x62, 0x17, 0x3e, 0x4a, 0x47, 0xdf, 0xcd, - 0x6f, 0x3f, 0x01, 0x27, 0xcf, 0x6b, 0xc6, 0x30, 0x34, 0x44, 0x15, 0x87, 0x18, 0x92, 0x30, 0x77, - 0x37, 0xbb, 0xc4, 0x69, 0x51, 0x5a, 0xa5, 0xf9, 0x24, 0x86, 0x64, 0x96, 0x7b, 0x60, 0xd7, 0x88, - 0x92, 0xb6, 0xaf, 0x0d, 0xb5, 0x6f, 0x76, 0xc9, 0x8f, 0x5c, 0x3f, 0x93, 0xb4, 0x7d, 0x72, 0x82, - 0xdd, 0xe0, 0x59, 0x57, 0x34, 0xef, 0xf4, 0x1f, 0x84, 0x2e, 0x38, 0x75, 0x6e, 0x9f, 0x08, 0xc4, - 0xda, 0x92, 0x2e, 0x6c, 0xad, 0x5a, 0xc3, 0xa7, 0x31, 0x24, 0xe7, 0xf9, 0x81, 0x61, 0x57, 0x18, - 0x55, 0xd4, 0x90, 0x25, 0x1e, 0xc5, 0x90, 0x9c, 0xe4, 0x7b, 0xfa, 0xf3, 0xb4, 0xa9, 0x8d, 0x35, - 0xfc, 0xd8, 0x7b, 0x4f, 0x8f, 0xf7, 0x5f, 0xbd, 0x80, 0x5d, 0x2f, 0xe0, 0xa7, 0x17, 0xf0, 0x31, - 0x88, 0x60, 0x37, 0x88, 0xe0, 0x7b, 0x10, 0xc1, 0x0b, 0xf7, 0x1f, 0x9b, 0x4a, 0xa6, 0xb5, 0xca, - 0x36, 0xe3, 0x22, 0x8b, 0xc8, 0x4d, 0xf2, 0xf0, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x81, 0x0e, 0xb3, - 0x00, 0x39, 0x01, 0x00, 0x00, + // 249 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0x84, 0x40, + 0x10, 0x86, 0x99, 0x93, 0x43, 0x6f, 0xd4, 0x66, 0x35, 0x66, 0x0b, 0xdd, 0xa0, 0x36, 0x54, 0x90, + 0x8b, 0x89, 0x0f, 0x60, 0x6d, 0x62, 0x42, 0x69, 0x63, 0x38, 0x98, 0x78, 0x04, 0x8e, 0xb9, 0xb0, + 0x2b, 0xf1, 0xde, 0xc2, 0x47, 0xb2, 0xb4, 0xbc, 0xd2, 0xd2, 0xc0, 0x8b, 0x18, 0x77, 0xcf, 0x1c, + 0xdd, 0x7c, 0x5f, 0xbe, 0x66, 0x7e, 0xbc, 0xcd, 0x59, 0xaf, 0x58, 0x27, 0x0b, 0x6a, 0xf2, 0xe5, + 0x2a, 0x6b, 0xab, 0xa4, 0x9b, 0xef, 0x21, 0x5e, 0xb7, 0x6c, 0x58, 0x9c, 0xb9, 0x28, 0xde, 0xfb, + 0x6e, 0x7e, 0xf3, 0x09, 0x38, 0x79, 0x5a, 0x0b, 0x81, 0xbe, 0x26, 0x2a, 0x24, 0x84, 0x10, 0xf9, + 0xa9, 0xbd, 0xc5, 0x39, 0x4e, 0xb3, 0xdc, 0x70, 0x2b, 0x27, 0x21, 0x44, 0xb3, 0xd4, 0x81, 0xb8, + 0x42, 0xac, 0x68, 0xf3, 0x52, 0x53, 0xf3, 0x6a, 0x96, 0xf2, 0xc0, 0xf6, 0xb3, 0x8a, 0x36, 0x8f, + 0x56, 0x88, 0x6b, 0x3c, 0xe9, 0xb2, 0xfa, 0x8d, 0xfe, 0x03, 0xdf, 0x06, 0xc7, 0xd6, 0xed, 0x12, + 0x85, 0x58, 0x1a, 0x6a, 0x33, 0x53, 0x72, 0xa3, 0xe5, 0x34, 0x84, 0xe8, 0x34, 0x1d, 0x19, 0x71, + 0x81, 0x41, 0x41, 0x35, 0x19, 0x92, 0x41, 0x08, 0xd1, 0x51, 0xba, 0xa3, 0x3f, 0x4f, 0xef, 0xa5, + 0x36, 0x5a, 0x1e, 0x3a, 0xef, 0xe8, 0xe1, 0xfe, 0xab, 0x57, 0xb0, 0xed, 0x15, 0xfc, 0xf4, 0x0a, + 0x3e, 0x06, 0xe5, 0x6d, 0x07, 0xe5, 0x7d, 0x0f, 0xca, 0x7b, 0xbe, 0x74, 0x1f, 0xeb, 0xa2, 0x8a, + 0x4b, 0x4e, 0x0c, 0x73, 0x3d, 0x9a, 0x68, 0x11, 0xd8, 0x59, 0xee, 0x7e, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x76, 0x0b, 0x27, 0x18, 0x3d, 0x01, 0x00, 0x00, } func (m *Op) Marshal() (dAtA []byte, err error) { diff --git a/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto b/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto index f0d7ddd44792..2e22994cdf9b 100644 --- a/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto +++ b/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto @@ -7,7 +7,7 @@ import "cosmos/app/v1alpha1/module.proto"; // Module is the config object of the benchmark module. message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "cosmossdk.io/x/benchmark" + go_import: "cosmossdk.io/tools/benchmark" }; GeneratorParams genesis_params = 1; diff --git a/tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto b/tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto index 0bad19a1c1b1..db77c229fe34 100644 --- a/tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto +++ b/tools/benchmark/proto/cosmos/benchmark/v1/benchmark.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package cosmos.benchmark.v1; -option go_package = "cosmossdk.io/x/benchmark"; +option go_package = "cosmossdk.io/tools/benchmark"; // Op is a message describing a benchmark operation. message Op { diff --git a/tools/benchmark/proto/cosmos/benchmark/v1/tx.proto b/tools/benchmark/proto/cosmos/benchmark/v1/tx.proto index dfedeb64bd72..50c2cb1a7b6d 100644 --- a/tools/benchmark/proto/cosmos/benchmark/v1/tx.proto +++ b/tools/benchmark/proto/cosmos/benchmark/v1/tx.proto @@ -6,12 +6,12 @@ import "cosmos/benchmark/v1/benchmark.proto"; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; -option go_package = "cosmossdk.io/x/benchmark"; +option go_package = "cosmossdk.io/tools/benchmark"; // MsgLoadTestOps defines a message containing a sequence of load test operations. message MsgLoadTest { option (cosmos.msg.v1.signer) = "caller"; - option (amino.name) = "cosmos-sdk/x/benchmark/v1/MsgLoadTest"; + option (amino.name) = "cosmos-sdk/tools/benchmark/v1/MsgLoadTest"; bytes caller = 1; diff --git a/tools/benchmark/tx.pb.go b/tools/benchmark/tx.pb.go index 269fcdfdf9d6..3a3b76a8d6ec 100644 --- a/tools/benchmark/tx.pb.go +++ b/tools/benchmark/tx.pb.go @@ -143,27 +143,28 @@ func init() { func init() { proto.RegisterFile("cosmos/benchmark/v1/tx.proto", fileDescriptor_481e3d7f7138b75b) } var fileDescriptor_481e3d7f7138b75b = []byte{ - // 320 bytes of a gzipped FileDescriptorProto + // 322 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcd, 0x4b, 0xce, 0xc8, 0x4d, 0x2c, 0xca, 0xd6, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, 0xca, 0x0c, 0xa5, 0x94, 0xb1, 0x69, 0x41, 0xa8, 0x00, 0xeb, 0x94, 0x12, 0x87, 0x2a, 0xca, 0x2d, 0x4e, 0x07, 0x49, 0xe7, 0x16, 0xa7, 0x43, 0x25, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, - 0x24, 0x44, 0x48, 0xa9, 0x9d, 0x91, 0x8b, 0xdb, 0xb7, 0x38, 0xdd, 0x27, 0x3f, 0x31, 0x25, 0x24, + 0x24, 0x44, 0x48, 0xa9, 0x9b, 0x91, 0x8b, 0xdb, 0xb7, 0x38, 0xdd, 0x27, 0x3f, 0x31, 0x25, 0x24, 0xb5, 0xb8, 0x44, 0x48, 0x8c, 0x8b, 0x2d, 0x39, 0x31, 0x27, 0x27, 0xb5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x08, 0xca, 0x13, 0xd2, 0xe4, 0x62, 0xce, 0x2f, 0x28, 0x96, 0x60, 0x52, 0x60, - 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0xc3, 0xe2, 0x36, 0x3d, 0xff, 0x82, 0x20, 0x90, 0x1a, 0x2b, 0xd3, - 0xa6, 0xe7, 0x1b, 0xb4, 0xa0, 0xfa, 0xba, 0x9e, 0x6f, 0xd0, 0x52, 0x85, 0x28, 0xd6, 0x2d, 0x4e, - 0xc9, 0xd6, 0xaf, 0x40, 0x75, 0x39, 0x92, 0xcd, 0x4a, 0xe1, 0x5c, 0xc2, 0x48, 0xdc, 0xa0, 0xd4, - 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x59, 0x2e, 0xae, 0x92, 0xfc, 0x92, 0xc4, 0x9c, 0xf8, - 0x92, 0xcc, 0xdc, 0x54, 0xb0, 0xa3, 0x58, 0x82, 0x38, 0xc1, 0x22, 0x21, 0x99, 0xb9, 0xa9, 0x42, - 0x8a, 0x5c, 0x3c, 0x10, 0xe9, 0xd4, 0xa2, 0xa2, 0xfc, 0x22, 0x90, 0x03, 0x41, 0x0a, 0xb8, 0xc1, - 0x62, 0xae, 0x60, 0x21, 0xa3, 0x14, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x30, 0x2e, 0x0e, 0xb8, - 0x2f, 0x15, 0xb0, 0x7a, 0x00, 0xc9, 0x7a, 0x29, 0x0d, 0x42, 0x2a, 0x60, 0x0e, 0x94, 0x62, 0x6d, - 0x78, 0xbe, 0x41, 0x8b, 0xd1, 0xc9, 0xe8, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, - 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, - 0xa2, 0x24, 0x20, 0x26, 0x15, 0xa7, 0x64, 0xeb, 0x65, 0xe6, 0x23, 0x87, 0x40, 0x12, 0x1b, 0x38, - 0x0e, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x47, 0x7e, 0x92, 0xc2, 0x09, 0x02, 0x00, 0x00, + 0xd6, 0xe0, 0x36, 0x12, 0xd7, 0xc3, 0xe2, 0x36, 0x3d, 0xff, 0x82, 0x20, 0x90, 0x1a, 0x2b, 0xcb, + 0xa6, 0xe7, 0x1b, 0xb4, 0xa0, 0xfa, 0xba, 0x9e, 0x6f, 0xd0, 0xd2, 0x84, 0x28, 0xd6, 0x2d, 0x4e, + 0xc9, 0xd6, 0x2f, 0xc9, 0xcf, 0xcf, 0x41, 0x73, 0x3d, 0x92, 0xed, 0x4a, 0xe1, 0x5c, 0xc2, 0x48, + 0xdc, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x59, 0x2e, 0xae, 0x92, 0xfc, 0x92, + 0xc4, 0x9c, 0xf8, 0x92, 0xcc, 0xdc, 0x54, 0xb0, 0xc3, 0x58, 0x82, 0x38, 0xc1, 0x22, 0x21, 0x99, + 0xb9, 0xa9, 0x42, 0x8a, 0x5c, 0x3c, 0x10, 0xe9, 0xd4, 0xa2, 0xa2, 0xfc, 0x22, 0x90, 0x23, 0x41, + 0x0a, 0xb8, 0xc1, 0x62, 0xae, 0x60, 0x21, 0xa3, 0x14, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x30, + 0x2e, 0x0e, 0xb8, 0x4f, 0x15, 0xb0, 0x7a, 0x02, 0xc9, 0x7a, 0x29, 0x0d, 0x42, 0x2a, 0x60, 0x0e, + 0x94, 0x62, 0x6d, 0x78, 0xbe, 0x41, 0x8b, 0xd1, 0xc9, 0xec, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, + 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, + 0x8f, 0xe5, 0x18, 0xa2, 0xa0, 0x51, 0x5d, 0x9c, 0x92, 0xad, 0x97, 0x99, 0x8f, 0x1e, 0x0a, 0x49, + 0x6c, 0xe0, 0xb8, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x15, 0x3a, 0xfe, 0x19, 0x11, 0x02, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From f9c3575a1873969bb2064cc45c0568a02dacec6d Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 13:24:36 -0600 Subject: [PATCH 10/27] go mod tidy all --- go.work.example | 1 + tests/go.mod | 4 ++-- tools/benchmark/README.md | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.work.example b/go.work.example index f8a9021395e7..35c4dd20ab28 100644 --- a/go.work.example +++ b/go.work.example @@ -27,6 +27,7 @@ use ( ./tools/cosmovisor ./tools/confix ./tools/hubl + ./tools/benchmark ./x/accounts ./x/accounts/defaults/base ./x/accounts/defaults/lockup diff --git a/tests/go.mod b/tests/go.mod index 25a216eab222..c6bb0aae5a11 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -74,7 +74,7 @@ require ( cosmossdk.io/indexer/postgres v0.1.0 // indirect cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/benchmark v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -259,13 +259,13 @@ replace ( cosmossdk.io/server/v2/stf => ../server/v2/stf cosmossdk.io/store => ../store cosmossdk.io/store/v2 => ../store/v2 + cosmossdk.io/tools/benchmark => ../tools/benchmark cosmossdk.io/x/accounts => ../x/accounts cosmossdk.io/x/accounts/defaults/base => ../x/accounts/defaults/base cosmossdk.io/x/accounts/defaults/lockup => ../x/accounts/defaults/lockup cosmossdk.io/x/accounts/defaults/multisig => ../x/accounts/defaults/multisig cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank - cosmossdk.io/x/benchmark => ../x/benchmark cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/consensus => ../x/consensus cosmossdk.io/x/distribution => ../x/distribution diff --git a/tools/benchmark/README.md b/tools/benchmark/README.md index 465a12d9c580..38a090c0d52e 100644 --- a/tools/benchmark/README.md +++ b/tools/benchmark/README.md @@ -1,7 +1,7 @@ -# x/benchmark +# cosmossdk.io/tools/benchmark A benchmark module to test chain and storage performance. It can be used to holistically test -the end to end performance of a node. Given an initial configuration x/benchmark provides: +the end to end performance of a node. Given an initial configuration tools/benchmark provides: * A possibly enormous sequence of key-value sets in InitGenesis distributed across n storekeys, e.g. 20M keys across 5 store keys From 611e9d1f079bcd5b7e2a4900d14851c296a89b23 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 13:32:33 -0600 Subject: [PATCH 11/27] add CI entries --- .github/dependabot.yml | 9 +++++++ .github/pr_labeler.yml | 1 + .github/workflows/test.yml | 31 ++++++++++++++++++++++++ tools/benchmark/sonar-project.properties | 16 ++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 tools/benchmark/sonar-project.properties diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f8033e258c15..cd97261d4e15 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -332,6 +332,15 @@ updates: labels: - "A:automerge" - dependencies + - package-ecosystem: gomod + directory: "/tools/benchmark" + schedule: + interval: weekly + day: wednesday + time: "03:25" + labels: + - "A:automerge" + - dependencies # Dependencies should be up to date on release branch - package-ecosystem: gomod diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index 8855dc2efff3..ae243fdddb2a 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -14,6 +14,7 @@ - x/simulation/**/* - x/*/simulation/**/* - simsx/**/* + - tools/benchmark/**/* "C:Store": - store/**/* "C:collections": diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4990e889c330..cf4065a8f647 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1541,3 +1541,34 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: projectBaseDir: x/consensus/ + + test-tools-benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.23.2" + check-latest: true + cache: true + cache-dependency-path: tools/benchmark/go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + tools/benchmark/**/*.go + tools/benchmark/go.mod + tools/benchmark/go.sum + - name: tests + if: env.GIT_DIFF + run: | + cd tools/benchmark + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace' ./... + - name: sonarcloud + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: tools/benchmark/ diff --git a/tools/benchmark/sonar-project.properties b/tools/benchmark/sonar-project.properties new file mode 100644 index 000000000000..6756fe89872e --- /dev/null +++ b/tools/benchmark/sonar-project.properties @@ -0,0 +1,16 @@ +sonar.projectKey=cosmos-sdk-tools-benchmark +sonar.organization=cosmos + +sonar.projectName=Cosmos SDK - tools/benchmark +sonar.project.monorepo.enabled=true + +sonar.sources=. +sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go +sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/** +sonar.tests=. +sonar.test.inclusions=**/*_test.go +sonar.go.coverage.reportPaths=coverage.out + +sonar.sourceEncoding=UTF-8 +sonar.scm.provider=git +sonar.scm.forceReloadAll=true From ba608a3d78c15ca0adddcbe8890f1dcb47c74131 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 14:42:52 -0600 Subject: [PATCH 12/27] fix(confix): correctly distinguish server/v2 config --- tools/confix/upgrade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/confix/upgrade.go b/tools/confix/upgrade.go index d212bbfb7927..d0ced95da66f 100644 --- a/tools/confix/upgrade.go +++ b/tools/confix/upgrade.go @@ -44,7 +44,7 @@ func Upgrade(ctx context.Context, plan transform.Plan, doc *tomledit.Document, c } // ignore validation for serverv2 by checking any default field found in doc - isServerV2 := doc.First(strings.Split("store.options.ss-pruning-option", ".")...) != nil + isServerV2 := doc.First(strings.Split("store.options.sc-pruning-option", ".")...) != nil // allow to skip validation if !skipValidate && !isServerV2 { From ac0080a30755967edb3cf44243e059a304956700 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 15:46:20 -0600 Subject: [PATCH 13/27] latest iavl/v2 work with test suite passing --- scripts/init-simapp-v2.sh | 4 ++ simapp/app_config.go | 4 +- simapp/v2/app_config.go | 4 +- store/v2/commitment/iavlv2/tree.go | 69 ++++++++++++++++++++++--- store/v2/commitment/iavlv2/tree_test.go | 3 +- store/v2/go.mod | 5 +- 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/scripts/init-simapp-v2.sh b/scripts/init-simapp-v2.sh index 02fb379f8e2c..c4575b638f09 100755 --- a/scripts/init-simapp-v2.sh +++ b/scripts/init-simapp-v2.sh @@ -10,7 +10,11 @@ $SIMD_BIN config set client chain-id simapp-v2-chain $SIMD_BIN config set client keyring-backend test $SIMD_BIN config set client keyring-default-keyname alice $SIMD_BIN config set app rest.enable true +$SIMD_BIN config set app store.options.iavl-config.cache-size 1000000 $SIMD_BIN config set app telemetry.prometheus-retention-time 600 +sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/' "$SIMD_HOME"/config/config.toml +sed -i '' 's/prometheus = false/prometheus = true/' "$SIMD_HOME"/config/config.toml + $SIMD_BIN keys add alice --indiscreet $SIMD_BIN keys add bob --indiscreet $SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain diff --git a/simapp/app_config.go b/simapp/app_config.go index 45846b673aba..606c0f34f617 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -304,8 +304,8 @@ var ( Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 1, - GenesisCount: 100, + BucketCount: 3, + GenesisCount: 10_000_000, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index b21565822ee0..bad55039c510 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -309,8 +309,8 @@ var ( Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 1, - GenesisCount: 100, + BucketCount: 3, + GenesisCount: 10_000_000, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/store/v2/commitment/iavlv2/tree.go b/store/v2/commitment/iavlv2/tree.go index 43c25a23a2c8..1c2a374caf38 100644 --- a/store/v2/commitment/iavlv2/tree.go +++ b/store/v2/commitment/iavlv2/tree.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" + "cosmossdk.io/core/log" "github.com/cosmos/iavl/v2" ics23 "github.com/cosmos/ics23/go" @@ -19,16 +20,24 @@ var ( ) type Tree struct { - tree *iavl.Tree -} - -func NewTree(treeOptions iavl.TreeOptions, dbOptions iavl.SqliteDbOptions, pool *iavl.NodePool) (*Tree, error) { + tree *iavl.Tree + log log.Logger + path string + dirty bool +} + +func NewTree( + treeOptions iavl.TreeOptions, + dbOptions iavl.SqliteDbOptions, + log log.Logger, +) (*Tree, error) { + pool := iavl.NewNodePool() sql, err := iavl.NewSqliteDb(pool, dbOptions) if err != nil { return nil, err } tree := iavl.NewTree(sql, pool, treeOptions) - return &Tree{tree: tree}, nil + return &Tree{tree: tree, log: log, path: dbOptions.Path}, nil } func (t *Tree) Set(key, value []byte) error { @@ -92,7 +101,17 @@ func (t *Tree) Get(version uint64, key []byte) ([]byte, error) { if err := isHighBitSet(version); err != nil { return nil, err } - if int64(version) != t.tree.Version() { + h := t.tree.Version() + v := int64(version) + switch { + case v == h: + return t.tree.Get(key) + case v == h+1 && (t.tree.IsDirty() || t.tree.IsEmpty()): + // permit h+1 reads if the tree is dirty or empty + return t.tree.Get(key) + case v > h: + return nil, fmt.Errorf("get: cannot read future version %d; h: %d path=%s", v, h, t.path) + case v < h: cloned, err := t.tree.ReadonlyClone() if err != nil { return nil, err @@ -101,8 +120,36 @@ func (t *Tree) Get(version uint64, key []byte) ([]byte, error) { return nil, err } return cloned.Get(key) - } else { - return t.tree.Get(key) + default: + return nil, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) + } +} + +func (t *Tree) Has(version uint64, key []byte) (bool, error) { + if err := isHighBitSet(version); err != nil { + return false, err + } + h := t.tree.Version() + v := int64(version) + switch { + case v == h: + return t.tree.Has(key) + case v == h+1 && (t.tree.IsDirty() || t.tree.IsEmpty()): + // permit h+1 reads if the tree is dirty or empty + return t.tree.Has(key) + case v > h: + return false, fmt.Errorf("has: cannot read future version %d; h: %d", v, h) + case v < h: + cloned, err := t.tree.ReadonlyClone() + if err != nil { + return false, err + } + if err = cloned.LoadVersion(int64(version)); err != nil { + return false, err + } + return cloned.Has(key) + default: + return false, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) } } @@ -114,6 +161,8 @@ func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (core return nil, fmt.Errorf("loading past version not yet supported") } if ascending { + // inclusive = false is IAVL v1's default behavior. + // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. return t.tree.Iterator(start, end, false) } else { return t.tree.ReverseIterator(start, end) @@ -143,6 +192,10 @@ func (t *Tree) Prune(version uint64) error { // PausePruning is unnecessary in IAVL v2 due to the advanced pruning mechanism func (t *Tree) PausePruning(bool) {} +func (t *Tree) IsConcurrentSafe() bool { + return true +} + func (t *Tree) WorkingHash() []byte { return t.tree.Hash() } diff --git a/store/v2/commitment/iavlv2/tree_test.go b/store/v2/commitment/iavlv2/tree_test.go index a173c453c976..77822615871c 100644 --- a/store/v2/commitment/iavlv2/tree_test.go +++ b/store/v2/commitment/iavlv2/tree_test.go @@ -14,7 +14,6 @@ import ( ) func TestCommitterSuite(t *testing.T) { - nodePool := iavl.NewNodePool() s := &commitment.CommitStoreTestSuite{ TreeType: "iavlv2", NewStore: func( @@ -26,7 +25,7 @@ func TestCommitterSuite(t *testing.T) { multiTrees := make(map[string]commitment.Tree) mountTreeFn := func(storeKey string) (commitment.Tree, error) { path := fmt.Sprintf("%s/%s", dbDir, storeKey) - tree, err := NewTree(iavl.DefaultTreeOptions(), iavl.SqliteDbOptions{Path: path}, nodePool) + tree, err := NewTree(iavl.DefaultTreeOptions(), iavl.SqliteDbOptions{Path: path}, logger) require.NoError(t, err) return tree, nil } diff --git a/store/v2/go.mod b/store/v2/go.mod index 42778f347ca4..12eb683b7c1b 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -76,4 +76,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace cosmossdk.io/core => ../../core +replace ( + cosmossdk.io/core => ../../core + github.com/cosmos/iavl/v2 => ../../../../iavl/iavl-v2 +) From 746abefe1c8e360c4057d39dd115aa39c695263c Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 5 Dec 2024 16:12:29 -0600 Subject: [PATCH 14/27] commit store with concurrent commit --- store/v2/commitment/iavl/tree.go | 4 ++ store/v2/commitment/mem/tree.go | 4 ++ store/v2/commitment/store.go | 89 ++++++++++++++++++++++-------- store/v2/commitment/tree.go | 2 + store/v2/proof/commit_info.go | 30 +++++----- store/v2/proof/commit_info_test.go | 42 +++++++------- store/v2/root/store.go | 2 +- store/v2/store.go | 2 + 8 files changed, 116 insertions(+), 59 deletions(-) diff --git a/store/v2/commitment/iavl/tree.go b/store/v2/commitment/iavl/tree.go index 4aaac08ab8bf..1769bc45126e 100644 --- a/store/v2/commitment/iavl/tree.go +++ b/store/v2/commitment/iavl/tree.go @@ -199,3 +199,7 @@ func (t *IavlTree) Import(version uint64) (commitment.Importer, error) { func (t *IavlTree) Close() error { return t.tree.Close() } + +func (t *IavlTree) IsConcurrentSafe() bool { + return false +} diff --git a/store/v2/commitment/mem/tree.go b/store/v2/commitment/mem/tree.go index bf0e95bfa9c1..15e2d1083909 100644 --- a/store/v2/commitment/mem/tree.go +++ b/store/v2/commitment/mem/tree.go @@ -69,3 +69,7 @@ func (t *Tree) Import(version uint64) (commitment.Importer, error) { func New() *Tree { return &Tree{MemDB: db.NewMemDB()} } + +func (t *Tree) IsConcurrentSafe() bool { + return false +} diff --git a/store/v2/commitment/store.go b/store/v2/commitment/store.go index aa383b57ae56..e542f64e2a1b 100644 --- a/store/v2/commitment/store.go +++ b/store/v2/commitment/store.go @@ -9,6 +9,7 @@ import ( "slices" protoio "github.com/cosmos/gogoproto/io" + "golang.org/x/sync/errgroup" corelog "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" @@ -61,6 +62,8 @@ func NewCommitStore(trees, oldTrees map[string]Tree, db corestore.KVStoreWithBat } func (c *CommitStore) WriteChangeset(cs *corestore.Changeset) error { + eg := new(errgroup.Group) + eg.SetLimit(store.MaxWriteParallelism) for _, pairs := range cs.Changes { key := conv.UnsafeBytesToStr(pairs.Actor) @@ -68,17 +71,30 @@ func (c *CommitStore) WriteChangeset(cs *corestore.Changeset) error { if !ok { return fmt.Errorf("store key %s not found in multiTrees", key) } - for _, kv := range pairs.StateChanges { - if kv.Remove { - if err := tree.Remove(kv.Key); err != nil { - return err - } - } else if err := tree.Set(kv.Key, kv.Value); err != nil { + if tree.IsConcurrentSafe() { + eg.Go(func() error { + return writeChangeset(tree, pairs) + }) + } else { + if err := writeChangeset(tree, pairs); err != nil { return err } } } + return eg.Wait() +} + +func writeChangeset(tree Tree, changes corestore.StateChanges) error { + for _, kv := range changes.StateChanges { + if kv.Remove { + if err := tree.Remove(kv.Key); err != nil { + return err + } + } else if err := tree.Set(kv.Key, kv.Value); err != nil { + return err + } + } return nil } @@ -188,27 +204,33 @@ func (c *CommitStore) loadVersion(targetVersion uint64, storeKeys []string, over } func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { - storeInfos := make([]proof.StoreInfo, 0, len(c.multiTrees)) + storeInfos := make([]*proof.StoreInfo, 0, len(c.multiTrees)) + var i int + eg := new(errgroup.Group) + eg.SetLimit(store.MaxWriteParallelism) for storeKey, tree := range c.multiTrees { if internal.IsMemoryStoreKey(storeKey) { continue } - hash, cversion, err := tree.Commit() - if err != nil { - return nil, err - } - if cversion != version { - return nil, fmt.Errorf("commit version %d does not match the target version %d", cversion, version) - } - commitID := proof.CommitID{ - Version: version, - Hash: hash, + si := &proof.StoreInfo{Name: []byte(storeKey)} + storeInfos = append(storeInfos, si) + + if tree.IsConcurrentSafe() { + eg.Go(func() error { + err := c.commit(tree, si, version) + if err != nil { + return fmt.Errorf("commit fail: %s: %w", si.Name, err) + } + return nil + }) + } else { + err := c.commit(tree, si, version) + if err != nil { + return nil, err + } } - storeInfos = append(storeInfos, proof.StoreInfo{ - Name: []byte(storeKey), - CommitID: commitID, - }) + i++ } cInfo := &proof.CommitInfo{ @@ -216,6 +238,10 @@ func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { StoreInfos: storeInfos, } + if err := eg.Wait(); err != nil { + return nil, err + } + if err := c.metadata.flushCommitInfo(version, cInfo); err != nil { return nil, err } @@ -223,6 +249,21 @@ func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { return cInfo, nil } +func (c *CommitStore) commit(tree Tree, si *proof.StoreInfo, expected uint64) error { + h, v, err := tree.Commit() + if err != nil { + return err + } + if v != expected { + return fmt.Errorf("commit version %d does not match the target version %d", v, expected) + } + si.CommitID = &proof.CommitID{ + Version: v, + Hash: h, + } + return nil +} + func (c *CommitStore) SetInitialVersion(version uint64) error { for _, tree := range c.multiTrees { if err := tree.SetInitialVersion(version); err != nil { @@ -531,7 +572,7 @@ func (c *CommitStore) GetCommitInfo(version uint64) (*proof.CommitInfo, error) { return ci, nil } // otherwise built the commit info from the trees - storeInfos := make([]proof.StoreInfo, 0, len(c.multiTrees)) + storeInfos := make([]*proof.StoreInfo, 0, len(c.multiTrees)) for storeKey, tree := range c.multiTrees { if internal.IsMemoryStoreKey(storeKey) { continue @@ -541,9 +582,9 @@ func (c *CommitStore) GetCommitInfo(version uint64) (*proof.CommitInfo, error) { return nil, fmt.Errorf("tree version %d does not match the target version %d", v, version) } bz := []byte(storeKey) - storeInfos = append(storeInfos, proof.StoreInfo{ + storeInfos = append(storeInfos, &proof.StoreInfo{ Name: bz, - CommitID: proof.CommitID{ + CommitID: &proof.CommitID{ Version: v, Hash: tree.Hash(), }, diff --git a/store/v2/commitment/tree.go b/store/v2/commitment/tree.go index 58a8b20beff2..03f1f3c80a72 100644 --- a/store/v2/commitment/tree.go +++ b/store/v2/commitment/tree.go @@ -34,6 +34,8 @@ type Tree interface { Export(version uint64) (Exporter, error) Import(version uint64) (Importer, error) + IsConcurrentSafe() bool + io.Closer } diff --git a/store/v2/proof/commit_info.go b/store/v2/proof/commit_info.go index b784676a8d34..0e30da961067 100644 --- a/store/v2/proof/commit_info.go +++ b/store/v2/proof/commit_info.go @@ -14,7 +14,7 @@ type ( // a version/height. CommitInfo struct { Version uint64 - StoreInfos []StoreInfo + StoreInfos []*StoreInfo Timestamp time.Time CommitHash []byte } @@ -23,7 +23,7 @@ type ( // between a store name/key and the commit ID. StoreInfo struct { Name []byte - CommitID CommitID + CommitID *CommitID Structure string } @@ -55,13 +55,13 @@ func (ci *CommitInfo) Hash() []byte { } // GetStoreCommitID returns the CommitID for the given store key. -func (ci *CommitInfo) GetStoreCommitID(storeKey []byte) CommitID { +func (ci *CommitInfo) GetStoreCommitID(storeKey []byte) *CommitID { for _, si := range ci.StoreInfos { if bytes.Equal(si.Name, storeKey) { return si.CommitID } } - return CommitID{} + return &CommitID{} } // GetStoreProof takes in a storeKey and returns a proof of the store key in addition @@ -106,6 +106,9 @@ func (ci *CommitInfo) encodedSize() int { size += encoding.EncodeUvarintSize(uint64(len(ci.StoreInfos))) for _, storeInfo := range ci.StoreInfos { size += encoding.EncodeBytesSize(storeInfo.Name) + if storeInfo.CommitID == nil { + panic("zomg") + } size += encoding.EncodeBytesSize(storeInfo.CommitID.Hash) size += encoding.EncodeBytesSize([]byte(storeInfo.Structure)) } @@ -171,8 +174,9 @@ func (ci *CommitInfo) Unmarshal(buf []byte) error { return err } buf = buf[n:] - ci.StoreInfos = make([]StoreInfo, storeInfosLen) + ci.StoreInfos = make([]*StoreInfo, storeInfosLen) for i := 0; i < int(storeInfosLen); i++ { + ci.StoreInfos[i] = &StoreInfo{} // Name name, n, err := encoding.DecodeBytes(buf) if err != nil { @@ -194,7 +198,7 @@ func (ci *CommitInfo) Unmarshal(buf []byte) error { buf = buf[n:] ci.StoreInfos[i].Structure = string(structure) - ci.StoreInfos[i].CommitID = CommitID{ + ci.StoreInfos[i].CommitID = &CommitID{ Hash: hash, Version: ci.Version, } @@ -203,24 +207,24 @@ func (ci *CommitInfo) Unmarshal(buf []byte) error { return nil } -func (ci *CommitInfo) CommitID() CommitID { - return CommitID{ +func (ci *CommitInfo) CommitID() *CommitID { + return &CommitID{ Version: ci.Version, Hash: ci.Hash(), } } -func (m *CommitInfo) GetVersion() uint64 { - if m != nil { - return m.Version +func (ci *CommitInfo) GetVersion() uint64 { + if ci != nil { + return ci.Version } return 0 } -func (cid CommitID) String() string { +func (cid *CommitID) String() string { return fmt.Sprintf("CommitID{%v:%X}", cid.Hash, cid.Version) } -func (cid CommitID) IsZero() bool { +func (cid *CommitID) IsZero() bool { return cid.Version == 0 && len(cid.Hash) == 0 } diff --git a/store/v2/proof/commit_info_test.go b/store/v2/proof/commit_info_test.go index e09449c51963..1c0221fe6360 100644 --- a/store/v2/proof/commit_info_test.go +++ b/store/v2/proof/commit_info_test.go @@ -10,37 +10,37 @@ import ( func TestGetStoreProof(t *testing.T) { tests := []struct { - storeInfos []StoreInfo + storeInfos []*StoreInfo }{ - {[]StoreInfo{ - {[]byte("key1"), CommitID{1, []byte("value1")}, "iavl"}, + {[]*StoreInfo{ + {[]byte("key1"), &CommitID{1, []byte("value1")}, "iavl"}, }}, - {[]StoreInfo{ - {[]byte("key2"), CommitID{1, []byte("value2")}, "iavl"}, - {[]byte("key1"), CommitID{1, []byte("value1")}, "iavl"}, + {[]*StoreInfo{ + {[]byte("key2"), &CommitID{1, []byte("value2")}, "iavl"}, + {[]byte("key1"), &CommitID{1, []byte("value1")}, "iavl"}, }}, - {[]StoreInfo{ - {[]byte("key3"), CommitID{1, []byte("value3")}, "iavl"}, - {[]byte("key2"), CommitID{1, []byte("value2")}, "iavl"}, - {[]byte("key1"), CommitID{1, []byte("value1")}, "iavl"}, + {[]*StoreInfo{ + {[]byte("key3"), &CommitID{1, []byte("value3")}, "iavl"}, + {[]byte("key2"), &CommitID{1, []byte("value2")}, "iavl"}, + {[]byte("key1"), &CommitID{1, []byte("value1")}, "iavl"}, }}, - {[]StoreInfo{ - {[]byte("key2"), CommitID{1, []byte("value2")}, "iavl"}, - {[]byte("key1"), CommitID{1, []byte("value1")}, "iavl"}, - {[]byte("key3"), CommitID{1, []byte("value3")}, "iavl"}, + {[]*StoreInfo{ + {[]byte("key2"), &CommitID{1, []byte("value2")}, "iavl"}, + {[]byte("key1"), &CommitID{1, []byte("value1")}, "iavl"}, + {[]byte("key3"), &CommitID{1, []byte("value3")}, "iavl"}, }}, - {[]StoreInfo{ - {[]byte("key4"), CommitID{1, []byte("value4")}, "iavl"}, - {[]byte("key1"), CommitID{1, []byte("value1")}, "iavl"}, - {[]byte("key3"), CommitID{1, []byte("value3")}, "iavl"}, - {[]byte("key2"), CommitID{1, []byte("value2")}, "iavl"}, + {[]*StoreInfo{ + {[]byte("key4"), &CommitID{1, []byte("value4")}, "iavl"}, + {[]byte("key1"), &CommitID{1, []byte("value1")}, "iavl"}, + {[]byte("key3"), &CommitID{1, []byte("value3")}, "iavl"}, + {[]byte("key2"), &CommitID{1, []byte("value2")}, "iavl"}, }}, } for i, tc := range tests { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { // create a commit info - ci := CommitInfo{ + ci := &CommitInfo{ Version: 1, Timestamp: time.Now(), StoreInfos: tc.storeInfos, @@ -59,7 +59,7 @@ func TestGetStoreProof(t *testing.T) { bz, err := ci.Marshal() require.NoError(t, err) - var ci2 CommitInfo + ci2 := &CommitInfo{} err = ci2.Unmarshal(bz) require.NoError(t, err) require.True(t, ci.Timestamp.Equal(ci2.Timestamp)) diff --git a/store/v2/root/store.go b/store/v2/root/store.go index 6faa51602c5b..af3cad4ec443 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -144,7 +144,7 @@ func (s *Store) GetStateCommitment() store.Committer { // latest version set, which is based off of the SC view. func (s *Store) LastCommitID() (proof.CommitID, error) { if s.lastCommitInfo != nil { - return s.lastCommitInfo.CommitID(), nil + return *s.lastCommitInfo.CommitID(), nil } latestVersion, err := s.stateCommitment.GetLatestVersion() diff --git a/store/v2/store.go b/store/v2/store.go index 20c6ab3c8ef2..df91caca6180 100644 --- a/store/v2/store.go +++ b/store/v2/store.go @@ -8,6 +8,8 @@ import ( "cosmossdk.io/store/v2/proof" ) +var MaxWriteParallelism = 8 + // RootStore defines an abstraction layer containing a State Storage (SS) engine // and one or more State Commitment (SC) engines. type RootStore interface { From e157e37d54989ac6f4c0abfe2776fcd62bbca925 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Sun, 8 Dec 2024 11:42:25 -0600 Subject: [PATCH 15/27] iavl v2 integration tests passing --- runtime/v2/go.mod | 5 ++ runtime/v2/go.sum | 18 +++++++ scripts/init-simapp-v2.sh | 2 +- server/v2/cometbft/go.mod | 4 ++ server/v2/cometbft/go.sum | 10 ++++ server/v2/go.mod | 5 ++ server/v2/go.sum | 12 +++++ simapp/v2/go.mod | 5 ++ simapp/v2/go.sum | 8 +++ store/v2/commitment/iavlv2/tree.go | 53 ++++++++++++------- store/v2/commitment/store.go | 2 - store/v2/database.go | 7 +++ store/v2/go.sum | 2 - store/v2/root/factory.go | 13 ++++- store/v2/root/store.go | 81 +++++++++++++++++------------- tests/go.mod | 4 ++ tests/go.sum | 10 ++++ 17 files changed, 181 insertions(+), 60 deletions(-) diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index a586442b1e61..2943593f0b03 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -34,7 +34,9 @@ require ( cosmossdk.io/core/testing v0.0.0 // indirect cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 // indirect github.com/DataDog/zstd v1.5.5 // indirect + github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bvinc/go-sqlite-lite v0.6.1 // indirect github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -47,8 +49,10 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/iavl v1.3.1 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -60,6 +64,7 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kocubinski/costor-api v1.1.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.9.3 // indirect diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index 82a468165c79..c0aecba31eaa 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -19,10 +19,14 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJnswS8vXy7YY1+fdlbVPuEVmDAfqvFOQ= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bvinc/go-sqlite-lite v0.6.1 h1:JU8Rz5YAOZQiU3WEulKF084wfXpytRiqD2IaW2QjPz4= +github.com/bvinc/go-sqlite-lite v0.6.1/go.mod h1:2GiE60NUdb0aNhDdY+LXgrqAVDpi2Ijc6dB6ZMp9x6s= github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -59,6 +63,10 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= +github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -66,6 +74,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -136,6 +146,8 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -147,6 +159,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kocubinski/costor-api v1.1.1 h1:sgfJA7T/8IfZ59zxiMrED0xdjerAFuPNBTqyO90GiEE= +github.com/kocubinski/costor-api v1.1.1/go.mod h1:ESMBMDkKfN+9vvvhhNVdKLhbOmzI3O/i16iXvRM9Tuc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -228,6 +242,10 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/scripts/init-simapp-v2.sh b/scripts/init-simapp-v2.sh index c4575b638f09..f83f1115753a 100755 --- a/scripts/init-simapp-v2.sh +++ b/scripts/init-simapp-v2.sh @@ -10,8 +10,8 @@ $SIMD_BIN config set client chain-id simapp-v2-chain $SIMD_BIN config set client keyring-backend test $SIMD_BIN config set client keyring-default-keyname alice $SIMD_BIN config set app rest.enable true -$SIMD_BIN config set app store.options.iavl-config.cache-size 1000000 $SIMD_BIN config set app telemetry.prometheus-retention-time 600 +$SIMD_BIN config set app store.options.sc-type iavl-v2 sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/' "$SIMD_HOME"/config/config.toml sed -i '' 's/prometheus = false/prometheus = true/' "$SIMD_HOME"/config/config.toml diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 20cba34dc235..cdb92aa113a1 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -58,8 +58,10 @@ require ( github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.2.0 // indirect + github.com/bvinc/go-sqlite-lite v0.6.1 // indirect github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -77,6 +79,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect @@ -125,6 +128,7 @@ require ( github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kocubinski/costor-api v1.1.1 // 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 diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 1cef4bfa7e19..27ff42be83b1 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -45,6 +45,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJnswS8vXy7YY1+fdlbVPuEVmDAfqvFOQ= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -58,6 +60,8 @@ github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/ github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bvinc/go-sqlite-lite v0.6.1 h1:JU8Rz5YAOZQiU3WEulKF084wfXpytRiqD2IaW2QjPz4= +github.com/bvinc/go-sqlite-lite v0.6.1/go.mod h1:2GiE60NUdb0aNhDdY+LXgrqAVDpi2Ijc6dB6ZMp9x6s= github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -124,6 +128,10 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= +github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -318,6 +326,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kocubinski/costor-api v1.1.1 h1:sgfJA7T/8IfZ59zxiMrED0xdjerAFuPNBTqyO90GiEE= +github.com/kocubinski/costor-api v1.1.1/go.mod h1:ESMBMDkKfN+9vvvhhNVdKLhbOmzI3O/i16iXvRM9Tuc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= diff --git a/server/v2/go.mod b/server/v2/go.mod index 0c9be05fde81..3fe9f8a11f94 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -45,7 +45,9 @@ require ( github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bvinc/go-sqlite-lite v0.6.1 // indirect github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -57,8 +59,10 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/iavl v1.3.1 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -76,6 +80,7 @@ require ( github.com/jhump/protoreflect v1.17.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kocubinski/costor-api v1.1.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.9.3 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 77d80d52875b..4b8491475a67 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -23,12 +23,16 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJnswS8vXy7YY1+fdlbVPuEVmDAfqvFOQ= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/bvinc/go-sqlite-lite v0.6.1 h1:JU8Rz5YAOZQiU3WEulKF084wfXpytRiqD2IaW2QjPz4= +github.com/bvinc/go-sqlite-lite v0.6.1/go.mod h1:2GiE60NUdb0aNhDdY+LXgrqAVDpi2Ijc6dB6ZMp9x6s= github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -77,6 +81,10 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= +github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -85,6 +93,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -204,6 +214,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kocubinski/costor-api v1.1.1 h1:sgfJA7T/8IfZ59zxiMrED0xdjerAFuPNBTqyO90GiEE= +github.com/kocubinski/costor-api v1.1.1/go.mod h1:ESMBMDkKfN+9vvvhhNVdKLhbOmzI3O/i16iXvRM9Tuc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 2c3d84a87a0c..4187feb74491 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -74,11 +74,13 @@ require ( github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/aws/aws-sdk-go v1.55.5 // indirect + github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/bvinc/go-sqlite-lite v0.6.1 // indirect github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -101,6 +103,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.6 // indirect @@ -161,6 +164,7 @@ require ( github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kocubinski/costor-api v1.1.1 // 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 @@ -303,4 +307,5 @@ replace ( cosmossdk.io/server/v2/stf => ../../server/v2/stf cosmossdk.io/store => ../../store cosmossdk.io/store/v2 => ../../store/v2 + github.com/cosmos/iavl/v2 => ../../../../iavl/iavl-v2 ) diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index e663b957246d..35cc0773fcae 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -237,6 +237,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJnswS8vXy7YY1+fdlbVPuEVmDAfqvFOQ= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -256,6 +258,8 @@ github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/ github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bvinc/go-sqlite-lite v0.6.1 h1:JU8Rz5YAOZQiU3WEulKF084wfXpytRiqD2IaW2QjPz4= +github.com/bvinc/go-sqlite-lite v0.6.1/go.mod h1:2GiE60NUdb0aNhDdY+LXgrqAVDpi2Ijc6dB6ZMp9x6s= github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -334,6 +338,8 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= +github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -626,6 +632,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kocubinski/costor-api v1.1.1 h1:sgfJA7T/8IfZ59zxiMrED0xdjerAFuPNBTqyO90GiEE= +github.com/kocubinski/costor-api v1.1.1/go.mod h1:ESMBMDkKfN+9vvvhhNVdKLhbOmzI3O/i16iXvRM9Tuc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= diff --git a/store/v2/commitment/iavlv2/tree.go b/store/v2/commitment/iavlv2/tree.go index 1c2a374caf38..c7d19006ed46 100644 --- a/store/v2/commitment/iavlv2/tree.go +++ b/store/v2/commitment/iavlv2/tree.go @@ -104,10 +104,8 @@ func (t *Tree) Get(version uint64, key []byte) ([]byte, error) { h := t.tree.Version() v := int64(version) switch { - case v == h: - return t.tree.Get(key) - case v == h+1 && (t.tree.IsDirty() || t.tree.IsEmpty()): - // permit h+1 reads if the tree is dirty or empty + // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) + case v == h || v == h+1: return t.tree.Get(key) case v > h: return nil, fmt.Errorf("get: cannot read future version %d; h: %d path=%s", v, h, t.path) @@ -132,10 +130,8 @@ func (t *Tree) Has(version uint64, key []byte) (bool, error) { h := t.tree.Version() v := int64(version) switch { - case v == h: - return t.tree.Has(key) - case v == h+1 && (t.tree.IsDirty() || t.tree.IsEmpty()): - // permit h+1 reads if the tree is dirty or empty + // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) + case v == h || v == h+1: return t.tree.Has(key) case v > h: return false, fmt.Errorf("has: cannot read future version %d; h: %d", v, h) @@ -157,15 +153,38 @@ func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (core if err := isHighBitSet(version); err != nil { return nil, err } - if int64(version) != t.tree.Version() { - return nil, fmt.Errorf("loading past version not yet supported") - } - if ascending { - // inclusive = false is IAVL v1's default behavior. - // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. - return t.tree.Iterator(start, end, false) - } else { - return t.tree.ReverseIterator(start, end) + h := t.tree.Version() + v := int64(version) + + switch { + // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) + case v == h || v == h+1: + if ascending { + // inclusive = false is IAVL v1's default behavior. + // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. + return t.tree.Iterator(start, end, false) + } else { + return t.tree.ReverseIterator(start, end) + } + case v > h: + return nil, fmt.Errorf("has: cannot read future version %d; h: %d", v, h) + case v < h: + cloned, err := t.tree.ReadonlyClone() + if err != nil { + return nil, err + } + if err = cloned.LoadVersion(int64(version)); err != nil { + return nil, err + } + if ascending { + // inclusive = false is IAVL v1's default behavior. + // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. + return t.tree.Iterator(start, end, false) + } else { + return t.tree.ReverseIterator(start, end) + } + default: + return nil, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) } } diff --git a/store/v2/commitment/store.go b/store/v2/commitment/store.go index e542f64e2a1b..c7060864b227 100644 --- a/store/v2/commitment/store.go +++ b/store/v2/commitment/store.go @@ -205,7 +205,6 @@ func (c *CommitStore) loadVersion(targetVersion uint64, storeKeys []string, over func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { storeInfos := make([]*proof.StoreInfo, 0, len(c.multiTrees)) - var i int eg := new(errgroup.Group) eg.SetLimit(store.MaxWriteParallelism) @@ -230,7 +229,6 @@ func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { return nil, err } } - i++ } cInfo := &proof.CommitInfo{ diff --git a/store/v2/database.go b/store/v2/database.go index 0e0697de57bb..7c6b242e257b 100644 --- a/store/v2/database.go +++ b/store/v2/database.go @@ -18,6 +18,13 @@ type VersionedReader interface { ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) } +type LatestReader interface { + Has(storeKey, key []byte) (bool, error) + Get(storeKey, key []byte) ([]byte, error) + Iterator(storeKey, start, end []byte) (corestore.Iterator, error) + ReverseIterator(storeKey, start, end []byte) (corestore.Iterator, error) +} + // UpgradableDatabase defines an API for a versioned database that allows pruning // deleted storeKeys type UpgradableDatabase interface { diff --git a/store/v2/go.sum b/store/v2/go.sum index ec5654d0a6a9..3ba7ea51fcf1 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -59,8 +59,6 @@ github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/store/v2/root/factory.go b/store/v2/root/factory.go index 36eadf2382bc..3927e7f9c986 100644 --- a/store/v2/root/factory.go +++ b/store/v2/root/factory.go @@ -4,11 +4,14 @@ import ( "errors" "fmt" + iavl_v2 "github.com/cosmos/iavl/v2" + "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/commitment" "cosmossdk.io/store/v2/commitment/iavl" + "cosmossdk.io/store/v2/commitment/iavlv2" "cosmossdk.io/store/v2/commitment/mem" "cosmossdk.io/store/v2/db" "cosmossdk.io/store/v2/internal" @@ -49,7 +52,7 @@ func DefaultStoreOptions() Options { Interval: 100, }, IavlConfig: &iavl.Config{ - CacheSize: 100_000, + CacheSize: 1_000_000, SkipFastStorageUpgrade: true, }, } @@ -97,7 +100,13 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { case SCTypeIavl: return iavl.NewIavlTree(db.NewPrefixDB(opts.SCRawDB, []byte(key)), opts.Logger, storeOpts.IavlConfig), nil case SCTypeIavlV2: - return nil, errors.New("iavl v2 not supported") + dir := fmt.Sprintf("%s/data/iavl-v2/%s", opts.RootDir, key) + // TODO load from config YAML or at least simapp + iavlOpts := iavl_v2.DefaultTreeOptions() + iavlOpts.EvictionDepth = 18 + iavlOpts.HeightFilter = 1 + iavlOpts.CheckpointInterval = 55 + return iavlv2.NewTree(iavlOpts, iavl_v2.SqliteDbOptions{Path: dir}, opts.Logger) default: return nil, errors.New("unsupported commitment store type") } diff --git a/store/v2/root/store.go b/store/v2/root/store.go index af3cad4ec443..9343595bb4ad 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -8,8 +8,6 @@ import ( "sync" "time" - "golang.org/x/sync/errgroup" - corelog "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" @@ -56,6 +54,9 @@ type Store struct { chDone chan struct{} // isMigrating reflects whether the store is currently migrating isMigrating bool + + preCommit sync.RWMutex + preCommitVersion uint64 } // New creates a new root Store instance. @@ -116,25 +117,27 @@ func (s *Store) getVersionedReader(version uint64) (store.VersionedReader, error return nil, fmt.Errorf("version %d does not exist", version) } -func (s *Store) StateLatest() (uint64, corestore.ReaderMap, error) { - v, err := s.GetLatestVersion() - if err != nil { - return 0, nil, err - } - vReader, err := s.getVersionedReader(v) - if err != nil { - return 0, nil, err - } - - return v, NewReaderMap(v, vReader), nil -} - // StateAt returns a read-only view of the state at a given version. func (s *Store) StateAt(v uint64) (corestore.ReaderMap, error) { vReader, err := s.getVersionedReader(v) return NewReaderMap(v, vReader), err } +func (s *Store) StateLatest() (uint64, corestore.ReaderMap, error) { + s.preCommit.RLock() + v := s.preCommitVersion + s.preCommit.RUnlock() + if v == 0 { + var err error + v, err = s.GetLatestVersion() + if err != nil { + return 0, nil, err + } + } + + return v, NewReaderMap(v, s.stateCommitment), nil +} + func (s *Store) GetStateCommitment() store.Committer { return s.stateCommitment } @@ -291,10 +294,14 @@ func (s *Store) loadVersion(v uint64, upgrades *corestore.StoreUpgrades, overrid // from the SC tree. Finally, it commits the SC tree and returns the hash of // the CommitInfo. func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { - if s.telemetry != nil { - now := time.Now() - defer s.telemetry.MeasureSince(now, "root_store", "commit") - } + s.logger.Warn("begin commit", "version", cs.Version) + now := time.Now() + defer func() { + if s.telemetry != nil { + s.telemetry.MeasureSince(now, "root_store", "commit") + } + s.logger.Warn(fmt.Sprintf("commit version %d took %s", cs.Version, time.Since(now))) + }() if err := s.handleMigration(cs); err != nil { return nil, err @@ -305,27 +312,29 @@ func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { // background pruning process (iavl v1 for example) which must be paused during the commit s.pruningManager.PausePruning() - eg := new(errgroup.Group) - - // commit SC async - var cInfo *proof.CommitInfo - eg.Go(func() error { - if err := s.stateCommitment.WriteChangeset(cs); err != nil { - return fmt.Errorf("failed to write batch to SC store: %w", err) - } - var scErr error - cInfo, scErr = s.stateCommitment.Commit(cs.Version) - if scErr != nil { - return fmt.Errorf("failed to commit SC store: %w", scErr) - } - return nil - }) + st := time.Now() + s.preCommit.Lock() + if err := s.stateCommitment.WriteChangeset(cs); err != nil { + s.preCommit.Unlock() + return nil, fmt.Errorf("failed to write batch to SC store: %w", err) + } + lastVersion := s.preCommitVersion + s.preCommitVersion = cs.Version + s.preCommit.Unlock() - if err := eg.Wait(); err != nil { - return nil, err + cInfo, err := s.stateCommitment.Commit(cs.Version) + if err != nil { + s.preCommit.Lock() + s.preCommitVersion = lastVersion + s.preCommit.Unlock() + return nil, fmt.Errorf("failed to commit SC store: %w", err) } + s.logger.Warn(fmt.Sprintf("sc commit version %d took %s", cs.Version, time.Since(st))) if cInfo.Version != cs.Version { + s.preCommit.Lock() + s.preCommitVersion = lastVersion + s.preCommit.Unlock() return nil, fmt.Errorf("commit version mismatch: got %d, expected %d", cInfo.Version, cs.Version) } s.lastCommitInfo = cInfo diff --git a/tests/go.mod b/tests/go.mod index c6bb0aae5a11..e0d3f5c6e7d6 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -84,11 +84,13 @@ require ( github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/aws/aws-sdk-go v1.55.5 // indirect + github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/bufbuild/protocompile v0.14.1 // indirect + github.com/bvinc/go-sqlite-lite v0.6.1 // indirect github.com/bytedance/sonic v1.12.4 // indirect github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -107,6 +109,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect @@ -168,6 +171,7 @@ require ( github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect + github.com/kocubinski/costor-api v1.1.1 // 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 diff --git a/tests/go.sum b/tests/go.sum index 4ca4d03dc5dd..ddf9622edf93 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -236,6 +236,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e h1:dSeuFcs4WAJJnswS8vXy7YY1+fdlbVPuEVmDAfqvFOQ= +github.com/aybabtme/uniplot v0.0.0-20151203143629-039c559e5e7e/go.mod h1:uh71c5Vc3VNIplXOFXsnDy21T1BepgT32c5X/YPrOyc= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -253,6 +255,8 @@ github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/ github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/bvinc/go-sqlite-lite v0.6.1 h1:JU8Rz5YAOZQiU3WEulKF084wfXpytRiqD2IaW2QjPz4= +github.com/bvinc/go-sqlite-lite v0.6.1/go.mod h1:2GiE60NUdb0aNhDdY+LXgrqAVDpi2Ijc6dB6ZMp9x6s= github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -331,6 +335,10 @@ github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fr github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= +github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= +github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -628,6 +636,8 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kocubinski/costor-api v1.1.1 h1:sgfJA7T/8IfZ59zxiMrED0xdjerAFuPNBTqyO90GiEE= +github.com/kocubinski/costor-api v1.1.1/go.mod h1:ESMBMDkKfN+9vvvhhNVdKLhbOmzI3O/i16iXvRM9Tuc= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= From f2e9c0de7e5030c9178add5fe3ddd1a5d2ea502e Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Sun, 8 Dec 2024 12:02:50 -0600 Subject: [PATCH 16/27] improve rate logging --- tools/benchmark/client/cli/tx.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go index b92ca0c7dcd3..e1f46d0aaf0a 100644 --- a/tools/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -62,8 +62,8 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { }() var ( - successCount uint64 - errCount uint64 + successCount int + errCount int since = time.Now() last int ) @@ -110,6 +110,7 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { }() i := 0 + begin := time.Now() ops := make([]*benchmark.Op, numOps) for { select { @@ -119,10 +120,13 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { } if time.Since(since) > 5*time.Second { cmd.Printf( - "success_tx=%d err_tx=%d seq=%d rate=%.2f/s\n", - successCount, errCount, accSeq, float64(i-last)/time.Since(since).Seconds()) + "success_tx=%d err_tx=%d seq=%d rate=%.2f/s overall=%.2f/s\n", + successCount, errCount, accSeq, + float64(successCount-last)/time.Since(since).Seconds(), + float64(successCount)/time.Since(begin).Seconds(), + ) since = time.Now() - last = i + last = successCount } for j := range numOps { From ec91784577ec32eb44a7d29d2e59fe007aa59ee1 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Sun, 8 Dec 2024 12:02:50 -0600 Subject: [PATCH 17/27] improve rate logging --- tools/benchmark/client/cli/tx.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go index b92ca0c7dcd3..e1f46d0aaf0a 100644 --- a/tools/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -62,8 +62,8 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { }() var ( - successCount uint64 - errCount uint64 + successCount int + errCount int since = time.Now() last int ) @@ -110,6 +110,7 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { }() i := 0 + begin := time.Now() ops := make([]*benchmark.Op, numOps) for { select { @@ -119,10 +120,13 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { } if time.Since(since) > 5*time.Second { cmd.Printf( - "success_tx=%d err_tx=%d seq=%d rate=%.2f/s\n", - successCount, errCount, accSeq, float64(i-last)/time.Since(since).Seconds()) + "success_tx=%d err_tx=%d seq=%d rate=%.2f/s overall=%.2f/s\n", + successCount, errCount, accSeq, + float64(successCount-last)/time.Since(since).Seconds(), + float64(successCount)/time.Since(begin).Seconds(), + ) since = time.Now() - last = i + last = successCount } for j := range numOps { From 4b43c9967796cdec79703c900272bb0f64ca9d1f Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Tue, 10 Dec 2024 15:26:01 -0600 Subject: [PATCH 18/27] rm mutex and iavlv import/export --- scripts/init-simapp-v2.sh | 11 +++ server/v2/commands.go | 5 +- simapp/app_config.go | 2 +- store/v2/commitment/iavlv2/snapshot.go | 59 ++++++++++++ store/v2/commitment/iavlv2/tree.go | 125 ++++++++++--------------- store/v2/root/factory.go | 2 +- store/v2/root/store.go | 32 ++----- x/auth/ante/sigverify.go | 1 + 8 files changed, 136 insertions(+), 101 deletions(-) create mode 100644 store/v2/commitment/iavlv2/snapshot.go diff --git a/scripts/init-simapp-v2.sh b/scripts/init-simapp-v2.sh index f83f1115753a..3ad1eedc41b1 100755 --- a/scripts/init-simapp-v2.sh +++ b/scripts/init-simapp-v2.sh @@ -17,6 +17,14 @@ sed -i '' 's/prometheus = false/prometheus = true/' "$SIMD_HOME"/config/config.t $SIMD_BIN keys add alice --indiscreet $SIMD_BIN keys add bob --indiscreet +aliases="" +for i in $(seq 10); do + alias=$(dd if=/dev/urandom bs=16 count=24 2> /dev/null | base32 | head -c 32) + $SIMD_BIN keys add "$alias" --indiscreet + aliases="$aliases $alias" +done +echo "Generated aliases: $aliases" + $SIMD_BIN init simapp-v2-node --chain-id simapp-v2-chain # to change the voting_period jq '.app_state.gov.params.voting_period = "600s"' $SIMD_HOME/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json @@ -24,5 +32,8 @@ jq '.app_state.gov.params.expedited_voting_period = "300s"' $SIMD_HOME/config/ge jq '.app_state.mint.minter.inflation = "0.300000000000000000"' $SIMD_HOME/config/genesis.json > temp.json && mv temp.json $SIMD_HOME/config/genesis.json # to change the inflation $SIMD_BIN genesis add-genesis-account alice 5000000000stake --keyring-backend test $SIMD_BIN genesis add-genesis-account bob 5000000000stake --keyring-backend test +for a in $aliases; do + $SIMD_BIN genesis add-genesis-account "$a" 100000000stake --keyring-backend test +done $SIMD_BIN genesis gentx alice 1000000stake --chain-id simapp-v2-chain $SIMD_BIN genesis collect-gentxs \ No newline at end of file diff --git a/server/v2/commands.go b/server/v2/commands.go index b0cf632138b1..082e78243f33 100644 --- a/server/v2/commands.go +++ b/server/v2/commands.go @@ -117,8 +117,9 @@ func createStartCommand[T transaction.Tx]( // wrapCPUProfile starts CPU profiling, if enabled, and executes the provided // callbackFn, then waits for it to return. func wrapCPUProfile(logger log.Logger, cfg server.ConfigMap, callbackFn func() error) error { - cpuProfileFile, ok := cfg[FlagCPUProfiling] - if !ok { + serverCfg := cfg[serverName].(map[string]any) + cpuProfileFile, ok := serverCfg["cpu-profile"] + if !ok || cpuProfileFile == "" { // if cpu profiling is not enabled, just run the callback return callbackFn() } diff --git a/simapp/app_config.go b/simapp/app_config.go index 606c0f34f617..47e028978493 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -305,7 +305,7 @@ var ( GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, BucketCount: 3, - GenesisCount: 10_000_000, + GenesisCount: 1_000_000, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/store/v2/commitment/iavlv2/snapshot.go b/store/v2/commitment/iavlv2/snapshot.go new file mode 100644 index 000000000000..ad3a8bada0d9 --- /dev/null +++ b/store/v2/commitment/iavlv2/snapshot.go @@ -0,0 +1,59 @@ +package iavlv2 + +import ( + "errors" + + "github.com/cosmos/iavl/v2" + + "cosmossdk.io/store/v2/commitment" + snapshotstypes "cosmossdk.io/store/v2/snapshots/types" +) + +// Exporter is a wrapper around iavl.Exporter. +type Exporter struct { + exporter *iavl.Exporter +} + +// Next returns the next item in the exporter. +func (e *Exporter) Next() (*snapshotstypes.SnapshotIAVLItem, error) { + item, err := e.exporter.Next() + if err != nil { + if errors.Is(err, iavl.ErrorExportDone) { + return nil, commitment.ErrorExportDone + } + return nil, err + } + + return &snapshotstypes.SnapshotIAVLItem{ + Key: item.Key(), + Value: item.Value(), + Version: item.Version(), + Height: int32(item.Height()), + }, nil +} + +// Close closes the exporter. +func (e *Exporter) Close() error { + return e.exporter.Close() +} + +type Importer struct { + importer *iavl.Importer +} + +// Add adds the given item to the importer. +func (i *Importer) Add(item *snapshotstypes.SnapshotIAVLItem) error { + return i.importer.Add(iavl.NewImportNode(item.Key, item.Value, item.Version, int8(item.Height))) +} + +// Commit commits the importer. +func (i *Importer) Commit() error { + return i.importer.Commit() +} + +// Close closes the importer. +func (i *Importer) Close() error { + i.importer.Close() + + return nil +} diff --git a/store/v2/commitment/iavlv2/tree.go b/store/v2/commitment/iavlv2/tree.go index c7d19006ed46..c421b8a66c28 100644 --- a/store/v2/commitment/iavlv2/tree.go +++ b/store/v2/commitment/iavlv2/tree.go @@ -1,7 +1,6 @@ package iavlv2 import ( - "errors" "fmt" "cosmossdk.io/core/log" @@ -101,52 +100,28 @@ func (t *Tree) Get(version uint64, key []byte) ([]byte, error) { if err := isHighBitSet(version); err != nil { return nil, err } - h := t.tree.Version() v := int64(version) - switch { - // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) - case v == h || v == h+1: - return t.tree.Get(key) - case v > h: + h := t.tree.Version() + if v > h { return nil, fmt.Errorf("get: cannot read future version %d; h: %d path=%s", v, h, t.path) - case v < h: - cloned, err := t.tree.ReadonlyClone() - if err != nil { - return nil, err - } - if err = cloned.LoadVersion(int64(version)); err != nil { - return nil, err - } - return cloned.Get(key) - default: - return nil, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) } + versionFound, val, err := t.tree.GetRecent(v, key) + if versionFound { + return val, err + } + cloned, err := t.tree.ReadonlyClone() + if err != nil { + return nil, err + } + if err = cloned.LoadVersion(int64(version)); err != nil { + return nil, err + } + return cloned.Get(key) } func (t *Tree) Has(version uint64, key []byte) (bool, error) { - if err := isHighBitSet(version); err != nil { - return false, err - } - h := t.tree.Version() - v := int64(version) - switch { - // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) - case v == h || v == h+1: - return t.tree.Has(key) - case v > h: - return false, fmt.Errorf("has: cannot read future version %d; h: %d", v, h) - case v < h: - cloned, err := t.tree.ReadonlyClone() - if err != nil { - return false, err - } - if err = cloned.LoadVersion(int64(version)); err != nil { - return false, err - } - return cloned.Has(key) - default: - return false, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) - } + res, err := t.Get(version, key) + return res != nil, err } func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (corestore.Iterator, error) { @@ -155,45 +130,49 @@ func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (core } h := t.tree.Version() v := int64(version) - - switch { - // TODO permit h+1 read only if the tree is dirty (i.e. has uncommitted changes from WriteChangeset) - case v == h || v == h+1: - if ascending { - // inclusive = false is IAVL v1's default behavior. - // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. - return t.tree.Iterator(start, end, false) - } else { - return t.tree.ReverseIterator(start, end) - } - case v > h: - return nil, fmt.Errorf("has: cannot read future version %d; h: %d", v, h) - case v < h: - cloned, err := t.tree.ReadonlyClone() - if err != nil { - return nil, err - } - if err = cloned.LoadVersion(int64(version)); err != nil { - return nil, err - } - if ascending { - // inclusive = false is IAVL v1's default behavior. - // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. - return t.tree.Iterator(start, end, false) - } else { - return t.tree.ReverseIterator(start, end) - } - default: - return nil, fmt.Errorf("unexpected version comparison: tree version: %d, requested: %d", h, v) + if v > h { + return nil, fmt.Errorf("iterator: cannot read future version %d; h: %d", v, h) + } + ok, itr := t.tree.IterateRecent(v, start, end, ascending) + if ok { + return itr, nil + } + cloned, err := t.tree.ReadonlyClone() + if err != nil { + return nil, err + } + if err = cloned.LoadVersion(int64(version)); err != nil { + return nil, err + } + if ascending { + // inclusive = false is IAVL v1's default behavior. + // the read expectations of certain modules (like x/staking) will cause a panic if this is changed. + return t.tree.Iterator(start, end, false) + } else { + return t.tree.ReverseIterator(start, end) } } func (t *Tree) Export(version uint64) (commitment.Exporter, error) { - return nil, errors.New("snapshot import/export not yet supported") + if err := isHighBitSet(version); err != nil { + return nil, err + } + e, err := t.tree.Export(int64(version), iavl.PostOrder) + if err != nil { + return nil, err + } + return &Exporter{e}, nil } func (t *Tree) Import(version uint64) (commitment.Importer, error) { - return nil, errors.New("snapshot import/export not yet supported") + if err := isHighBitSet(version); err != nil { + return nil, err + } + importer, err := t.tree.Import(int64(version)) + if err != nil { + return nil, err + } + return &Importer{importer}, nil } func (t *Tree) Close() error { diff --git a/store/v2/root/factory.go b/store/v2/root/factory.go index 3927e7f9c986..53a0f02776a9 100644 --- a/store/v2/root/factory.go +++ b/store/v2/root/factory.go @@ -103,7 +103,7 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { dir := fmt.Sprintf("%s/data/iavl-v2/%s", opts.RootDir, key) // TODO load from config YAML or at least simapp iavlOpts := iavl_v2.DefaultTreeOptions() - iavlOpts.EvictionDepth = 18 + iavlOpts.EvictionDepth = 22 iavlOpts.HeightFilter = 1 iavlOpts.CheckpointInterval = 55 return iavlv2.NewTree(iavlOpts, iavl_v2.SqliteDbOptions{Path: dir}, opts.Logger) diff --git a/store/v2/root/store.go b/store/v2/root/store.go index 9343595bb4ad..9ea3afdf6ad5 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -54,9 +54,6 @@ type Store struct { chDone chan struct{} // isMigrating reflects whether the store is currently migrating isMigrating bool - - preCommit sync.RWMutex - preCommitVersion uint64 } // New creates a new root Store instance. @@ -124,18 +121,16 @@ func (s *Store) StateAt(v uint64) (corestore.ReaderMap, error) { } func (s *Store) StateLatest() (uint64, corestore.ReaderMap, error) { - s.preCommit.RLock() - v := s.preCommitVersion - s.preCommit.RUnlock() - if v == 0 { - var err error - v, err = s.GetLatestVersion() - if err != nil { - return 0, nil, err - } + v, err := s.GetLatestVersion() + if err != nil { + return 0, nil, err + } + vReader, err := s.getVersionedReader(v) + if err != nil { + return 0, nil, err } - return v, NewReaderMap(v, s.stateCommitment), nil + return v, NewReaderMap(v, vReader), nil } func (s *Store) GetStateCommitment() store.Committer { @@ -313,28 +308,17 @@ func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { s.pruningManager.PausePruning() st := time.Now() - s.preCommit.Lock() if err := s.stateCommitment.WriteChangeset(cs); err != nil { - s.preCommit.Unlock() return nil, fmt.Errorf("failed to write batch to SC store: %w", err) } - lastVersion := s.preCommitVersion - s.preCommitVersion = cs.Version - s.preCommit.Unlock() cInfo, err := s.stateCommitment.Commit(cs.Version) if err != nil { - s.preCommit.Lock() - s.preCommitVersion = lastVersion - s.preCommit.Unlock() return nil, fmt.Errorf("failed to commit SC store: %w", err) } s.logger.Warn(fmt.Sprintf("sc commit version %d took %s", cs.Version, time.Since(st))) if cInfo.Version != cs.Version { - s.preCommit.Lock() - s.preCommitVersion = lastVersion - s.preCommit.Unlock() return nil, fmt.Errorf("commit version mismatch: got %d, expected %d", cInfo.Version, cs.Version) } s.lastCommitInfo = cInfo diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 3b83b17e3379..f37bb0b0a582 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -379,6 +379,7 @@ func (svd SigVerificationDecorator) verifySig(ctx context.Context, tx sdk.Tx, ac // and therefore communicate sequence number as a potential cause of error. errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d), sequence (%d) and chain-id (%s): (%s)", accNum, acc.GetSequence(), chainID, err.Error()) } else { + fmt.Printf("signature verification failed!!!! account number (%d)", accNum) errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d) and chain-id (%s): (%s)", accNum, chainID, err.Error()) } return errorsmod.Wrap(sdkerrors.ErrUnauthorized, errMsg) From 0693d8c5c655e7b8324442ee5ab23449286f2b87 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Tue, 10 Dec 2024 16:52:47 -0600 Subject: [PATCH 19/27] go mod tidy all --- simapp/v2/go.mod | 2 +- tools/benchmark/go.mod | 4 ++-- tools/benchmark/go.sum | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index cfcc5b7d19c1..4129553481f1 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -43,8 +43,8 @@ require ( ) require ( - cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/indexer/postgres v0.0.0-20241204160609-556102cfa046 + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 diff --git a/tools/benchmark/go.mod b/tools/benchmark/go.mod index 8af851297594..d4a143ad9142 100644 --- a/tools/benchmark/go.mod +++ b/tools/benchmark/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.4.0 // indirect - cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect + cosmossdk.io/schema v0.4.0 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/tx v1.0.0-alpha.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -89,7 +89,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.9.3 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/tools/benchmark/go.sum b/tools/benchmark/go.sum index 91457b7e51b6..490fe724f419 100644 --- a/tools/benchmark/go.sum +++ b/tools/benchmark/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= -cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b h1:svpFdulZRrYz+RTHu2u9CeKkMKrIHx5354vjiHerovo= -cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.4.0 h1:TrBs5BUnGqniAwEBVsjiisrAk3h3DK/zHLU1O8fRnO0= +cosmossdk.io/schema v0.4.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc h1:R9O9d75e0qZYUsVV0zzi+D7cNLnX2JrUOQNoIPaF0Bg= cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc/go.mod h1:amTTatOUV3u1PsKmNb87z6/galCxrRbz9kRdJkL0DyU= cosmossdk.io/x/tx v1.0.0-alpha.1 h1:5w61etWMQbdCSR7uveWXCnGnD5eQ/64B2vzIhqA80yo= @@ -297,8 +297,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/linxGnu/grocksdb v1.9.3 h1:s1cbPcOd0cU2SKXRG1nEqCOWYAELQjdqg3RVI2MH9ik= github.com/linxGnu/grocksdb v1.9.3/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= From 91d4291389342f835f2c7c6f66859c19b542fd87 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Tue, 10 Dec 2024 18:06:09 -0600 Subject: [PATCH 20/27] add comments, some review fixes --- scripts/build/build.mk | 5 +++ simapp/app_config.go | 19 ++-------- simapp/app_di.go | 3 +- simapp/benchmark.go | 30 ++++++++++++++++ simapp/v2/app_config.go | 19 ++-------- simapp/v2/app_di.go | 3 +- simapp/v2/benchmark.go | 30 ++++++++++++++++ tools/benchmark/generator/gen.go | 35 ++++++++++++++++++- tools/benchmark/module/depinject.go | 1 - tools/benchmark/module/module.go | 5 +-- tools/benchmark/proto/buf.yaml | 2 +- .../cosmos/benchmark/module/v1/module.proto | 11 ++++++ 12 files changed, 120 insertions(+), 43 deletions(-) create mode 100644 simapp/benchmark.go create mode 100644 simapp/v2/benchmark.go diff --git a/scripts/build/build.mk b/scripts/build/build.mk index 581ee1dbe06d..da13b0e95e23 100644 --- a/scripts/build/build.mk +++ b/scripts/build/build.mk @@ -70,6 +70,11 @@ ifeq (bls12381,$(findstring bls12381,$(COSMOS_BUILD_OPTIONS))) build_tags += bls12381 endif +# benchmark module +ifeq (benchmark,$(findstring benchmark,$(COSMOS_BUILD_OPTIONS))) + build_tags += benchmark +endif + whitespace := whitespace += $(whitespace) comma := , diff --git a/simapp/app_config.go b/simapp/app_config.go index 45846b673aba..1eb1d5b16dd0 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -12,7 +12,6 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" - benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" @@ -109,7 +108,7 @@ var ( } // application configuration (used by depinject) - appConfig = appconfig.Compose(&appv1alpha1.Config{ + appConfig = &appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { Name: runtime.ModuleName, @@ -299,20 +298,6 @@ var ( Name: bankv2types.ModuleName, Config: appconfig.WrapAny(&bankmodulev2.Module{}), }, - { - Name: benchmark.ModuleName, - Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ - GenesisParams: &benchmarkmodulev1.GeneratorParams{ - Seed: 34, - BucketCount: 1, - GenesisCount: 100, - KeyMean: 64, - KeyStdDev: 12, - ValueMean: 1024, - ValueStdDev: 256, - }, - }), - }, }, - }) + } ) diff --git a/simapp/app_di.go b/simapp/app_di.go index 90de295e8b7d..e57e2899d1c0 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -13,6 +13,7 @@ import ( "cosmossdk.io/core/registry" corestore "cosmossdk.io/core/store" "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" _ "cosmossdk.io/indexer/postgres" // register the postgres indexer "cosmossdk.io/log" "cosmossdk.io/x/accounts" @@ -96,7 +97,7 @@ func init() { // AppConfig returns the default app config. func AppConfig() depinject.Config { return depinject.Configs( - appConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) + appconfig.Compose(appConfig), // Alternatively use appconfig.LoadYAML(AppConfigYAML) depinject.Provide( ProvideExampleMintFn, // optional: override the mint module's mint function with epoched minting ), diff --git a/simapp/benchmark.go b/simapp/benchmark.go new file mode 100644 index 000000000000..64bb9e039ac8 --- /dev/null +++ b/simapp/benchmark.go @@ -0,0 +1,30 @@ +//go:build benchmark + +package simapp + +import ( + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" + "cosmossdk.io/depinject/appconfig" + benchmark "cosmossdk.io/tools/benchmark/module" +) + +func init() { + // WARNING! + // Enabling this module will produce 3M keys in the genesis state for the benchmark module. + // Will also enable processing of benchmark transactions which can easily overwhelm the system. + appConfig.Modules = append(appConfig.Modules, &appv1alpha1.ModuleConfig{ + Name: benchmark.ModuleName, + Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ + GenesisParams: &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 3, + GenesisCount: 3_000_000, + KeyMean: 64, + KeyStdDev: 12, + ValueMean: 1024, + ValueStdDev: 256, + }, + }), + }) +} diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index b21565822ee0..b8271884fb5e 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -12,7 +12,6 @@ import ( authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" authzmodulev1 "cosmossdk.io/api/cosmos/authz/module/v1" bankmodulev1 "cosmossdk.io/api/cosmos/bank/module/v1" - benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" @@ -109,7 +108,7 @@ var ( } // ModuleConfig is the application module configuration used by depinject - ModuleConfig = appconfig.Compose(&appv1alpha1.Config{ + ModuleConfig = &appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { Name: runtime.ModuleName, @@ -304,20 +303,6 @@ var ( Name: bankv2types.ModuleName, Config: appconfig.WrapAny(&bankmodulev2.Module{}), }, - { - Name: benchmark.ModuleName, - Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ - GenesisParams: &benchmarkmodulev1.GeneratorParams{ - Seed: 34, - BucketCount: 1, - GenesisCount: 100, - KeyMean: 64, - KeyStdDev: 12, - ValueMean: 1024, - ValueStdDev: 256, - }, - }), - }, }, - }) + } ) diff --git a/simapp/v2/app_di.go b/simapp/v2/app_di.go index e78708807b33..601d641ad060 100644 --- a/simapp/v2/app_di.go +++ b/simapp/v2/app_di.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" _ "cosmossdk.io/indexer/postgres" // register the postgres indexer "cosmossdk.io/log" "cosmossdk.io/runtime/v2" @@ -49,7 +50,7 @@ type SimApp[T transaction.Tx] struct { // AppConfig returns the default app config. func AppConfig() depinject.Config { return depinject.Configs( - ModuleConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) + appconfig.Compose(ModuleConfig), // Alternatively use appconfig.LoadYAML(AppConfigYAML) runtime.DefaultServiceBindings(), codec.DefaultProviders, depinject.Provide( diff --git a/simapp/v2/benchmark.go b/simapp/v2/benchmark.go new file mode 100644 index 000000000000..25e5f9956003 --- /dev/null +++ b/simapp/v2/benchmark.go @@ -0,0 +1,30 @@ +//go:build benchmark + +package simapp + +import ( + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" + "cosmossdk.io/depinject/appconfig" + benchmark "cosmossdk.io/tools/benchmark/module" +) + +func init() { + // WARNING! + // Enabling this module will produce 3M keys in the genesis state for the benchmark module. + // Will also enable processing of benchmark transactions which can easily overwhelm the system. + ModuleConfig.Modules = append(ModuleConfig.Modules, &appv1alpha1.ModuleConfig{ + Name: benchmark.ModuleName, + Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ + GenesisParams: &benchmarkmodulev1.GeneratorParams{ + Seed: 34, + BucketCount: 3, + GenesisCount: 3_000_000, + KeyMean: 64, + KeyStdDev: 12, + ValueMean: 1024, + ValueStdDev: 256, + }, + }), + }) +} diff --git a/tools/benchmark/generator/gen.go b/tools/benchmark/generator/gen.go index 1d473781cbab..c8c4e2c00c27 100644 --- a/tools/benchmark/generator/gen.go +++ b/tools/benchmark/generator/gen.go @@ -16,6 +16,7 @@ import ( "cosmossdk.io/tools/benchmark" ) +// Options is the configuration for the generator. type Options struct { *module.GeneratorParams // HomeDir is for reading/writing state @@ -27,6 +28,8 @@ type Options struct { DeleteWeight float64 } +// State is the state of the generator. +// It can be marshaled and unmarshaled to/from a binary format. type State struct { Src interface { rand.Source @@ -36,6 +39,7 @@ type State struct { Keys [][]Payload } +// Marshal writes the state to w. func (s *State) Marshal(w io.Writer) error { srcBz, err := s.Src.MarshalBinary() if err != nil { @@ -65,6 +69,7 @@ func (s *State) Marshal(w io.Writer) error { return nil } +// Unmarshal reads the state from r. func (s *State) Unmarshal(r io.Reader) error { srcBz := make([]byte, 20) if _, err := r.Read(srcBz); err != nil { @@ -95,6 +100,9 @@ func (s *State) Unmarshal(r io.Reader) error { return nil } +// Generator generates operations for a benchmark transaction. +// The generator is stateful, keeping track of which keys have been inserted +// so that meaningful gets and deletes can be generated. type Generator struct { Options @@ -104,6 +112,7 @@ type Generator struct { type opt func(*Generator) +// NewGenerator creates a new generator with the given options. func NewGenerator(opts Options, f ...opt) *Generator { g := &Generator{ Options: opts, @@ -118,6 +127,9 @@ func NewGenerator(opts Options, f ...opt) *Generator { return g } +// WithGenesis sets the generator state to the genesis seed. +// When the generator is created, it will sync to genesis state. +// The benchmark client needs to do this so that it can generate meaningful tx operations. func WithGenesis() func(*Generator) { return func(g *Generator) { // sync state to genesis seed @@ -130,6 +142,7 @@ func WithGenesis() func(*Generator) { } } +// WithSeed sets the seed for the generator. func WithSeed(seed uint64) func(*Generator) { return func(g *Generator) { g.state.Src = rand.NewPCG(seed, seed>>32) @@ -137,6 +150,7 @@ func WithSeed(seed uint64) func(*Generator) { } } +// Load loads the generator state from disk. func (g *Generator) Load() error { f := fmt.Sprintf("%s/data/generator_state.bin", g.HomeDir) r, err := os.Open(f) @@ -149,16 +163,22 @@ func (g *Generator) Load() error { return g.state.Unmarshal(r) } +// Payload is a 2-tuple of seed and length. +// A seed is uint64 which is used to generate a byte slice of size length. type Payload [2]uint64 +// Seed returns the seed in the payload. func (p Payload) Seed() uint64 { return p[0] } +// Length returns the length in the payload. func (p Payload) Length() uint64 { return p[1] } +// Bytes returns the byte slice generated from the seed and length. +// The underlying byte slice is deterministically generated using the (very fast) xxhash algorithm. func (p Payload) Bytes() []byte { return Bytes(p.Seed(), p.Length()) } @@ -171,6 +191,7 @@ func NewPayload(seed, length uint64) Payload { return Payload{seed, length} } +// KV is a key-value pair with a store key. type KV struct { StoreKey uint64 Key Payload @@ -194,6 +215,9 @@ func (g *Generator) setKey(bucket uint64, payload Payload) { g.state.Keys[bucket] = append(g.state.Keys[bucket], payload) } +// GenesisSet returns a sequence of key-value pairs for the genesis state. +// It is called by the server during InitGenesis to generate and set the initial state. +// The client uses WithGenesis to sync to the genesis state. func (g *Generator) GenesisSet() iter.Seq[*KV] { return func(yield func(*KV) bool) { for range g.GenesisCount { @@ -209,9 +233,12 @@ func (g *Generator) GenesisSet() iter.Seq[*KV] { } } +// Next generates the next benchmark operation. +// The operation is one of insert, update, get, or delete. +// The tx client calls this function to deterministically generate the next operation. func (g *Generator) Next() (uint64, *benchmark.Op, error) { if g.InsertWeight+g.UpdateWeight+g.GetWeight+g.DeleteWeight != 1 { - return 0, nil, fmt.Errorf("probabilities must sum to 1") + return 0, nil, fmt.Errorf("weights must sum to 1") } var ( @@ -265,6 +292,7 @@ func (g *Generator) Next() (uint64, *benchmark.Op, error) { return bucket, op, nil } +// NormUint64 returns a random uint64 with a normal distribution. func (g *Generator) NormUint64(mean, stdDev uint64) uint64 { return uint64(g.rand.NormFloat64()*float64(stdDev) + float64(mean)) } @@ -277,6 +305,7 @@ func (g *Generator) getLength(mean, stdDev uint64) uint64 { return length } +// UintN returns a random uint64 in the range [0, n). func (g *Generator) UintN(n uint64) uint64 { return g.rand.Uint64N(n) } @@ -305,6 +334,7 @@ func encodeUint64(x uint64) []byte { const maxStoreKeyGenIterations = 100 +// StoreKeys deterministically generates a set of unique store keys from seed. func StoreKeys(prefix string, seed, count uint64) ([]string, error) { r := rand.New(rand.NewPCG(seed, seed>>32)) keys := make([]string, count) @@ -323,10 +353,13 @@ func StoreKeys(prefix string, seed, count uint64) ([]string, error) { keys[i] = sk seen[sk] = struct{}{} i++ + j++ } return keys, nil } +// Bytes generates a byte slice of length length from seed. +// The byte slice is deterministically generated using the (very fast) xxhash algorithm. func Bytes(seed, length uint64) []byte { b := make([]byte, length) rounds := length / 8 diff --git a/tools/benchmark/module/depinject.go b/tools/benchmark/module/depinject.go index ffb9b653aa28..d09d98c895e1 100644 --- a/tools/benchmark/module/depinject.go +++ b/tools/benchmark/module/depinject.go @@ -17,7 +17,6 @@ const ModuleName = "benchmark" const maxStoreKeyGenIterations = 100 func init() { - // TODO try depinject gogo API appconfig.RegisterModule( &modulev1.Module{}, appconfig.Provide( diff --git a/tools/benchmark/module/module.go b/tools/benchmark/module/module.go index dfe1423b2d7b..ad40eb04e9d9 100644 --- a/tools/benchmark/module/module.go +++ b/tools/benchmark/module/module.go @@ -3,8 +3,6 @@ package module import ( "context" "encoding/json" - "fmt" - "github.com/cosmos/cosmos-sdk/types/msgservice" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -67,8 +65,7 @@ func (a *AppModule) InitGenesis(ctx context.Context, _ json.RawMessage) error { for kv := range g.GenesisSet() { i++ if i%100_000 == 0 { - fmt.Printf("init genesis: %d/%d\n", i, a.genesisParams.GenesisCount) - a.log.Warn("init genesis", "progress", i, "total", a.genesisParams.GenesisCount) + a.log.Warn("benchmark: init genesis", "progress", i, "total", a.genesisParams.GenesisCount) } sk := a.storeKeys[kv.StoreKey] key := gen.Bytes(kv.Key.Seed(), kv.Key.Length()) diff --git a/tools/benchmark/proto/buf.yaml b/tools/benchmark/proto/buf.yaml index 19fd0b6afb95..ae83b8045617 100644 --- a/tools/benchmark/proto/buf.yaml +++ b/tools/benchmark/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/mods/consensus +name: buf.build/mods/benchmark deps: - buf.build/cosmos/cosmos-sdk # pin the Cosmos SDK version - buf.build/cometbft/cometbft:4a62c99d422068a5165429b62a7eb824df46cca9 # CometBFT v0.38 diff --git a/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto b/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto index 2e22994cdf9b..c0bc93f0dfb5 100644 --- a/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto +++ b/tools/benchmark/proto/cosmos/benchmark/module/v1/module.proto @@ -15,18 +15,29 @@ message Module { // GenesisParams defines the genesis parameters for the benchmark module. message GeneratorParams { + // seed is the seed for the random number generator. uint64 seed = 1; + // bucket_count is the number of store keys to uniformly distribute genesis_count keys across. uint64 bucket_count = 2; + // key_mean is the mean size (in normal distribution) of keys in each bucket. uint64 key_mean = 3; + // key_std_dev is the standard deviation of key sizes in each bucket. uint64 key_std_dev = 4; + // value_mean is the mean size (in normal distribution) of values in each bucket. uint64 value_mean = 6; + // value_std_dev is the standard deviation of value sizes in each bucket. uint64 value_std_dev = 7; + // genesis_count is the number of keys to insert in the store, distributed across all buckets. uint64 genesis_count = 8; + // insert_weight is the weight of insert operations. float insert_weight = 9; + // update_weight is the weight of update operations. float update_weight = 10; + // get_weight is the weight of get operations. float get_weight = 12; + // delete_weight is the weight of delete operations. float delete_weight = 11; } \ No newline at end of file From 1d25773df8518d3dc40cad35ac4b35f97ac1d0c2 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Tue, 10 Dec 2024 19:05:43 -0600 Subject: [PATCH 21/27] fix init genesis order --- simapp/app_config.go | 2 -- simapp/benchmark.go | 9 +++++++++ simapp/v2/app_config.go | 2 -- simapp/v2/benchmark.go | 9 +++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/simapp/app_config.go b/simapp/app_config.go index 1eb1d5b16dd0..275c3f730fe0 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -31,7 +31,6 @@ import ( validatemodulev1 "cosmossdk.io/api/cosmos/validate/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" - benchmark "cosmossdk.io/tools/benchmark/module" "cosmossdk.io/x/accounts" "cosmossdk.io/x/authz" _ "cosmossdk.io/x/authz/module" // import for side-effects @@ -175,7 +174,6 @@ var ( circuittypes.ModuleName, pooltypes.ModuleName, epochstypes.ModuleName, - benchmark.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order diff --git a/simapp/benchmark.go b/simapp/benchmark.go index 64bb9e039ac8..50a16ea909b8 100644 --- a/simapp/benchmark.go +++ b/simapp/benchmark.go @@ -3,10 +3,12 @@ package simapp import ( + runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" "cosmossdk.io/depinject/appconfig" benchmark "cosmossdk.io/tools/benchmark/module" + "fmt" ) func init() { @@ -27,4 +29,11 @@ func init() { }, }), }) + runtimeConfig := &runtimev1alpha1.Module{} + err := appConfig.Modules[0].Config.UnmarshalTo(runtimeConfig) + if err != nil { + panic(fmt.Errorf("benchmark init: failed to unmarshal runtime module config: %w", err)) + } + runtimeConfig.InitGenesis = append(runtimeConfig.InitGenesis, benchmark.ModuleName) + appConfig.Modules[0].Config = appconfig.WrapAny(runtimeConfig) } diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index b8271884fb5e..0681354b549e 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -31,7 +31,6 @@ import ( validatemodulev1 "cosmossdk.io/api/cosmos/validate/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" - benchmark "cosmossdk.io/tools/benchmark/module" "cosmossdk.io/x/accounts" "cosmossdk.io/x/authz" _ "cosmossdk.io/x/authz/module" // import for side-effects @@ -174,7 +173,6 @@ var ( circuittypes.ModuleName, pooltypes.ModuleName, epochstypes.ModuleName, - benchmark.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order diff --git a/simapp/v2/benchmark.go b/simapp/v2/benchmark.go index 25e5f9956003..85376b02cb83 100644 --- a/simapp/v2/benchmark.go +++ b/simapp/v2/benchmark.go @@ -3,10 +3,12 @@ package simapp import ( + runtimev2 "cosmossdk.io/api/cosmos/app/runtime/v2" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" "cosmossdk.io/depinject/appconfig" benchmark "cosmossdk.io/tools/benchmark/module" + "fmt" ) func init() { @@ -27,4 +29,11 @@ func init() { }, }), }) + runtimeConfig := &runtimev2.Module{} + err := ModuleConfig.Modules[0].Config.UnmarshalTo(runtimeConfig) + if err != nil { + panic(fmt.Errorf("benchmark init: failed to unmarshal runtime module config: %w", err)) + } + runtimeConfig.InitGenesis = append(runtimeConfig.InitGenesis, benchmark.ModuleName) + ModuleConfig.Modules[0].Config = appconfig.WrapAny(runtimeConfig) } From 256ca9342b9743921151960febb370113aa4abb3 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 11 Dec 2024 10:22:18 -0600 Subject: [PATCH 22/27] a store/v1 replace directive is required --- tools/benchmark/go.mod | 3 ++- tools/benchmark/go.sum | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/benchmark/go.mod b/tools/benchmark/go.mod index d4a143ad9142..3f84dfb70325 100644 --- a/tools/benchmark/go.mod +++ b/tools/benchmark/go.mod @@ -20,6 +20,7 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1 // indirect cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b // indirect + cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.4.0 // indirect cosmossdk.io/schema v0.4.0 // indirect @@ -48,7 +49,6 @@ require ( github.com/cometbft/cometbft-db v1.0.1 // indirect github.com/cometbft/cometbft/api v1.0.0-rc2 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.1.0 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect @@ -151,6 +151,7 @@ require ( replace ( cosmossdk.io/api => ../../api + cosmossdk.io/store => ../../store cosmossdk.io/x/bank => ../../x/bank cosmossdk.io/x/staking => ../../x/staking github.com/cosmos/cosmos-sdk => ../../ diff --git a/tools/benchmark/go.sum b/tools/benchmark/go.sum index 490fe724f419..95258663a3cb 100644 --- a/tools/benchmark/go.sum +++ b/tools/benchmark/go.sum @@ -20,8 +20,6 @@ cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= cosmossdk.io/schema v0.4.0 h1:TrBs5BUnGqniAwEBVsjiisrAk3h3DK/zHLU1O8fRnO0= cosmossdk.io/schema v0.4.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc h1:R9O9d75e0qZYUsVV0zzi+D7cNLnX2JrUOQNoIPaF0Bg= -cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc/go.mod h1:amTTatOUV3u1PsKmNb87z6/galCxrRbz9kRdJkL0DyU= cosmossdk.io/x/tx v1.0.0-alpha.1 h1:5w61etWMQbdCSR7uveWXCnGnD5eQ/64B2vzIhqA80yo= cosmossdk.io/x/tx v1.0.0-alpha.1/go.mod h1:xlJjZV1wxZBTCP+ygZx9pNT/XxsfHDPf1H0VhHaUp5w= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= From 944ac1fc522ec55e0fb7f27bd5c6447b80113af3 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 11 Dec 2024 15:45:32 -0600 Subject: [PATCH 23/27] go mod tidy --- simapp/v2/go.mod | 2 +- tools/benchmark/go.mod | 4 ++-- tools/benchmark/go.sum | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 918908768291..fdd07382f41c 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -43,8 +43,8 @@ require ( ) require ( - cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/indexer/postgres v0.0.0-20241204160609-556102cfa046 + cosmossdk.io/tools/benchmark v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 diff --git a/tools/benchmark/go.mod b/tools/benchmark/go.mod index 8af851297594..d4a143ad9142 100644 --- a/tools/benchmark/go.mod +++ b/tools/benchmark/go.mod @@ -22,7 +22,7 @@ require ( cosmossdk.io/collections v0.4.1-0.20241128094659-bd76b47e1d8b // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.4.0 // indirect - cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b // indirect + cosmossdk.io/schema v0.4.0 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/tx v1.0.0-alpha.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -89,7 +89,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.9.3 // indirect - github.com/magiconair/properties v1.8.7 // indirect + github.com/magiconair/properties v1.8.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/tools/benchmark/go.sum b/tools/benchmark/go.sum index 91457b7e51b6..490fe724f419 100644 --- a/tools/benchmark/go.sum +++ b/tools/benchmark/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= -cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b h1:svpFdulZRrYz+RTHu2u9CeKkMKrIHx5354vjiHerovo= -cosmossdk.io/schema v0.3.1-0.20241128094659-bd76b47e1d8b/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.4.0 h1:TrBs5BUnGqniAwEBVsjiisrAk3h3DK/zHLU1O8fRnO0= +cosmossdk.io/schema v0.4.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc h1:R9O9d75e0qZYUsVV0zzi+D7cNLnX2JrUOQNoIPaF0Bg= cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc/go.mod h1:amTTatOUV3u1PsKmNb87z6/galCxrRbz9kRdJkL0DyU= cosmossdk.io/x/tx v1.0.0-alpha.1 h1:5w61etWMQbdCSR7uveWXCnGnD5eQ/64B2vzIhqA80yo= @@ -297,8 +297,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/linxGnu/grocksdb v1.9.3 h1:s1cbPcOd0cU2SKXRG1nEqCOWYAELQjdqg3RVI2MH9ik= github.com/linxGnu/grocksdb v1.9.3/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= +github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= From 8626463adcef10f67daa98d1c77b529ebc115dd4 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Thu, 12 Dec 2024 09:04:48 -0600 Subject: [PATCH 24/27] tx async --- tools/benchmark/client/cli/tx.go | 2 +- tools/benchmark/go.mod | 2 +- tools/benchmark/go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go index e1f46d0aaf0a..f466d73143c1 100644 --- a/tools/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -154,7 +154,7 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { if err != nil { return err } - res, err := clientCtx.BroadcastTxSync(txBytes) + res, err := clientCtx.BroadcastTxAsync(txBytes) if err != nil { return err } diff --git a/tools/benchmark/go.mod b/tools/benchmark/go.mod index 3f84dfb70325..dc5e5bda5937 100644 --- a/tools/benchmark/go.mod +++ b/tools/benchmark/go.mod @@ -129,7 +129,7 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.12.0 // indirect - golang.org/x/crypto v0.30.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.32.0 // indirect diff --git a/tools/benchmark/go.sum b/tools/benchmark/go.sum index 95258663a3cb..55a476ac0849 100644 --- a/tools/benchmark/go.sum +++ b/tools/benchmark/go.sum @@ -461,8 +461,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= -golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= From d469c30e963f60c9ae89dbfdedc1dfeb8f7f39a9 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Mon, 30 Dec 2024 10:15:35 -0600 Subject: [PATCH 25/27] integrate with config --- runtime/v2/module.go | 1 - simapp/v2/app.go | 16 +++++++++++++++- simapp/v2/benchmark.go | 7 ++++--- store/v2/commitment/iavlv2/tree.go | 21 +++++++-------------- store/v2/commitment/store.go | 25 +++++++++++++++++++++---- store/v2/root/factory.go | 8 ++------ store/v2/root/store.go | 7 +++---- tools/benchmark/client/cli/tx.go | 4 ++-- 8 files changed, 54 insertions(+), 35 deletions(-) diff --git a/runtime/v2/module.go b/runtime/v2/module.go index 8ef338f52c2a..2a58c9b4c431 100644 --- a/runtime/v2/module.go +++ b/runtime/v2/module.go @@ -147,7 +147,6 @@ func ProvideAppBuilder[T transaction.Tx]( type AppInputs struct { depinject.In - StoreConfig *root.Config Config *runtimev2.Module AppBuilder *AppBuilder[transaction.Tx] ModuleManager *MM[transaction.Tx] diff --git a/simapp/v2/app.go b/simapp/v2/app.go index 601d641ad060..2ff1ca10bc79 100644 --- a/simapp/v2/app.go +++ b/simapp/v2/app.go @@ -28,6 +28,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" _ "github.com/cosmos/cosmos-sdk/x/genutil" + iavlv2 "github.com/cosmos/iavl/v2" ) // SimApp extends an ABCI application, but with most of its parameters exported. @@ -220,5 +221,18 @@ func (app *SimApp[T]) Close() error { } func ProvideRootStoreConfig(config runtime.GlobalConfig) (*root.Config, error) { - return serverstore.UnmarshalConfig(config) + cfg, err := serverstore.UnmarshalConfig(config) + if err != nil { + return nil, err + } + iavlV2Opts := iavlv2.DefaultTreeOptions() + iavlV2Opts.MinimumKeepVersions = int64(cfg.Options.SCPruningOption.KeepRecent) + iavlV2Opts.EvictionDepth = 22 + iavlV2Opts.HeightFilter = 1 + iavlV2Opts.CheckpointInterval = 60 + iavlV2Opts.PruneRatio = 1.5 + iavlv2.SetGlobalPruneLimit(1) + cfg.Options.IavlV2Config = iavlV2Opts + + return cfg, err } diff --git a/simapp/v2/benchmark.go b/simapp/v2/benchmark.go index 85376b02cb83..bccc212b7629 100644 --- a/simapp/v2/benchmark.go +++ b/simapp/v2/benchmark.go @@ -3,12 +3,13 @@ package simapp import ( + "fmt" + runtimev2 "cosmossdk.io/api/cosmos/app/runtime/v2" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" "cosmossdk.io/depinject/appconfig" benchmark "cosmossdk.io/tools/benchmark/module" - "fmt" ) func init() { @@ -20,8 +21,8 @@ func init() { Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ GenesisParams: &benchmarkmodulev1.GeneratorParams{ Seed: 34, - BucketCount: 3, - GenesisCount: 3_000_000, + BucketCount: 5, + GenesisCount: 20_000_000, KeyMean: 64, KeyStdDev: 12, ValueMean: 1024, diff --git a/store/v2/commitment/iavlv2/tree.go b/store/v2/commitment/iavlv2/tree.go index c421b8a66c28..52e836599658 100644 --- a/store/v2/commitment/iavlv2/tree.go +++ b/store/v2/commitment/iavlv2/tree.go @@ -3,10 +3,10 @@ package iavlv2 import ( "fmt" - "cosmossdk.io/core/log" "github.com/cosmos/iavl/v2" ics23 "github.com/cosmos/ics23/go" + "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/commitment" @@ -19,10 +19,9 @@ var ( ) type Tree struct { - tree *iavl.Tree - log log.Logger - path string - dirty bool + tree *iavl.Tree + log log.Logger + path string } func NewTree( @@ -66,14 +65,11 @@ func (t *Tree) LoadVersion(version uint64) error { return err } - if version == 0 { - return nil - } return t.tree.LoadVersion(int64(version)) } func (t *Tree) LoadVersionForOverwriting(version uint64) error { - return t.LoadVersion(version) // TODO: implement overwriting + return t.LoadVersion(version) } func (t *Tree) Commit() ([]byte, uint64, error) { @@ -180,11 +176,8 @@ func (t *Tree) Close() error { } func (t *Tree) Prune(version uint64) error { - if err := isHighBitSet(version); err != nil { - return err - } - - return t.tree.DeleteVersionsTo(int64(version)) + // do nothing, IAVL v2 has its own advanced pruning mechanism + return nil } // PausePruning is unnecessary in IAVL v2 due to the advanced pruning mechanism diff --git a/store/v2/commitment/store.go b/store/v2/commitment/store.go index c7060864b227..757fb45851c1 100644 --- a/store/v2/commitment/store.go +++ b/store/v2/commitment/store.go @@ -178,18 +178,35 @@ func (c *CommitStore) loadVersion(targetVersion uint64, storeKeys []string, over } } + eg := errgroup.Group{} + eg.SetLimit(store.MaxWriteParallelism) for _, storeKey := range storeKeys { + tree := c.multiTrees[storeKey] if overrideAfter { - if err := c.multiTrees[storeKey].LoadVersionForOverwriting(targetVersion); err != nil { - return err + if tree.IsConcurrentSafe() { + eg.Go(func() error { + return c.multiTrees[storeKey].LoadVersionForOverwriting(targetVersion) + }) + } else { + if err := c.multiTrees[storeKey].LoadVersionForOverwriting(targetVersion); err != nil { + return err + } } } else { - if err := c.multiTrees[storeKey].LoadVersion(targetVersion); err != nil { - return err + if tree.IsConcurrentSafe() { + eg.Go(func() error { return c.multiTrees[storeKey].LoadVersion(targetVersion) }) + } else { + if err := c.multiTrees[storeKey].LoadVersion(targetVersion); err != nil { + return err + } } } } + if err := eg.Wait(); err != nil { + return err + } + // If the target version is greater than the latest version, it is the snapshot // restore case, we should create a new commit info for the target version. if targetVersion > latestVersion { diff --git a/store/v2/root/factory.go b/store/v2/root/factory.go index 4f42f909065a..309964fcbf46 100644 --- a/store/v2/root/factory.go +++ b/store/v2/root/factory.go @@ -33,6 +33,7 @@ type Options struct { SCType SCType `mapstructure:"sc-type" toml:"sc-type" comment:"State commitment database type. Currently we support: \"iavl\" and \"iavl-v2\""` SCPruningOption *store.PruningOption `mapstructure:"sc-pruning-option" toml:"sc-pruning-option" comment:"Pruning options for state commitment"` IavlConfig *iavl.Config `mapstructure:"iavl-config" toml:"iavl-config"` + IavlV2Config iavl_v2.TreeOptions } // FactoryOptions are the options for creating a root store. @@ -102,12 +103,7 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { return iavl.NewIavlTree(db.NewPrefixDB(opts.SCRawDB, []byte(key)), opts.Logger, storeOpts.IavlConfig), nil case SCTypeIavlV2: dir := fmt.Sprintf("%s/data/iavl-v2/%s", opts.RootDir, key) - // TODO load from config YAML or at least simapp - iavlOpts := iavl_v2.DefaultTreeOptions() - iavlOpts.EvictionDepth = 22 - iavlOpts.HeightFilter = 1 - iavlOpts.CheckpointInterval = 55 - return iavlv2.NewTree(iavlOpts, iavl_v2.SqliteDbOptions{Path: dir}, opts.Logger) + return iavlv2.NewTree(opts.Options.IavlV2Config, iavl_v2.SqliteDbOptions{Path: dir}, opts.Logger) default: return nil, errors.New("unsupported commitment store type") } diff --git a/store/v2/root/store.go b/store/v2/root/store.go index 9ea3afdf6ad5..41056fa3c401 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -289,13 +289,11 @@ func (s *Store) loadVersion(v uint64, upgrades *corestore.StoreUpgrades, overrid // from the SC tree. Finally, it commits the SC tree and returns the hash of // the CommitInfo. func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { - s.logger.Warn("begin commit", "version", cs.Version) now := time.Now() defer func() { if s.telemetry != nil { s.telemetry.MeasureSince(now, "root_store", "commit") } - s.logger.Warn(fmt.Sprintf("commit version %d took %s", cs.Version, time.Since(now))) }() if err := s.handleMigration(cs); err != nil { @@ -311,12 +309,13 @@ func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { if err := s.stateCommitment.WriteChangeset(cs); err != nil { return nil, fmt.Errorf("failed to write batch to SC store: %w", err) } - + writeDur := time.Since(st) + st = time.Now() cInfo, err := s.stateCommitment.Commit(cs.Version) if err != nil { return nil, fmt.Errorf("failed to commit SC store: %w", err) } - s.logger.Warn(fmt.Sprintf("sc commit version %d took %s", cs.Version, time.Since(st))) + s.logger.Warn(fmt.Sprintf("commit version %d write=%s commit=%s", cs.Version, writeDur, time.Since(st))) if cInfo.Version != cs.Version { return nil, fmt.Errorf("commit version mismatch: got %d, expected %d", cInfo.Version, cs.Version) diff --git a/tools/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go index f466d73143c1..7b8fd7c1d05c 100644 --- a/tools/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -172,7 +172,7 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { } i++ if pause > 0 { - time.Sleep(time.Duration(pause) * time.Millisecond) + time.Sleep(time.Duration(pause) * time.Microsecond) } } }, @@ -181,7 +181,7 @@ func NewLoadTestCmd(params *modulev1.GeneratorParams) *cobra.Command { flags.AddTxFlagsToCmd(cmd) cmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "print the response") cmd.Flags().Uint64Var(&numOps, "ops", 1, "number of operations per transaction") - cmd.Flags().Int64Var(&pause, "pause", 0, "pause between transactions in milliseconds") + cmd.Flags().Int64Var(&pause, "pause", 0, "pause between transactions in microseconds") return cmd } From 15a7c381610bbd54c2ccc050df575079b6dc2ce8 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Mon, 30 Dec 2024 14:20:58 -0600 Subject: [PATCH 26/27] almost done --- runtime/v2/go.mod | 2 +- runtime/v2/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 ++-- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- simapp/v2/app.go | 2 +- simapp/v2/go.mod | 3 +-- simapp/v2/go.sum | 2 ++ store/v2/commitment/store_test_suite.go | 3 --- store/v2/go.mod | 7 +------ store/v2/go.sum | 4 ++++ store/v2/root/factory_test.go | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- 15 files changed, 23 insertions(+), 26 deletions(-) diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index d6d02d27d081..daea0836aeb6 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -49,7 +49,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/iavl v1.3.1 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index f51de45a00ea..b851634d5b6c 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -65,8 +65,8 @@ github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index bd88ba799741..f364976a8f57 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -79,7 +79,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index bc5f9d446ffb..1a244c0f6a13 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -130,8 +130,8 @@ github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/server/v2/go.mod b/server/v2/go.mod index 63babb97787d..d307a4f21e75 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -59,7 +59,7 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/iavl v1.3.1 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 8f351b9dfb69..6e5e4c37725d 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -83,8 +83,8 @@ github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= diff --git a/simapp/v2/app.go b/simapp/v2/app.go index 2ff1ca10bc79..f05f0badb95e 100644 --- a/simapp/v2/app.go +++ b/simapp/v2/app.go @@ -230,7 +230,7 @@ func ProvideRootStoreConfig(config runtime.GlobalConfig) (*root.Config, error) { iavlV2Opts.EvictionDepth = 22 iavlV2Opts.HeightFilter = 1 iavlV2Opts.CheckpointInterval = 60 - iavlV2Opts.PruneRatio = 1.5 + iavlV2Opts.PruneRatio = 0.8 iavlv2.SetGlobalPruneLimit(1) cfg.Options.IavlV2Config = iavlV2Opts diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index ee46aef9bdbf..5e897cc19de2 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -48,6 +48,7 @@ require ( cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 github.com/jackc/pgx/v5 v5.7.1 ) @@ -105,7 +106,6 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.6 // indirect @@ -313,5 +313,4 @@ replace ( cosmossdk.io/server/v2/stf => ../../server/v2/stf cosmossdk.io/store => ../../store cosmossdk.io/store/v2 => ../../store/v2 - github.com/cosmos/iavl/v2 => ../../../../iavl/iavl-v2 ) diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 7184a6195d3a..1725cf855510 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -340,6 +340,8 @@ github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/store/v2/commitment/store_test_suite.go b/store/v2/commitment/store_test_suite.go index b91119301c1e..76d1029a74a9 100644 --- a/store/v2/commitment/store_test_suite.go +++ b/store/v2/commitment/store_test_suite.go @@ -66,9 +66,6 @@ type CommitStoreTestSuite struct { // - Checks that the restored store's Merkle tree hashes match the original // - Ensures store integrity by comparing CommitInfo hashes func (s *CommitStoreTestSuite) TestStore_Snapshotter() { - if s.TreeType == "iavlv2" { - s.T().Skip("FIXME: iavlv2 does not yet support snapshots") - } storeKeys := []string{storeKey1, storeKey2} commitStore, err := s.NewStore(dbm.NewMemDB(), s.T().TempDir(), storeKeys, nil, coretesting.NewNopLogger()) s.Require().NoError(err) diff --git a/store/v2/go.mod b/store/v2/go.mod index e6645180cc8b..9ce7f31d0613 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -11,7 +11,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/iavl v1.3.1 - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 github.com/cosmos/ics23/go v0.11.0 github.com/google/btree v1.1.3 github.com/hashicorp/go-metrics v0.5.3 @@ -75,8 +75,3 @@ require ( google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - cosmossdk.io/core => ../../core - github.com/cosmos/iavl/v2 => ../../../../iavl/iavl-v2 -) diff --git a/store/v2/go.sum b/store/v2/go.sum index 3aa8ea3ddb4e..f27ca1daaf72 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -1,3 +1,5 @@ +cosmossdk.io/core v1.0.0-alpha.6 h1:5ukC4JcQKmemLQXcAgu/QoOvJI50hpBkIIg4ZT2EN8E= +cosmossdk.io/core v1.0.0-alpha.6/go.mod h1:3u9cWq1FAVtiiCrDPpo4LhR+9V6k/ycSG4/Y/tREWCY= cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e h1:F+ScucYxwrrDJU8guJXQXpGhdpziYSbxW6HMP2wCNxs= cosmossdk.io/core/testing v0.0.0-20241108153815-606544c7be7e/go.mod h1:3YvVv9aJayjPhdX0DY1IMrGse4sR63hNBWx2VtDWjGQ= cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 h1:IQNdY2kB+k+1OM2DvqFG1+UgeU1JzZrWtwuWzI3ZfwA= @@ -59,6 +61,8 @@ github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/store/v2/root/factory_test.go b/store/v2/root/factory_test.go index 45fd34699bf7..1da5e4309ab8 100644 --- a/store/v2/root/factory_test.go +++ b/store/v2/root/factory_test.go @@ -24,6 +24,6 @@ func TestFactory(t *testing.T) { fop.Options.SCType = SCTypeIavlV2 f, err = CreateRootStore(&fop) - require.Error(t, err) - require.Nil(t, f) + require.NoError(t, err) + require.NotNil(t, f) } diff --git a/tests/go.mod b/tests/go.mod index 643ad31f374a..c4d4ff8f4b5f 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -108,7 +108,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.2 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index dc7c792144bd..67582d673720 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -336,8 +336,8 @@ github.com/cosmos/iavl v1.3.2 h1:pQyZMG+N/dzmpSV0IXXpSa86Dz7AmIwNjXku3xBrL60= github.com/cosmos/iavl v1.3.2/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9 h1:H+ttW6HTzezz2l3Fp/hFNNHWA+a+7qZgNDE5OFySTiY= -github.com/cosmos/iavl/v2 v2.0.0-20241128205019-1b18c0edbbd9/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= +github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= From 31c9a6d392344d1a978f8012b9781d4a3ac5fdca Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Mon, 30 Dec 2024 15:26:37 -0600 Subject: [PATCH 27/27] iavl/v2 alpha candidate --- go.mod | 1 - go.sum | 2 -- scripts/build/build.mk | 2 +- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 +-- simapp/benchmark.go | 39 ----------------------------- simapp/v2/app.go | 3 ++- simapp/v2/benchmark.go | 1 - simapp/v2/go.mod | 2 +- simapp/v2/go.sum | 4 +-- store/v2/go.mod | 2 +- store/v2/go.sum | 4 +-- tests/go.mod | 2 +- tests/go.sum | 4 +-- tools/benchmark/client/cli/tx.go | 1 - tools/benchmark/module/depinject.go | 2 -- 16 files changed, 15 insertions(+), 60 deletions(-) delete mode 100644 simapp/benchmark.go diff --git a/go.mod b/go.mod index ca2d9b7e53b2..144a61092e0c 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,6 @@ require ( cosmossdk.io/math v1.4.0 cosmossdk.io/schema v1.0.0 cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43 - cosmossdk.io/tools/benchmark v0.2.0-rc.1 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v1.0.0-alpha.3 diff --git a/go.sum b/go.sum index a487927ed280..c4ccc928e1fc 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,6 @@ cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43 h1:glZ6MpmD+5AhwJYV4jzx+rn7cgUB2owHgk9o+93luz0= cosmossdk.io/store v1.10.0-rc.1.0.20241218084712-ca559989da43/go.mod h1:XCWpgfueHSBY+B7Cf2Aq/CcsU+6XoFH+EmseCKglFrU= -cosmossdk.io/tools/benchmark v0.2.0-rc.1 h1:Jgk0FLvnMQJrivrSMhKQBwaTiJz6MGq5ZbaHag7Sqq0= -cosmossdk.io/tools/benchmark v0.2.0-rc.1/go.mod h1:tnGa8L7xHFMp26FbLvU5MRlS89BFrCxSOKR8jCi7kVU= cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ= cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/scripts/build/build.mk b/scripts/build/build.mk index c715a855a4f9..92de16d200a9 100644 --- a/scripts/build/build.mk +++ b/scripts/build/build.mk @@ -12,7 +12,7 @@ MOCKS_DIR = $(CURDIR)/tests/mocks HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git DOCKER := $(shell which docker) PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) -COSMOS_BUILD_OPTIONS := v2 +COSMOS_BUILD_OPTIONS += ' v2' rocksdb_version=v9.6.1 diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 39b3008b5c48..fa47fbcafef1 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -74,7 +74,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/iavl v1.3.4 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 2832326e1604..b8ec42cc92cb 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -129,8 +129,8 @@ github.com/cosmos/iavl v1.3.4 h1:A0RUAms7TZ0L6EFrrBIPg4Dy7qD9vvD5lJKUxEXURLM= github.com/cosmos/iavl v1.3.4/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 h1:9lOhgjRYdAEAkHZW6smbp8vDtvpikQrrNVhHZoZNMGk= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= diff --git a/simapp/benchmark.go b/simapp/benchmark.go deleted file mode 100644 index 50a16ea909b8..000000000000 --- a/simapp/benchmark.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build benchmark - -package simapp - -import ( - runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" - appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" - benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" - "cosmossdk.io/depinject/appconfig" - benchmark "cosmossdk.io/tools/benchmark/module" - "fmt" -) - -func init() { - // WARNING! - // Enabling this module will produce 3M keys in the genesis state for the benchmark module. - // Will also enable processing of benchmark transactions which can easily overwhelm the system. - appConfig.Modules = append(appConfig.Modules, &appv1alpha1.ModuleConfig{ - Name: benchmark.ModuleName, - Config: appconfig.WrapAny(&benchmarkmodulev1.Module{ - GenesisParams: &benchmarkmodulev1.GeneratorParams{ - Seed: 34, - BucketCount: 3, - GenesisCount: 3_000_000, - KeyMean: 64, - KeyStdDev: 12, - ValueMean: 1024, - ValueStdDev: 256, - }, - }), - }) - runtimeConfig := &runtimev1alpha1.Module{} - err := appConfig.Modules[0].Config.UnmarshalTo(runtimeConfig) - if err != nil { - panic(fmt.Errorf("benchmark init: failed to unmarshal runtime module config: %w", err)) - } - runtimeConfig.InitGenesis = append(runtimeConfig.InitGenesis, benchmark.ModuleName) - appConfig.Modules[0].Config = appconfig.WrapAny(runtimeConfig) -} diff --git a/simapp/v2/app.go b/simapp/v2/app.go index f05f0badb95e..d5df4d2ff524 100644 --- a/simapp/v2/app.go +++ b/simapp/v2/app.go @@ -4,6 +4,7 @@ import ( _ "embed" "fmt" + iavlv2 "github.com/cosmos/iavl/v2" _ "github.com/jackc/pgx/v5/stdlib" // Import and register pgx driver "cosmossdk.io/core/registry" @@ -17,6 +18,7 @@ import ( serverstore "cosmossdk.io/server/v2/store" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/root" + _ "cosmossdk.io/tools/benchmark" basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject" lockupdepinject "cosmossdk.io/x/accounts/defaults/lockup/depinject" multisigdepinject "cosmossdk.io/x/accounts/defaults/multisig/depinject" @@ -28,7 +30,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" _ "github.com/cosmos/cosmos-sdk/x/genutil" - iavlv2 "github.com/cosmos/iavl/v2" ) // SimApp extends an ABCI application, but with most of its parameters exported. diff --git a/simapp/v2/benchmark.go b/simapp/v2/benchmark.go index 0c10f1329633..bccc212b7629 100644 --- a/simapp/v2/benchmark.go +++ b/simapp/v2/benchmark.go @@ -10,7 +10,6 @@ import ( benchmarkmodulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" "cosmossdk.io/depinject/appconfig" benchmark "cosmossdk.io/tools/benchmark/module" - "fmt" ) func init() { diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 0c2da01de50c..af7bdb24e1a9 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -48,7 +48,7 @@ require ( google.golang.org/protobuf v1.36.0 ) -require github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 +require github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 3575e85e4d39..aa2aa8f5263d 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -348,8 +348,8 @@ github.com/cosmos/iavl v1.3.4 h1:A0RUAms7TZ0L6EFrrBIPg4Dy7qD9vvD5lJKUxEXURLM= github.com/cosmos/iavl v1.3.4/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 h1:9lOhgjRYdAEAkHZW6smbp8vDtvpikQrrNVhHZoZNMGk= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/store/v2/go.mod b/store/v2/go.mod index 172c78ced402..820b235641fb 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -11,7 +11,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/iavl v1.3.4 - github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 + github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 github.com/cosmos/ics23/go v0.11.0 github.com/google/btree v1.1.3 github.com/hashicorp/go-metrics v0.5.3 diff --git a/store/v2/go.sum b/store/v2/go.sum index bce97717a8e6..a6494d562ede 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -61,8 +61,8 @@ github.com/cosmos/iavl v1.3.4 h1:A0RUAms7TZ0L6EFrrBIPg4Dy7qD9vvD5lJKUxEXURLM= github.com/cosmos/iavl v1.3.4/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 h1:9lOhgjRYdAEAkHZW6smbp8vDtvpikQrrNVhHZoZNMGk= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/tests/go.mod b/tests/go.mod index 248c9e8e424f..27525550d4fd 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -102,7 +102,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/iavl v1.3.4 // indirect - github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 // indirect + github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index f127ce89d5b6..79cacde1957f 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -333,8 +333,8 @@ github.com/cosmos/iavl v1.3.4 h1:A0RUAms7TZ0L6EFrrBIPg4Dy7qD9vvD5lJKUxEXURLM= github.com/cosmos/iavl v1.3.4/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/iavl-bench/bench v0.0.4 h1:J6zQPiBqF4CXMM3QBsLqZgQEBGY0taX85vLIZMhmAfQ= github.com/cosmos/iavl-bench/bench v0.0.4/go.mod h1:j2rLae77EffacWcp7mmj3Uaa4AOAmZA7ymvhsuBQKKI= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690 h1:9J9VLOdacwrJkuyEt1fOxIOQ+0jrgKf0L2SlwkHNYQ8= -github.com/cosmos/iavl/v2 v2.0.0-20241230201056-64573f084690/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186 h1:9lOhgjRYdAEAkHZW6smbp8vDtvpikQrrNVhHZoZNMGk= +github.com/cosmos/iavl/v2 v2.0.0-20241230202043-079dc2f54186/go.mod h1:7RSm0aeApe3S1x4TrLffvUL6pjOtMYV4glYnpAhr2lw= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/tools/benchmark/client/cli/tx.go b/tools/benchmark/client/cli/tx.go index 7984d8aac76f..8944b8ad57b9 100644 --- a/tools/benchmark/client/cli/tx.go +++ b/tools/benchmark/client/cli/tx.go @@ -17,7 +17,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" clienttx "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" ) func NewTxCmd(params *modulev1.GeneratorParams) *cobra.Command { diff --git a/tools/benchmark/module/depinject.go b/tools/benchmark/module/depinject.go index 872c33928f20..815248cc5993 100644 --- a/tools/benchmark/module/depinject.go +++ b/tools/benchmark/module/depinject.go @@ -3,8 +3,6 @@ package module import ( "unsafe" - "cosmossdk.io/depinject" - modulev1 "cosmossdk.io/api/cosmos/benchmark/module/v1" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store"