diff --git a/.gitignore b/.gitignore index 5d6c5097485a..e6893eaeeb62 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ vagrant # IDE .idea *.iml +*.ipr +*.iws .dir-locals.el .vscode diff --git a/Makefile b/Makefile index 563c661ddcb0..96dfdd054eb3 100644 --- a/Makefile +++ b/Makefile @@ -267,6 +267,20 @@ test-sim-nondeterminism: @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \ -NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h +# Requires an exported plugin. See store/streaming/README.md for documentation. +# +# example: +# export COSMOS_SDK_ABCI_V1= +# make test-sim-nondeterminism-streaming +# +# Using the built-in examples: +# export COSMOS_SDK_ABCI_V1=/store/streaming/abci/examples/file/file +# make test-sim-nondeterminism-streaming +test-sim-nondeterminism-streaming: + @echo "Running non-determinism-streaming test..." + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \ + -NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h -EnableStreaming=true + test-sim-custom-genesis-fast: @echo "Running custom genesis simulation..." @echo "By default, ${HOME}/.gaiad/config/genesis.json will be used." @@ -302,6 +316,7 @@ test-sim-benchmark-invariants: .PHONY: \ test-sim-nondeterminism \ +test-sim-nondeterminism-streaming \ test-sim-custom-genesis-fast \ test-sim-import-export \ test-sim-after-import \ @@ -316,14 +331,42 @@ SIM_COMMIT ?= true test-sim-benchmark: @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" - @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run=^$$ $(.) -bench ^BenchmarkFullAppSimulation$$ \ -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h +# Requires an exported plugin. See store/streaming/README.md for documentation. +# +# example: +# export COSMOS_SDK_ABCI_V1= +# make test-sim-benchmark-streaming +# +# Using the built-in examples: +# export COSMOS_SDK_ABCI_V1=/store/streaming/abci/examples/file/file +# make test-sim-benchmark-streaming +test-sim-benchmark-streaming: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -run=^$$ $(.) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -EnableStreaming=true + test-sim-profile: @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" - @go test -mod=readonly -benchmem -run=^$$ $(SIMAPP) -bench ^BenchmarkFullAppSimulation$$ \ + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -benchmem -run=^$$ $(.) -bench ^BenchmarkFullAppSimulation$$ \ -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out +# Requires an exported plugin. See store/streaming/README.md for documentation. +# +# example: +# export COSMOS_SDK_ABCI_V1= +# make test-sim-profile-streaming +# +# Using the built-in examples: +# export COSMOS_SDK_ABCI_V1=/store/streaming/abci/examples/file/file +# make test-sim-profile-streaming +test-sim-profile-streaming: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @cd ${CURRENT_DIR}/simapp && go test -mod=readonly -benchmem -run=^$$ $(.) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out -EnableStreaming=true + .PHONY: test-sim-profile test-sim-benchmark test-rosetta: diff --git a/api/cosmos/store/streaming/abci/grpc.pulsar.go b/api/cosmos/store/streaming/abci/grpc.pulsar.go new file mode 100644 index 000000000000..168975eda0e3 --- /dev/null +++ b/api/cosmos/store/streaming/abci/grpc.pulsar.go @@ -0,0 +1,4250 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package abci + +import ( + v1beta1 "cosmossdk.io/api/cosmos/store/v1beta1" + abci "cosmossdk.io/api/tendermint/abci" + 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_ListenBeginBlockRequest protoreflect.MessageDescriptor + fd_ListenBeginBlockRequest_req protoreflect.FieldDescriptor + fd_ListenBeginBlockRequest_res protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenBeginBlockRequest = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenBeginBlockRequest") + fd_ListenBeginBlockRequest_req = md_ListenBeginBlockRequest.Fields().ByName("req") + fd_ListenBeginBlockRequest_res = md_ListenBeginBlockRequest.Fields().ByName("res") +} + +var _ protoreflect.Message = (*fastReflection_ListenBeginBlockRequest)(nil) + +type fastReflection_ListenBeginBlockRequest ListenBeginBlockRequest + +func (x *ListenBeginBlockRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenBeginBlockRequest)(x) +} + +func (x *ListenBeginBlockRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_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_ListenBeginBlockRequest_messageType fastReflection_ListenBeginBlockRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListenBeginBlockRequest_messageType{} + +type fastReflection_ListenBeginBlockRequest_messageType struct{} + +func (x fastReflection_ListenBeginBlockRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenBeginBlockRequest)(nil) +} +func (x fastReflection_ListenBeginBlockRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListenBeginBlockRequest) +} +func (x fastReflection_ListenBeginBlockRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenBeginBlockRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenBeginBlockRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListenBeginBlockRequest +} + +// 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_ListenBeginBlockRequest) Type() protoreflect.MessageType { + return _fastReflection_ListenBeginBlockRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenBeginBlockRequest) New() protoreflect.Message { + return new(fastReflection_ListenBeginBlockRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenBeginBlockRequest) Interface() protoreflect.ProtoMessage { + return (*ListenBeginBlockRequest)(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_ListenBeginBlockRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Req != nil { + value := protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + if !f(fd_ListenBeginBlockRequest_req, value) { + return + } + } + if x.Res != nil { + value := protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + if !f(fd_ListenBeginBlockRequest_res, 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_ListenBeginBlockRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + return x.Req != nil + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + return x.Res != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + x.Req = nil + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + x.Res = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + value := x.Req + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + value := x.Res + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + x.Req = value.Message().Interface().(*abci.RequestBeginBlock) + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + x.Res = value.Message().Interface().(*abci.ResponseBeginBlock) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + if x.Req == nil { + x.Req = new(abci.RequestBeginBlock) + } + return protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + if x.Res == nil { + x.Res = new(abci.ResponseBeginBlock) + } + return protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.req": + m := new(abci.RequestBeginBlock) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenBeginBlockRequest.res": + m := new(abci.ResponseBeginBlock) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockRequest 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_ListenBeginBlockRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenBeginBlockRequest", 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_ListenBeginBlockRequest) 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_ListenBeginBlockRequest) 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_ListenBeginBlockRequest) 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_ListenBeginBlockRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenBeginBlockRequest) + 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.Req != nil { + l = options.Size(x.Req) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Res != nil { + l = options.Size(x.Res) + 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().(*ListenBeginBlockRequest) + 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.Res != nil { + encoded, err := options.Marshal(x.Res) + 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 x.Req != nil { + encoded, err := options.Marshal(x.Req) + 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().(*ListenBeginBlockRequest) + 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: ListenBeginBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenBeginBlockRequest: 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 Req", 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.Req == nil { + x.Req = &abci.RequestBeginBlock{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Req); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Res", 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.Res == nil { + x.Res = &abci.ResponseBeginBlock{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Res); 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_ListenBeginBlockResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenBeginBlockResponse = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenBeginBlockResponse") +} + +var _ protoreflect.Message = (*fastReflection_ListenBeginBlockResponse)(nil) + +type fastReflection_ListenBeginBlockResponse ListenBeginBlockResponse + +func (x *ListenBeginBlockResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenBeginBlockResponse)(x) +} + +func (x *ListenBeginBlockResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_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_ListenBeginBlockResponse_messageType fastReflection_ListenBeginBlockResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListenBeginBlockResponse_messageType{} + +type fastReflection_ListenBeginBlockResponse_messageType struct{} + +func (x fastReflection_ListenBeginBlockResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenBeginBlockResponse)(nil) +} +func (x fastReflection_ListenBeginBlockResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListenBeginBlockResponse) +} +func (x fastReflection_ListenBeginBlockResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenBeginBlockResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenBeginBlockResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListenBeginBlockResponse +} + +// 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_ListenBeginBlockResponse) Type() protoreflect.MessageType { + return _fastReflection_ListenBeginBlockResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenBeginBlockResponse) New() protoreflect.Message { + return new(fastReflection_ListenBeginBlockResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenBeginBlockResponse) Interface() protoreflect.ProtoMessage { + return (*ListenBeginBlockResponse)(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_ListenBeginBlockResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_ListenBeginBlockResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenBeginBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenBeginBlockResponse 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_ListenBeginBlockResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenBeginBlockResponse", 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_ListenBeginBlockResponse) 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_ListenBeginBlockResponse) 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_ListenBeginBlockResponse) 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_ListenBeginBlockResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenBeginBlockResponse) + 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.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().(*ListenBeginBlockResponse) + 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 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().(*ListenBeginBlockResponse) + 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: ListenBeginBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenBeginBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_ListenEndBlockRequest protoreflect.MessageDescriptor + fd_ListenEndBlockRequest_req protoreflect.FieldDescriptor + fd_ListenEndBlockRequest_res protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenEndBlockRequest = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenEndBlockRequest") + fd_ListenEndBlockRequest_req = md_ListenEndBlockRequest.Fields().ByName("req") + fd_ListenEndBlockRequest_res = md_ListenEndBlockRequest.Fields().ByName("res") +} + +var _ protoreflect.Message = (*fastReflection_ListenEndBlockRequest)(nil) + +type fastReflection_ListenEndBlockRequest ListenEndBlockRequest + +func (x *ListenEndBlockRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenEndBlockRequest)(x) +} + +func (x *ListenEndBlockRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[2] + 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_ListenEndBlockRequest_messageType fastReflection_ListenEndBlockRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListenEndBlockRequest_messageType{} + +type fastReflection_ListenEndBlockRequest_messageType struct{} + +func (x fastReflection_ListenEndBlockRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenEndBlockRequest)(nil) +} +func (x fastReflection_ListenEndBlockRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListenEndBlockRequest) +} +func (x fastReflection_ListenEndBlockRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenEndBlockRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenEndBlockRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListenEndBlockRequest +} + +// 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_ListenEndBlockRequest) Type() protoreflect.MessageType { + return _fastReflection_ListenEndBlockRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenEndBlockRequest) New() protoreflect.Message { + return new(fastReflection_ListenEndBlockRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenEndBlockRequest) Interface() protoreflect.ProtoMessage { + return (*ListenEndBlockRequest)(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_ListenEndBlockRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Req != nil { + value := protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + if !f(fd_ListenEndBlockRequest_req, value) { + return + } + } + if x.Res != nil { + value := protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + if !f(fd_ListenEndBlockRequest_res, 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_ListenEndBlockRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + return x.Req != nil + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + return x.Res != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + x.Req = nil + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + x.Res = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + value := x.Req + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + value := x.Res + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + x.Req = value.Message().Interface().(*abci.RequestEndBlock) + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + x.Res = value.Message().Interface().(*abci.ResponseEndBlock) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + if x.Req == nil { + x.Req = new(abci.RequestEndBlock) + } + return protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + if x.Res == nil { + x.Res = new(abci.ResponseEndBlock) + } + return protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenEndBlockRequest.req": + m := new(abci.RequestEndBlock) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenEndBlockRequest.res": + m := new(abci.ResponseEndBlock) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockRequest 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_ListenEndBlockRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenEndBlockRequest", 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_ListenEndBlockRequest) 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_ListenEndBlockRequest) 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_ListenEndBlockRequest) 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_ListenEndBlockRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenEndBlockRequest) + 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.Req != nil { + l = options.Size(x.Req) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Res != nil { + l = options.Size(x.Res) + 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().(*ListenEndBlockRequest) + 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.Res != nil { + encoded, err := options.Marshal(x.Res) + 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 x.Req != nil { + encoded, err := options.Marshal(x.Req) + 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().(*ListenEndBlockRequest) + 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: ListenEndBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenEndBlockRequest: 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 Req", 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.Req == nil { + x.Req = &abci.RequestEndBlock{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Req); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Res", 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.Res == nil { + x.Res = &abci.ResponseEndBlock{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Res); 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_ListenEndBlockResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenEndBlockResponse = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenEndBlockResponse") +} + +var _ protoreflect.Message = (*fastReflection_ListenEndBlockResponse)(nil) + +type fastReflection_ListenEndBlockResponse ListenEndBlockResponse + +func (x *ListenEndBlockResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenEndBlockResponse)(x) +} + +func (x *ListenEndBlockResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[3] + 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_ListenEndBlockResponse_messageType fastReflection_ListenEndBlockResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListenEndBlockResponse_messageType{} + +type fastReflection_ListenEndBlockResponse_messageType struct{} + +func (x fastReflection_ListenEndBlockResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenEndBlockResponse)(nil) +} +func (x fastReflection_ListenEndBlockResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListenEndBlockResponse) +} +func (x fastReflection_ListenEndBlockResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenEndBlockResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenEndBlockResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListenEndBlockResponse +} + +// 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_ListenEndBlockResponse) Type() protoreflect.MessageType { + return _fastReflection_ListenEndBlockResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenEndBlockResponse) New() protoreflect.Message { + return new(fastReflection_ListenEndBlockResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenEndBlockResponse) Interface() protoreflect.ProtoMessage { + return (*ListenEndBlockResponse)(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_ListenEndBlockResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_ListenEndBlockResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenEndBlockResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenEndBlockResponse 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_ListenEndBlockResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenEndBlockResponse", 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_ListenEndBlockResponse) 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_ListenEndBlockResponse) 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_ListenEndBlockResponse) 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_ListenEndBlockResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenEndBlockResponse) + 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.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().(*ListenEndBlockResponse) + 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 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().(*ListenEndBlockResponse) + 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: ListenEndBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenEndBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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_ListenDeliverTxRequest protoreflect.MessageDescriptor + fd_ListenDeliverTxRequest_block_height protoreflect.FieldDescriptor + fd_ListenDeliverTxRequest_req protoreflect.FieldDescriptor + fd_ListenDeliverTxRequest_res protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenDeliverTxRequest = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenDeliverTxRequest") + fd_ListenDeliverTxRequest_block_height = md_ListenDeliverTxRequest.Fields().ByName("block_height") + fd_ListenDeliverTxRequest_req = md_ListenDeliverTxRequest.Fields().ByName("req") + fd_ListenDeliverTxRequest_res = md_ListenDeliverTxRequest.Fields().ByName("res") +} + +var _ protoreflect.Message = (*fastReflection_ListenDeliverTxRequest)(nil) + +type fastReflection_ListenDeliverTxRequest ListenDeliverTxRequest + +func (x *ListenDeliverTxRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenDeliverTxRequest)(x) +} + +func (x *ListenDeliverTxRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[4] + 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_ListenDeliverTxRequest_messageType fastReflection_ListenDeliverTxRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListenDeliverTxRequest_messageType{} + +type fastReflection_ListenDeliverTxRequest_messageType struct{} + +func (x fastReflection_ListenDeliverTxRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenDeliverTxRequest)(nil) +} +func (x fastReflection_ListenDeliverTxRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListenDeliverTxRequest) +} +func (x fastReflection_ListenDeliverTxRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenDeliverTxRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenDeliverTxRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListenDeliverTxRequest +} + +// 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_ListenDeliverTxRequest) Type() protoreflect.MessageType { + return _fastReflection_ListenDeliverTxRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenDeliverTxRequest) New() protoreflect.Message { + return new(fastReflection_ListenDeliverTxRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenDeliverTxRequest) Interface() protoreflect.ProtoMessage { + return (*ListenDeliverTxRequest)(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_ListenDeliverTxRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockHeight) + if !f(fd_ListenDeliverTxRequest_block_height, value) { + return + } + } + if x.Req != nil { + value := protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + if !f(fd_ListenDeliverTxRequest_req, value) { + return + } + } + if x.Res != nil { + value := protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + if !f(fd_ListenDeliverTxRequest_res, 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_ListenDeliverTxRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + return x.BlockHeight != int64(0) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + return x.Req != nil + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + return x.Res != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + x.BlockHeight = int64(0) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + x.Req = nil + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + x.Res = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + value := x.BlockHeight + return protoreflect.ValueOfInt64(value) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + value := x.Req + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + value := x.Res + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + x.BlockHeight = value.Int() + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + x.Req = value.Message().Interface().(*abci.RequestDeliverTx) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + x.Res = value.Message().Interface().(*abci.ResponseDeliverTx) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + if x.Req == nil { + x.Req = new(abci.RequestDeliverTx) + } + return protoreflect.ValueOfMessage(x.Req.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + if x.Res == nil { + x.Res = new(abci.ResponseDeliverTx) + } + return protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + panic(fmt.Errorf("field block_height of message cosmos.store.streaming.abci.ListenDeliverTxRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.block_height": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.req": + m := new(abci.RequestDeliverTx) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenDeliverTxRequest.res": + m := new(abci.ResponseDeliverTx) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxRequest 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_ListenDeliverTxRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenDeliverTxRequest", 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_ListenDeliverTxRequest) 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_ListenDeliverTxRequest) 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_ListenDeliverTxRequest) 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_ListenDeliverTxRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenDeliverTxRequest) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if x.Req != nil { + l = options.Size(x.Req) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Res != nil { + l = options.Size(x.Res) + 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().(*ListenDeliverTxRequest) + 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.Res != nil { + encoded, err := options.Marshal(x.Res) + 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] = 0x1a + } + if x.Req != nil { + encoded, err := options.Marshal(x.Req) + 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 x.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + 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().(*ListenDeliverTxRequest) + 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: ListenDeliverTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenDeliverTxRequest: 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 BlockHeight", wireType) + } + x.BlockHeight = 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.BlockHeight |= int64(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 Req", 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.Req == nil { + x.Req = &abci.RequestDeliverTx{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Req); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Res", 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.Res == nil { + x.Res = &abci.ResponseDeliverTx{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Res); 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_ListenDeliverTxResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenDeliverTxResponse = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenDeliverTxResponse") +} + +var _ protoreflect.Message = (*fastReflection_ListenDeliverTxResponse)(nil) + +type fastReflection_ListenDeliverTxResponse ListenDeliverTxResponse + +func (x *ListenDeliverTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenDeliverTxResponse)(x) +} + +func (x *ListenDeliverTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ListenDeliverTxResponse_messageType fastReflection_ListenDeliverTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListenDeliverTxResponse_messageType{} + +type fastReflection_ListenDeliverTxResponse_messageType struct{} + +func (x fastReflection_ListenDeliverTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenDeliverTxResponse)(nil) +} +func (x fastReflection_ListenDeliverTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListenDeliverTxResponse) +} +func (x fastReflection_ListenDeliverTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenDeliverTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenDeliverTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListenDeliverTxResponse +} + +// 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_ListenDeliverTxResponse) Type() protoreflect.MessageType { + return _fastReflection_ListenDeliverTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenDeliverTxResponse) New() protoreflect.Message { + return new(fastReflection_ListenDeliverTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenDeliverTxResponse) Interface() protoreflect.ProtoMessage { + return (*ListenDeliverTxResponse)(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_ListenDeliverTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_ListenDeliverTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenDeliverTxResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenDeliverTxResponse 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_ListenDeliverTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenDeliverTxResponse", 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_ListenDeliverTxResponse) 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_ListenDeliverTxResponse) 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_ListenDeliverTxResponse) 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_ListenDeliverTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenDeliverTxResponse) + 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.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().(*ListenDeliverTxResponse) + 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 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().(*ListenDeliverTxResponse) + 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: ListenDeliverTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenDeliverTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 _ protoreflect.List = (*_ListenCommitRequest_3_list)(nil) + +type _ListenCommitRequest_3_list struct { + list *[]*v1beta1.StoreKVPair +} + +func (x *_ListenCommitRequest_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ListenCommitRequest_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ListenCommitRequest_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.StoreKVPair) + (*x.list)[i] = concreteValue +} + +func (x *_ListenCommitRequest_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.StoreKVPair) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ListenCommitRequest_3_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.StoreKVPair) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListenCommitRequest_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ListenCommitRequest_3_list) NewElement() protoreflect.Value { + v := new(v1beta1.StoreKVPair) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListenCommitRequest_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ListenCommitRequest protoreflect.MessageDescriptor + fd_ListenCommitRequest_block_height protoreflect.FieldDescriptor + fd_ListenCommitRequest_res protoreflect.FieldDescriptor + fd_ListenCommitRequest_change_set protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenCommitRequest = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenCommitRequest") + fd_ListenCommitRequest_block_height = md_ListenCommitRequest.Fields().ByName("block_height") + fd_ListenCommitRequest_res = md_ListenCommitRequest.Fields().ByName("res") + fd_ListenCommitRequest_change_set = md_ListenCommitRequest.Fields().ByName("change_set") +} + +var _ protoreflect.Message = (*fastReflection_ListenCommitRequest)(nil) + +type fastReflection_ListenCommitRequest ListenCommitRequest + +func (x *ListenCommitRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenCommitRequest)(x) +} + +func (x *ListenCommitRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ListenCommitRequest_messageType fastReflection_ListenCommitRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListenCommitRequest_messageType{} + +type fastReflection_ListenCommitRequest_messageType struct{} + +func (x fastReflection_ListenCommitRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenCommitRequest)(nil) +} +func (x fastReflection_ListenCommitRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListenCommitRequest) +} +func (x fastReflection_ListenCommitRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenCommitRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenCommitRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListenCommitRequest +} + +// 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_ListenCommitRequest) Type() protoreflect.MessageType { + return _fastReflection_ListenCommitRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenCommitRequest) New() protoreflect.Message { + return new(fastReflection_ListenCommitRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenCommitRequest) Interface() protoreflect.ProtoMessage { + return (*ListenCommitRequest)(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_ListenCommitRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockHeight) + if !f(fd_ListenCommitRequest_block_height, value) { + return + } + } + if x.Res != nil { + value := protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + if !f(fd_ListenCommitRequest_res, value) { + return + } + } + if len(x.ChangeSet) != 0 { + value := protoreflect.ValueOfList(&_ListenCommitRequest_3_list{list: &x.ChangeSet}) + if !f(fd_ListenCommitRequest_change_set, 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_ListenCommitRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + return x.BlockHeight != int64(0) + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + return x.Res != nil + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + return len(x.ChangeSet) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + x.BlockHeight = int64(0) + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + x.Res = nil + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + x.ChangeSet = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + value := x.BlockHeight + return protoreflect.ValueOfInt64(value) + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + value := x.Res + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + if len(x.ChangeSet) == 0 { + return protoreflect.ValueOfList(&_ListenCommitRequest_3_list{}) + } + listValue := &_ListenCommitRequest_3_list{list: &x.ChangeSet} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + x.BlockHeight = value.Int() + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + x.Res = value.Message().Interface().(*abci.ResponseCommit) + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + lv := value.List() + clv := lv.(*_ListenCommitRequest_3_list) + x.ChangeSet = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + if x.Res == nil { + x.Res = new(abci.ResponseCommit) + } + return protoreflect.ValueOfMessage(x.Res.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + if x.ChangeSet == nil { + x.ChangeSet = []*v1beta1.StoreKVPair{} + } + value := &_ListenCommitRequest_3_list{list: &x.ChangeSet} + return protoreflect.ValueOfList(value) + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + panic(fmt.Errorf("field block_height of message cosmos.store.streaming.abci.ListenCommitRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.store.streaming.abci.ListenCommitRequest.block_height": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.store.streaming.abci.ListenCommitRequest.res": + m := new(abci.ResponseCommit) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.store.streaming.abci.ListenCommitRequest.change_set": + list := []*v1beta1.StoreKVPair{} + return protoreflect.ValueOfList(&_ListenCommitRequest_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitRequest")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitRequest 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_ListenCommitRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenCommitRequest", 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_ListenCommitRequest) 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_ListenCommitRequest) 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_ListenCommitRequest) 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_ListenCommitRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenCommitRequest) + 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.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if x.Res != nil { + l = options.Size(x.Res) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ChangeSet) > 0 { + for _, e := range x.ChangeSet { + 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().(*ListenCommitRequest) + 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.ChangeSet) > 0 { + for iNdEx := len(x.ChangeSet) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ChangeSet[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] = 0x1a + } + } + if x.Res != nil { + encoded, err := options.Marshal(x.Res) + 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 x.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + 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().(*ListenCommitRequest) + 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: ListenCommitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenCommitRequest: 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 BlockHeight", wireType) + } + x.BlockHeight = 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.BlockHeight |= int64(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 Res", 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.Res == nil { + x.Res = &abci.ResponseCommit{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Res); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChangeSet", 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.ChangeSet = append(x.ChangeSet, &v1beta1.StoreKVPair{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ChangeSet[len(x.ChangeSet)-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_ListenCommitResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_store_streaming_abci_grpc_proto_init() + md_ListenCommitResponse = File_cosmos_store_streaming_abci_grpc_proto.Messages().ByName("ListenCommitResponse") +} + +var _ protoreflect.Message = (*fastReflection_ListenCommitResponse)(nil) + +type fastReflection_ListenCommitResponse ListenCommitResponse + +func (x *ListenCommitResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListenCommitResponse)(x) +} + +func (x *ListenCommitResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[7] + 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_ListenCommitResponse_messageType fastReflection_ListenCommitResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListenCommitResponse_messageType{} + +type fastReflection_ListenCommitResponse_messageType struct{} + +func (x fastReflection_ListenCommitResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListenCommitResponse)(nil) +} +func (x fastReflection_ListenCommitResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListenCommitResponse) +} +func (x fastReflection_ListenCommitResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListenCommitResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListenCommitResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListenCommitResponse +} + +// 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_ListenCommitResponse) Type() protoreflect.MessageType { + return _fastReflection_ListenCommitResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListenCommitResponse) New() protoreflect.Message { + return new(fastReflection_ListenCommitResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListenCommitResponse) Interface() protoreflect.ProtoMessage { + return (*ListenCommitResponse)(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_ListenCommitResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_ListenCommitResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.store.streaming.abci.ListenCommitResponse")) + } + panic(fmt.Errorf("message cosmos.store.streaming.abci.ListenCommitResponse 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_ListenCommitResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.store.streaming.abci.ListenCommitResponse", 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_ListenCommitResponse) 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_ListenCommitResponse) 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_ListenCommitResponse) 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_ListenCommitResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListenCommitResponse) + 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.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().(*ListenCommitResponse) + 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 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().(*ListenCommitResponse) + 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: ListenCommitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListenCommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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/store/streaming/abci/grpc.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) +) + +// ListenBeginBlockRequest is the request type for the ListenBeginBlock RPC method +type ListenBeginBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Req *abci.RequestBeginBlock `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` + Res *abci.ResponseBeginBlock `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (x *ListenBeginBlockRequest) Reset() { + *x = ListenBeginBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenBeginBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenBeginBlockRequest) ProtoMessage() {} + +// Deprecated: Use ListenBeginBlockRequest.ProtoReflect.Descriptor instead. +func (*ListenBeginBlockRequest) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{0} +} + +func (x *ListenBeginBlockRequest) GetReq() *abci.RequestBeginBlock { + if x != nil { + return x.Req + } + return nil +} + +func (x *ListenBeginBlockRequest) GetRes() *abci.ResponseBeginBlock { + if x != nil { + return x.Res + } + return nil +} + +// ListenBeginBlockResponse is the response type for the ListenBeginBlock RPC method +type ListenBeginBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListenBeginBlockResponse) Reset() { + *x = ListenBeginBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenBeginBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenBeginBlockResponse) ProtoMessage() {} + +// Deprecated: Use ListenBeginBlockResponse.ProtoReflect.Descriptor instead. +func (*ListenBeginBlockResponse) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{1} +} + +// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +type ListenEndBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Req *abci.RequestEndBlock `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` + Res *abci.ResponseEndBlock `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (x *ListenEndBlockRequest) Reset() { + *x = ListenEndBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenEndBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenEndBlockRequest) ProtoMessage() {} + +// Deprecated: Use ListenEndBlockRequest.ProtoReflect.Descriptor instead. +func (*ListenEndBlockRequest) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{2} +} + +func (x *ListenEndBlockRequest) GetReq() *abci.RequestEndBlock { + if x != nil { + return x.Req + } + return nil +} + +func (x *ListenEndBlockRequest) GetRes() *abci.ResponseEndBlock { + if x != nil { + return x.Res + } + return nil +} + +// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +type ListenEndBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListenEndBlockResponse) Reset() { + *x = ListenEndBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenEndBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenEndBlockResponse) ProtoMessage() {} + +// Deprecated: Use ListenEndBlockResponse.ProtoReflect.Descriptor instead. +func (*ListenEndBlockResponse) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{3} +} + +// ListenDeliverTxRequest is the request type for the ListenDeliverTx RPC method +type ListenDeliverTxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Req *abci.RequestDeliverTx `protobuf:"bytes,2,opt,name=req,proto3" json:"req,omitempty"` + Res *abci.ResponseDeliverTx `protobuf:"bytes,3,opt,name=res,proto3" json:"res,omitempty"` +} + +func (x *ListenDeliverTxRequest) Reset() { + *x = ListenDeliverTxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenDeliverTxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenDeliverTxRequest) ProtoMessage() {} + +// Deprecated: Use ListenDeliverTxRequest.ProtoReflect.Descriptor instead. +func (*ListenDeliverTxRequest) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{4} +} + +func (x *ListenDeliverTxRequest) GetBlockHeight() int64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *ListenDeliverTxRequest) GetReq() *abci.RequestDeliverTx { + if x != nil { + return x.Req + } + return nil +} + +func (x *ListenDeliverTxRequest) GetRes() *abci.ResponseDeliverTx { + if x != nil { + return x.Res + } + return nil +} + +// ListenDeliverTxResponse is the response type for the ListenDeliverTx RPC method +type ListenDeliverTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListenDeliverTxResponse) Reset() { + *x = ListenDeliverTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenDeliverTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenDeliverTxResponse) ProtoMessage() {} + +// Deprecated: Use ListenDeliverTxResponse.ProtoReflect.Descriptor instead. +func (*ListenDeliverTxResponse) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{5} +} + +// ListenCommitRequest is the request type for the ListenCommit RPC method +type ListenCommitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // explicitly pass in block height as ResponseCommit does not contain this info + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Res *abci.ResponseCommit `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` + ChangeSet []*v1beta1.StoreKVPair `protobuf:"bytes,3,rep,name=change_set,json=changeSet,proto3" json:"change_set,omitempty"` +} + +func (x *ListenCommitRequest) Reset() { + *x = ListenCommitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenCommitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenCommitRequest) ProtoMessage() {} + +// Deprecated: Use ListenCommitRequest.ProtoReflect.Descriptor instead. +func (*ListenCommitRequest) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{6} +} + +func (x *ListenCommitRequest) GetBlockHeight() int64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *ListenCommitRequest) GetRes() *abci.ResponseCommit { + if x != nil { + return x.Res + } + return nil +} + +func (x *ListenCommitRequest) GetChangeSet() []*v1beta1.StoreKVPair { + if x != nil { + return x.ChangeSet + } + return nil +} + +// ListenCommitResponse is the response type for the ListenCommit RPC method +type ListenCommitResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListenCommitResponse) Reset() { + *x = ListenCommitResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_store_streaming_abci_grpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListenCommitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListenCommitResponse) ProtoMessage() {} + +// Deprecated: Use ListenCommitResponse.ProtoReflect.Descriptor instead. +func (*ListenCommitResponse) Descriptor() ([]byte, []int) { + return file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP(), []int{7} +} + +var File_cosmos_store_streaming_abci_grpc_proto protoreflect.FileDescriptor + +var file_cosmos_store_streaming_abci_grpc_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x2e, 0x61, 0x62, 0x63, 0x69, 0x1a, 0x1b, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x69, + 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, + 0x74, 0x65, 0x6e, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, + 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x65, 0x67, 0x69, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x03, 0x72, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x03, 0x72, 0x65, + 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x42, 0x65, 0x67, 0x69, 0x6e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x01, + 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x6e, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x03, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x03, 0x72, 0x65, 0x73, + 0x22, 0x18, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x16, 0x4c, + 0x69, 0x73, 0x74, 0x65, 0x6e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x33, 0x0a, 0x03, 0x72, 0x65, 0x71, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x52, 0x03, 0x72, 0x65, 0x71, 0x12, 0x34, 0x0a, + 0x03, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x52, 0x03, + 0x72, 0x65, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x44, 0x65, 0x6c, + 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xad, + 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x72, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x03, 0x72, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0a, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x4b, 0x56, 0x50, + 0x61, 0x69, 0x72, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x74, 0x22, 0x16, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x84, 0x04, 0x0a, 0x13, 0x41, 0x42, 0x43, 0x49, 0x4c, + 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7f, + 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x42, 0x65, 0x67, + 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, + 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x4c, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x12, 0x33, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x78, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xea, 0x01, + 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x62, 0x63, + 0x69, 0x42, 0x09, 0x47, 0x72, 0x70, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x62, 0x63, 0x69, 0xa2, 0x02, 0x04, 0x43, + 0x53, 0x53, 0x41, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x41, 0x62, 0x63, + 0x69, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x5c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5c, 0x41, 0x62, 0x63, 0x69, 0xe2, + 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x3a, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x41, 0x62, 0x63, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_cosmos_store_streaming_abci_grpc_proto_rawDescOnce sync.Once + file_cosmos_store_streaming_abci_grpc_proto_rawDescData = file_cosmos_store_streaming_abci_grpc_proto_rawDesc +) + +func file_cosmos_store_streaming_abci_grpc_proto_rawDescGZIP() []byte { + file_cosmos_store_streaming_abci_grpc_proto_rawDescOnce.Do(func() { + file_cosmos_store_streaming_abci_grpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_store_streaming_abci_grpc_proto_rawDescData) + }) + return file_cosmos_store_streaming_abci_grpc_proto_rawDescData +} + +var file_cosmos_store_streaming_abci_grpc_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_store_streaming_abci_grpc_proto_goTypes = []interface{}{ + (*ListenBeginBlockRequest)(nil), // 0: cosmos.store.streaming.abci.ListenBeginBlockRequest + (*ListenBeginBlockResponse)(nil), // 1: cosmos.store.streaming.abci.ListenBeginBlockResponse + (*ListenEndBlockRequest)(nil), // 2: cosmos.store.streaming.abci.ListenEndBlockRequest + (*ListenEndBlockResponse)(nil), // 3: cosmos.store.streaming.abci.ListenEndBlockResponse + (*ListenDeliverTxRequest)(nil), // 4: cosmos.store.streaming.abci.ListenDeliverTxRequest + (*ListenDeliverTxResponse)(nil), // 5: cosmos.store.streaming.abci.ListenDeliverTxResponse + (*ListenCommitRequest)(nil), // 6: cosmos.store.streaming.abci.ListenCommitRequest + (*ListenCommitResponse)(nil), // 7: cosmos.store.streaming.abci.ListenCommitResponse + (*abci.RequestBeginBlock)(nil), // 8: tendermint.abci.RequestBeginBlock + (*abci.ResponseBeginBlock)(nil), // 9: tendermint.abci.ResponseBeginBlock + (*abci.RequestEndBlock)(nil), // 10: tendermint.abci.RequestEndBlock + (*abci.ResponseEndBlock)(nil), // 11: tendermint.abci.ResponseEndBlock + (*abci.RequestDeliverTx)(nil), // 12: tendermint.abci.RequestDeliverTx + (*abci.ResponseDeliverTx)(nil), // 13: tendermint.abci.ResponseDeliverTx + (*abci.ResponseCommit)(nil), // 14: tendermint.abci.ResponseCommit + (*v1beta1.StoreKVPair)(nil), // 15: cosmos.store.v1beta1.StoreKVPair +} +var file_cosmos_store_streaming_abci_grpc_proto_depIdxs = []int32{ + 8, // 0: cosmos.store.streaming.abci.ListenBeginBlockRequest.req:type_name -> tendermint.abci.RequestBeginBlock + 9, // 1: cosmos.store.streaming.abci.ListenBeginBlockRequest.res:type_name -> tendermint.abci.ResponseBeginBlock + 10, // 2: cosmos.store.streaming.abci.ListenEndBlockRequest.req:type_name -> tendermint.abci.RequestEndBlock + 11, // 3: cosmos.store.streaming.abci.ListenEndBlockRequest.res:type_name -> tendermint.abci.ResponseEndBlock + 12, // 4: cosmos.store.streaming.abci.ListenDeliverTxRequest.req:type_name -> tendermint.abci.RequestDeliverTx + 13, // 5: cosmos.store.streaming.abci.ListenDeliverTxRequest.res:type_name -> tendermint.abci.ResponseDeliverTx + 14, // 6: cosmos.store.streaming.abci.ListenCommitRequest.res:type_name -> tendermint.abci.ResponseCommit + 15, // 7: cosmos.store.streaming.abci.ListenCommitRequest.change_set:type_name -> cosmos.store.v1beta1.StoreKVPair + 0, // 8: cosmos.store.streaming.abci.ABCIListenerService.ListenBeginBlock:input_type -> cosmos.store.streaming.abci.ListenBeginBlockRequest + 2, // 9: cosmos.store.streaming.abci.ABCIListenerService.ListenEndBlock:input_type -> cosmos.store.streaming.abci.ListenEndBlockRequest + 4, // 10: cosmos.store.streaming.abci.ABCIListenerService.ListenDeliverTx:input_type -> cosmos.store.streaming.abci.ListenDeliverTxRequest + 6, // 11: cosmos.store.streaming.abci.ABCIListenerService.ListenCommit:input_type -> cosmos.store.streaming.abci.ListenCommitRequest + 1, // 12: cosmos.store.streaming.abci.ABCIListenerService.ListenBeginBlock:output_type -> cosmos.store.streaming.abci.ListenBeginBlockResponse + 3, // 13: cosmos.store.streaming.abci.ABCIListenerService.ListenEndBlock:output_type -> cosmos.store.streaming.abci.ListenEndBlockResponse + 5, // 14: cosmos.store.streaming.abci.ABCIListenerService.ListenDeliverTx:output_type -> cosmos.store.streaming.abci.ListenDeliverTxResponse + 7, // 15: cosmos.store.streaming.abci.ABCIListenerService.ListenCommit:output_type -> cosmos.store.streaming.abci.ListenCommitResponse + 12, // [12:16] is the sub-list for method output_type + 8, // [8:12] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_cosmos_store_streaming_abci_grpc_proto_init() } +func file_cosmos_store_streaming_abci_grpc_proto_init() { + if File_cosmos_store_streaming_abci_grpc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenBeginBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenBeginBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenEndBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenEndBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenDeliverTxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenDeliverTxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenCommitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_store_streaming_abci_grpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListenCommitResponse); 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_store_streaming_abci_grpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_store_streaming_abci_grpc_proto_goTypes, + DependencyIndexes: file_cosmos_store_streaming_abci_grpc_proto_depIdxs, + MessageInfos: file_cosmos_store_streaming_abci_grpc_proto_msgTypes, + }.Build() + File_cosmos_store_streaming_abci_grpc_proto = out.File + file_cosmos_store_streaming_abci_grpc_proto_rawDesc = nil + file_cosmos_store_streaming_abci_grpc_proto_goTypes = nil + file_cosmos_store_streaming_abci_grpc_proto_depIdxs = nil +} diff --git a/api/cosmos/store/streaming/abci/grpc_grpc.pb.go b/api/cosmos/store/streaming/abci/grpc_grpc.pb.go new file mode 100644 index 000000000000..cd79aaf29de7 --- /dev/null +++ b/api/cosmos/store/streaming/abci/grpc_grpc.pb.go @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: cosmos/store/streaming/abci/grpc.proto + +package abci + +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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ABCIListenerServiceClient is the client API for ABCIListenerService 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. +type ABCIListenerServiceClient interface { + // ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock + ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error) + // ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error) + // ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx + ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error) + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error) +} + +type aBCIListenerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewABCIListenerServiceClient(cc grpc.ClientConnInterface) ABCIListenerServiceClient { + return &aBCIListenerServiceClient{cc} +} + +func (c *aBCIListenerServiceClient) ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error) { + out := new(ListenBeginBlockResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenBeginBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error) { + out := new(ListenEndBlockResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenEndBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error) { + out := new(ListenDeliverTxResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenDeliverTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error) { + out := new(ListenCommitResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ABCIListenerServiceServer is the server API for ABCIListenerService service. +// All implementations must embed UnimplementedABCIListenerServiceServer +// for forward compatibility +type ABCIListenerServiceServer interface { + // ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock + ListenBeginBlock(context.Context, *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) + // ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + ListenEndBlock(context.Context, *ListenEndBlockRequest) (*ListenEndBlockResponse, error) + // ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx + ListenDeliverTx(context.Context, *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + ListenCommit(context.Context, *ListenCommitRequest) (*ListenCommitResponse, error) + mustEmbedUnimplementedABCIListenerServiceServer() +} + +// UnimplementedABCIListenerServiceServer must be embedded to have forward compatible implementations. +type UnimplementedABCIListenerServiceServer struct { +} + +func (UnimplementedABCIListenerServiceServer) ListenBeginBlock(context.Context, *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenBeginBlock not implemented") +} +func (UnimplementedABCIListenerServiceServer) ListenEndBlock(context.Context, *ListenEndBlockRequest) (*ListenEndBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenEndBlock not implemented") +} +func (UnimplementedABCIListenerServiceServer) ListenDeliverTx(context.Context, *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenDeliverTx not implemented") +} +func (UnimplementedABCIListenerServiceServer) ListenCommit(context.Context, *ListenCommitRequest) (*ListenCommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenCommit not implemented") +} +func (UnimplementedABCIListenerServiceServer) mustEmbedUnimplementedABCIListenerServiceServer() {} + +// UnsafeABCIListenerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ABCIListenerServiceServer will +// result in compilation errors. +type UnsafeABCIListenerServiceServer interface { + mustEmbedUnimplementedABCIListenerServiceServer() +} + +func RegisterABCIListenerServiceServer(s grpc.ServiceRegistrar, srv ABCIListenerServiceServer) { + s.RegisterService(&ABCIListenerService_ServiceDesc, srv) +} + +func _ABCIListenerService_ListenBeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenBeginBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenBeginBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, req.(*ListenBeginBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenEndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenEndBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenEndBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, req.(*ListenEndBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenDeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenDeliverTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenDeliverTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, req.(*ListenDeliverTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenCommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenCommit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenCommit(ctx, req.(*ListenCommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ABCIListenerService_ServiceDesc is the grpc.ServiceDesc for ABCIListenerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ABCIListenerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.store.streaming.abci.ABCIListenerService", + HandlerType: (*ABCIListenerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListenBeginBlock", + Handler: _ABCIListenerService_ListenBeginBlock_Handler, + }, + { + MethodName: "ListenEndBlock", + Handler: _ABCIListenerService_ListenEndBlock_Handler, + }, + { + MethodName: "ListenDeliverTx", + Handler: _ABCIListenerService_ListenDeliverTx_Handler, + }, + { + MethodName: "ListenCommit", + Handler: _ABCIListenerService_ListenCommit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/store/streaming/abci/grpc.proto", +} diff --git a/baseapp/abci.go b/baseapp/abci.go index b0de6ce94244..a00b7b039d1d 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -215,10 +215,12 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg // set the signed validators for addition to context in deliverTx app.voteInfos = req.LastCommitInfo.GetVotes() - // call the hooks with the BeginBlock messages - for _, streamingListener := range app.abciListeners { - if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil { - panic(fmt.Errorf("BeginBlock listening hook failed, height: %d, err: %w", req.Header.Height, err)) + // call the streaming service hook with the BeginBlock messages + for _, abciListener := range app.streamingManager.ABCIListeners { + ctx := app.deliverState.ctx + blockHeight := ctx.BlockHeight() + if err := abciListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil { + app.logger.Error("BeginBlock listening hook failed", "height", blockHeight, "err", err) } } @@ -244,10 +246,12 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc res.ConsensusParamUpdates = cp } - // call the streaming service hooks with the EndBlock messages - for _, streamingListener := range app.abciListeners { - if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil { - panic(fmt.Errorf("EndBlock listening hook failed, height: %d, err: %w", req.Height, err)) + // call the streaming service hook with the EndBlock messages + for _, abciListener := range app.streamingManager.ABCIListeners { + ctx := app.deliverState.ctx + blockHeight := ctx.BlockHeight() + if err := abciListener.ListenEndBlock(ctx, req, res); err != nil { + app.logger.Error("EndBlock listening hook failed", "height", blockHeight, "err", err) } } @@ -393,14 +397,18 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { // Otherwise, the ResponseDeliverTx will contain relevant error information. // Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant // gas execution context. -func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) { +func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { gInfo := sdk.GasInfo{} resultStr := "successful" + var res abci.ResponseDeliverTx defer func() { - for _, streamingListener := range app.abciListeners { - if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil { - panic(fmt.Errorf("DeliverTx listening hook failed: %w", err)) + // call the streaming service hook with the EndBlock messages + for _, abciListener := range app.streamingManager.ABCIListeners { + ctx := app.deliverState.ctx + blockHeight := ctx.BlockHeight() + if err := abciListener.ListenDeliverTx(ctx, req, res); err != nil { + app.logger.Error("DeliverTx listening hook failed", "height", blockHeight, "err", err) } } }() @@ -418,13 +426,15 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(anteEvents, app.indexEvents), app.trace) } - return abci.ResponseDeliverTx{ + res = abci.ResponseDeliverTx{ GasWanted: int64(gInfo.GasWanted), // TODO: Should type accept unsigned ints? GasUsed: int64(gInfo.GasUsed), // TODO: Should type accept unsigned ints? Log: result.Log, Data: result.Data, Events: sdk.MarkEventsToIndex(result.Events, app.indexEvents), } + + return res } // Commit implements the ABCI interface. It will commit all state that exists in @@ -449,10 +459,16 @@ func (app *BaseApp) Commit() abci.ResponseCommit { RetainHeight: retainHeight, } - // call the hooks with the Commit message - for _, streamingListener := range app.abciListeners { - if err := streamingListener.ListenCommit(app.deliverState.ctx, res); err != nil { - panic(fmt.Errorf("Commit listening hook failed, height: %d, err: %w", header.Height, err)) + // call the streaming service hook with the EndBlock messages + abciListeners := app.streamingManager.ABCIListeners + if len(abciListeners) > 0 { + ctx := app.deliverState.ctx + blockHeight := ctx.BlockHeight() + changeSet := app.cms.PopStateCache() + for _, abciListener := range abciListeners { + if err := abciListener.ListenCommit(ctx, res, changeSet); err != nil { + app.logger.Error("Commit listening hook failed", "height", blockHeight, "err", err) + } } } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 44368c509936..55ed3c3ac4c8 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -141,9 +141,8 @@ type BaseApp struct { //nolint: maligned // which informs CometBFT what to index. If empty, all events will be indexed. indexEvents map[string]struct{} - // abciListeners for hooking into the ABCI message processing of the BaseApp - // and exposing the requests and responses to external consumers - abciListeners []storetypes.ABCIListener + // streamingManager for managing instances and configuration of ABCIListener services + streamingManager storetypes.StreamingManager chainID string } @@ -415,7 +414,7 @@ func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) { ms := app.cms.CacheMultiStore() baseState := &state{ ms: ms, - ctx: sdk.NewContext(ms, header, false, app.logger), + ctx: sdk.NewContext(ms, header, false, app.logger).WithStreamingManager(app.streamingManager), } switch mode { diff --git a/baseapp/options.go b/baseapp/options.go index 7ef64e96ea04..2900cd798b5d 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -8,14 +8,10 @@ import ( pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/snapshots" snapshottypes "cosmossdk.io/store/snapshots/types" - "cosmossdk.io/store/streaming" storetypes "cosmossdk.io/store/types" dbm "github.com/cosmos/cosmos-db" - "github.com/spf13/cast" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/mempool" ) @@ -246,29 +242,6 @@ func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { app.msgServiceRouter.SetInterfaceRegistry(registry) } -// SetStreamingService is used to set a streaming service into the BaseApp hooks and load the listeners into the multistore -func (app *BaseApp) SetStreamingService( - appOpts servertypes.AppOptions, - appCodec storetypes.Codec, - keys map[string]*storetypes.KVStoreKey, -) error { - homePath := cast.ToString(appOpts.Get(flags.FlagHome)) - streamers, _, err := streaming.LoadStreamingServices(appOpts, appCodec, app.logger, keys, homePath) - if err != nil { - return err - } - // add the listeners for each StoreKey - for _, streamer := range streamers { - for key, lis := range streamer.Listeners() { - app.cms.AddListeners(key, lis) - } - // register the StreamingService within the BaseApp - // BaseApp will pass BeginBlock, DeliverTx, and EndBlock requests and responses to the streaming services to update their ABCI context - app.abciListeners = append(app.abciListeners, streamer) - } - return nil -} - // SetTxDecoder sets the TxDecoder if it wasn't provided in the BaseApp constructor. func (app *BaseApp) SetTxDecoder(txDecoder sdk.TxDecoder) { app.txDecoder = txDecoder @@ -319,3 +292,8 @@ func (app *BaseApp) SetStoreMetrics(gatherer metrics.StoreMetrics) { app.cms.SetMetrics(gatherer) } + +// SetStreamingManager sets the streaming manager for the BaseApp. +func (app *BaseApp) SetStreamingManager(manager storetypes.StreamingManager) { + app.streamingManager = manager +} diff --git a/baseapp/streaming.go b/baseapp/streaming.go new file mode 100644 index 000000000000..a3c8e1493f2b --- /dev/null +++ b/baseapp/streaming.go @@ -0,0 +1,112 @@ +package baseapp + +import ( + "fmt" + "os" + "sort" + "strings" + + "cosmossdk.io/store/streaming" + storetypes "cosmossdk.io/store/types" + "github.com/spf13/cast" + + "github.com/cosmos/cosmos-sdk/client/flags" + servertypes "github.com/cosmos/cosmos-sdk/server/types" +) + +const ( + StreamingTomlKey = "streaming" + StreamingABCITomlKey = "abci" + StreamingABCIPluginTomlKey = "plugin" + StreamingABCIKeysTomlKey = "keys" + StreamingABCIStopNodeOnErrTomlKey = "stop-node-on-err" +) + +// RegisterStreamingServices registers streaming services with the BaseApp. +func (app *BaseApp) RegisterStreamingServices(appOpts servertypes.AppOptions, keys map[string]*storetypes.KVStoreKey) { + // register streaming services + streamingCfg := cast.ToStringMap(appOpts.Get(StreamingTomlKey)) + for service := range streamingCfg { + pluginKey := fmt.Sprintf("%s.%s.%s", StreamingTomlKey, service, StreamingABCIPluginTomlKey) + pluginName := strings.TrimSpace(cast.ToString(appOpts.Get(pluginKey))) + if len(pluginName) > 0 { + logLevel := cast.ToString(appOpts.Get(flags.FlagLogLevel)) + plugin, err := streaming.NewStreamingPlugin(pluginName, logLevel) + if err != nil { + app.logger.Error("failed to load streaming plugin", "error", err) + os.Exit(1) + } + if err := app.registerStreamingPlugin(appOpts, keys, plugin); err != nil { + app.logger.Error("failed to register streaming plugin", "error", err) + os.Exit(1) + } + } + } +} + +// registerStreamingPlugin registers streaming plugins with the BaseApp. +func (app *BaseApp) registerStreamingPlugin( + appOpts servertypes.AppOptions, + keys map[string]*storetypes.KVStoreKey, + streamingPlugin interface{}, +) error { + v, ok := streamingPlugin.(storetypes.ABCIListener) + if !ok { + return fmt.Errorf("unexpected plugin type %T", v) + } + + app.registerABCIListenerPlugin(appOpts, keys, v) + return nil +} + +// registerABCIListenerPlugin registers plugins that implement the ABCIListener interface. +func (app *BaseApp) registerABCIListenerPlugin( + appOpts servertypes.AppOptions, + keys map[string]*storetypes.KVStoreKey, + abciListener storetypes.ABCIListener, +) { + stopNodeOnErrKey := fmt.Sprintf("%s.%s.%s", StreamingTomlKey, StreamingABCITomlKey, StreamingABCIStopNodeOnErrTomlKey) + stopNodeOnErr := cast.ToBool(appOpts.Get(stopNodeOnErrKey)) + keysKey := fmt.Sprintf("%s.%s.%s", StreamingTomlKey, StreamingABCITomlKey, StreamingABCIKeysTomlKey) + exposeKeysStr := cast.ToStringSlice(appOpts.Get(keysKey)) + exposedKeys := exposeStoreKeysSorted(exposeKeysStr, keys) + app.cms.AddListeners(exposedKeys) + app.SetStreamingManager( + storetypes.StreamingManager{ + ABCIListeners: []storetypes.ABCIListener{abciListener}, + StopNodeOnErr: stopNodeOnErr, + }, + ) +} + +func exposeAll(list []string) bool { + for _, ele := range list { + if ele == "*" { + return true + } + } + return false +} + +func exposeStoreKeysSorted(keysStr []string, keys map[string]*storetypes.KVStoreKey) []storetypes.StoreKey { + var exposeStoreKeys []storetypes.StoreKey + if exposeAll(keysStr) { + exposeStoreKeys = make([]storetypes.StoreKey, 0, len(keys)) + for key := range keys { + exposeStoreKeys = append(exposeStoreKeys, keys[key]) + } + } else { + exposeStoreKeys = make([]storetypes.StoreKey, 0, len(keysStr)) + for _, keyStr := range keysStr { + if storeKey, ok := keys[keyStr]; ok { + exposeStoreKeys = append(exposeStoreKeys, storeKey) + } + } + } + // sort storeKeys for deterministic output + sort.SliceStable(exposeStoreKeys, func(i, j int) bool { + return exposeStoreKeys[i].Name() < exposeStoreKeys[j].Name() + }) + + return exposeStoreKeys +} diff --git a/baseapp/streaming_test.go b/baseapp/streaming_test.go new file mode 100644 index 000000000000..ca63305fcbfa --- /dev/null +++ b/baseapp/streaming_test.go @@ -0,0 +1,147 @@ +package baseapp_test + +import ( + "context" + "fmt" + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" + baseapptestutil "github.com/cosmos/cosmos-sdk/baseapp/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ storetypes.ABCIListener = (*MockABCIListener)(nil) + +type MockABCIListener struct { + name string + ChangeSet []*storetypes.StoreKVPair +} + +func NewMockABCIListener(name string) MockABCIListener { + return MockABCIListener{ + name: name, + ChangeSet: make([]*storetypes.StoreKVPair, 0), + } +} + +func (m MockABCIListener) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + return nil +} + +func (m MockABCIListener) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + return nil +} + +func (m MockABCIListener) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + return nil +} + +func (m *MockABCIListener) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*storetypes.StoreKVPair) error { + m.ChangeSet = changeSet + return nil +} + +var distKey1 = storetypes.NewKVStoreKey("distKey1") + +func TestABCI_MultiListener_StateChanges(t *testing.T) { + anteKey := []byte("ante-key") + anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } + distOpt := func(bapp *baseapp.BaseApp) { bapp.MountStores(distKey1) } + mockListener1 := NewMockABCIListener("lis_1") + mockListener2 := NewMockABCIListener("lis_2") + streamingManager := storetypes.StreamingManager{ABCIListeners: []storetypes.ABCIListener{&mockListener1, &mockListener2}} + streamingManagerOpt := func(bapp *baseapp.BaseApp) { bapp.SetStreamingManager(streamingManager) } + addListenerOpt := func(bapp *baseapp.BaseApp) { bapp.CommitMultiStore().AddListeners([]storetypes.StoreKey{distKey1}) } + suite := NewBaseAppSuite(t, anteOpt, distOpt, streamingManagerOpt, addListenerOpt) + + suite.baseApp.InitChain(abci.RequestInitChain{ + ConsensusParams: &tmproto.ConsensusParams{}, + }) + + deliverKey := []byte("deliver-key") + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), CounterServerImpl{t, capKey1, deliverKey}) + + nBlocks := 3 + txPerHeight := 5 + + for blockN := 0; blockN < nBlocks; blockN++ { + header := tmproto.Header{Height: int64(blockN) + 1} + suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) + var expectedChangeSet []*storetypes.StoreKVPair + + for i := 0; i < txPerHeight; i++ { + counter := int64(blockN*txPerHeight + i) + tx := newTxCounter(t, suite.txConfig, counter, counter) + + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + + sKey := []byte(fmt.Sprintf("distKey%d", i)) + sVal := []byte(fmt.Sprintf("distVal%d", i)) + store := getDeliverStateCtx(suite.baseApp).KVStore(distKey1) + store.Set(sKey, sVal) + + expectedChangeSet = append(expectedChangeSet, &storetypes.StoreKVPair{ + StoreKey: distKey1.Name(), + Delete: false, + Key: sKey, + Value: sVal, + }) + + res := suite.baseApp.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + require.True(t, res.IsOK(), fmt.Sprintf("%v", res)) + + events := res.GetEvents() + require.Len(t, events, 3, "should contain ante handler, message type and counter events respectively") + require.Equal(t, sdk.MarkEventsToIndex(counterEvent("ante_handler", counter).ToABCIEvents(), map[string]struct{}{})[0], events[0], "ante handler event") + require.Equal(t, sdk.MarkEventsToIndex(counterEvent(sdk.EventTypeMessage, counter).ToABCIEvents(), map[string]struct{}{})[0], events[2], "msg handler update counter event") + } + + suite.baseApp.EndBlock(abci.RequestEndBlock{}) + suite.baseApp.Commit() + + require.Equal(t, expectedChangeSet, mockListener1.ChangeSet, "should contain the same changeSet") + require.Equal(t, expectedChangeSet, mockListener2.ChangeSet, "should contain the same changeSet") + } +} + +func Test_Ctx_with_StreamingManager(t *testing.T) { + mockListener1 := NewMockABCIListener("lis_1") + mockListener2 := NewMockABCIListener("lis_2") + listeners := []storetypes.ABCIListener{&mockListener1, &mockListener2} + streamingManager := storetypes.StreamingManager{ABCIListeners: listeners, StopNodeOnErr: true} + streamingManagerOpt := func(bapp *baseapp.BaseApp) { bapp.SetStreamingManager(streamingManager) } + addListenerOpt := func(bapp *baseapp.BaseApp) { bapp.CommitMultiStore().AddListeners([]storetypes.StoreKey{distKey1}) } + suite := NewBaseAppSuite(t, streamingManagerOpt, addListenerOpt) + + suite.baseApp.InitChain(abci.RequestInitChain{ + ConsensusParams: &tmproto.ConsensusParams{}, + }) + + ctx := getDeliverStateCtx(suite.baseApp) + sm := ctx.StreamingManager() + require.NotNil(t, sm, fmt.Sprintf("nil StreamingManager: %v", sm)) + require.Equal(t, listeners, sm.ABCIListeners, fmt.Sprintf("should contain same listeners: %v", listeners)) + require.Equal(t, true, sm.StopNodeOnErr, "should contain StopNodeOnErr = true") + + nBlocks := 2 + + for blockN := 0; blockN < nBlocks; blockN++ { + header := tmproto.Header{Height: int64(blockN) + 1} + suite.baseApp.BeginBlock(abci.RequestBeginBlock{Header: header}) + + ctx := getDeliverStateCtx(suite.baseApp) + sm := ctx.StreamingManager() + require.NotNil(t, sm, fmt.Sprintf("nil StreamingManager: %v", sm)) + require.Equal(t, listeners, sm.ABCIListeners, fmt.Sprintf("should contain same listeners: %v", listeners)) + require.Equal(t, true, sm.StopNodeOnErr, "should contain StopNodeOnErr = true") + + suite.baseApp.EndBlock(abci.RequestEndBlock{}) + suite.baseApp.Commit() + } +} diff --git a/go.mod b/go.mod index 04510b1987e6..e3e1cb1c222b 100644 --- a/go.mod +++ b/go.mod @@ -89,6 +89,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -107,8 +108,11 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.16.0 // indirect @@ -121,8 +125,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -152,6 +158,11 @@ require ( nhooyr.io/websocket v1.8.6 // indirect ) +// Here are the short-lived replace from the Cosmos SDK +// Replace here are pending PRs, or version to be tagged +// TODO tag after https://github.com/cosmos/cosmos-sdk/pull/14207 merge +replace cosmossdk.io/store => ./store + // Below are the long-lived replace of the Cosmos SDK replace ( // use cosmos fork of keyring diff --git a/go.sum b/go.sum index e9fe17fdbbc8..d6e8c0510d48 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -258,6 +256,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -448,11 +448,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -472,6 +476,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -566,7 +572,9 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -575,6 +583,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -596,6 +605,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -628,6 +638,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1015,6 +1026,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/proto/cosmos/store/streaming/abci/grpc.proto b/proto/cosmos/store/streaming/abci/grpc.proto new file mode 100644 index 000000000000..8d8070c569cc --- /dev/null +++ b/proto/cosmos/store/streaming/abci/grpc.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package cosmos.store.streaming.abci; + +import "tendermint/abci/types.proto"; +import "cosmos/store/v1beta1/listening.proto"; + +option go_package = "cosmossdk.io/store/streaming/abci"; + +// ListenBeginBlockRequest is the request type for the ListenBeginBlock RPC method +message ListenBeginBlockRequest { + tendermint.abci.RequestBeginBlock req = 1; + tendermint.abci.ResponseBeginBlock res = 2; +} + +// ListenBeginBlockResponse is the response type for the ListenBeginBlock RPC method +message ListenBeginBlockResponse {} + +// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +message ListenEndBlockRequest { + tendermint.abci.RequestEndBlock req = 1; + tendermint.abci.ResponseEndBlock res = 2; +} + +// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +message ListenEndBlockResponse {} + +// ListenDeliverTxRequest is the request type for the ListenDeliverTx RPC method +message ListenDeliverTxRequest { + // explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it + int64 block_height = 1; + tendermint.abci.RequestDeliverTx req = 2; + tendermint.abci.ResponseDeliverTx res = 3; +} + +// ListenDeliverTxResponse is the response type for the ListenDeliverTx RPC method +message ListenDeliverTxResponse {} + +// ListenCommitRequest is the request type for the ListenCommit RPC method +message ListenCommitRequest { + // explicitly pass in block height as ResponseCommit does not contain this info + int64 block_height = 1; + tendermint.abci.ResponseCommit res = 2; + repeated cosmos.store.v1beta1.StoreKVPair change_set = 3; +} + +// ListenCommitResponse is the response type for the ListenCommit RPC method +message ListenCommitResponse {} + +// ABCIListenerService is the service for the BaseApp ABCIListener interface +service ABCIListenerService { + // ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock + rpc ListenBeginBlock(ListenBeginBlockRequest) returns (ListenBeginBlockResponse); + // ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + rpc ListenEndBlock(ListenEndBlockRequest) returns (ListenEndBlockResponse); + // ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx + rpc ListenDeliverTx(ListenDeliverTxRequest) returns (ListenDeliverTxResponse); + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + rpc ListenCommit(ListenCommitRequest) returns (ListenCommitResponse); +} diff --git a/server/config/config.go b/server/config/config.go index bb9d49e06704..5cf1313b6673 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -30,9 +30,6 @@ const ( // DefaultGRPCMaxSendMsgSize defines the default gRPC max message size in // bytes the server can send. DefaultGRPCMaxSendMsgSize = math.MaxInt32 - - // FileStreamer defines the store streaming type for file streaming. - FileStreamer = "file" ) // BaseConfig defines the server's basic configuration @@ -171,34 +168,17 @@ type MempoolConfig struct { MaxTxs int } +// State Streaming configuration type ( - // StoreConfig defines application configuration for state streaming and other - // storage related operations. - StoreConfig struct { - Streamers []string `mapstructure:"streamers"` + // StreamingConfig defines application configuration for external streaming services + StreamingConfig struct { + ABCI ABCIListenerConfig `mapstructure:"abci"` } - - // StreamersConfig defines concrete state streaming configuration options. These - // fields are required to be set when state streaming is enabled via a non-empty - // list defined by 'StoreConfig.Streamers'. - StreamersConfig struct { - File FileStreamerConfig `mapstructure:"file"` - } - - // FileStreamerConfig defines the file streaming configuration options. - FileStreamerConfig struct { - Keys []string `mapstructure:"keys"` - WriteDir string `mapstructure:"write_dir"` - Prefix string `mapstructure:"prefix"` - // OutputMetadata specifies if output the block metadata file which includes - // the abci requests/responses, otherwise only the data file is outputted. - OutputMetadata bool `mapstructure:"output-metadata"` - // StopNodeOnError specifies if propagate the streamer errors to the consensus - // state machine, it's nesserary for data integrity of output. - StopNodeOnError bool `mapstructure:"stop-node-on-error"` - // Fsync specifies if calling fsync after writing the files, it slows down - // the commit, but don't lose data in face of system crash. - Fsync bool `mapstructure:"fsync"` + // ABCIListenerConfig defines application configuration for ABCIListener streaming service + ABCIListenerConfig struct { + Keys []string `mapstructure:"keys"` + Plugin string `mapstructure:"plugin"` + StopNodeOnErr bool `mapstructure:"stop-node-on-err"` } ) @@ -212,8 +192,7 @@ type Config struct { GRPC GRPCConfig `mapstructure:"grpc"` GRPCWeb GRPCWebConfig `mapstructure:"grpc-web"` StateSync StateSyncConfig `mapstructure:"state-sync"` - Store StoreConfig `mapstructure:"store"` - Streamers StreamersConfig `mapstructure:"streamers"` + Streaming StreamingConfig `mapstructure:"streaming"` Mempool MempoolConfig `mapstructure:"mempool"` } @@ -285,18 +264,10 @@ func DefaultConfig() *Config { SnapshotInterval: 0, SnapshotKeepRecent: 2, }, - Store: StoreConfig{ - Streamers: []string{}, - }, - Streamers: StreamersConfig{ - File: FileStreamerConfig{ - Keys: []string{"*"}, - WriteDir: "", - OutputMetadata: true, - StopNodeOnError: true, - // NOTICE: The default config doesn't protect the streamer data integrity - // in face of system crash. - Fsync: false, + Streaming: StreamingConfig{ + ABCI: ABCIListenerConfig{ + Keys: []string{}, + StopNodeOnErr: true, }, }, Mempool: MempoolConfig{ diff --git a/server/config/config_test.go b/server/config/config_test.go index c18244d36220..c15186e73a2d 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -2,10 +2,12 @@ package config import ( "bytes" + "os" "path/filepath" "testing" "github.com/spf13/viper" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -34,24 +36,65 @@ func TestIndexEventsMarshalling(t *testing.T) { require.Contains(t, actual, expectedIn, "config file contents") } -func TestParseStoreStreaming(t *testing.T) { - expectedContents := `[store] -streamers = ["file", ] +func TestStreamingConfig(t *testing.T) { + cfg := Config{ + Streaming: StreamingConfig{ + ABCI: ABCIListenerConfig{ + Keys: []string{"one", "two"}, + Plugin: "plugin-A", + StopNodeOnErr: false, + }, + }, + } + + testDir := t.TempDir() + cfgFile := filepath.Join(testDir, "app.toml") + WriteConfigFile(cfgFile, &cfg) + + cfgFileBz, err := os.ReadFile(cfgFile) + require.NoError(t, err, "reading %s", cfgFile) + cfgFileContents := string(cfgFileBz) + t.Logf("Config file contents: %s:\n%s", cfgFile, cfgFileContents) + + expectedLines := []string{ + `keys = ["one", "two", ]`, + `plugin = "plugin-A"`, + `stop-node-on-err = false`, + } + + for _, line := range expectedLines { + assert.Contains(t, cfgFileContents, line+"\n", "config file contents") + } + + vpr := viper.New() + vpr.SetConfigFile(cfgFile) + err = vpr.ReadInConfig() + require.NoError(t, err, "reading config file into viper") + + var actual Config + err = vpr.Unmarshal(&actual) + require.NoError(t, err, "vpr.Unmarshal") + + assert.Equal(t, cfg.Streaming, actual.Streaming, "Streaming") +} -[streamers] -[streamers.file] -keys = ["*", ] -write_dir = "/foo/bar" -prefix = ""` +func TestParseStreaming(t *testing.T) { + expectedKeys := `keys = ["*", ]` + "\n" + expectedPlugin := `plugin = "abci_v1"` + "\n" + expectedStopNodeOnErr := `stop-node-on-err = true` + "\n" cfg := DefaultConfig() - cfg.Store.Streamers = []string{FileStreamer} - cfg.Streamers.File.Keys = []string{"*"} - cfg.Streamers.File.WriteDir = "/foo/bar" + cfg.Streaming.ABCI.Keys = []string{"*"} + cfg.Streaming.ABCI.Plugin = "abci_v1" + cfg.Streaming.ABCI.StopNodeOnErr = true var buffer bytes.Buffer - require.NoError(t, configTemplate.Execute(&buffer, cfg), "executing template") - require.Contains(t, buffer.String(), expectedContents, "config file contents") + err := configTemplate.Execute(&buffer, cfg) + require.NoError(t, err, "executing template") + actual := buffer.String() + require.Contains(t, actual, expectedKeys, "config file contents") + require.Contains(t, actual, expectedPlugin, "config file contents") + require.Contains(t, actual, expectedStopNodeOnErr, "config file contents") } func TestReadConfig(t *testing.T) { diff --git a/server/config/toml.go b/server/config/toml.go index b15b5c85fdae..de846d8f8575 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -199,27 +199,30 @@ snapshot-interval = {{ .StateSync.SnapshotInterval }} snapshot-keep-recent = {{ .StateSync.SnapshotKeepRecent }} ############################################################################### -### Store / State Streaming ### +### State Streaming ### ############################################################################### -[store] -streamers = [{{ range .Store.Streamers }}{{ printf "%q, " . }}{{end}}] +# Streaming allows nodes to stream state to external systems. +[streaming] -[streamers] -[streamers.file] -keys = [{{ range .Streamers.File.Keys }}{{ printf "%q, " . }}{{end}}] -write_dir = "{{ .Streamers.File.WriteDir }}" -prefix = "{{ .Streamers.File.Prefix }}" +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] -# output-metadata specifies if output the metadata file which includes the abci request/responses -# during processing the block. -output-metadata = "{{ .Streamers.File.OutputMetadata }}" +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [{{ range .Streaming.ABCI.Keys }}{{ printf "%q, " . }}{{end}}] -# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine. -stop-node-on-error = "{{ .Streamers.File.StopNodeOnError }}" +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "{{ .Streaming.ABCI.Plugin }}" -# fsync specifies if call fsync after writing the files. -fsync = "{{ .Streamers.File.Fsync }}" +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }} ############################################################################### ### Mempool ### diff --git a/server/mock/store.go b/server/mock/store.go index 6d4e784c1a6c..31b73f3fd86f 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -34,7 +34,7 @@ func (ms multiStore) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) panic("not implemented") } -func (ms multiStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.WriteListener) storetypes.CacheWrap { +func (ms multiStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { panic("not implemented") } @@ -50,7 +50,7 @@ func (ms multiStore) SetTracer(w io.Writer) storetypes.MultiStore { panic("not implemented") } -func (ms multiStore) AddListeners(key storetypes.StoreKey, listeners []storetypes.WriteListener) { +func (ms multiStore) AddListeners(keys []storetypes.StoreKey) { panic("not implemented") } @@ -62,6 +62,10 @@ func (ms multiStore) ListeningEnabled(key storetypes.StoreKey) bool { panic("not implemented") } +func (ms multiStore) PopStateCache() []*storetypes.StoreKVPair { + panic("not implemented") +} + func (ms multiStore) Commit() storetypes.CommitID { panic("not implemented") } @@ -178,7 +182,7 @@ func (kv kvStore) CacheWrapWithTrace(w io.Writer, tc storetypes.TraceContext) st panic("not implemented") } -func (kv kvStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.WriteListener) storetypes.CacheWrap { +func (kv kvStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { panic("not implemented") } diff --git a/simapp/app.go b/simapp/app.go index 6dbdc5f8969e..5d9604b3f1f4 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -259,16 +259,14 @@ func NewSimApp( evidencetypes.StoreKey, authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey, ) + // register streaming services + bApp.RegisterStreamingServices(appOpts, keys) + tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) // NOTE: The testingkey is just mounted for testing purposes. Actual applications should // not include this key. memKeys := storetypes.NewMemoryStoreKeys("testingkey") - // register the streaming service with the BaseApp - if err := bApp.SetStreamingService(appOpts, appCodec, keys); err != nil { - panic(fmt.Errorf("failed to load state streaming: %w", err)) - } - app := &SimApp{ BaseApp: bApp, legacyAmino: legacyAmino, diff --git a/simapp/app_v2.go b/simapp/app_v2.go index 1ca91b7d03ad..9142591302f0 100644 --- a/simapp/app_v2.go +++ b/simapp/app_v2.go @@ -4,7 +4,6 @@ package simapp import ( _ "embed" - "fmt" "io" "os" "path/filepath" @@ -252,9 +251,8 @@ func NewSimApp( app.App = appBuilder.Build(logger, db, traceStore, baseAppOptions...) - if err := app.App.BaseApp.SetStreamingService(appOpts, app.appCodec, app.kvStoreKeys()); err != nil { - panic(fmt.Errorf("failed to load state streaming: %w", err)) - } + // register streaming services + app.RegisterStreamingServices(appOpts, app.kvStoreKeys()) /**** Module Options ****/ diff --git a/simapp/go.mod b/simapp/go.mod index b3fe24d6c0ce..267198140261 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -81,6 +81,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -110,11 +111,14 @@ require ( github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -138,6 +142,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -189,6 +194,7 @@ require ( // Replace here are pending PRs, or version to be tagged replace ( // TODO tag all extracted modules after SDK refactor + cosmossdk.io/store => ../store cosmossdk.io/tools/confix => ../tools/confix cosmossdk.io/tools/rosetta => ../tools/rosetta cosmossdk.io/x/evidence => ../x/evidence diff --git a/simapp/go.sum b/simapp/go.sum index 74406dabde79..855995ac8337 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -204,8 +204,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230309163709-87da587416ba h1:63dnRBywQLvo/Ke0zljksFlWg5tAMTwOiuv6yZ3X0sM= -cosmossdk.io/store v0.0.0-20230309163709-87da587416ba/go.mod h1:sf0uPZvsgXqXy2ydRXJmsM+sNHSZLZN6xZZkh7c3+t0= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -427,6 +425,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -651,11 +651,15 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -679,6 +683,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -777,7 +783,9 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -786,6 +794,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -843,6 +852,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1274,6 +1284,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index cb38d99935dc..1f0baf4e29c7 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -2,10 +2,12 @@ package simapp import ( "fmt" + "github.com/spf13/viper" "os" "testing" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + flag "github.com/spf13/pflag" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client/flags" @@ -16,6 +18,13 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" ) +var FlagEnableBenchStreamingValue bool + +// Get flags every time the simulator is run +func init() { + flag.BoolVar(&FlagEnableBenchStreamingValue, "EnableStreaming", false, "Enable streaming service") +} + // Profile with: // /usr/local/go/bin/go test -benchmem -run=^$ cosmossdk.io/simapp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out func BenchmarkFullAppSimulation(b *testing.B) { @@ -38,9 +47,18 @@ func BenchmarkFullAppSimulation(b *testing.B) { require.NoError(b, os.RemoveAll(dir)) }() - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + appOptions := viper.New() + if FlagEnableStreamingValue { + m := make(map[string]interface{}) + m["streaming.abci.keys"] = []string{"*"} + m["streaming.abci.plugin"] = "abci_v1" + m["streaming.abci.stop-node-on-err"] = true + for key, value := range m { + appOptions.SetDefault(key, value) + } + } + appOptions.SetDefault(flags.FlagHome, DefaultNodeHome) + appOptions.SetDefault(server.FlagInvCheckPeriod, simcli.FlagPeriodValue) app := NewSimApp(logger, db, nil, true, appOptions, interBlockCacheOpt()) diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 031935a414a9..b30f1771c1be 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -2,6 +2,7 @@ package simapp import ( "encoding/json" + "flag" "fmt" "math/rand" "os" @@ -13,6 +14,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" dbm "github.com/cosmos/cosmos-db" + "github.com/spf13/viper" "github.com/stretchr/testify/require" "cosmossdk.io/log" @@ -40,9 +42,12 @@ import ( // SimAppChainID hardcoded chainID for simulation const SimAppChainID = "simulation-app" +var FlagEnableStreamingValue bool + // Get flags every time the simulator is run func init() { simcli.GetSimulatorFlags() + flag.BoolVar(&FlagEnableStreamingValue, "EnableStreaming", false, "Enable streaming service") } type StoreKeysPrefixes struct { @@ -328,9 +333,21 @@ func TestAppStateDeterminism(t *testing.T) { numTimesToRunPerSeed := 5 appHashList := make([]json.RawMessage, numTimesToRunPerSeed) - appOptions := make(simtestutil.AppOptionsMap, 0) - appOptions[flags.FlagHome] = DefaultNodeHome - appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + appOptions := viper.New() + if FlagEnableStreamingValue { + m := make(map[string]interface{}) + m["streaming.abci.keys"] = []string{"*"} + m["streaming.abci.plugin"] = "abci_v1" + m["streaming.abci.stop-node-on-err"] = true + for key, value := range m { + appOptions.SetDefault(key, value) + } + } + appOptions.SetDefault(flags.FlagHome, DefaultNodeHome) + appOptions.SetDefault(server.FlagInvCheckPeriod, simcli.FlagPeriodValue) + if simcli.FlagVerboseValue { + appOptions.SetDefault(flags.FlagLogLevel, "debug") + } for i := 0; i < numSeeds; i++ { config.Seed = rand.Int63() diff --git a/store/go.mod b/store/go.mod index 7f058ba73cbe..ec220639853f 100644 --- a/store/go.mod +++ b/store/go.mod @@ -14,14 +14,16 @@ require ( github.com/cosmos/iavl v0.21.0-alpha.1 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 // indirect + github.com/hashicorp/go-hclog v1.2.0 + github.com/hashicorp/go-plugin v1.4.8 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d - github.com/spf13/cast v1.5.0 + github.com/spf13/cast v1.5.0 // indirect github.com/stretchr/testify v1.8.2 github.com/tidwall/btree v1.6.0 golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect - google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.29.1 // indirect + google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.29.0 // indirect gotest.tools/v3 v3.4.0 ) @@ -36,6 +38,7 @@ require ( github.com/cockroachdb/redact v1.1.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -43,6 +46,8 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-uuid v1.0.1 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/klauspost/compress v1.16.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -50,6 +55,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/onsi/gomega v1.20.0 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/store/go.sum b/store/go.sum index 33fca23ccd98..aad774e17634 100644 --- a/store/go.sum +++ b/store/go.sum @@ -86,6 +86,9 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -165,17 +168,24 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= 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/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -186,6 +196,7 @@ github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/ github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= 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/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -222,13 +233,16 @@ github.com/linxGnu/grocksdb v1.7.15 h1:AEhP28lkeAybv5UYNYviYISpR6bJejEnKuYbnWAnx github.com/linxGnu/grocksdb v1.7.15/go.mod h1:pY55D0o+r8yUYLq70QmhdudxYvoDb9F+9puf4m3/W+U= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 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.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -241,6 +255,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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= @@ -256,6 +272,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS 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/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -266,8 +284,9 @@ github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3 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 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= 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 v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -443,6 +462,7 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/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-20191008105621-543471e840be/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-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -531,8 +551,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba 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.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= +google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/store/listenkv/store.go b/store/listenkv/store.go index 706df3082db6..27cbe1cbcdf0 100644 --- a/store/listenkv/store.go +++ b/store/listenkv/store.go @@ -13,14 +13,14 @@ var _ types.KVStore = &Store{} // underlying listeners with the proper key and operation permissions type Store struct { parent types.KVStore - listeners []types.WriteListener + listener *types.MemoryListener parentStoreKey types.StoreKey } // NewStore returns a reference to a new traceKVStore given a parent // KVStore implementation and a buffered writer. -func NewStore(parent types.KVStore, parentStoreKey types.StoreKey, listeners []types.WriteListener) *Store { - return &Store{parent: parent, listeners: listeners, parentStoreKey: parentStoreKey} +func NewStore(parent types.KVStore, parentStoreKey types.StoreKey, listener *types.MemoryListener) *Store { + return &Store{parent: parent, listener: listener, parentStoreKey: parentStoreKey} } // Get implements the KVStore interface. It traces a read operation and @@ -35,14 +35,14 @@ func (s *Store) Get(key []byte) []byte { func (s *Store) Set(key []byte, value []byte) { types.AssertValidKey(key) s.parent.Set(key, value) - s.onWrite(false, key, value) + s.listener.OnWrite(s.parentStoreKey, key, value, false) } // Delete implements the KVStore interface. It traces a write operation and // delegates the Delete call to the parent KVStore. func (s *Store) Delete(key []byte) { s.parent.Delete(key) - s.onWrite(true, key, nil) + s.listener.OnWrite(s.parentStoreKey, key, nil, true) } // Has implements the KVStore interface. It delegates the Has call to the @@ -74,16 +74,16 @@ func (s *Store) iterator(start, end []byte, ascending bool) types.Iterator { parent = s.parent.ReverseIterator(start, end) } - return newTraceIterator(parent, s.listeners) + return newTraceIterator(parent, s.listener) } type listenIterator struct { - parent types.Iterator - listeners []types.WriteListener + parent types.Iterator + listener *types.MemoryListener } -func newTraceIterator(parent types.Iterator, listeners []types.WriteListener) types.Iterator { - return &listenIterator{parent: parent, listeners: listeners} +func newTraceIterator(parent types.Iterator, listener *types.MemoryListener) types.Iterator { + return &listenIterator{parent: parent, listener: listener} } // Domain implements the Iterator interface. @@ -140,10 +140,3 @@ func (s *Store) CacheWrap() types.CacheWrap { func (s *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { panic("cannot CacheWrapWithTrace a ListenKVStore") } - -// onWrite writes a KVStore operation to all of the WriteListeners -func (s *Store) onWrite(delete bool, key, value []byte) { - for _, l := range s.listeners { - l.OnWrite(s.parentStoreKey, key, value, delete) - } -} diff --git a/store/listenkv/store_test.go b/store/listenkv/store_test.go index 4cfdef5cf088..9a56ffedbc34 100644 --- a/store/listenkv/store_test.go +++ b/store/listenkv/store_test.go @@ -1,9 +1,7 @@ package listenkv_test import ( - "bytes" "fmt" - "io" "testing" "cosmossdk.io/store/dbadapter" @@ -28,13 +26,10 @@ var kvPairs = []kv.Pair{ {Key: keyFmt(3), Value: valFmt(3)}, } -var ( - testStoreKey = types.NewKVStoreKey("listen_test") - testMarshaller = types.NewTestCodec() -) +var testStoreKey = types.NewKVStoreKey("listen_test") -func newListenKVStore(w io.Writer) *listenkv.Store { - store := newEmptyListenKVStore(w) +func newListenKVStore(listener *types.MemoryListener) *listenkv.Store { + store := newEmptyListenKVStore(listener) for _, kvPair := range kvPairs { store.Set(kvPair.Key, kvPair.Value) @@ -43,11 +38,10 @@ func newListenKVStore(w io.Writer) *listenkv.Store { return store } -func newEmptyListenKVStore(w io.Writer) *listenkv.Store { - listener := types.NewStoreKVPairWriteListener(w, testMarshaller) +func newEmptyListenKVStore(listener *types.MemoryListener) *listenkv.Store { memDB := dbadapter.Store{DB: dbm.NewMemDB()} - return listenkv.NewStore(memDB, testStoreKey, []types.WriteListener{listener}) + return listenkv.NewStore(memDB, testStoreKey, listener) } func TestListenKVStoreGet(t *testing.T) { @@ -66,10 +60,9 @@ func TestListenKVStoreGet(t *testing.T) { } for _, tc := range testCases { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newListenKVStore(&buf) - buf.Reset() + store := newListenKVStore(listener) value := store.Get(tc.key) require.Equal(t, tc.expectedValue, value) @@ -115,19 +108,17 @@ func TestListenKVStoreSet(t *testing.T) { } for _, tc := range testCases { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newEmptyListenKVStore(&buf) - buf.Reset() + store := newEmptyListenKVStore(listener) store.Set(tc.key, tc.value) - storeKVPair := new(types.StoreKVPair) - testMarshaller.UnmarshalLengthPrefixed(buf.Bytes(), storeKVPair) + storeKVPair := listener.PopStateCache()[0] require.Equal(t, tc.expectedOut, storeKVPair) } - var buf bytes.Buffer - store := newEmptyListenKVStore(&buf) + listener := types.NewMemoryListener() + store := newEmptyListenKVStore(listener) require.Panics(t, func() { store.Set([]byte(""), []byte("value")) }, "setting an empty key should panic") require.Panics(t, func() { store.Set(nil, []byte("value")) }, "setting a nil key should panic") } @@ -149,13 +140,13 @@ func TestListenKVStoreDelete(t *testing.T) { } for _, tc := range testCases { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newListenKVStore(&buf) - buf.Reset() + store := newListenKVStore(listener) store.Delete(tc.key) - storeKVPair := new(types.StoreKVPair) - testMarshaller.UnmarshalLengthPrefixed(buf.Bytes(), storeKVPair) + cache := listener.PopStateCache() + require.NotEmpty(t, cache) + storeKVPair := cache[len(cache)-1] require.Equal(t, tc.expectedOut, storeKVPair) } @@ -173,10 +164,9 @@ func TestListenKVStoreHas(t *testing.T) { } for _, tc := range testCases { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newListenKVStore(&buf) - buf.Reset() + store := newListenKVStore(listener) ok := store.Has(tc.key) require.Equal(t, tc.expected, ok) @@ -184,9 +174,9 @@ func TestListenKVStoreHas(t *testing.T) { } func TestTestListenKVStoreIterator(t *testing.T) { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newListenKVStore(&buf) + store := newListenKVStore(listener) iterator := store.Iterator(nil, nil) s, e := iterator.Domain() @@ -227,9 +217,9 @@ func TestTestListenKVStoreIterator(t *testing.T) { } func TestTestListenKVStoreReverseIterator(t *testing.T) { - var buf bytes.Buffer + listener := types.NewMemoryListener() - store := newListenKVStore(&buf) + store := newListenKVStore(listener) iterator := store.ReverseIterator(nil, nil) s, e := iterator.Domain() diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index b87bcd219015..f54a30dbb543 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -74,7 +74,7 @@ type Store struct { interBlockCache types.MultiStorePersistentCache - listeners map[types.StoreKey][]types.WriteListener + listeners map[types.StoreKey]*types.MemoryListener metrics metrics.StoreMetrics } @@ -97,7 +97,7 @@ func NewStore(db dbm.DB, logger log.Logger, metricGatherer metrics.StoreMetrics) storesParams: make(map[types.StoreKey]storeParams), stores: make(map[types.StoreKey]types.CommitKVStore), keysByName: make(map[string]types.StoreKey), - listeners: make(map[types.StoreKey][]types.WriteListener), + listeners: make(map[types.StoreKey]*types.MemoryListener), removalMap: make(map[types.StoreKey]bool), pruningManager: pruning.NewManager(db, logger), metrics: metricGatherer, @@ -400,23 +400,42 @@ func (rs *Store) TracingEnabled() bool { return rs.traceWriter != nil } -// AddListeners adds listeners for a specific KVStore -func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListener) { - if ls, ok := rs.listeners[key]; ok { - rs.listeners[key] = append(ls, listeners...) - } else { - rs.listeners[key] = listeners +// AddListeners adds a listener for the KVStore belonging to the provided StoreKey +func (rs *Store) AddListeners(keys []types.StoreKey) { + for i := range keys { + listener := rs.listeners[keys[i]] + if listener == nil { + rs.listeners[keys[i]] = types.NewMemoryListener() + } } } // ListeningEnabled returns if listening is enabled for a specific KVStore func (rs *Store) ListeningEnabled(key types.StoreKey) bool { if ls, ok := rs.listeners[key]; ok { - return len(ls) != 0 + return ls != nil } return false } +// PopStateCache returns the accumulated state change messages from the CommitMultiStore +// Calling PopStateCache destroys only the currently accumulated state in each listener +// not the state in the store itself. This is a mutating and destructive operation. +// This method has been synchronized. +func (rs *Store) PopStateCache() []*types.StoreKVPair { + var cache []*types.StoreKVPair + for key := range rs.listeners { + ls := rs.listeners[key] + if ls != nil { + cache = append(cache, ls.PopStateCache()...) + } + } + sort.SliceStable(cache, func(i, j int) bool { + return cache[i].StoreKey < cache[j].StoreKey + }) + return cache +} + // LatestVersion returns the latest version in the store func (rs *Store) LatestVersion() int64 { return rs.LastCommitID().Version diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index a997077eccef..4beaa73af630 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -14,7 +14,6 @@ import ( "cosmossdk.io/store/cachemulti" "cosmossdk.io/store/iavl" sdkmaps "cosmossdk.io/store/internal/maps" - "cosmossdk.io/store/listenkv" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/types" @@ -663,13 +662,8 @@ func TestAddListenersAndListeningEnabled(t *testing.T) { enabled := multi.ListeningEnabled(testKey) require.False(t, enabled) - multi.AddListeners(testKey, []types.WriteListener{}) - enabled = multi.ListeningEnabled(testKey) - require.False(t, enabled) - - mockListener := types.NewStoreKVPairWriteListener(nil, nil) - multi.AddListeners(testKey, []types.WriteListener{mockListener}) wrongTestKey := types.NewKVStoreKey("wrong_listening_test_key") + multi.AddListeners([]types.StoreKey{testKey}) enabled = multi.ListeningEnabled(wrongTestKey) require.False(t, enabled) @@ -677,91 +671,6 @@ func TestAddListenersAndListeningEnabled(t *testing.T) { require.True(t, enabled) } -var ( - testMarshaller = types.NewTestCodec() - testKey1 = []byte{1, 2, 3, 4, 5} - testValue1 = []byte{5, 4, 3, 2, 1} - testKey2 = []byte{2, 3, 4, 5, 6} - testValue2 = []byte{6, 5, 4, 3, 2} -) - -func TestGetListenWrappedKVStore(t *testing.T) { - buf := new(bytes.Buffer) - var db dbm.DB = dbm.NewMemDB() - ms := newMultiStoreWithMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) - ms.LoadLatestVersion() - mockListeners := []types.WriteListener{types.NewStoreKVPairWriteListener(buf, testMarshaller)} - ms.AddListeners(testStoreKey1, mockListeners) - ms.AddListeners(testStoreKey2, mockListeners) - - listenWrappedStore1 := ms.GetKVStore(testStoreKey1) - require.IsType(t, &listenkv.Store{}, listenWrappedStore1) - - listenWrappedStore1.Set(testKey1, testValue1) - expectedOutputKVPairSet1, err := testMarshaller.MarshalLengthPrefixed(&types.StoreKVPair{ - Key: testKey1, - Value: testValue1, - StoreKey: testStoreKey1.Name(), - Delete: false, - }) - require.Nil(t, err) - kvPairSet1Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, expectedOutputKVPairSet1, kvPairSet1Bytes) - - listenWrappedStore1.Delete(testKey1) - expectedOutputKVPairDelete1, err := testMarshaller.MarshalLengthPrefixed(&types.StoreKVPair{ - Key: testKey1, - Value: nil, - StoreKey: testStoreKey1.Name(), - Delete: true, - }) - require.Nil(t, err) - kvPairDelete1Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, expectedOutputKVPairDelete1, kvPairDelete1Bytes) - - listenWrappedStore2 := ms.GetKVStore(testStoreKey2) - require.IsType(t, &listenkv.Store{}, listenWrappedStore2) - - listenWrappedStore2.Set(testKey2, testValue2) - expectedOutputKVPairSet2, err := testMarshaller.MarshalLengthPrefixed(&types.StoreKVPair{ - Key: testKey2, - Value: testValue2, - StoreKey: testStoreKey2.Name(), - Delete: false, - }) - require.NoError(t, err) - kvPairSet2Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, expectedOutputKVPairSet2, kvPairSet2Bytes) - - listenWrappedStore2.Delete(testKey2) - expectedOutputKVPairDelete2, err := testMarshaller.MarshalLengthPrefixed(&types.StoreKVPair{ - Key: testKey2, - Value: nil, - StoreKey: testStoreKey2.Name(), - Delete: true, - }) - require.NoError(t, err) - kvPairDelete2Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, expectedOutputKVPairDelete2, kvPairDelete2Bytes) - - unwrappedStore := ms.GetKVStore(testStoreKey3) - require.IsType(t, &iavl.Store{}, unwrappedStore) - - unwrappedStore.Set(testKey2, testValue2) - kvPairSet3Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, []byte{}, kvPairSet3Bytes) - - unwrappedStore.Delete(testKey2) - kvPairDelete3Bytes := buf.Bytes() - buf.Reset() - require.Equal(t, []byte{}, kvPairDelete3Bytes) -} - func TestCacheWraps(t *testing.T) { db := dbm.NewMemDB() multi := newMultiStoreWithMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) @@ -964,36 +873,30 @@ func (tl *MockListener) OnWrite(storeKey types.StoreKey, key []byte, value []byt func TestStateListeners(t *testing.T) { var db dbm.DB = dbm.NewMemDB() ms := newMultiStoreWithMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) + require.Empty(t, ms.listeners) - listener := &MockListener{} - ms.AddListeners(testStoreKey1, []types.WriteListener{listener}) + ms.AddListeners([]types.StoreKey{testStoreKey1}) + require.Equal(t, 1, len(ms.listeners)) require.NoError(t, ms.LoadLatestVersion()) cacheMulti := ms.CacheMultiStore() - store1 := cacheMulti.GetKVStore(testStoreKey1) - store1.Set([]byte{1}, []byte{1}) - require.Empty(t, listener.stateCache) + store := cacheMulti.GetKVStore(testStoreKey1) + store.Set([]byte{1}, []byte{1}) + require.Empty(t, ms.PopStateCache()) // writes are observed when cache store commit. cacheMulti.Write() - require.Equal(t, 1, len(listener.stateCache)) - - // test nested cache store - listener.stateCache = []types.StoreKVPair{} - nested := cacheMulti.CacheMultiStore() - - store1 = nested.GetKVStore(testStoreKey1) - store1.Set([]byte{1}, []byte{1}) - require.Empty(t, listener.stateCache) + require.Equal(t, 1, len(ms.PopStateCache())) - // writes are not observed when nested cache store commit - nested.Write() - require.Empty(t, listener.stateCache) + // test no listening on unobserved store + store = cacheMulti.GetKVStore(testStoreKey2) + store.Set([]byte{1}, []byte{1}) + require.Empty(t, ms.PopStateCache()) - // writes are observed when inner cache store commit + // writes are not observed when cache store commit cacheMulti.Write() - require.Equal(t, 1, len(listener.stateCache)) + require.Empty(t, ms.PopStateCache()) } type commitKVStoreStub struct { diff --git a/store/streaming/README.md b/store/streaming/README.md index 57fa3f6631ec..9b2ead19be06 100644 --- a/store/streaming/README.md +++ b/store/streaming/README.md @@ -1,88 +1,27 @@ -# State Streaming Service +# Cosmos-SDK Plugins -This package contains the constructors for the `StreamingService`s used to write -state changes out from individual KVStores to a file or stream, as described in -[ADR-038](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-038-state-listening.md) -and defined in [types/streaming.go](https://github.com/cosmos/cosmos-sdk/blob/main/store/types/streaming.go). -The child directories contain the implementations for specific output destinations. +This package contains an extensible plugin system for the Cosmos-SDK. The plugin system leverages the [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin) system. This system is designed to work over RPC. -Currently, a `StreamingService` implementation that writes state changes out to -files is supported, in the future support for additional output destinations can -be added. +Although the `go-plugin` is built to work over RPC, it is currently only designed to work over a local network. -The `StreamingService` is configured from within an App using the `AppOptions` -loaded from the `app.toml` file: +## Pre requisites +For an overview of supported features by the `go-plugin` system, please see https://github.com/hashicorp/go-plugin. The `go-plugin` documentation is located [here](https://github.com/hashicorp/go-plugin/tree/master/docs). You can also directly visit any of the links below: +- [Writing plugins without Go](https://github.com/hashicorp/go-plugin/blob/master/docs/guide-plugin-write-non-go.md) +- [Go Plugin Tutorial](https://github.com/hashicorp/go-plugin/blob/master/docs/extensive-go-plugin-tutorial.md) +- [Plugin Internals](https://github.com/hashicorp/go-plugin/blob/master/docs/internals.md) +- [Plugin Architecture](https://www.youtube.com/watch?v=SRvm3zQQc1Q) (start here) -```toml -# ... +## Exposing plugins -[store] -# streaming is enabled if one or more streamers are defined -streamers = [ - # name of the streaming service, used by constructor - "file" -] +To expose plugins to the plugin system, you will need to: +1. Implement the gRPC message protocol service of the plugin +2. Build the plugin binary +3. Export it -[streamers] -[streamers.file] - keys = ["list", "of", "store", "keys", "we", "want", "to", "expose", "for", "this", "streaming", "service"] - write_dir = "path to the write directory" - prefix = "optional prefix to prepend to the generated file names" -``` +Read the plugin documentation in the [Streaming Plugins](#streaming-plugins) section for examples on how to build a plugin. -The `store.streamers` field contains a list of the names of the `StreamingService` -implementations to employ which are used by `ServiceTypeFromString` to return -the `ServiceConstructor` for that particular implementation: +## Streaming Plugins -```go -listeners := cast.ToStringSlice(appOpts.Get("store.streamers")) -for _, listenerName := range listeners { - constructor, err := ServiceTypeFromString(listenerName) - if err != nil { - // handle error - } -} -``` +List of support streaming plugins -The `streamers` field contains a mapping of the specific `StreamingService` -implementation name to the configuration parameters for that specific service. - -The `streamers.x.keys` field contains the list of `StoreKey` names for the -KVStores to expose using this service and is required by every type of -`StreamingService`. In order to expose *ALL* KVStores, we can include `*` in -this list. An empty list is equivalent to turning the service off. - -Additional configuration parameters are optional and specific to the implementation. -In the case of the file streaming service, the `streamers.file.write_dir` field -contains the path to the directory to write the files to, and `streamers.file.prefix` -contains an optional prefix to prepend to the output files to prevent potential -collisions with other App `StreamingService` output files. - -The `ServiceConstructor` accepts `AppOptions`, the store keys collected using -`streamers.x.keys`, a `BinaryMarshaller` and returns a `StreamingService -implementation. - -The `AppOptions` are passed in to provide access to any implementation specific -configuration options, e.g. in the case of the file streaming service the -`streamers.file.write_dir` and `streamers.file.prefix`. - -```go -streamingService, err := constructor(appOpts, exposeStoreKeys, appCodec) -if err != nil { - // handler error -} -``` - -The returned `StreamingService` is loaded into the BaseApp using the BaseApp's -`SetStreamingService` method. - -The `Stream` method is called on the service to begin the streaming process. -Depending on the implementation this process may be synchronous or asynchronous -with the message processing of the state machine. - -```go -bApp.SetStreamingService(streamingService) -wg := new(sync.WaitGroup) -quitChan := make(chan struct{}) -streamingService.Stream(wg, quitChan) -``` +- [ABCI State Streaming Plugin](abci/README.md) diff --git a/store/streaming/abci/README.md b/store/streaming/abci/README.md new file mode 100644 index 000000000000..5c4b52bfaf62 --- /dev/null +++ b/store/streaming/abci/README.md @@ -0,0 +1,380 @@ +# ABCI and State Streaming Plugin (gRPC) + +The `BaseApp` package contains the interface for a [ABCIListener](https://github.com/cosmos/cosmos-sdk/blob/main/baseapp/streaming.go) +service used to write state changes out from individual KVStores to external systems, +as described in [ADR-038](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-038-state-listening.md). + +Specific `ABCIListener` service implementations are written and loaded as [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin). + +## Implementation + +In this section we describe the implementation of the `ABCIListener` interface as a gRPC service. + +### Service Protocol + +The companion service protocol for the `ABCIListener` interface is described below. +See [proto/cosmos/store/streaming/abci/grpc.proto](https://github.com/cosmos/cosmos-sdk/blob/main/proto/cosmos/store/streaming/grpc.proto) for full details. + +```protobuf +syntax = "proto3"; + +package cosmos.store.streaming.abci; + +import "tendermint/abci/types.proto"; +import "cosmos/base/store/v1beta1/listening.proto"; + +option go_package = "cosmossdk.io/store/streaming/abci"; + +// Empty is the response message for incoming requests +message Empty {} + +// ListenBeginBlockRequest sends BeginBlock requests and responses to server +message ListenBeginBlockRequest { + tendermint.abci.RequestBeginBlock req = 1; + tendermint.abci.ResponseBeginBlock res = 2; +} + +// ListenEndBlockRequest sends EndBlock requests and responses to server +message ListenEndBlockRequest { + tendermint.abci.RequestEndBlock req = 1; + tendermint.abci.ResponseEndBlock res = 2; +} + +// ListenDeliverTxRequest sends DeliverTx requests and responses to server +message ListenDeliverTxRequest { + // explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it + int64 block_height = 1; + tendermint.abci.RequestDeliverTx req = 2; + tendermint.abci.ResponseDeliverTx res = 3; +} + +// ListenCommitRequest sends Commit responses and state changes to server +message ListenCommitRequest { + // explicitly pass in block height as ResponseCommit does not contain this info + int64 block_height = 1; + tendermint.abci.ResponseCommit res = 2; + repeated cosmos.base.store.v1beta1.StoreKVPair change_set = 3; +} + +service ABCIListenerService { + rpc ListenBeginBlock(ListenBeginBlockRequest) returns (Empty); + rpc ListenEndBlock(ListenEndBlockRequest) returns (Empty); + rpc ListenDeliverTx(ListenDeliverTxRequest) returns (Empty); + rpc ListenCommit(ListenCommitRequest) returns (Empty); +} +``` + +### Generating the Code + +To generate the stubs the local client implementation can call, run the following command: + +```shell +make proto-gen +``` + +For other languages you'll need to [download](https://github.com/cosmos/cosmos-sdk/blob/main/third_party/proto/README.md) +the CosmosSDK protos into your project and compile. For language specific compilation instructions visit +[https://github.com/grpc](https://github.com/grpc) and look in the `examples` folder of your +language of choice `https://github.com/grpc/grpc-{language}/tree/master/examples` and [https://grpc.io](https://grpc.io) +for the documentation. + +### gRPC Client and Server + +Implementing the ABCIListener gRPC client and server is a simple and straight forward process. + +To create the client and server we create a `ListenerGRPCPlugin` struct that implements the +`plugin.GRPCPlugin` interface and a `Impl` property that will contain a concrete implementation +of the `ABCIListener` plugin written in Go. + +#### The Interface + +The `BaseApp` `ABCIListener` interface will be what will define the plugins capabilities. + +Boilerplate RPC implementation example of the `ABCIListener` interface. ([store/streaming/abci/grpc.go](grpc.go)) +```go +... + +var ( + _ storetypes.ABCIListener = (*GRPCClient)(nil) +) + +// GRPCClient is an implementation of the ABCIListener interface that talks over gRPC. +type GRPCClient struct { + client ABCIListenerServiceClient +} + +func (m GRPCClient) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + _, err := m.client.ListenBeginBlock(ctx, &ListenBeginBlockRequest{ + Req: &req, + Res: &res, + }) + return err +} + +func (m GRPCClient) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + _, err := m.client.ListenEndBlock(ctx, &ListenEndBlockRequest{ + Req: &req, + Res: &res, + }) + return err +} + +func (m GRPCClient) ListenDeliverTx(goCtx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + ctx := sdk.UnwrapSDKContext(goCtx) + _, err := m.client.ListenDeliverTx(ctx, &ListenDeliverTxRequest{ + BlockHeight: ctx.BlockHeight(), + Req: &req, + Res: &res, + }) + return err +} + +func (m GRPCClient) ListenCommit(goCtx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error { + ctx := sdk.UnwrapSDKContext(goCtx) + _, err := m.client.ListenCommit(ctx, &ListenCommitRequest{ + BlockHeight: ctx.BlockHeight(), + Res: &res, + ChangeSet: changeSet, + }) + return err +} + +// GRPCServer is the gRPC server that GRPCClient talks to. +type GRPCServer struct { + // This is the real implementation + Impl storetypes.ABCIListener +} + +func (m GRPCServer) ListenBeginBlock(ctx context.Context, request *ListenBeginBlockRequest) (*Empty, error) { + if err := m.Impl.ListenBeginBlock(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &Empty{}, nil +} + +func (m GRPCServer) ListenEndBlock(ctx context.Context, request *ListenEndBlockRequest) (*Empty, error) { + if err := m.Impl.ListenEndBlock(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &Empty{}, nil +} + +func (m GRPCServer) ListenDeliverTx(ctx context.Context, request *ListenDeliverTxRequest) (*Empty, error) { + if err := m.Impl.ListenDeliverTx(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &Empty{}, nil +} + +func (m GRPCServer) ListenCommit(ctx context.Context, request *ListenCommitRequest) (*Empty, error) { + if err := m.Impl.ListenCommit(ctx, *request.Res, request.ChangeSet); err != nil { + return nil, err + } + return &Empty{}, nil +} +``` + +Our `ABCIlistener` service plugin. ([store/streaming/plugins/abci/v1/interface.go](interface.go)) +```go +... + +// Handshake is a common handshake that is shared by streaming and host. +// This prevents users from executing bad plugins or executing a plugin +// directory. It is a UX feature, not a security feature. +var Handshake = plugin.HandshakeConfig{ + // This isn't required when using VersionedPlugins + ProtocolVersion: 1, + MagicCookieKey: "ABCI_LISTENER_PLUGIN", + MagicCookieValue: "ef78114d-7bdf-411c-868f-347c99a78345", +} + +var ( + _ plugin.GRPCPlugin = (*ABCIListenerGRPCPlugin)(nil) +) + +// ListenerGRPCPlugin is the implementation of plugin.Plugin so we can serve/consume this +// +// This has two methods: Server must return an RPC server for this plugin +// type. We construct a GreeterRPCServer for this. +// +// Client must return an implementation of our interface that communicates +// over an RPC client. We return GreeterRPC for this. +// +// Ignore MuxBroker. That is used to create more multiplexed streams on our +// plugin connection and is a more advanced use case. +// +// description: copied from hashicorp plugin documentation. +type ListenerGRPCPlugin struct { + // GRPCPlugin must still implement the Plugin interface + plugin.Plugin + // Concrete implementation, written in Go. This is only used for plugins + // that are written in Go. + Impl storetypes.ABCIListener +} + +func (p *ListenerGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { + RegisterABCIListenerServiceServer(s, &GRPCServer{Impl: p.Impl}) + return nil +} + +func (p *ListenerGRPCPlugin) GRPCClient( + _ context.Context, + _ *plugin.GRPCBroker, + c *grpc.ClientConn, +) (interface{}, error) { + return &GRPCClient{client: NewABCIListenerServiceClient(c)}, nil +} +``` + +#### Plugin Implementation + +Plugin implementations can be in a completely separate package but will need access +to the `ABCIListener` interface. One thing to note here is that plugin implementations +defined in the `ListenerGRPCPlugin.Impl` property are **only** required when building +plugins in Go. They are pre-compiled into Go modules. The `GRPCServer.Impl` calls methods +on this out-of-process plugin. + +For Go plugins this is all that is required to process data that is sent over gRPC. +This provides the advantage of writing quick plugins that process data to different +external systems (i.e: DB, File, DB, Kafka, etc.) without the need for implementing +the gRPC server endpoints. + +```go +// MyPlugin is the implementation of the ABCIListener interface +// For Go plugins this is all that is required to process data sent over gRPC. +type MyPlugin struct { + ... +} + +func (a FilePlugin) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + // process data + return nil +} + +func (a FilePlugin) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + // process data + return nil +} + +func (a FilePlugin) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + // process data + return nil +} + +func (a FilePlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error { + // process data + return nil +} + +func main() { + plugin.Serve(&plugin.ServeConfig{ + HandshakeConfig: v1.Handshake, + Plugins: map[string]plugin.Plugin{ + "abci": &ABCIListenerGRPCPlugin{Impl: &MyPlugin{}}, + }, + + // A non-nil value here enables gRPC serving for this streaming... + GRPCServer: plugin.DefaultGRPCServer, + }) +} +``` + +## Plugin Loading System + +A general purpose plugin loading system has been provided by the SDK to be able to load not just +the `ABCIListener` service plugin but other protocol services as well. You can take a look +at how plugins are loaded by the SDK in [store/streaming/streaming.go](https://github.com/cosmos/cosmos-sdk/blob/main/store/streaming/streaming.go) + +You'll need to add this in your `app.go` +```go +// app.go + +func NewApp(...) *App { + + ... + + // register streaming services + streamingCfg := cast.ToStringMap(appOpts.Get(baseapp.StreamingTomlKey)) + for service := range streamingCfg { + pluginKey := fmt.Sprintf("%s.%s.%s", baseapp.StreamingTomlKey, service, baseapp.StreamingABCIPluginTomlKey) + pluginName := strings.TrimSpace(cast.ToString(appOpts.Get(pluginKey))) + if len(pluginName) > 0 { + logLevel := cast.ToString(appOpts.Get(flags.FlagLogLevel)) + plugin, err := streaming.NewStreamingPlugin(pluginName, logLevel) + if err != nil { + tmos.Exit(err.Error()) + } + if err := baseapp.RegisterStreamingPlugin(bApp, appOpts, keys, plugin); err != nil { + tmos.Exit(err.Error()) + } + } + } + + ... +} +``` + +## Configuration + +Update the streaming section in `app.toml` +```toml +# Streaming allows nodes to stream state to external systems +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service +[streaming.abci] + +# List of kv store keys to stream out via gRPC +# Set to ["*"] to expose all keys. +keys = ["*"] + +# The plugin name used for streaming via gRPC +# Supported plugins: abci +plugin = "abci" + +# stop-node-on-err specifies whether to stop the node when the +stop-node-on-err = true +``` + +## Updating the protocol + +If you update the protocol buffers file, you can regenerate the file and plugins using the +following commands from the project root directory. You do not need to run this if you're +just trying the examples, you can skip ahead to the [Testing](#testing) section. + +```shell +make proto-gen +``` + +- stdout plugin; from inside the `store/` dir, run: +```shell +go build -o streaming/abci/examples/stdout/stdout streaming/abci/examples/stdout/stdout.go +``` + +- file plugin (writes to `~/`); from inside the `store/` dir, run: +```shell +go build -o streaming/abci/examples/file/file streaming/abci/examples/file/file.go +``` + +### Testing + +Export a plugin from one of the Go or Python examples. + +- stdout plugin +```shell +export COSMOS_SDK_ABCI="{path to}/cosmos-sdk/store/streaming/abci/examples/stdout/stdout" +``` +- file plugin (writes to ~/) +```shell +export COSMOS_SDK_ABCI="{path to}/cosmos-sdk/store/streaming/abci/examples/file/file" +``` +where `{path to}` is the parent path to the `cosmos-sdk` repo on you system. + +Test: +```shell +make test-sim-nondeterminism-streaming +``` + +The plugin system will look for the plugin binary in the `env` variable `COSMOS_SDK_{PLUGIN_NAME}` above +and if it does not find it, it will error out. The plugin UPPERCASE name is that of the +`streaming.abci.plugin` TOML configuration setting. diff --git a/store/streaming/abci/examples/file/.gitignore b/store/streaming/abci/examples/file/.gitignore new file mode 100644 index 000000000000..bc8ff790632d --- /dev/null +++ b/store/streaming/abci/examples/file/.gitignore @@ -0,0 +1,2 @@ +# ignore the file plugin binary +file \ No newline at end of file diff --git a/store/streaming/abci/examples/file/README.md b/store/streaming/abci/examples/file/README.md new file mode 100644 index 000000000000..94c927be690d --- /dev/null +++ b/store/streaming/abci/examples/file/README.md @@ -0,0 +1,17 @@ +# File Plugin + +The file plugin is an example plugin written in Go. It is intended for local testing and should not be used in production environments. + +## Build + +To build the plugin run the following command: + +```shell +cd store +``` + +```shell +go build -o streaming/abci/examples/file/file streaming/abci/examples/file/file.go +``` + +- The plugin will write files to the users home directory `~/`. \ No newline at end of file diff --git a/store/streaming/abci/examples/file/file.go b/store/streaming/abci/examples/file/file.go new file mode 100644 index 000000000000..a0fa5dc138a0 --- /dev/null +++ b/store/streaming/abci/examples/file/file.go @@ -0,0 +1,106 @@ +package main + +import ( + "context" + "fmt" + "os" + "path/filepath" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/hashicorp/go-plugin" + + streamingabci "cosmossdk.io/store/streaming/abci" + store "cosmossdk.io/store/types" +) + +// FilePlugin is the implementation of the baseapp.ABCIListener interface +// For Go plugins this is all that is required to process data sent over gRPC. +type FilePlugin struct { + BlockHeight int64 +} + +func (a *FilePlugin) writeToFile(file string, data []byte) error { + home, err := os.UserHomeDir() + if err != nil { + return err + } + + filename := fmt.Sprintf("%s/%s.txt", home, file) + f, err := os.OpenFile(filepath.Clean(filename), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600) + if err != nil { + return err + } + + if _, err := f.Write(data); err != nil { + f.Close() // ignore error; Write error takes precedence + return err + } + + if err := f.Close(); err != nil { + return err + } + + return nil +} + +func (a *FilePlugin) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + a.BlockHeight = req.Header.Height + d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req)) + d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res)) + if err := a.writeToFile("begin-block-req", d1); err != nil { + return err + } + if err := a.writeToFile("begin-block-res", d2); err != nil { + return err + } + return nil +} + +func (a *FilePlugin) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req)) + d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req)) + if err := a.writeToFile("end-block-req", d1); err != nil { + return err + } + if err := a.writeToFile("end-block-res", d2); err != nil { + return err + } + return nil +} + +func (a *FilePlugin) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req)) + d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res)) + if err := a.writeToFile("deliver-tx-req", d1); err != nil { + return err + } + if err := a.writeToFile("deliver-tx-res", d2); err != nil { + return err + } + return nil +} + +func (a *FilePlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error { + fmt.Printf("listen-commit: block_height=%d data=%v", res.RetainHeight, changeSet) + d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res)) + d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, changeSet)) + if err := a.writeToFile("commit-res", d1); err != nil { + return err + } + if err := a.writeToFile("state-change", d2); err != nil { + return err + } + return nil +} + +func main() { + plugin.Serve(&plugin.ServeConfig{ + HandshakeConfig: streamingabci.Handshake, + Plugins: map[string]plugin.Plugin{ + "abci": &streamingabci.ListenerGRPCPlugin{Impl: &FilePlugin{}}, + }, + + // A non-nil value here enables gRPC serving for this streaming... + GRPCServer: plugin.DefaultGRPCServer, + }) +} diff --git a/store/streaming/abci/examples/stdout/stdout b/store/streaming/abci/examples/stdout/stdout new file mode 100755 index 000000000000..b7de2c5ebfd3 Binary files /dev/null and b/store/streaming/abci/examples/stdout/stdout differ diff --git a/store/streaming/abci/examples/stdout/stdout.go b/store/streaming/abci/examples/stdout/stdout.go new file mode 100644 index 000000000000..37f3ef6e0b84 --- /dev/null +++ b/store/streaming/abci/examples/stdout/stdout.go @@ -0,0 +1,55 @@ +package main + +import ( + "context" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/hashicorp/go-plugin" + + streamingabci "cosmossdk.io/store/streaming/abci" + store "cosmossdk.io/store/types" +) + +// StdoutPlugin is the implementation of the ABCIListener interface +// For Go plugins this is all that is required to process data sent over gRPC. +type StdoutPlugin struct { + BlockHeight int64 +} + +func (a *StdoutPlugin) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + a.BlockHeight = req.Header.Height + // process tx messages (i.e: sent to external system) + fmt.Printf("listen-begin-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res) + return nil +} + +func (a *StdoutPlugin) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + // process end block messages (i.e: sent to external system) + fmt.Printf("listen-end-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res) + return nil +} + +func (a *StdoutPlugin) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + // process tx messages (i.e: sent to external system) + fmt.Printf("listen-deliver-tx: block-height=%d req=%v res=%v", a.BlockHeight, req, res) + return nil +} + +func (a *StdoutPlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error { + // process block commit messages (i.e: sent to external system) + fmt.Printf("listen-commit: block_height=%d res=%v data=%v", a.BlockHeight, res, changeSet) + return nil +} + +func main() { + plugin.Serve(&plugin.ServeConfig{ + HandshakeConfig: streamingabci.Handshake, + Plugins: map[string]plugin.Plugin{ + "abci": &streamingabci.ListenerGRPCPlugin{Impl: &StdoutPlugin{}}, + }, + + // A non-nil value here enables gRPC serving for this streaming... + GRPCServer: plugin.DefaultGRPCServer, + }) +} diff --git a/store/streaming/abci/grpc.go b/store/streaming/abci/grpc.go new file mode 100644 index 000000000000..1fd8f8808b76 --- /dev/null +++ b/store/streaming/abci/grpc.go @@ -0,0 +1,127 @@ +package abci + +import ( + "context" + "os" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/hashicorp/go-plugin" + + storetypes "cosmossdk.io/store/types" +) + +var _ storetypes.ABCIListener = (*GRPCClient)(nil) + +// GRPCClient is an implementation of the ABCIListener interface that talks over RPC. +type GRPCClient struct { + client ABCIListenerServiceClient +} + +// ListenBeginBlock listens to begin block request and responses. +// In addition, it retrieves a types.Context from a context.Context instance. +// It panics if a types.Context was not properly attached. +// When the node is configured to stop on listening errors, +// it will terminate immediately and exit with a non-zero code. +func (m *GRPCClient) ListenBeginBlock(goCtx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { + ctx := goCtx.(storetypes.Context) + sm := ctx.StreamingManager() + request := &ListenBeginBlockRequest{Req: &req, Res: &res} + _, err := m.client.ListenBeginBlock(goCtx, request) + if err != nil && sm.StopNodeOnErr { + ctx.Logger().Error("BeginBlock listening hook failed", "height", ctx.BlockHeight(), "err", err) + cleanupAndExit() + } + return err +} + +// ListenEndBlock listens to end block request and responses. +// In addition, it retrieves a types.Context from a context.Context instance. +// It panics if a types.Context was not properly attached. +// When the node is configured to stop on listening errors, +// it will terminate immediately and exit with a non-zero code. +func (m *GRPCClient) ListenEndBlock(goCtx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { + ctx := goCtx.(storetypes.Context) + sm := ctx.StreamingManager() + request := &ListenEndBlockRequest{Req: &req, Res: &res} + _, err := m.client.ListenEndBlock(goCtx, request) + if err != nil && sm.StopNodeOnErr { + ctx.Logger().Error("EndBlock listening hook failed", "height", ctx.BlockHeight(), "err", err) + cleanupAndExit() + } + return err +} + +// ListenDeliverTx listens to deliver tx request and responses. +// In addition, it retrieves a types.Context from a context.Context instance. +// It panics if a types.Context was not properly attached. +// When the node is configured to stop on listening errors, +// it will terminate immediately and exit with a non-zero code. +func (m *GRPCClient) ListenDeliverTx(goCtx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { + ctx := goCtx.(storetypes.Context) + sm := ctx.StreamingManager() + request := &ListenDeliverTxRequest{BlockHeight: ctx.BlockHeight(), Req: &req, Res: &res} + _, err := m.client.ListenDeliverTx(goCtx, request) + if err != nil && sm.StopNodeOnErr { + ctx.Logger().Error("DeliverTx listening hook failed", "height", ctx.BlockHeight(), "err", err) + cleanupAndExit() + } + return err +} + +// ListenCommit listens to commit responses and state changes for the current block. +// In addition, it retrieves a types.Context from a context.Context instance. +// It panics if a types.Context was not properly attached. +// When the node is configured to stop on listening errors, +// it will terminate immediately and exit with a non-zero code. +func (m *GRPCClient) ListenCommit(goCtx context.Context, res abci.ResponseCommit, changeSet []*storetypes.StoreKVPair) error { + ctx := goCtx.(storetypes.Context) + sm := ctx.StreamingManager() + request := &ListenCommitRequest{BlockHeight: ctx.BlockHeight(), Res: &res, ChangeSet: changeSet} + _, err := m.client.ListenCommit(goCtx, request) + if err != nil && sm.StopNodeOnErr { + ctx.Logger().Error("Commit listening hook failed", "height", ctx.BlockHeight(), "err", err) + cleanupAndExit() + } + return err +} + +func cleanupAndExit() { + plugin.CleanupClients() + os.Exit(1) +} + +var _ ABCIListenerServiceServer = (*GRPCServer)(nil) + +// GRPCServer is the gRPC server that GRPCClient talks to. +type GRPCServer struct { + // This is the real implementation + Impl storetypes.ABCIListener +} + +func (m GRPCServer) ListenBeginBlock(ctx context.Context, request *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) { + if err := m.Impl.ListenBeginBlock(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &ListenBeginBlockResponse{}, nil +} + +func (m GRPCServer) ListenEndBlock(ctx context.Context, request *ListenEndBlockRequest) (*ListenEndBlockResponse, error) { + if err := m.Impl.ListenEndBlock(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &ListenEndBlockResponse{}, nil +} + +func (m GRPCServer) ListenDeliverTx(ctx context.Context, request *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) { + if err := m.Impl.ListenDeliverTx(ctx, *request.Req, *request.Res); err != nil { + return nil, err + } + return &ListenDeliverTxResponse{}, nil +} + +func (m GRPCServer) ListenCommit(ctx context.Context, request *ListenCommitRequest) (*ListenCommitResponse, error) { + if err := m.Impl.ListenCommit(ctx, *request.Res, request.ChangeSet); err != nil { + return nil, err + } + return &ListenCommitResponse{}, nil +} diff --git a/store/streaming/abci/grpc.pb.go b/store/streaming/abci/grpc.pb.go new file mode 100644 index 000000000000..ff8c59af1f6c --- /dev/null +++ b/store/streaming/abci/grpc.pb.go @@ -0,0 +1,1886 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/store/streaming/abci/grpc.proto + +package abci + +import ( + context "context" + types1 "cosmossdk.io/store/types" + fmt "fmt" + types "github.com/cometbft/cometbft/abci/types" + 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 + +// ListenBeginBlockRequest is the request type for the ListenBeginBlock RPC method +type ListenBeginBlockRequest struct { + Req *types.RequestBeginBlock `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` + Res *types.ResponseBeginBlock `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *ListenBeginBlockRequest) Reset() { *m = ListenBeginBlockRequest{} } +func (m *ListenBeginBlockRequest) String() string { return proto.CompactTextString(m) } +func (*ListenBeginBlockRequest) ProtoMessage() {} +func (*ListenBeginBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{0} +} +func (m *ListenBeginBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenBeginBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenBeginBlockRequest.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 *ListenBeginBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenBeginBlockRequest.Merge(m, src) +} +func (m *ListenBeginBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *ListenBeginBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListenBeginBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenBeginBlockRequest proto.InternalMessageInfo + +func (m *ListenBeginBlockRequest) GetReq() *types.RequestBeginBlock { + if m != nil { + return m.Req + } + return nil +} + +func (m *ListenBeginBlockRequest) GetRes() *types.ResponseBeginBlock { + if m != nil { + return m.Res + } + return nil +} + +// ListenBeginBlockResponse is the response type for the ListenBeginBlock RPC method +type ListenBeginBlockResponse struct { +} + +func (m *ListenBeginBlockResponse) Reset() { *m = ListenBeginBlockResponse{} } +func (m *ListenBeginBlockResponse) String() string { return proto.CompactTextString(m) } +func (*ListenBeginBlockResponse) ProtoMessage() {} +func (*ListenBeginBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{1} +} +func (m *ListenBeginBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenBeginBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenBeginBlockResponse.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 *ListenBeginBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenBeginBlockResponse.Merge(m, src) +} +func (m *ListenBeginBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *ListenBeginBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListenBeginBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenBeginBlockResponse proto.InternalMessageInfo + +// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +type ListenEndBlockRequest struct { + Req *types.RequestEndBlock `protobuf:"bytes,1,opt,name=req,proto3" json:"req,omitempty"` + Res *types.ResponseEndBlock `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *ListenEndBlockRequest) Reset() { *m = ListenEndBlockRequest{} } +func (m *ListenEndBlockRequest) String() string { return proto.CompactTextString(m) } +func (*ListenEndBlockRequest) ProtoMessage() {} +func (*ListenEndBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{2} +} +func (m *ListenEndBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenEndBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenEndBlockRequest.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 *ListenEndBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenEndBlockRequest.Merge(m, src) +} +func (m *ListenEndBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *ListenEndBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListenEndBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenEndBlockRequest proto.InternalMessageInfo + +func (m *ListenEndBlockRequest) GetReq() *types.RequestEndBlock { + if m != nil { + return m.Req + } + return nil +} + +func (m *ListenEndBlockRequest) GetRes() *types.ResponseEndBlock { + if m != nil { + return m.Res + } + return nil +} + +// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +type ListenEndBlockResponse struct { +} + +func (m *ListenEndBlockResponse) Reset() { *m = ListenEndBlockResponse{} } +func (m *ListenEndBlockResponse) String() string { return proto.CompactTextString(m) } +func (*ListenEndBlockResponse) ProtoMessage() {} +func (*ListenEndBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{3} +} +func (m *ListenEndBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenEndBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenEndBlockResponse.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 *ListenEndBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenEndBlockResponse.Merge(m, src) +} +func (m *ListenEndBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *ListenEndBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListenEndBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenEndBlockResponse proto.InternalMessageInfo + +// ListenDeliverTxRequest is the request type for the ListenDeliverTx RPC method +type ListenDeliverTxRequest struct { + // explicitly pass in block height as neither RequestDeliverTx or ResponseDeliverTx contain it + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Req *types.RequestDeliverTx `protobuf:"bytes,2,opt,name=req,proto3" json:"req,omitempty"` + Res *types.ResponseDeliverTx `protobuf:"bytes,3,opt,name=res,proto3" json:"res,omitempty"` +} + +func (m *ListenDeliverTxRequest) Reset() { *m = ListenDeliverTxRequest{} } +func (m *ListenDeliverTxRequest) String() string { return proto.CompactTextString(m) } +func (*ListenDeliverTxRequest) ProtoMessage() {} +func (*ListenDeliverTxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{4} +} +func (m *ListenDeliverTxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenDeliverTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenDeliverTxRequest.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 *ListenDeliverTxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenDeliverTxRequest.Merge(m, src) +} +func (m *ListenDeliverTxRequest) XXX_Size() int { + return m.Size() +} +func (m *ListenDeliverTxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListenDeliverTxRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenDeliverTxRequest proto.InternalMessageInfo + +func (m *ListenDeliverTxRequest) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *ListenDeliverTxRequest) GetReq() *types.RequestDeliverTx { + if m != nil { + return m.Req + } + return nil +} + +func (m *ListenDeliverTxRequest) GetRes() *types.ResponseDeliverTx { + if m != nil { + return m.Res + } + return nil +} + +// ListenDeliverTxResponse is the response type for the ListenDeliverTx RPC method +type ListenDeliverTxResponse struct { +} + +func (m *ListenDeliverTxResponse) Reset() { *m = ListenDeliverTxResponse{} } +func (m *ListenDeliverTxResponse) String() string { return proto.CompactTextString(m) } +func (*ListenDeliverTxResponse) ProtoMessage() {} +func (*ListenDeliverTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{5} +} +func (m *ListenDeliverTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenDeliverTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenDeliverTxResponse.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 *ListenDeliverTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenDeliverTxResponse.Merge(m, src) +} +func (m *ListenDeliverTxResponse) XXX_Size() int { + return m.Size() +} +func (m *ListenDeliverTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListenDeliverTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenDeliverTxResponse proto.InternalMessageInfo + +// ListenCommitRequest is the request type for the ListenCommit RPC method +type ListenCommitRequest struct { + // explicitly pass in block height as ResponseCommit does not contain this info + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Res *types.ResponseCommit `protobuf:"bytes,2,opt,name=res,proto3" json:"res,omitempty"` + ChangeSet []*types1.StoreKVPair `protobuf:"bytes,3,rep,name=change_set,json=changeSet,proto3" json:"change_set,omitempty"` +} + +func (m *ListenCommitRequest) Reset() { *m = ListenCommitRequest{} } +func (m *ListenCommitRequest) String() string { return proto.CompactTextString(m) } +func (*ListenCommitRequest) ProtoMessage() {} +func (*ListenCommitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{6} +} +func (m *ListenCommitRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenCommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenCommitRequest.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 *ListenCommitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenCommitRequest.Merge(m, src) +} +func (m *ListenCommitRequest) XXX_Size() int { + return m.Size() +} +func (m *ListenCommitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListenCommitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenCommitRequest proto.InternalMessageInfo + +func (m *ListenCommitRequest) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *ListenCommitRequest) GetRes() *types.ResponseCommit { + if m != nil { + return m.Res + } + return nil +} + +func (m *ListenCommitRequest) GetChangeSet() []*types1.StoreKVPair { + if m != nil { + return m.ChangeSet + } + return nil +} + +// ListenCommitResponse is the response type for the ListenCommit RPC method +type ListenCommitResponse struct { +} + +func (m *ListenCommitResponse) Reset() { *m = ListenCommitResponse{} } +func (m *ListenCommitResponse) String() string { return proto.CompactTextString(m) } +func (*ListenCommitResponse) ProtoMessage() {} +func (*ListenCommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b98083eb9315fb6, []int{7} +} +func (m *ListenCommitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListenCommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListenCommitResponse.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 *ListenCommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenCommitResponse.Merge(m, src) +} +func (m *ListenCommitResponse) XXX_Size() int { + return m.Size() +} +func (m *ListenCommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListenCommitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListenCommitResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ListenBeginBlockRequest)(nil), "cosmos.store.streaming.abci.ListenBeginBlockRequest") + proto.RegisterType((*ListenBeginBlockResponse)(nil), "cosmos.store.streaming.abci.ListenBeginBlockResponse") + proto.RegisterType((*ListenEndBlockRequest)(nil), "cosmos.store.streaming.abci.ListenEndBlockRequest") + proto.RegisterType((*ListenEndBlockResponse)(nil), "cosmos.store.streaming.abci.ListenEndBlockResponse") + proto.RegisterType((*ListenDeliverTxRequest)(nil), "cosmos.store.streaming.abci.ListenDeliverTxRequest") + proto.RegisterType((*ListenDeliverTxResponse)(nil), "cosmos.store.streaming.abci.ListenDeliverTxResponse") + proto.RegisterType((*ListenCommitRequest)(nil), "cosmos.store.streaming.abci.ListenCommitRequest") + proto.RegisterType((*ListenCommitResponse)(nil), "cosmos.store.streaming.abci.ListenCommitResponse") +} + +func init() { + proto.RegisterFile("cosmos/store/streaming/abci/grpc.proto", fileDescriptor_7b98083eb9315fb6) +} + +var fileDescriptor_7b98083eb9315fb6 = []byte{ + // 519 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x6b, 0x82, 0x90, 0xf0, 0x26, 0x40, 0x1e, 0x8c, 0x90, 0x49, 0xa1, 0x0d, 0x08, 0x71, + 0x72, 0xe8, 0x9f, 0x9d, 0xb8, 0x40, 0x07, 0x12, 0x08, 0x0e, 0xa8, 0x45, 0x1c, 0xb8, 0x4c, 0x69, + 0xfa, 0x2a, 0xb5, 0xd6, 0xc4, 0xad, 0x6d, 0x2a, 0x26, 0x21, 0xc1, 0x01, 0x71, 0xe6, 0x53, 0x70, + 0xe3, 0x7b, 0x70, 0xdc, 0x91, 0x23, 0x6a, 0xbf, 0x08, 0x8a, 0x9d, 0x6e, 0x49, 0xb6, 0x4c, 0xcd, + 0xb1, 0xf6, 0xf3, 0x3c, 0xef, 0xef, 0xed, 0xfb, 0xc6, 0xf8, 0x51, 0xc8, 0x65, 0xcc, 0xa5, 0x2f, + 0x15, 0x17, 0xe0, 0x4b, 0x25, 0x20, 0x88, 0x59, 0x12, 0xf9, 0xc1, 0x28, 0x64, 0x7e, 0x24, 0x66, + 0x21, 0x9d, 0x09, 0xae, 0x38, 0xd9, 0x33, 0x3a, 0xaa, 0x75, 0xf4, 0x54, 0x47, 0x53, 0x9d, 0xb3, + 0xa7, 0x20, 0x19, 0x83, 0x88, 0x59, 0xa2, 0x8c, 0x51, 0x1d, 0xcf, 0x40, 0x1a, 0xa7, 0xf3, 0xb0, + 0x50, 0x61, 0xd1, 0x1e, 0x81, 0x0a, 0xda, 0xfe, 0x94, 0x49, 0x05, 0x49, 0x9a, 0xa0, 0x55, 0xde, + 0x0f, 0x84, 0xef, 0xbe, 0xd5, 0x67, 0x7d, 0x88, 0x58, 0xd2, 0x9f, 0xf2, 0xf0, 0x68, 0x00, 0xf3, + 0x4f, 0x20, 0x15, 0xe9, 0x61, 0x4b, 0xc0, 0xdc, 0x46, 0x4d, 0xf4, 0x78, 0xab, 0xe3, 0xd1, 0xb3, + 0x62, 0xba, 0x3a, 0xcd, 0x64, 0x39, 0x5f, 0x2a, 0x27, 0xfb, 0xa9, 0x4b, 0xda, 0x57, 0xb4, 0xeb, + 0xc1, 0x05, 0x2e, 0x39, 0xe3, 0x89, 0x84, 0xa2, 0x4d, 0x7a, 0x0e, 0xb6, 0xcf, 0x73, 0x18, 0xa9, + 0xf7, 0x0d, 0xe1, 0x3b, 0xe6, 0xf2, 0x65, 0x32, 0x2e, 0x20, 0x76, 0xf2, 0x88, 0xcd, 0x2a, 0xc4, + 0x53, 0x97, 0x06, 0xec, 0xe6, 0x01, 0x5b, 0x95, 0x80, 0x79, 0x93, 0xf4, 0x6c, 0xbc, 0x5b, 0x26, + 0xc8, 0xe0, 0x7e, 0xa1, 0xf5, 0xd5, 0x0b, 0x98, 0xb2, 0x05, 0x88, 0xf7, 0x9f, 0xd7, 0x74, 0x2d, + 0xbc, 0x3d, 0x4a, 0xb5, 0x87, 0x13, 0x60, 0xd1, 0x44, 0x69, 0x4c, 0x6b, 0xb0, 0xa5, 0xcf, 0x5e, + 0xe9, 0x23, 0x03, 0x33, 0xbf, 0x04, 0x46, 0x27, 0x9d, 0x25, 0xeb, 0x0e, 0x7a, 0xa6, 0x03, 0xab, + 0x72, 0x30, 0x06, 0xad, 0xe0, 0x92, 0xde, 0xbd, 0xf5, 0xa4, 0x73, 0x9c, 0x59, 0x0f, 0xbf, 0x11, + 0xde, 0x31, 0x77, 0x07, 0x3c, 0x8e, 0x99, 0xaa, 0xd1, 0x40, 0x3b, 0xff, 0x6f, 0xde, 0xaf, 0x64, + 0xc9, 0x72, 0x53, 0x2d, 0x79, 0x86, 0x71, 0x38, 0x09, 0x92, 0x08, 0x0e, 0x25, 0x28, 0xdb, 0x6a, + 0x5a, 0xba, 0xf5, 0xc2, 0xa2, 0x67, 0xeb, 0x4a, 0x87, 0xe9, 0xaf, 0x37, 0x1f, 0xde, 0x05, 0x4c, + 0x0c, 0xae, 0x1b, 0xd3, 0x10, 0x94, 0xb7, 0x8b, 0x6f, 0x17, 0x71, 0x4d, 0x91, 0xce, 0xf7, 0xab, + 0x78, 0xe7, 0x79, 0xff, 0xe0, 0xb5, 0xb9, 0x04, 0x31, 0x04, 0xb1, 0x60, 0x21, 0x90, 0xaf, 0xf8, + 0x56, 0x79, 0xb9, 0x48, 0x8f, 0x5e, 0xf2, 0x69, 0xd1, 0x8a, 0x6f, 0xc2, 0xd9, 0xaf, 0xe9, 0x32, + 0x60, 0xe4, 0x18, 0xdf, 0x28, 0xae, 0x0f, 0xe9, 0x6c, 0x10, 0x54, 0xda, 0x76, 0xa7, 0x5b, 0xcb, + 0x93, 0x95, 0xfe, 0x82, 0x6f, 0x96, 0xc6, 0x4e, 0x36, 0xc9, 0x29, 0x2f, 0xb3, 0xd3, 0xab, 0x67, + 0xca, 0xaa, 0x4b, 0xbc, 0x9d, 0x9f, 0x14, 0x79, 0xb2, 0x41, 0x4a, 0x61, 0x07, 0x9d, 0x76, 0x0d, + 0x47, 0xf6, 0xb4, 0x3c, 0xfd, 0xb3, 0x74, 0xd1, 0xc9, 0xd2, 0x45, 0xff, 0x96, 0x2e, 0xfa, 0xb9, + 0x72, 0x1b, 0x27, 0x2b, 0xb7, 0xf1, 0x77, 0xe5, 0x36, 0x3e, 0xb6, 0x4c, 0x96, 0x1c, 0x1f, 0x51, + 0xc6, 0x2f, 0x7c, 0x7c, 0x47, 0xd7, 0xf4, 0xc3, 0xd8, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x25, + 0xac, 0xcc, 0x9e, 0xa2, 0x05, 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 + +// ABCIListenerServiceClient is the client API for ABCIListenerService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ABCIListenerServiceClient interface { + // ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock + ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error) + // ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error) + // ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx + ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error) + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error) +} + +type aBCIListenerServiceClient struct { + cc grpc1.ClientConn +} + +func NewABCIListenerServiceClient(cc grpc1.ClientConn) ABCIListenerServiceClient { + return &aBCIListenerServiceClient{cc} +} + +func (c *aBCIListenerServiceClient) ListenBeginBlock(ctx context.Context, in *ListenBeginBlockRequest, opts ...grpc.CallOption) (*ListenBeginBlockResponse, error) { + out := new(ListenBeginBlockResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenBeginBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenEndBlock(ctx context.Context, in *ListenEndBlockRequest, opts ...grpc.CallOption) (*ListenEndBlockResponse, error) { + out := new(ListenEndBlockResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenEndBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenDeliverTx(ctx context.Context, in *ListenDeliverTxRequest, opts ...grpc.CallOption) (*ListenDeliverTxResponse, error) { + out := new(ListenDeliverTxResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenDeliverTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aBCIListenerServiceClient) ListenCommit(ctx context.Context, in *ListenCommitRequest, opts ...grpc.CallOption) (*ListenCommitResponse, error) { + out := new(ListenCommitResponse) + err := c.cc.Invoke(ctx, "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ABCIListenerServiceServer is the server API for ABCIListenerService service. +type ABCIListenerServiceServer interface { + // ListenBeginBlock is the corresponding endpoint for ABCIListener.ListenBeginBlock + ListenBeginBlock(context.Context, *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) + // ListenEndBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + ListenEndBlock(context.Context, *ListenEndBlockRequest) (*ListenEndBlockResponse, error) + // ListenDeliverTx is the corresponding endpoint for ABCIListener.ListenDeliverTx + ListenDeliverTx(context.Context, *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + ListenCommit(context.Context, *ListenCommitRequest) (*ListenCommitResponse, error) +} + +// UnimplementedABCIListenerServiceServer can be embedded to have forward compatible implementations. +type UnimplementedABCIListenerServiceServer struct { +} + +func (*UnimplementedABCIListenerServiceServer) ListenBeginBlock(ctx context.Context, req *ListenBeginBlockRequest) (*ListenBeginBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenBeginBlock not implemented") +} +func (*UnimplementedABCIListenerServiceServer) ListenEndBlock(ctx context.Context, req *ListenEndBlockRequest) (*ListenEndBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenEndBlock not implemented") +} +func (*UnimplementedABCIListenerServiceServer) ListenDeliverTx(ctx context.Context, req *ListenDeliverTxRequest) (*ListenDeliverTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenDeliverTx not implemented") +} +func (*UnimplementedABCIListenerServiceServer) ListenCommit(ctx context.Context, req *ListenCommitRequest) (*ListenCommitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListenCommit not implemented") +} + +func RegisterABCIListenerServiceServer(s grpc1.Server, srv ABCIListenerServiceServer) { + s.RegisterService(&_ABCIListenerService_serviceDesc, srv) +} + +func _ABCIListenerService_ListenBeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenBeginBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenBeginBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenBeginBlock(ctx, req.(*ListenBeginBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenEndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenEndBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenEndBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenEndBlock(ctx, req.(*ListenEndBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenDeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenDeliverTxRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenDeliverTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenDeliverTx(ctx, req.(*ListenDeliverTxRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ABCIListenerService_ListenCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListenCommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIListenerServiceServer).ListenCommit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIListenerServiceServer).ListenCommit(ctx, req.(*ListenCommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ABCIListenerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.store.streaming.abci.ABCIListenerService", + HandlerType: (*ABCIListenerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListenBeginBlock", + Handler: _ABCIListenerService_ListenBeginBlock_Handler, + }, + { + MethodName: "ListenEndBlock", + Handler: _ABCIListenerService_ListenEndBlock_Handler, + }, + { + MethodName: "ListenDeliverTx", + Handler: _ABCIListenerService_ListenDeliverTx_Handler, + }, + { + MethodName: "ListenCommit", + Handler: _ABCIListenerService_ListenCommit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/store/streaming/abci/grpc.proto", +} + +func (m *ListenBeginBlockRequest) 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 *ListenBeginBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenBeginBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListenBeginBlockResponse) 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 *ListenBeginBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenBeginBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListenEndBlockRequest) 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 *ListenEndBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenEndBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListenEndBlockResponse) 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 *ListenEndBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenEndBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListenDeliverTxRequest) 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 *ListenDeliverTxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenDeliverTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Req != nil { + { + size, err := m.Req.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockHeight != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListenDeliverTxResponse) 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 *ListenDeliverTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenDeliverTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListenCommitRequest) 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 *ListenCommitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenCommitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChangeSet) > 0 { + for iNdEx := len(m.ChangeSet) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ChangeSet[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.Res != nil { + { + size, err := m.Res.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGrpc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockHeight != 0 { + i = encodeVarintGrpc(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ListenCommitResponse) 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 *ListenCommitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListenCommitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintGrpc(dAtA []byte, offset int, v uint64) int { + offset -= sovGrpc(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ListenBeginBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *ListenBeginBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListenEndBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *ListenEndBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListenDeliverTxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovGrpc(uint64(m.BlockHeight)) + } + if m.Req != nil { + l = m.Req.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + return n +} + +func (m *ListenDeliverTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListenCommitRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovGrpc(uint64(m.BlockHeight)) + } + if m.Res != nil { + l = m.Res.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + if len(m.ChangeSet) > 0 { + for _, e := range m.ChangeSet { + l = e.Size() + n += 1 + l + sovGrpc(uint64(l)) + } + } + return n +} + +func (m *ListenCommitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovGrpc(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGrpc(x uint64) (n int) { + return sovGrpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ListenBeginBlockRequest) 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 ErrIntOverflowGrpc + } + 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: ListenBeginBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenBeginBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &types.RequestBeginBlock{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &types.ResponseBeginBlock{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenBeginBlockResponse) 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 ErrIntOverflowGrpc + } + 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: ListenBeginBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenBeginBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenEndBlockRequest) 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 ErrIntOverflowGrpc + } + 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: ListenEndBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenEndBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &types.RequestEndBlock{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &types.ResponseEndBlock{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenEndBlockResponse) 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 ErrIntOverflowGrpc + } + 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: ListenEndBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenEndBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenDeliverTxRequest) 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 ErrIntOverflowGrpc + } + 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: ListenDeliverTxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenDeliverTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Req", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Req == nil { + m.Req = &types.RequestDeliverTx{} + } + if err := m.Req.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &types.ResponseDeliverTx{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenDeliverTxResponse) 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 ErrIntOverflowGrpc + } + 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: ListenDeliverTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenDeliverTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenCommitRequest) 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 ErrIntOverflowGrpc + } + 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: ListenCommitRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenCommitRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Res", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Res == nil { + m.Res = &types.ResponseCommit{} + } + if err := m.Res.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChangeSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGrpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGrpc + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGrpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChangeSet = append(m.ChangeSet, &types1.StoreKVPair{}) + if err := m.ChangeSet[len(m.ChangeSet)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListenCommitResponse) 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 ErrIntOverflowGrpc + } + 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: ListenCommitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenCommitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGrpc(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGrpc + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGrpc(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, ErrIntOverflowGrpc + } + 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, ErrIntOverflowGrpc + } + 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, ErrIntOverflowGrpc + } + 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, ErrInvalidLengthGrpc + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGrpc + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGrpc + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGrpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGrpc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGrpc = fmt.Errorf("proto: unexpected end of group") +) diff --git a/store/streaming/abci/interface.go b/store/streaming/abci/interface.go new file mode 100644 index 000000000000..cecc1b0ad0ee --- /dev/null +++ b/store/streaming/abci/interface.go @@ -0,0 +1,45 @@ +// Package abci contains shared data between the host and plugins. +package abci + +import ( + "context" + + "github.com/hashicorp/go-plugin" + "google.golang.org/grpc" + + storetypes "cosmossdk.io/store/types" +) + +// Handshake is a common handshake that is shared by streaming and host. +// This prevents users from executing bad plugins or executing a plugin +// directory. It is a UX feature, not a security feature. +var Handshake = plugin.HandshakeConfig{ + // This isn't required when using VersionedPlugins + ProtocolVersion: 1, + MagicCookieKey: "ABCI_LISTENER_PLUGIN", + MagicCookieValue: "ef78114d-7bdf-411c-868f-347c99a78345", +} + +var _ plugin.GRPCPlugin = (*ListenerGRPCPlugin)(nil) + +// ListenerGRPCPlugin is the implementation of plugin.GRPCPlugin, so we can serve/consume this. +type ListenerGRPCPlugin struct { + // GRPCPlugin must still implement the Plugin interface + plugin.Plugin + // Concrete implementation, written in Go. This is only used for plugins + // that are written in Go. + Impl storetypes.ABCIListener +} + +func (p *ListenerGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { + RegisterABCIListenerServiceServer(s, &GRPCServer{Impl: p.Impl}) + return nil +} + +func (p *ListenerGRPCPlugin) GRPCClient( + _ context.Context, + _ *plugin.GRPCBroker, + c *grpc.ClientConn, +) (interface{}, error) { + return &GRPCClient{client: NewABCIListenerServiceClient(c)}, nil +} diff --git a/store/streaming/constructor.go b/store/streaming/constructor.go deleted file mode 100644 index acfe2cd2e7e0..000000000000 --- a/store/streaming/constructor.go +++ /dev/null @@ -1,196 +0,0 @@ -package streaming - -import ( - "fmt" - "os" - "path" - "strings" - "sync" - - "cosmossdk.io/log" - "cosmossdk.io/store/streaming/file" - "cosmossdk.io/store/types" - - "github.com/spf13/cast" -) - -type ( - // AppOptions is an interface for accessing application options - AppOptions interface { - Get(string) interface{} - } - // ServiceConstructor is used to construct a streaming service - ServiceConstructor func(AppOptions, []types.StoreKey, types.Codec, log.Logger, string) (types.StreamingService, error) -) - -// ServiceType enum for specifying the type of StreamingService -type ServiceType int - -const ( - Unknown ServiceType = iota - File -) - -// Streaming option keys -const ( - OptStreamersFilePrefix = "streamers.file.prefix" - OptStreamersFileWriteDir = "streamers.file.write_dir" - OptStreamersFileOutputMetadata = "streamers.file.output-metadata" - OptStreamersFileStopNodeOnError = "streamers.file.stop-node-on-error" - OptStreamersFileFsync = "streamers.file.fsync" - - OptStoreStreamers = "store.streamers" -) - -// ServiceTypeFromString returns the streaming.ServiceType corresponding to the -// provided name. -func ServiceTypeFromString(name string) ServiceType { - switch strings.ToLower(name) { - case "file", "f": - return File - - default: - return Unknown - } -} - -// String returns the string name of a streaming.ServiceType -func (sst ServiceType) String() string { - switch sst { - case File: - return "file" - - default: - return "unknown" - } -} - -// ServiceConstructorLookupTable is a mapping of streaming.ServiceTypes to -// streaming.ServiceConstructors types. -var ServiceConstructorLookupTable = map[ServiceType]ServiceConstructor{ - File: NewFileStreamingService, -} - -// NewServiceConstructor returns the streaming.ServiceConstructor corresponding -// to the provided name. -func NewServiceConstructor(name string) (ServiceConstructor, error) { - ssType := ServiceTypeFromString(name) - if ssType == Unknown { - return nil, fmt.Errorf("unrecognized streaming service name %s", name) - } - - if constructor, ok := ServiceConstructorLookupTable[ssType]; ok && constructor != nil { - return constructor, nil - } - - return nil, fmt.Errorf("streaming service constructor of type %s not found", ssType.String()) -} - -// NewFileStreamingService is the streaming.ServiceConstructor function for -// creating a FileStreamingService. -func NewFileStreamingService( - opts AppOptions, - keys []types.StoreKey, - marshaller types.Codec, - logger log.Logger, - homePath string, -) (types.StreamingService, error) { - filePrefix := cast.ToString(opts.Get(OptStreamersFilePrefix)) - fileDir := cast.ToString(opts.Get(OptStreamersFileWriteDir)) - outputMetadata := cast.ToBool(opts.Get(OptStreamersFileOutputMetadata)) - stopNodeOnErr := cast.ToBool(opts.Get(OptStreamersFileStopNodeOnError)) - fsync := cast.ToBool(opts.Get(OptStreamersFileFsync)) - - // relative path is based on node home directory. - if !path.IsAbs(fileDir) { - fileDir = path.Join(homePath, fileDir) - } - - // try to create output directory if not exists. - if _, err := os.Stat(fileDir); os.IsNotExist(err) { - if err = os.MkdirAll(fileDir, os.ModePerm); err != nil { - return nil, err - } - } - - return file.NewStreamingService(fileDir, filePrefix, keys, marshaller, logger, outputMetadata, stopNodeOnErr, fsync) -} - -// LoadStreamingServices is a function for loading StreamingServices onto the -// BaseApp using the provided AppOptions, codec, and keys. It returns the -// WaitGroup and quit channel used to synchronize with the streaming services -// and any error that occurs during the setup. -func LoadStreamingServices( - appOpts AppOptions, - appCodec types.Codec, - logger log.Logger, - keys map[string]*types.KVStoreKey, - homePath string, -) ([]types.StreamingService, *sync.WaitGroup, error) { - // waitgroup and quit channel for optional shutdown coordination of the streaming service(s) - wg := new(sync.WaitGroup) - - // configure state listening capabilities using AppOptions - streamers := cast.ToStringSlice(appOpts.Get(OptStoreStreamers)) - activeStreamers := make([]types.StreamingService, 0, len(streamers)) - - for _, streamerName := range streamers { - var exposeStoreKeys []types.StoreKey - - // get the store keys allowed to be exposed for this streaming service - exposeKeyStrs := cast.ToStringSlice(appOpts.Get(fmt.Sprintf("streamers.%s.keys", streamerName))) - - // if list contains '*', expose all store keys - if types.SliceContains(exposeKeyStrs, "*") { - exposeStoreKeys = make([]types.StoreKey, 0, len(keys)) - for _, storeKey := range keys { - exposeStoreKeys = append(exposeStoreKeys, storeKey) - } - } else { - exposeStoreKeys = make([]types.StoreKey, 0, len(exposeKeyStrs)) - for _, keyStr := range exposeKeyStrs { - if storeKey, ok := keys[keyStr]; ok { - exposeStoreKeys = append(exposeStoreKeys, storeKey) - } - } - } - - if len(exposeStoreKeys) == 0 { - continue - } - - constructor, err := NewServiceConstructor(streamerName) - if err != nil { - // Close any services we may have already spun up before hitting the error - // on this one. - for _, activeStreamer := range activeStreamers { - activeStreamer.Close() - } - - return nil, nil, err - } - - // Generate the streaming service using the constructor, appOptions, and the - // StoreKeys we want to expose. - streamingService, err := constructor(appOpts, exposeStoreKeys, appCodec, logger, homePath) - if err != nil { - // Close any services we may have already spun up before hitting the error - // on this one. - for _, activeStreamer := range activeStreamers { - activeStreamer.Close() - } - - return nil, nil, err - } - - // kick off the background streaming service loop - streamingService.Stream(wg) - - // add to the list of active streamers - activeStreamers = append(activeStreamers, streamingService) - } - - // If there are no active streamers, activeStreamers is empty (len == 0) and - // the waitGroup is not waiting on anything. - return activeStreamers, wg, nil -} diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go deleted file mode 100644 index aacc4f79d78c..000000000000 --- a/store/streaming/constructor_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package streaming_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "cosmossdk.io/log" - "cosmossdk.io/store/streaming" - "cosmossdk.io/store/streaming/file" - "cosmossdk.io/store/types" -) - -type fakeOptions struct{} - -func (f *fakeOptions) Get(key string) interface{} { - if key == "streamers.file.write_dir" { - return "data/file_streamer" - } - return nil -} - -var ( - mockOptions = new(fakeOptions) - mockKeys = []types.StoreKey{types.NewKVStoreKey("mockKey1"), types.NewKVStoreKey("mockKey2")} - testMarshaller = types.NewTestCodec() -) - -func TestStreamingServiceConstructor(t *testing.T) { - _, err := streaming.NewServiceConstructor("unexpectedName") - require.NotNil(t, err) - - constructor, err := streaming.NewServiceConstructor("file") - require.Nil(t, err) - var expectedType streaming.ServiceConstructor - require.IsType(t, expectedType, constructor) - - serv, err := constructor(mockOptions, mockKeys, testMarshaller, log.NewNopLogger(), "path/to/data") - require.Nil(t, err) - require.IsType(t, &file.StreamingService{}, serv) - listeners := serv.Listeners() - for _, key := range mockKeys { - _, ok := listeners[key] - require.True(t, ok) - } -} - -func TestLoadStreamingServices(t *testing.T) { - encCdc := types.NewTestCodec() - keys := types.NewKVStoreKeys("mockKey1", "mockKey2") - - testCases := map[string]struct { - appOpts streaming.AppOptions - activeStreamersLen int - }{ - "empty app options": { - appOpts: emptyAppOptions{}, - }, - "all StoreKeys exposed": { - appOpts: streamingAppOptions{keys: []string{"*"}}, - activeStreamersLen: 1, - }, - "some StoreKey exposed": { - appOpts: streamingAppOptions{keys: []string{"mockKey1"}}, - activeStreamersLen: 1, - }, - "not exposing anything": { - appOpts: streamingAppOptions{keys: []string{"mockKey3"}}, - }, - } - - for name, tc := range testCases { - t.Run(name, func(t *testing.T) { - activeStreamers, _, err := streaming.LoadStreamingServices(tc.appOpts, encCdc, log.NewNopLogger(), keys, "path/to/data") - require.NoError(t, err) - require.Equal(t, tc.activeStreamersLen, len(activeStreamers)) - }) - } -} - -type streamingAppOptions struct { - keys []string -} - -func (ao streamingAppOptions) Get(o string) interface{} { - switch o { - case "store.streamers": - return []string{"file"} - case "streamers.file.keys": - return ao.keys - case "streamers.file.write_dir": - return "data/file_streamer" - default: - return nil - } -} - -type emptyAppOptions struct{} - -func (ao emptyAppOptions) Get(o string) interface{} { - return nil -} diff --git a/store/streaming/file/README.md b/store/streaming/file/README.md deleted file mode 100644 index d5ca3534d3ea..000000000000 --- a/store/streaming/file/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# File Streaming Service - -This pkg contains an implementation of the [StreamingService](../../types/streaming.go) that writes -the data stream out to files on the local filesystem. This process is performed synchronously with the message processing -of the state machine. - -## Configuration - -The `file.StreamingService` is configured from within an App using the `AppOptions` loaded from the app.toml file: - -```toml -[store] - streamers = [ # if len(streamers) > 0 we are streaming - "file", # name of the streaming service, used by constructor - ] - -[streamers] - [streamers.file] - keys = ["list", "of", "store", "keys", "we", "want", "to", "expose", "for", "this", "streaming", "service"] - write_dir = "path to the write directory" - prefix = "optional prefix to prepend to the generated file names" -``` - -We turn the service on by adding its name, "file", to `store.streamers`- the list of streaming services for this App to employ. - -In `streamers.file` we include three configuration parameters for the file streaming service: - -1. `streamers.file.keys` contains the list of `StoreKey` names for the KVStores to expose using this service. - In order to expose *all* KVStores, we can include `*` in this list. An empty list is equivalent to turning the service off. -2. `streamers.file.write_dir` contains the path to the directory to write the files to. -3. `streamers.file.prefix` contains an optional prefix to prepend to the output files to prevent potential collisions - with other App `StreamingService` output files. -4. `streamers.file.output-metadata` specifies if output the metadata file, otherwise only data file is outputted. -5. `streamers.file.stop-node-on-error` specifies if propagate the error to consensus state machine, it's nesserary for data integrity when node restarts. -6. `streamers.file.fsync` specifies if call fsync after writing the files, it's nesserary for data integrity when system crash, but slows down the commit time. - -### Encoding - -For each block, two files are created and names `block-{N}-meta` and `block-{N}-data`, where `N` is the block number. - -The meta file contains the protobuf encoded message `BlockMetadata` which contains the abci event requests and responses of the block: - -```protobuf -message BlockMetadata { - message DeliverTx { - tendermint.abci.RequestDeliverTx request = 1; - tendermint.abci.ResponseDeliverTx response = 2; - } - tendermint.abci.RequestBeginBlock request_begin_block = 1; - tendermint.abci.ResponseBeginBlock response_begin_block = 2; - repeated DeliverTx deliver_txs = 3; - tendermint.abci.RequestEndBlock request_end_block = 4; - tendermint.abci.ResponseEndBlock response_end_block = 5; - tendermint.abci.ResponseCommit response_commit = 6; -} -``` - -The data file contains a series of length-prefixed protobuf encoded `StoreKVPair`s representing `Set` and `Delete` operations within the KVStores during the execution of block. - -Both meta and data files are prefixed with the length of the data content for consumer to detect completeness of the file, the length is encoded as 8 bytes with big endianness. - -The files are written at abci commit event, by default the error happens will be propagated to interuppted consensus state machine, but fsync is not called, it'll have good performance but have the risk of lossing data in face of rare event of system crash. - -### Decoding - -The pseudo-code for decoding is like this: - -```python -def decode_meta_file(file): - bz = file.read(8) - if len(bz) < 8: - raise "incomplete file exception" - size = int.from_bytes(bz, 'big') - - if file.size != size + 8: - raise "incomplete file exception" - - return decode_protobuf_message(BlockMetadata, file) - -def decode_data_file(file): - bz = file.read(8) - if len(bz) < 8: - raise "incomplete file exception" - size = int.from_bytes(bz, 'big') - - if file.size != size + 8: - raise "incomplete file exception" - - while not file.eof(): - yield decode_length_prefixed_protobuf_message(StoreKVStore, file) -``` diff --git a/store/streaming/file/example_config.toml b/store/streaming/file/example_config.toml deleted file mode 100644 index 8202bd8ef559..000000000000 --- a/store/streaming/file/example_config.toml +++ /dev/null @@ -1,10 +0,0 @@ -[store] - streamers = [ # if len(streamers) > 0 we are streaming - "file", # name of the streaming service, used by constructor - ] - -[streamers] - [streamers.file] - keys = ["list", "of", "store", "keys", "we", "want", "to", "expose", "for", "this", "streaming", "service"] - write_dir = "path to the write directory" - prefix = "optional prefix to prepend to the generated file names" diff --git a/store/streaming/file/service.go b/store/streaming/file/service.go deleted file mode 100644 index dae6b6a15c71..000000000000 --- a/store/streaming/file/service.go +++ /dev/null @@ -1,244 +0,0 @@ -package file - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "path" - "sort" - "sync" - - "cosmossdk.io/errors" - "cosmossdk.io/log" - abci "github.com/cometbft/cometbft/abci/types" - - "cosmossdk.io/store/types" -) - -var _ types.StreamingService = &StreamingService{} - -// StreamingService is a concrete implementation of StreamingService that writes -// state changes out to files. -type StreamingService struct { - storeListeners []*types.MemoryListener // a series of KVStore listeners for each KVStore - filePrefix string // optional prefix for each of the generated files - writeDir string // directory to write files into - codec types.Codec // marshaller used for re-marshalling the ABCI messages to write them out to the destination files - logger log.Logger - - currentBlockNumber int64 - blockMetadata types.BlockMetadata - - // outputMetadata, if true, writes additional metadata to file per block - outputMetadata bool - - // stopNodeOnErr, if true, will panic and stop the node during ABCI Commit - // to ensure eventual consistency of the output, otherwise, any errors are - // logged and ignored which could yield data loss in streamed output. - stopNodeOnErr bool - - // fsync, if true, will execute file Sync to make sure the data is persisted - // onto disk, otherwise there is a risk of data loss during any crash. - fsync bool -} - -func NewStreamingService( - writeDir, filePrefix string, - storeKeys []types.StoreKey, - cdc types.Codec, - logger log.Logger, - outputMetadata, stopNodeOnErr, fsync bool, -) (*StreamingService, error) { - // Check that the writeDir exists and is writable so that we can catch the - // error here at initialization. If it is not we don't open a dstFile until we - // receive our first ABCI message. - if err := isDirWriteable(writeDir); err != nil { - return nil, err - } - - // sort storeKeys for deterministic output - sort.SliceStable(storeKeys, func(i, j int) bool { - return storeKeys[i].Name() < storeKeys[j].Name() - }) - - // NOTE: We use the same listener for each store. - listeners := make([]*types.MemoryListener, len(storeKeys)) - for i, key := range storeKeys { - listeners[i] = types.NewMemoryListener(key) - } - - return &StreamingService{ - storeListeners: listeners, - filePrefix: filePrefix, - writeDir: writeDir, - codec: cdc, - logger: logger, - outputMetadata: outputMetadata, - stopNodeOnErr: stopNodeOnErr, - fsync: fsync, - }, nil -} - -// Listeners satisfies the StreamingService interface. It returns the -// StreamingService's underlying WriteListeners. Use for registering the -// underlying WriteListeners with the BaseApp. -func (fss *StreamingService) Listeners() map[types.StoreKey][]types.WriteListener { - listeners := make(map[types.StoreKey][]types.WriteListener, len(fss.storeListeners)) - for _, listener := range fss.storeListeners { - listeners[listener.StoreKey()] = []types.WriteListener{listener} - } - - return listeners -} - -// ListenBeginBlock satisfies the ABCIListener interface. It sets the received -// BeginBlock request, response and the current block number. Note, these are -// not written to file until ListenCommit is executed and outputMetadata is set, -// after which it will be reset again on the next block. -func (fss *StreamingService) ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error { - fss.blockMetadata.RequestBeginBlock = &req - fss.blockMetadata.ResponseBeginBlock = &res - fss.currentBlockNumber = req.Header.Height - return nil -} - -// ListenDeliverTx satisfies the ABCIListener interface. It appends the received -// DeliverTx request and response to a list of DeliverTxs objects. Note, these -// are not written to file until ListenCommit is executed and outputMetadata is -// set, after which it will be reset again on the next block. -func (fss *StreamingService) ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error { - fss.blockMetadata.DeliverTxs = append(fss.blockMetadata.DeliverTxs, &types.BlockMetadata_DeliverTx{ - Request: &req, - Response: &res, - }) - - return nil -} - -// ListenEndBlock satisfies the ABCIListener interface. It sets the received -// EndBlock request, response and the current block number. Note, these are -// not written to file until ListenCommit is executed and outputMetadata is set, -// after which it will be reset again on the next block. -func (fss *StreamingService) ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error { - fss.blockMetadata.RequestEndBlock = &req - fss.blockMetadata.ResponseEndBlock = &res - return nil -} - -// ListenCommit satisfies the ABCIListener interface. It is executed during the -// ABCI Commit request and is responsible for writing all staged data to files. -// It will only return a non-nil error when stopNodeOnErr is set. -func (fss *StreamingService) ListenCommit(ctx context.Context, res abci.ResponseCommit) error { - if err := fss.doListenCommit(ctx, res); err != nil { - fss.logger.Error("Listen commit failed", "height", fss.currentBlockNumber, "err", err) - if fss.stopNodeOnErr { - return err - } - } - - return nil -} - -func (fss *StreamingService) doListenCommit(ctx context.Context, res abci.ResponseCommit) (err error) { - fss.blockMetadata.ResponseCommit = &res - - // Write to target files, the file size is written at the beginning, which can - // be used to detect completeness. - metaFileName := fmt.Sprintf("block-%d-meta", fss.currentBlockNumber) - dataFileName := fmt.Sprintf("block-%d-data", fss.currentBlockNumber) - - if fss.filePrefix != "" { - metaFileName = fmt.Sprintf("%s-%s", fss.filePrefix, metaFileName) - dataFileName = fmt.Sprintf("%s-%s", fss.filePrefix, dataFileName) - } - - if fss.outputMetadata { - bz, err := fss.codec.Marshal(&fss.blockMetadata) - if err != nil { - return err - } - - if err := writeLengthPrefixedFile(path.Join(fss.writeDir, metaFileName), bz, fss.fsync); err != nil { - return err - } - } - - var buf bytes.Buffer - if err := fss.writeBlockData(&buf); err != nil { - return err - } - - return writeLengthPrefixedFile(path.Join(fss.writeDir, dataFileName), buf.Bytes(), fss.fsync) -} - -func (fss *StreamingService) writeBlockData(writer io.Writer) error { - for _, listener := range fss.storeListeners { - cache := listener.PopStateCache() - - for i := range cache { - bz, err := fss.codec.MarshalLengthPrefixed(&cache[i]) - if err != nil { - return err - } - - if _, err := writer.Write(bz); err != nil { - return err - } - } - } - - return nil -} - -// Stream satisfies the StreamingService interface. It performs a no-op. -func (fss *StreamingService) Stream(wg *sync.WaitGroup) error { return nil } - -// Close satisfies the StreamingService interface. It performs a no-op. -func (fss *StreamingService) Close() error { return nil } - -// isDirWriteable checks if dir is writable by writing and removing a file -// to dir. It returns nil if dir is writable. We have to do this as there is no -// platform-independent way of determining if a directory is writeable. -func isDirWriteable(dir string) error { - f := path.Join(dir, ".touch") - if err := os.WriteFile(f, []byte(""), 0o600); err != nil { - return err - } - - return os.Remove(f) -} - -func writeLengthPrefixedFile(path string, data []byte, fsync bool) (err error) { - var f *os.File - f, err = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600) - if err != nil { - return errors.Wrapf(err, "open file failed: %s", path) - } - - defer func() { - // avoid overriding the real error with file close error - if err1 := f.Close(); err1 != nil && err == nil { - err = errors.Wrapf(err, "close file failed: %s", path) - } - }() - _, err = f.Write(types.Uint64ToBigEndian(uint64(len(data)))) - if err != nil { - return errors.Wrapf(err, "write length prefix failed: %s", path) - } - - _, err = f.Write(data) - if err != nil { - return errors.Wrapf(err, "write block data failed: %s", path) - } - - if fsync { - err = f.Sync() - if err != nil { - return errors.Wrapf(err, "fsync failed: %s", path) - } - } - - return err -} diff --git a/store/streaming/file/service_test.go b/store/streaming/file/service_test.go deleted file mode 100644 index ba71d4eda7d3..000000000000 --- a/store/streaming/file/service_test.go +++ /dev/null @@ -1,373 +0,0 @@ -package file - -import ( - "context" - "encoding/binary" - "errors" - "fmt" - "os" - "path/filepath" - "sync" - "testing" - - abci "github.com/cometbft/cometbft/abci/types" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/stretchr/testify/require" - - "cosmossdk.io/log" - "cosmossdk.io/store/types" -) - -var ( - testMarshaller = types.NewTestCodec() - testStreamingService *StreamingService - testListener1, testListener2 types.WriteListener - emptyContext = context.TODO() - - // test abci message types - mockHash = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9} - testBeginBlockReq = abci.RequestBeginBlock{ - Header: cmtproto.Header{ - Height: 1, - }, - ByzantineValidators: []abci.Misbehavior{}, - Hash: mockHash, - LastCommitInfo: abci.CommitInfo{ - Round: 1, - Votes: []abci.VoteInfo{}, - }, - } - testBeginBlockRes = abci.ResponseBeginBlock{ - Events: []abci.Event{ - { - Type: "testEventType1", - }, - { - Type: "testEventType2", - }, - }, - } - testEndBlockReq = abci.RequestEndBlock{ - Height: 1, - } - testEndBlockRes = abci.ResponseEndBlock{ - Events: []abci.Event{}, - ConsensusParamUpdates: &cmtproto.ConsensusParams{}, - ValidatorUpdates: []abci.ValidatorUpdate{}, - } - testCommitRes = abci.ResponseCommit{ - Data: []byte{1}, - RetainHeight: 0, - } - mockTxBytes1 = []byte{9, 8, 7, 6, 5, 4, 3, 2, 1} - testDeliverTxReq1 = abci.RequestDeliverTx{ - Tx: mockTxBytes1, - } - mockTxBytes2 = []byte{8, 7, 6, 5, 4, 3, 2} - testDeliverTxReq2 = abci.RequestDeliverTx{ - Tx: mockTxBytes2, - } - mockTxResponseData1 = []byte{1, 3, 5, 7, 9} - testDeliverTxRes1 = abci.ResponseDeliverTx{ - Events: []abci.Event{}, - Code: 1, - Codespace: "mockCodeSpace", - Data: mockTxResponseData1, - GasUsed: 2, - GasWanted: 3, - Info: "mockInfo", - Log: "mockLog", - } - mockTxResponseData2 = []byte{1, 3, 5, 7, 9} - testDeliverTxRes2 = abci.ResponseDeliverTx{ - Events: []abci.Event{}, - Code: 1, - Codespace: "mockCodeSpace", - Data: mockTxResponseData2, - GasUsed: 2, - GasWanted: 3, - Info: "mockInfo", - Log: "mockLog", - } - - // mock store keys - mockStoreKey1 = types.NewKVStoreKey("mockStore1") - mockStoreKey2 = types.NewKVStoreKey("mockStore2") - - // file stuff - testPrefix = "testPrefix" - testDir = "./.test" - - // mock state changes - mockKey1 = []byte{1, 2, 3} - mockValue1 = []byte{3, 2, 1} - mockKey2 = []byte{2, 3, 4} - mockValue2 = []byte{4, 3, 2} - mockKey3 = []byte{3, 4, 5} - mockValue3 = []byte{5, 4, 3} -) - -func TestFileStreamingService(t *testing.T) { - if os.Getenv("CI") != "" { - t.Skip("Skipping TestFileStreamingService in CI environment") - } - - require.Nil(t, os.Mkdir(testDir, 0o700)) - defer os.RemoveAll(testDir) - - testKeys := []types.StoreKey{mockStoreKey1, mockStoreKey2} - var err error - testStreamingService, err = NewStreamingService(testDir, testPrefix, testKeys, testMarshaller, log.NewNopLogger(), true, false, false) - require.Nil(t, err) - require.IsType(t, &StreamingService{}, testStreamingService) - require.Equal(t, testPrefix, testStreamingService.filePrefix) - require.Equal(t, testDir, testStreamingService.writeDir) - require.Equal(t, testMarshaller, testStreamingService.codec) - - testListener1 = testStreamingService.storeListeners[0] - testListener2 = testStreamingService.storeListeners[1] - - wg := new(sync.WaitGroup) - - testStreamingService.Stream(wg) - testListenBlock(t) - testStreamingService.Close() - wg.Wait() -} - -func testListenBlock(t *testing.T) { - var ( - expectKVPairsStore1 [][]byte - expectKVPairsStore2 [][]byte - ) - - // write state changes - testListener1.OnWrite(mockStoreKey1, mockKey1, mockValue1, false) - testListener2.OnWrite(mockStoreKey2, mockKey2, mockValue2, false) - testListener1.OnWrite(mockStoreKey1, mockKey3, mockValue3, false) - - // expected KV pairs - expectedKVPair1, err := testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey1, - Value: mockValue1, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair2, err := testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey2, - Value: mockValue2, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair3, err := testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey3, - Value: mockValue3, - Delete: false, - }) - require.Nil(t, err) - - expectKVPairsStore1 = append(expectKVPairsStore1, expectedKVPair1, expectedKVPair3) - expectKVPairsStore2 = append(expectKVPairsStore2, expectedKVPair2) - - // send the ABCI messages - err = testStreamingService.ListenBeginBlock(emptyContext, testBeginBlockReq, testBeginBlockRes) - require.Nil(t, err) - - // write state changes - testListener1.OnWrite(mockStoreKey1, mockKey1, mockValue1, false) - testListener2.OnWrite(mockStoreKey2, mockKey2, mockValue2, false) - testListener2.OnWrite(mockStoreKey2, mockKey3, mockValue3, false) - - // expected KV pairs - expectedKVPair1, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey1, - Value: mockValue1, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair2, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey2, - Value: mockValue2, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair3, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey3, - Value: mockValue3, - Delete: false, - }) - require.Nil(t, err) - - expectKVPairsStore1 = append(expectKVPairsStore1, expectedKVPair1) - expectKVPairsStore2 = append(expectKVPairsStore2, expectedKVPair2, expectedKVPair3) - - // send the ABCI messages - err = testStreamingService.ListenDeliverTx(emptyContext, testDeliverTxReq1, testDeliverTxRes1) - require.Nil(t, err) - - // write state changes - testListener2.OnWrite(mockStoreKey2, mockKey1, mockValue1, false) - testListener1.OnWrite(mockStoreKey1, mockKey2, mockValue2, false) - testListener2.OnWrite(mockStoreKey2, mockKey3, mockValue3, false) - - // expected KV pairs - expectedKVPair1, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey1, - Value: mockValue1, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair2, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey2, - Value: mockValue2, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair3, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey3, - Value: mockValue3, - Delete: false, - }) - require.Nil(t, err) - - expectKVPairsStore1 = append(expectKVPairsStore1, expectedKVPair2) - expectKVPairsStore2 = append(expectKVPairsStore2, expectedKVPair1, expectedKVPair3) - - // send the ABCI messages - err = testStreamingService.ListenDeliverTx(emptyContext, testDeliverTxReq2, testDeliverTxRes2) - require.Nil(t, err) - - // write state changes - testListener1.OnWrite(mockStoreKey1, mockKey1, mockValue1, false) - testListener1.OnWrite(mockStoreKey1, mockKey2, mockValue2, false) - testListener2.OnWrite(mockStoreKey2, mockKey3, mockValue3, false) - - // expected KV pairs - expectedKVPair1, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey1, - Value: mockValue1, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair2, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey1.Name(), - Key: mockKey2, - Value: mockValue2, - Delete: false, - }) - require.Nil(t, err) - - expectedKVPair3, err = testMarshaller.Marshal(&types.StoreKVPair{ - StoreKey: mockStoreKey2.Name(), - Key: mockKey3, - Value: mockValue3, - Delete: false, - }) - require.Nil(t, err) - - expectKVPairsStore1 = append(expectKVPairsStore1, expectedKVPair1, expectedKVPair2) - expectKVPairsStore2 = append(expectKVPairsStore2, expectedKVPair3) - - // send the ABCI messages - err = testStreamingService.ListenEndBlock(emptyContext, testEndBlockReq, testEndBlockRes) - require.Nil(t, err) - - err = testStreamingService.ListenCommit(emptyContext, testCommitRes) - require.Nil(t, err) - - // load the file, checking that it was created with the expected name - metaFileName := fmt.Sprintf("%s-block-%d-meta", testPrefix, testBeginBlockReq.GetHeader().Height) - dataFileName := fmt.Sprintf("%s-block-%d-data", testPrefix, testBeginBlockReq.GetHeader().Height) - metaFileBytes, err := readInFile(metaFileName) - require.Nil(t, err) - dataFileBytes, err := readInFile(dataFileName) - require.Nil(t, err) - - metadata := types.BlockMetadata{ - RequestBeginBlock: &testBeginBlockReq, - ResponseBeginBlock: &testBeginBlockRes, - RequestEndBlock: &testEndBlockReq, - ResponseEndBlock: &testEndBlockRes, - ResponseCommit: &testCommitRes, - DeliverTxs: []*types.BlockMetadata_DeliverTx{ - {Request: &testDeliverTxReq1, Response: &testDeliverTxRes1}, - {Request: &testDeliverTxReq2, Response: &testDeliverTxRes2}, - }, - } - expectedMetadataBytes, err := testMarshaller.Marshal(&metadata) - require.Nil(t, err) - require.Equal(t, expectedMetadataBytes, metaFileBytes) - - // segment the file into the separate gRPC messages and check the correctness of each - segments, err := segmentBytes(dataFileBytes) - require.Nil(t, err) - require.Equal(t, len(expectKVPairsStore1)+len(expectKVPairsStore2), len(segments)) - require.Equal(t, expectKVPairsStore1, segments[:len(expectKVPairsStore1)]) - require.Equal(t, expectKVPairsStore2, segments[len(expectKVPairsStore1):]) -} - -func readInFile(name string) ([]byte, error) { - path := filepath.Join(testDir, name) - bz, err := os.ReadFile(path) - if err != nil { - return nil, err - } - size := types.BigEndianToUint64(bz[:8]) - if len(bz) != int(size)+8 { - return nil, errors.New("incomplete file ") - } - - return bz[8:], nil -} - -// segmentBytes returns all of the protobuf messages contained in the byte array -// as an array of byte arrays. The messages have their length prefix removed. -func segmentBytes(bz []byte) ([][]byte, error) { - var err error - - segments := make([][]byte, 0) - for len(bz) > 0 { - var segment []byte - - segment, bz, err = getHeadSegment(bz) - if err != nil { - return nil, err - } - - segments = append(segments, segment) - } - - return segments, nil -} - -// getHeadSegment returns the bytes for the leading protobuf object in the byte -// array (removing the length prefix) and returns the remainder of the byte array. -func getHeadSegment(bz []byte) ([]byte, []byte, error) { - size, prefixSize := binary.Uvarint(bz) - if prefixSize < 0 { - return nil, nil, fmt.Errorf("invalid number of bytes read from length-prefixed encoding: %d", prefixSize) - } - - if size > uint64(len(bz)-prefixSize) { - return nil, nil, fmt.Errorf("not enough bytes to read; want: %v, got: %v", size, len(bz)-prefixSize) - } - - return bz[prefixSize:(uint64(prefixSize) + size)], bz[uint64(prefixSize)+size:], nil -} diff --git a/store/streaming/streaming.go b/store/streaming/streaming.go new file mode 100644 index 000000000000..212651343217 --- /dev/null +++ b/store/streaming/streaming.go @@ -0,0 +1,79 @@ +package streaming + +import ( + "fmt" + "os" + "os/exec" + "strings" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/go-plugin" + + streamingabci "cosmossdk.io/store/streaming/abci" +) + +const pluginEnvKeyPrefix = "COSMOS_SDK" + +// HandshakeMap contains a map of each supported streaming's handshake config +var HandshakeMap = map[string]plugin.HandshakeConfig{ + "abci": streamingabci.Handshake, +} + +// PluginMap contains a map of supported gRPC plugins +var PluginMap = map[string]plugin.Plugin{ + "abci": &streamingabci.ListenerGRPCPlugin{}, +} + +func GetPluginEnvKey(name string) string { + return fmt.Sprintf("%s_%s", pluginEnvKeyPrefix, strings.ToUpper(name)) +} + +func NewStreamingPlugin(name string, logLevel string) (interface{}, error) { + logger := hclog.New(&hclog.LoggerOptions{ + Output: hclog.DefaultOutput, + Level: toHclogLevel(logLevel), + Name: fmt.Sprintf("plugin.%s", name), + }) + + // We're a host. Start by launching the streaming process. + env := os.Getenv(GetPluginEnvKey(name)) + client := plugin.NewClient(&plugin.ClientConfig{ + HandshakeConfig: HandshakeMap[name], + Managed: true, + Plugins: PluginMap, + // For verifying the integrity of executables see SecureConfig documentation + // https://pkg.go.dev/github.com/hashicorp/go-plugin#SecureConfig + //#nosec G204 -- Required to load plugins + Cmd: exec.Command("sh", "-c", env), + Logger: logger, + AllowedProtocols: []plugin.Protocol{ + plugin.ProtocolNetRPC, plugin.ProtocolGRPC, + }, + }) + + // Connect via RPC + rpcClient, err := client.Client() + if err != nil { + return nil, err + } + + // Request streaming plugin + return rpcClient.Dispense(name) +} + +func toHclogLevel(s string) hclog.Level { + switch s { + case "trace": + return hclog.Trace + case "debug": + return hclog.Debug + case "info": + return hclog.Info + case "warn": + return hclog.Warn + case "error": + return hclog.Error + default: + return hclog.DefaultLevel + } +} diff --git a/store/streaming/streaming_test.go b/store/streaming/streaming_test.go new file mode 100644 index 000000000000..62ca55e63e9d --- /dev/null +++ b/store/streaming/streaming_test.go @@ -0,0 +1,189 @@ +package streaming + +import ( + "context" + "fmt" + "os" + "testing" + "time" + + "cosmossdk.io/log" + abci "github.com/cometbft/cometbft/abci/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" + + storetypes "cosmossdk.io/store/types" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" +) + +type PluginTestSuite struct { + suite.Suite + + loggerCtx MockContext + + workDir string + + beginBlockReq abci.RequestBeginBlock + beginBlockRes abci.ResponseBeginBlock + endBlockReq abci.RequestEndBlock + endBlockRes abci.ResponseEndBlock + deliverTxReq abci.RequestDeliverTx + deliverTxRes abci.ResponseDeliverTx + commitRes abci.ResponseCommit + + changeSet []*storetypes.StoreKVPair +} + +func (s *PluginTestSuite) SetupTest() { + path, err := os.Getwd() + if err != nil { + s.T().Fail() + } + s.workDir = path + + pluginVersion := "abci" + // to write data to files, replace stdout/stdout => file/file + pluginPath := fmt.Sprintf("%s/abci/examples/stdout/stdout", s.workDir) + if err := os.Setenv(GetPluginEnvKey(pluginVersion), pluginPath); err != nil { + s.T().Fail() + } + + raw, err := NewStreamingPlugin(pluginVersion, "trace") + require.NoError(s.T(), err, "load", "streaming", "unexpected error") + + abciListener, ok := raw.(storetypes.ABCIListener) + require.True(s.T(), ok, "should pass type check") + + header := tmproto.Header{Height: 1, Time: time.Now()} + logger := log.NewNopLogger() + streamingService := storetypes.StreamingManager{ + ABCIListeners: []storetypes.ABCIListener{abciListener}, + StopNodeOnErr: true, + } + s.loggerCtx = NewMockContext(header, logger, streamingService) + + // test abci message types + s.beginBlockReq = abci.RequestBeginBlock{ + Header: s.loggerCtx.BlockHeader(), + ByzantineValidators: []abci.Misbehavior{}, + Hash: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, + LastCommitInfo: abci.CommitInfo{Round: 1, Votes: []abci.VoteInfo{}}, + } + s.beginBlockRes = abci.ResponseBeginBlock{ + Events: []abci.Event{{Type: "testEventType1"}}, + } + s.endBlockReq = abci.RequestEndBlock{Height: s.loggerCtx.BlockHeight()} + s.endBlockRes = abci.ResponseEndBlock{ + Events: []abci.Event{}, + ConsensusParamUpdates: &tmproto.ConsensusParams{}, + ValidatorUpdates: []abci.ValidatorUpdate{}, + } + s.deliverTxReq = abci.RequestDeliverTx{ + Tx: []byte{9, 8, 7, 6, 5, 4, 3, 2, 1}, + } + s.deliverTxRes = abci.ResponseDeliverTx{ + Events: []abci.Event{}, + Code: 1, + Codespace: "mockCodeSpace", + Data: []byte{5, 6, 7, 8}, + GasUsed: 2, + GasWanted: 3, + Info: "mockInfo", + Log: "mockLog", + } + s.commitRes = abci.ResponseCommit{} + + // test store kv pair types + for range [2000]int{} { + s.changeSet = append(s.changeSet, &storetypes.StoreKVPair{ + StoreKey: "mockStore", + Delete: false, + Key: []byte{1, 2, 3}, + Value: []byte{3, 2, 1}, + }) + } +} + +func TestPluginTestSuite(t *testing.T) { + suite.Run(t, new(PluginTestSuite)) +} + +func (s *PluginTestSuite) TestABCIGRPCPlugin() { + s.T().Run("Should successfully load streaming", func(t *testing.T) { + + abciListeners := s.loggerCtx.StreamingManager().ABCIListeners + for _, abciListener := range abciListeners { + for i := range [50]int{} { + err := abciListener.ListenBeginBlock(s.loggerCtx, s.beginBlockReq, s.beginBlockRes) + assert.NoError(t, err, "ListenBeginBlock") + + err = abciListener.ListenEndBlock(s.loggerCtx, s.endBlockReq, s.endBlockRes) + assert.NoError(t, err, "ListenEndBlock") + + for range [50]int{} { + err = abciListener.ListenDeliverTx(s.loggerCtx, s.deliverTxReq, s.deliverTxRes) + assert.NoError(t, err, "ListenDeliverTx") + } + + err = abciListener.ListenCommit(s.loggerCtx, s.commitRes, s.changeSet) + assert.NoError(t, err, "ListenCommit") + + s.updateHeight(int64(i + 1)) + } + } + }) +} + +func (s *PluginTestSuite) updateHeight(n int64) { + header := s.loggerCtx.BlockHeader() + header.Height = n + s.loggerCtx = NewMockContext(header, s.loggerCtx.Logger(), s.loggerCtx.StreamingManager()) +} + +var _ context.Context = MockContext{} +var _ storetypes.Context = MockContext{} + +type MockContext struct { + baseCtx context.Context + header tmproto.Header + logger log.Logger + streamingManager storetypes.StreamingManager +} + +func (m MockContext) BlockHeight() int64 { return m.header.Height } +func (m MockContext) Logger() log.Logger { return m.logger } +func (m MockContext) StreamingManager() storetypes.StreamingManager { return m.streamingManager } + +func (m MockContext) BlockHeader() tmproto.Header { + msg := proto.Clone(&m.header).(*tmproto.Header) + return *msg +} + +func NewMockContext(header tmproto.Header, logger log.Logger, sm storetypes.StreamingManager) MockContext { + header.Time = header.Time.UTC() + return MockContext{ + baseCtx: context.Background(), + header: header, + logger: logger, + streamingManager: sm, + } +} + +func (m MockContext) Deadline() (deadline time.Time, ok bool) { + return m.baseCtx.Deadline() +} + +func (m MockContext) Done() <-chan struct{} { + return m.baseCtx.Done() +} + +func (m MockContext) Err() error { + return m.baseCtx.Err() +} + +func (m MockContext) Value(key any) any { + return m.baseCtx.Value(key) +} diff --git a/store/types/context.go b/store/types/context.go new file mode 100644 index 000000000000..37f18d31a7b4 --- /dev/null +++ b/store/types/context.go @@ -0,0 +1,15 @@ +package types + +import ( + "cosmossdk.io/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" +) + +// Context is an interface used by an App to pass context information +// needed to process store streaming requests. +type Context interface { + BlockHeader() tmproto.Header + BlockHeight() int64 + Logger() log.Logger + StreamingManager() StreamingManager +} diff --git a/store/types/listening.go b/store/types/listening.go index 0d35542e9592..dba5aa934a58 100644 --- a/store/types/listening.go +++ b/store/types/listening.go @@ -1,88 +1,28 @@ package types -import ( - "io" -) - -// WriteListener interface for streaming data out from a KVStore -type WriteListener interface { - // if value is nil then it was deleted - // storeKey indicates the source KVStore, to facilitate using the same WriteListener across separate KVStores - // delete bool indicates if it was a delete; true: delete, false: set - OnWrite(storeKey StoreKey, key []byte, value []byte, delete bool) error -} - -// StoreKVPairWriteListener is used to configure listening to a KVStore by -// writing out length-prefixed Protobuf encoded StoreKVPairs to an underlying -// io.Writer object. -type StoreKVPairWriteListener struct { - writer io.Writer - marshaller Codec -} - -// NewStoreKVPairWriteListener wraps creates a StoreKVPairWriteListener with a -// provided io.Writer and codec.BinaryCodec. -func NewStoreKVPairWriteListener(w io.Writer, m Codec) *StoreKVPairWriteListener { - return &StoreKVPairWriteListener{ - writer: w, - marshaller: m, - } -} - -// OnWrite satisfies the WriteListener interface by writing length-prefixed -// Protobuf encoded StoreKVPairs. -func (wl *StoreKVPairWriteListener) OnWrite(storeKey StoreKey, key []byte, value []byte, delete bool) error { - kvPair := &StoreKVPair{ - StoreKey: storeKey.Name(), - Key: key, - Value: value, - Delete: delete, - } - - by, err := wl.marshaller.MarshalLengthPrefixed(kvPair) - if err != nil { - return err - } - - if _, err := wl.writer.Write(by); err != nil { - return err - } - - return nil -} - // MemoryListener listens to the state writes and accumulate the records in memory. type MemoryListener struct { - key StoreKey - stateCache []StoreKVPair + stateCache []*StoreKVPair } // NewMemoryListener creates a listener that accumulate the state writes in memory. -func NewMemoryListener(key StoreKey) *MemoryListener { - return &MemoryListener{key: key} +func NewMemoryListener() *MemoryListener { + return &MemoryListener{} } -// OnWrite implements WriteListener interface. -func (fl *MemoryListener) OnWrite(storeKey StoreKey, key []byte, value []byte, delete bool) error { - fl.stateCache = append(fl.stateCache, StoreKVPair{ +// OnWrite implements MemoryListener interface +func (fl *MemoryListener) OnWrite(storeKey StoreKey, key []byte, value []byte, delete bool) { + fl.stateCache = append(fl.stateCache, &StoreKVPair{ StoreKey: storeKey.Name(), Delete: delete, Key: key, Value: value, }) - - return nil } -// PopStateCache returns the current state caches and set to nil. -func (fl *MemoryListener) PopStateCache() []StoreKVPair { +// PopStateCache returns the current state caches and set to nil +func (fl *MemoryListener) PopStateCache() []*StoreKVPair { res := fl.stateCache fl.stateCache = nil - return res } - -// StoreKey returns the storeKey it listens to. -func (fl *MemoryListener) StoreKey() StoreKey { - return fl.key -} diff --git a/store/types/listening_test.go b/store/types/listening_test.go index dd1701571888..034d2a49601c 100644 --- a/store/types/listening_test.go +++ b/store/types/listening_test.go @@ -1,61 +1,42 @@ package types import ( - "bytes" "testing" "github.com/stretchr/testify/require" ) func TestNewStoreKVPairWriteListener(t *testing.T) { - testWriter := new(bytes.Buffer) - testMarshaller := NewTestCodec() - - wl := NewStoreKVPairWriteListener(testWriter, testMarshaller) - - require.IsType(t, &StoreKVPairWriteListener{}, wl) - require.Equal(t, testWriter, wl.writer) - require.Equal(t, testMarshaller, wl.marshaller) + listener := NewMemoryListener() + require.IsType(t, &MemoryListener{}, listener) } func TestOnWrite(t *testing.T) { - testWriter := new(bytes.Buffer) - testMarshaller := NewTestCodec() - - wl := NewStoreKVPairWriteListener(testWriter, testMarshaller) + listener := NewMemoryListener() testStoreKey := NewKVStoreKey("test_key") testKey := []byte("testing123") testValue := []byte("testing321") // test set - err := wl.OnWrite(testStoreKey, testKey, testValue, false) - require.Nil(t, err) - - outputBytes := testWriter.Bytes() - outputKVPair := new(StoreKVPair) + listener.OnWrite(testStoreKey, testKey, testValue, false) + outputKVPair := listener.PopStateCache()[0] expectedOutputKVPair := &StoreKVPair{ Key: testKey, Value: testValue, StoreKey: testStoreKey.Name(), Delete: false, } - testMarshaller.UnmarshalLengthPrefixed(outputBytes, outputKVPair) require.EqualValues(t, expectedOutputKVPair, outputKVPair) - testWriter.Reset() // test delete - err = wl.OnWrite(testStoreKey, testKey, testValue, true) - require.Nil(t, err) - - outputBytes = testWriter.Bytes() - outputKVPair = new(StoreKVPair) + listener.OnWrite(testStoreKey, testKey, testValue, true) + outputKVPair = listener.PopStateCache()[0] expectedOutputKVPair = &StoreKVPair{ Key: testKey, Value: testValue, StoreKey: testStoreKey.Name(), Delete: true, } - testMarshaller.UnmarshalLengthPrefixed(outputBytes, outputKVPair) require.EqualValues(t, expectedOutputKVPair, outputKVPair) } diff --git a/store/types/store.go b/store/types/store.go index 020519102a64..52db4a087552 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -197,9 +197,11 @@ type CommitMultiStore interface { // ListeningEnabled returns if listening is enabled for the KVStore belonging the provided StoreKey ListeningEnabled(key StoreKey) bool - // AddListeners adds WriteListeners for the KVStore belonging to the provided StoreKey - // It appends the listeners to a current set, if one already exists - AddListeners(key StoreKey, listeners []WriteListener) + // AddListeners adds a listener for the KVStore belonging to the provided StoreKey + AddListeners(keys []StoreKey) + + // PopStateCache returns the accumulated state change messages from the CommitMultiStore + PopStateCache() []*StoreKVPair // SetMetrics sets the metrics for the KVStore SetMetrics(metrics metrics.StoreMetrics) diff --git a/store/types/streaming.go b/store/types/streaming.go index 92988b047916..bf5827d8549d 100644 --- a/store/types/streaming.go +++ b/store/types/streaming.go @@ -2,14 +2,13 @@ package types import ( "context" - "io" - "sync" abci "github.com/cometbft/cometbft/abci/types" ) -// ABCIListener interface used to hook into the ABCI message processing of the BaseApp. -// the error results are propagated to consensus state machine, +// ABCIListener is the interface that we're exposing as a streaming service. +// It hooks into the ABCI message processing of the BaseApp. +// The error results are propagated to consensus state machine, // if you don't want to affect consensus, handle the errors internally and always return `nil` in these APIs. type ABCIListener interface { // ListenBeginBlock updates the streaming service with the latest BeginBlock messages @@ -18,18 +17,16 @@ type ABCIListener interface { ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error // ListenDeliverTx updates the steaming service with the latest DeliverTx messages ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error - // ListenCommit updates the steaming service with the latest Commit event - ListenCommit(ctx context.Context, res abci.ResponseCommit) error + // ListenCommit updates the steaming service with the latest Commit messages and state changes + ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*StoreKVPair) error } -// StreamingService interface for registering WriteListeners with the BaseApp and updating the service with the ABCI messages using the hooks -type StreamingService interface { - // Stream is the streaming service loop, awaits kv pairs and writes them to some destination stream or file - Stream(wg *sync.WaitGroup) error - // Listeners returns the streaming service's listeners for the BaseApp to register - Listeners() map[StoreKey][]WriteListener - // ABCIListener interface for hooking into the ABCI messages from inside the BaseApp - ABCIListener - // Closer interface - io.Closer +// StreamingManager is the struct that maintains a list of ABCIListeners and configuration settings. +type StreamingManager struct { + // ABCIListeners for hooking into the ABCI message processing of the BaseApp + // and exposing the requests and responses to external consumers + ABCIListeners []ABCIListener + + // StopNodeOnErr halts the node when ABCI streaming service listening results in an error. + StopNodeOnErr bool } diff --git a/tests/go.mod b/tests/go.mod index 360d635d021e..186d047ff506 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -76,6 +76,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -104,11 +105,14 @@ require ( github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.2.0 // indirect @@ -133,6 +137,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -186,6 +191,7 @@ require ( // It must be in sync with SimApp temporary replaces replace ( // TODO tag all extracted modules after SDK refactor + cosmossdk.io/store => ../store cosmossdk.io/x/evidence => ../x/evidence cosmossdk.io/x/feegrant => ../x/feegrant cosmossdk.io/x/nft => ../x/nft diff --git a/tests/go.sum b/tests/go.sum index 67390e5089d8..909777388313 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -204,8 +204,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230309163709-87da587416ba h1:63dnRBywQLvo/Ke0zljksFlWg5tAMTwOiuv6yZ3X0sM= -cosmossdk.io/store v0.0.0-20230309163709-87da587416ba/go.mod h1:sf0uPZvsgXqXy2ydRXJmsM+sNHSZLZN6xZZkh7c3+t0= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -419,6 +417,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -646,11 +646,15 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -674,6 +678,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -774,7 +780,9 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -783,6 +791,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -841,6 +850,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1277,6 +1287,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/tools/confix/data/v0.48-app.toml b/tools/confix/data/v0.48-app.toml index c8f117169919..bf8c127bf1ad 100644 --- a/tools/confix/data/v0.48-app.toml +++ b/tools/confix/data/v0.48-app.toml @@ -187,27 +187,30 @@ snapshot-interval = 0 snapshot-keep-recent = 2 ############################################################################### -### Store / State Streaming ### +### State Streaming ### ############################################################################### -[store] -streamers = [] +# Streaming allows nodes to stream state to external systems. +[streaming] -[streamers] -[streamers.file] -keys = ["*", ] -write_dir = "" -prefix = "" +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] -# output-metadata specifies if output the metadata file which includes the abci request/responses -# during processing the block. -output-metadata = "true" +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] -# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine. -stop-node-on-error = "true" +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci_v1 +plugin = "" -# fsync specifies if call fsync after writing the files. -fsync = "false" +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true ############################################################################### ### Mempool ### diff --git a/tools/confix/go.mod b/tools/confix/go.mod index d8fc451622d7..e2b14eec5d55 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -59,6 +59,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -83,9 +84,12 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -103,8 +107,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -148,6 +154,14 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +// Here are the short-lived replace of Confix +// Replace here are pending PRs, or version to be tagged +replace ( + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) + // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 // TODO investigate if we can outright delete this dependency, otherwise go install won't work :( diff --git a/tools/confix/go.sum b/tools/confix/go.sum index c532f4885ca1..9f151168faf1 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -180,8 +178,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -256,6 +252,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -447,11 +445,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -471,6 +473,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -563,7 +567,9 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -572,6 +578,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -593,6 +600,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -626,6 +634,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1019,6 +1028,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 0a3ec4f5803c..362841e574a1 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -57,6 +57,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -84,11 +85,14 @@ require ( github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -108,6 +112,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -154,3 +159,12 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +// Here are the short-lived replace of Comosivosr +// Replace here are pending PRs, or version to be tagged +replace ( + // This can be removed when https://github.com/cosmos/cosmos-sdk/pull/14207 is merged and /store is bumped + cosmossdk.io/store => ../../store + // This can be removed when x/upgrade is bumped + github.com/cosmos/cosmos-sdk => ../.. +) diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 1efdedb4dd89..4fa6d7637d99 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -202,8 +202,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f h1:K9arlZkok6I5X5+FEqQBj3vtTXSccWTfOsU9WPhsif0= cosmossdk.io/x/upgrade v0.0.0-20230227110325-294ef34f396f/go.mod h1:DgT89ckyz+u8XVfYdIoAhkFXV+o3ieva3zE+qoYu89g= @@ -270,6 +268,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -331,8 +330,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -394,6 +391,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -620,11 +619,15 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -648,6 +651,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -672,6 +677,7 @@ github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/ github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -739,7 +745,9 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -749,6 +757,7 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -805,6 +814,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1232,6 +1242,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 617bc7185562..dcf37837ca2d 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -119,3 +119,12 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +// Here are the short-lived replace of Hubl +// Replace here are pending PRs, or version to be tagged +replace ( + // TODO tag after https://github.com/cosmos/cosmos-sdk/pull/14207 merge + cosmossdk.io/store => ../../store + // TODO this can be removed when client/v2 is released with CometBFT changes in the SDK + github.com/cosmos/cosmos-sdk => ../.. +) diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index c44706aa5460..c7b2272bffbf 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -51,8 +51,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= @@ -145,8 +143,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -192,6 +188,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -338,14 +335,16 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= 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-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= 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-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -353,6 +352,7 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 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.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -439,6 +439,7 @@ github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0Em github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -458,6 +459,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA 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/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= diff --git a/tools/rosetta/go.mod b/tools/rosetta/go.mod index e1db877ce54c..4aacd30dcd8f 100644 --- a/tools/rosetta/go.mod +++ b/tools/rosetta/go.mod @@ -52,6 +52,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -73,9 +74,12 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -90,8 +94,10 @@ require ( github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -131,3 +137,12 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +// Here are the short-lived replace of Rosetta +// Replace here are pending PRs, or version to be tagged +replace ( + // This can be removed when https://github.com/cosmos/cosmos-sdk/pull/14207 is merged and /store is bumped + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) diff --git a/tools/rosetta/go.sum b/tools/rosetta/go.sum index dced44df34b9..2c9d1283828a 100644 --- a/tools/rosetta/go.sum +++ b/tools/rosetta/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -110,6 +108,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -170,8 +169,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -234,6 +231,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -422,11 +421,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -446,6 +449,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -470,6 +475,7 @@ github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/ github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -532,7 +538,9 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -542,6 +550,7 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -562,6 +571,7 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -594,6 +604,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -970,6 +981,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/types/context.go b/types/context.go index 89d2d41e37eb..c4e047dc7272 100644 --- a/types/context.go +++ b/types/context.go @@ -40,29 +40,31 @@ type Context struct { priority int64 // The tx priority, only relevant in CheckTx kvGasConfig storetypes.GasConfig transientKVGasConfig storetypes.GasConfig + streamingManager storetypes.StreamingManager } // Proposed rename, not done to avoid API breakage type Request = Context // Read-only accessors -func (c Context) Context() context.Context { return c.baseCtx } -func (c Context) MultiStore() storetypes.MultiStore { return c.ms } -func (c Context) BlockHeight() int64 { return c.header.Height } -func (c Context) BlockTime() time.Time { return c.header.Time } -func (c Context) ChainID() string { return c.chainID } -func (c Context) TxBytes() []byte { return c.txBytes } -func (c Context) Logger() log.Logger { return c.logger } -func (c Context) VoteInfos() []abci.VoteInfo { return c.voteInfo } -func (c Context) GasMeter() storetypes.GasMeter { return c.gasMeter } -func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter } -func (c Context) IsCheckTx() bool { return c.checkTx } -func (c Context) IsReCheckTx() bool { return c.recheckTx } -func (c Context) MinGasPrices() DecCoins { return c.minGasPrice } -func (c Context) EventManager() EventManagerI { return c.eventManager } -func (c Context) Priority() int64 { return c.priority } -func (c Context) KVGasConfig() storetypes.GasConfig { return c.kvGasConfig } -func (c Context) TransientKVGasConfig() storetypes.GasConfig { return c.transientKVGasConfig } +func (c Context) Context() context.Context { return c.baseCtx } +func (c Context) MultiStore() storetypes.MultiStore { return c.ms } +func (c Context) BlockHeight() int64 { return c.header.Height } +func (c Context) BlockTime() time.Time { return c.header.Time } +func (c Context) ChainID() string { return c.chainID } +func (c Context) TxBytes() []byte { return c.txBytes } +func (c Context) Logger() log.Logger { return c.logger } +func (c Context) VoteInfos() []abci.VoteInfo { return c.voteInfo } +func (c Context) GasMeter() storetypes.GasMeter { return c.gasMeter } +func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter } +func (c Context) IsCheckTx() bool { return c.checkTx } +func (c Context) IsReCheckTx() bool { return c.recheckTx } +func (c Context) MinGasPrices() DecCoins { return c.minGasPrice } +func (c Context) EventManager() EventManagerI { return c.eventManager } +func (c Context) Priority() int64 { return c.priority } +func (c Context) KVGasConfig() storetypes.GasConfig { return c.kvGasConfig } +func (c Context) TransientKVGasConfig() storetypes.GasConfig { return c.transientKVGasConfig } +func (c Context) StreamingManager() storetypes.StreamingManager { return c.streamingManager } // clone the header before returning func (c Context) BlockHeader() cmtproto.Header { @@ -254,6 +256,12 @@ func (c Context) WithPriority(p int64) Context { return c } +// WithStreamingManager returns a Context with an updated streaming manager +func (c Context) WithStreamingManager(sm storetypes.StreamingManager) Context { + c.streamingManager = sm + return c +} + // TODO: remove??? func (c Context) IsZero() bool { return c.ms == nil @@ -302,7 +310,10 @@ func (c Context) CacheContext() (cc Context, writeCache func()) { return cc, writeCache } -var _ context.Context = Context{} +var ( + _ context.Context = Context{} + _ storetypes.Context = Context{} +) // ContextKey defines a type alias for a stdlib Context key. type ContextKey string diff --git a/x/circuit/go.mod b/x/circuit/go.mod index f50944e788b1..a614c3962691 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -99,3 +99,11 @@ require ( pgregory.net/rapid v0.5.5 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) + +// Here are the short-lived replace of Rosetta +// Replace here are pending PRs, or version to be tagged +replace ( + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 4a94be430a85..10722980441d 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230302163046-da238c555585 h1:kTCveRw3C9qjZ/OXjol1q3r/SM6Qa7N/51rlGfTxqbY= -cosmossdk.io/store v0.0.0-20230302163046-da238c555585/go.mod h1:gWCnPGa1lkOscgyrrC2S5rXyKa29Z1wpXvpczZpJef4= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= @@ -134,8 +132,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= @@ -171,6 +167,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -309,12 +306,14 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= 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-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= 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-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -322,6 +321,7 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 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.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= @@ -403,6 +403,7 @@ github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjK github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -420,6 +421,7 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS 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/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 53ec3dc43869..275be958967e 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -61,6 +61,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -82,9 +83,12 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -102,8 +106,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -146,6 +152,15 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +// Here are the short-lived replace from the module. +// Replace here are pending PRs, or version to be tagged. +replace ( + // This can be removed when https://github.com/cosmos/cosmos-sdk/pull/14207 is merged and /store is bumped + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) + // Below are the long-lived replace of the Cosmos SDK // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 92ef5f736766..c272b3caaea4 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -180,8 +178,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -252,6 +248,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -443,11 +441,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -467,6 +469,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -559,7 +563,9 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -568,6 +574,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -589,6 +596,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -622,6 +630,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1015,6 +1024,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 46fe05be1ee6..d77ed37ecb3d 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -62,6 +62,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -83,9 +84,12 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -104,8 +108,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -148,6 +154,15 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +// Here are the short-lived replace from the module. +// Replace here are pending PRs, or version to be tagged. +replace ( + // This can be removed after https://github.com/cosmos/cosmos-sdk/pull/14207 merge and tag + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) + // Below are the long-lived replace of the Cosmos SDK // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index ae57048142a4..dda84fbd1d2f 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -185,8 +183,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -257,6 +253,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -448,11 +446,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -472,6 +474,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -565,7 +569,9 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -574,6 +580,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -595,6 +602,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -628,6 +636,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1021,6 +1030,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/x/nft/go.mod b/x/nft/go.mod index d2db2d4b58da..c59f7eb1af21 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -60,6 +60,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -81,9 +82,12 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -101,8 +105,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -146,6 +152,15 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +// Here are the short-lived replace from the module. +// Replace here are pending PRs, or version to be tagged. +replace ( + // This can be removed after https://github.com/cosmos/cosmos-sdk/pull/14207 merge and tag + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) + // Below are the long-lived replace of the Cosmos SDK // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 diff --git a/x/nft/go.sum b/x/nft/go.sum index 92ef5f736766..c272b3caaea4 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -49,8 +49,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -180,8 +178,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -252,6 +248,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -443,11 +441,15 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -467,6 +469,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -559,7 +563,9 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -568,6 +574,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -589,6 +596,7 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -622,6 +630,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1015,6 +1024,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index facd504aff81..5905206216ed 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -71,6 +71,7 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect @@ -98,11 +99,14 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.2.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -126,6 +130,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oklog/run v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.7 // indirect github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect @@ -172,6 +177,15 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +// Here are the short-lived replace from the module. +// Replace here are pending PRs, or version to be tagged. +replace ( + // This can be removed after https://github.com/cosmos/cosmos-sdk/pull/14207 merge and tag + cosmossdk.io/store => ../../store + // TODO use instead a tagged version of the SDK (with CometBFT) when available + github.com/cosmos/cosmos-sdk => ../.. +) + // Below are the long-lived replace of the Cosmos SDK // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 18025fece40d..678c8eb7f610 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -202,8 +202,6 @@ cosmossdk.io/log v0.1.0 h1:Vnexi+KzUCjmqq/m93teAxjt5biWFfZ5PI1imx2IJw8= cosmossdk.io/log v0.1.0/go.mod h1:p95Wq6mDY3SREMc4y7+QU9Uwy3nyvfpWGD1iSaFkVFs= cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44 h1:/pKsj/ApzO4+zMwpgLiPG5iakoHxziGpMiJcz4S+r4w= -cosmossdk.io/store v0.0.0-20230227103508-bbe7f8a11b44/go.mod h1:flrxUykloEW1asE9p+Q+d8LSuNI3fBRdzISg9HTpYlQ= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba h1:NmWXkl0voj3dN96Qmk4rfrze6dLLLxB4qTCxXZTXBpM= cosmossdk.io/x/tx v0.2.3-0.20230309163709-87da587416ba/go.mod h1:dhIxZhZF2glIA9hkkildy/JmSqVH3FIU/OhSU8is7PM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -345,8 +343,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d h1:ZGpyYilrUZ3UsFk4jJR0nUc5w3mP1q7PWRN8eT84ra0= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230313124132-b4d769a8a87d/go.mod h1:Kp3H/lgq6JfzSRXEerhhkLIkz+B5ouga3A3i01VqtUQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -418,6 +414,8 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojt github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= @@ -645,11 +643,15 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= 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-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -673,6 +675,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -771,7 +775,9 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -780,6 +786,7 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -838,6 +845,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1274,6 +1282,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/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=